Merge branch 'master' of https://git.magicalgirl.moe/KartKrew/Kart.git into sonicitems

This commit is contained in:
toaster 2018-07-02 23:29:21 +01:00
commit 249bb594d8
5 changed files with 66 additions and 5 deletions

View file

@ -2145,6 +2145,7 @@ static void CL_ConnectToServer(boolean viams)
} }
while (!(cl_mode == CL_CONNECTED && (client || (server && nodewaited <= pnumnodes)))); while (!(cl_mode == CL_CONNECTED && (client || (server && nodewaited <= pnumnodes))));
F_StartWaitingPlayers();
DEBFILE(va("Synchronisation Finished\n")); DEBFILE(va("Synchronisation Finished\n"));
displayplayer = consoleplayer; displayplayer = consoleplayer;
@ -3878,9 +3879,8 @@ FILESTAMP
// Update the nettics // Update the nettics
nettics[node] = realend; nettics[node] = realend;
// Don't do anything for packets of type NODEKEEPALIVE? // This should probably still timeout though, as the node should always have a player 1 number
if (netconsole == -1 || netbuffer->packettype == PT_NODEKEEPALIVE if (netconsole == -1)
|| netbuffer->packettype == PT_NODEKEEPALIVEMIS)
break; break;
// If a client sends a ticcmd it should mean they are done receiving the savegame // If a client sends a ticcmd it should mean they are done receiving the savegame
@ -3890,6 +3890,12 @@ FILESTAMP
/// \todo Use a separate cvar for that kind of timeout? /// \todo Use a separate cvar for that kind of timeout?
freezetimeout[node] = I_GetTime() + connectiontimeout; freezetimeout[node] = I_GetTime() + connectiontimeout;
// Don't do anything for packets of type NODEKEEPALIVE?
// Sryder 2018/07/01: Update the freezetimeout still!
if (netbuffer->packettype == PT_NODEKEEPALIVE
|| netbuffer->packettype == PT_NODEKEEPALIVEMIS)
break;
// Copy ticcmd // Copy ticcmd
G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][netconsole], &netbuffer->u.clientpak.cmd, 1); G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][netconsole], &netbuffer->u.clientpak.cmd, 1);

View file

@ -388,6 +388,8 @@ static void D_Display(void)
case GS_WAITINGPLAYERS: case GS_WAITINGPLAYERS:
// The clientconnect drawer is independent... // The clientconnect drawer is independent...
// I don't think HOM from nothing drawing is independent...
F_WaitingPlayersDrawer();
case GS_DEDICATEDSERVER: case GS_DEDICATEDSERVER:
case GS_NULL: case GS_NULL:
break; break;

View file

@ -58,6 +58,9 @@ static patch_t *ttkart; // *vroom* KART
static patch_t *ttcheckers; // *vroom* KART static patch_t *ttcheckers; // *vroom* KART
static patch_t *ttkflash; // flash screen static patch_t *ttkflash; // flash screen
static patch_t *driver[2]; // Driving character on the waiting screen
static UINT8 *waitcolormap; // colormap for the spinning character
static void F_SkyScroll(INT32 scrollspeed); static void F_SkyScroll(INT32 scrollspeed);
// //
@ -1031,6 +1034,50 @@ void F_TitleDemoTicker(void)
keypressed = false; keypressed = false;
} }
// ================
// WAITINGPLAYERS
// ================
void F_StartWaitingPlayers(void)
{
INT32 i;
INT32 randskin;
spriteframe_t *sprframe;
wipegamestate = GS_TITLESCREEN; // technically wiping from title screen
finalecount = 0;
randskin = M_RandomKey(numskins);
waitcolormap = R_GetTranslationColormap(randskin, skins[randskin].prefcolor, 0);
for (i = 0; i < 2; i++)
{
sprframe = &skins[randskin].spritedef.spriteframes[(6+i) & FF_FRAMEMASK];
driver[i] = W_CachePatchNum(sprframe->lumppat[1], PU_LEVEL);
}
}
void F_WaitingPlayersTicker()
{
finalecount++;
// dumb hack, only start the music on the 1st tick so if you instantly go into the map you aren't hearing a tic of music
if (finalecount == 2)
S_ChangeMusicInternal("WAIT2J", true);
}
void F_WaitingPlayersDrawer(void)
{
UINT32 frame = (finalecount % 8) / 4; // The game only tics every other frame while waitingplayers
INT32 flags = V_FLIP;
const char *waittext1 = "You will join";
const char *waittext2 = "the next race...";
V_DrawFill(0, 0, 320, 200, 31);
V_DrawCreditString((160 - (V_CreditStringWidth(waittext1)>>1))<<FRACBITS, 48<<FRACBITS, 0, waittext1);
V_DrawCreditString((160 - (V_CreditStringWidth(waittext2)>>1))<<FRACBITS, 64<<FRACBITS, 0, waittext2);
V_DrawFixedPatch((160<<FRACBITS) - driver[frame]->width / 2, 150<<FRACBITS, 1<<FRACBITS, flags, driver[frame], waitcolormap);
}
// ========== // ==========
// CONTINUE // CONTINUE
// ========== // ==========

View file

@ -39,6 +39,10 @@ FUNCMATH void F_GameEndDrawer(void);
void F_IntroDrawer(void); void F_IntroDrawer(void);
void F_TitleScreenDrawer(void); void F_TitleScreenDrawer(void);
void F_StartWaitingPlayers(void);
void F_WaitingPlayersTicker(void);
void F_WaitingPlayersDrawer(void);
void F_GameEvaluationDrawer(void); void F_GameEvaluationDrawer(void);
void F_StartGameEvaluation(void); void F_StartGameEvaluation(void);
void F_GameEvaluationTicker(void); void F_GameEvaluationTicker(void);

View file

@ -2157,9 +2157,11 @@ void G_Ticker(boolean run)
break; break;
case GS_TITLESCREEN: case GS_TITLESCREEN:
case GS_WAITINGPLAYERS:
F_TitleScreenTicker(run); F_TitleScreenTicker(run);
break; break;
case GS_WAITINGPLAYERS:
F_WaitingPlayersTicker();
break;
case GS_DEDICATEDSERVER: case GS_DEDICATEDSERVER:
case GS_NULL: case GS_NULL:
@ -3687,7 +3689,7 @@ void G_SaveGameData(boolean force)
if (force) // SRB2Kart: for enabling unlocks online, even if the game is modified if (force) // SRB2Kart: for enabling unlocks online, even if the game is modified
modifiedgame = savemoddata; // L-let's just sort of... hack around the cheat protection, because I'm too worried about just removing it @@; modifiedgame = savemoddata; // L-let's just sort of... hack around the cheat protection, because I'm too worried about just removing it @@;
else if (modifiedgame && !savemoddata) else if (modifiedgame && !savemoddata)
{ {
free(savebuffer); free(savebuffer);
save_p = savebuffer = NULL; save_p = savebuffer = NULL;