mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-23 23:52:30 +00:00
Fixed disconnection issue when multiplayer game started on Shaun White Snowboarding, and improved multiplayer performance on games that use GameMode.
This commit is contained in:
parent
5a169077f1
commit
d395611135
@ -110,7 +110,8 @@ inline bool isDisconnected(int errcode) { return (errcode == EPIPE || errcode ==
|
||||
|
||||
// Default GameMode definitions
|
||||
#define ADHOC_GAMEMODE_PORT 31000
|
||||
#define GAMEMODE_UPDATE_INTERVAL 10000 // 12000 usec on JPCSP, but 10000 works better on BattleZone (in order to get full speed 60 FPS)
|
||||
#define GAMEMODE_UPDATE_INTERVAL 500 // 12000 usec on JPCSP, but lower value works better on BattleZone (in order to get full speed 60 FPS)
|
||||
#define GAMEMODE_INIT_DELAY 10000
|
||||
|
||||
// psp strutcs and definitions
|
||||
#define ADHOCCTL_MODE_NONE -1
|
||||
|
@ -163,8 +163,8 @@ static void __GameModeNotify(u64 userdata, int cyclesLate) {
|
||||
}
|
||||
}
|
||||
|
||||
// Recv new Replica data
|
||||
while (IsGameModeActive() && IsSocketReady(sock->data.pdp.id, true, false) > 0) {
|
||||
// Recv new Replica data. We shouldn't do too much activity on a single event and just try again later after a short delay (1ms or lower, to prevent long sync with max players)
|
||||
if (IsGameModeActive() && IsSocketReady(sock->data.pdp.id, true, false) > 0) {
|
||||
SceNetEtherAddr sendermac;
|
||||
s32_le senderport = ADHOC_GAMEMODE_PORT;
|
||||
s32_le bufsz = uid; // GAMEMODE_BUFFER_SIZE;
|
||||
@ -333,7 +333,7 @@ int StartGameModeScheduler(int bufSize) {
|
||||
|
||||
INFO_LOG(SCENET, "GameMode Scheduler (%d, %d) has started", gameModeSocket, bufSize);
|
||||
u64 param = ((u64)__KernelGetCurThread()) << 32 | bufSize;
|
||||
CoreTiming::ScheduleEvent(usToCycles(GAMEMODE_UPDATE_INTERVAL), gameModeNotifyEvent, param);
|
||||
CoreTiming::ScheduleEvent(usToCycles(GAMEMODE_INIT_DELAY), gameModeNotifyEvent, param);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -5201,8 +5201,7 @@ void __NetTriggerCallbacks()
|
||||
case ADHOCCTL_EVENT_GAME:
|
||||
{
|
||||
newState = ADHOCCTL_STATE_GAMEMODE;
|
||||
if (adhocConnectionType != ADHOC_JOIN)
|
||||
delayus = adhocEventDelay;
|
||||
delayus = adhocEventDelay;
|
||||
// Shows player list
|
||||
INFO_LOG(SCENET, "GameMode - All players have joined:");
|
||||
int i = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user