mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Compare commits
	
		
			18 commits
		
	
	
		
			add76b17aa
			...
			b4c597161b
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | b4c597161b | ||
|   | 2b7e1384ed | ||
|   | 176713d243 | ||
|   | d363c71007 | ||
|   | fd27994c48 | ||
|   | 9244b9148e | ||
|   | 5d697e378f | ||
|   | 0e431cd334 | ||
|   | 21a3489bcb | ||
|   | 039ba6c3dc | ||
|   | de0fc7d3be | ||
|   | fcb7d38dce | ||
|   | f984ecc5d7 | ||
|   | 4c2e540451 | ||
|   | 59830a4ff0 | ||
|   | 687bfb0e1d | ||
|   | ea8acf33aa | ||
|   | 4bb035c7a5 | 
					 15 changed files with 64 additions and 33 deletions
				
			
		|  | @ -105,6 +105,7 @@ boolean server = true; // true or false but !server == client | |||
| #define client (!server) | ||||
| boolean nodownload = false; | ||||
| boolean serverrunning = false; | ||||
| boolean connectedtodedicated = false; | ||||
| INT32 serverplayer = 0; | ||||
| char motd[254], server_context[8]; // Message of the Day, Unique Context (even without Mumble support)
 | ||||
| 
 | ||||
|  | @ -1271,6 +1272,7 @@ static boolean SV_SendServerConfig(INT32 node) | |||
| 	netbuffer->u.servercfg.gamestate = (UINT8)gamestate; | ||||
| 	netbuffer->u.servercfg.gametype = (UINT8)gametype; | ||||
| 	netbuffer->u.servercfg.modifiedgame = (UINT8)modifiedgame; | ||||
| 	netbuffer->u.servercfg.dedicated = (boolean)dedicated; | ||||
| 
 | ||||
| 	netbuffer->u.servercfg.maxplayer = (UINT8)(min((dedicated ? MAXPLAYERS-1 : MAXPLAYERS), cv_maxconnections.value)); | ||||
| 	netbuffer->u.servercfg.allownewplayer = cv_allownewplayer.value; | ||||
|  | @ -2502,6 +2504,7 @@ static void Command_connect(void) | |||
| 	// we don't request a restart unless the filelist differs
 | ||||
| 
 | ||||
| 	server = false; | ||||
| 	connectedtodedicated = false; | ||||
| 
 | ||||
| 	// Get the server node.
 | ||||
| 	if (netgame) | ||||
|  | @ -2761,6 +2764,7 @@ void CL_Reset(void) | |||
| 	multiplayer = false; | ||||
| 	servernode = 0; | ||||
| 	server = true; | ||||
| 	connectedtodedicated = false; | ||||
| 	doomcom->numnodes = 1; | ||||
| 	doomcom->numslots = 1; | ||||
| 	SV_StopServer(); | ||||
|  | @ -4274,6 +4278,11 @@ boolean Playing(void) | |||
| 	return (server && serverrunning) || (client && cl_mode == CL_CONNECTED); | ||||
| } | ||||
| 
 | ||||
| boolean InADedicatedServer(void) | ||||
| { | ||||
| 	return Playing() && (dedicated || connectedtodedicated); | ||||
| } | ||||
| 
 | ||||
| boolean SV_SpawnServer(void) | ||||
| { | ||||
| #ifdef TESTERS | ||||
|  | @ -4376,6 +4385,7 @@ void SV_StartSinglePlayerServer(INT32 dogametype, boolean donetgame) | |||
| { | ||||
| 	INT32 lastgametype = gametype; | ||||
| 	server = true; | ||||
| 	connectedtodedicated = false; | ||||
| 	multiplayer = (modeattacking == ATTACKING_NONE); | ||||
| 	joinedIP[0] = '\0';	// Make sure to empty this so that we don't save garbage when we start our own game. (because yes we use this for netgames too....)
 | ||||
| 
 | ||||
|  | @ -5002,6 +5012,7 @@ static void HandlePacketFromAwayNode(SINT8 node) | |||
| 				G_SetGametype(netbuffer->u.servercfg.gametype); | ||||
| 
 | ||||
| 				modifiedgame = netbuffer->u.servercfg.modifiedgame; | ||||
| 				connectedtodedicated = netbuffer->u.servercfg.dedicated; | ||||
| 
 | ||||
| 				memcpy(server_context, netbuffer->u.servercfg.server_context, 8); | ||||
| 
 | ||||
|  |  | |||
|  | @ -231,6 +231,7 @@ struct serverconfig_pak | |||
| 
 | ||||
| 	UINT8 gametype; | ||||
| 	UINT8 modifiedgame; | ||||
| 	boolean dedicated; | ||||
| 
 | ||||
| 	char server_context[8]; // Unique context id, generated at server startup.
 | ||||
| 
 | ||||
|  | @ -407,7 +408,7 @@ struct resultsall_pak | |||
| 
 | ||||
| struct say_pak | ||||
| { | ||||
| 	char message[HU_MAXMSGLEN]; | ||||
| 	char message[HU_MAXMSGLEN + 1]; | ||||
| 	UINT8 target; | ||||
| 	UINT8 flags; | ||||
| 	UINT8 source; | ||||
|  | @ -465,7 +466,7 @@ struct doomdata_t | |||
| 		client3cmd_pak client3pak;          //         264 bytes(?)
 | ||||
| 		client4cmd_pak client4pak;          //         324 bytes(?)
 | ||||
| 		servertics_pak serverpak;           //      132495 bytes (more around 360, no?)
 | ||||
| 		serverconfig_pak servercfg;         //         773 bytes
 | ||||
| 		serverconfig_pak servercfg;         //         777 bytes
 | ||||
| 		UINT8 textcmd[MAXTEXTCMD+2];        //       66049 bytes (wut??? 64k??? More like 258 bytes...)
 | ||||
| 		char filetxpak[sizeof (filetx_pak)];//         139 bytes
 | ||||
| 		char fileack[sizeof (fileack_pak)]; | ||||
|  | @ -558,6 +559,7 @@ extern boolean server; | |||
| extern boolean serverrunning; | ||||
| #define client (!server) | ||||
| extern boolean dedicated; // For dedicated server
 | ||||
| extern boolean connectedtodedicated; // Client that is connected to a dedicated server.
 | ||||
| extern UINT16 software_MAXPACKETLENGTH; | ||||
| extern boolean acceptnewnode; | ||||
| extern SINT8 servernode; | ||||
|  | @ -670,6 +672,7 @@ void CL_UpdateServerList(void); | |||
| void CL_TimeoutServerList(void); | ||||
| // Is there a game running
 | ||||
| boolean Playing(void); | ||||
| boolean InADedicatedServer(void); | ||||
| 
 | ||||
| // Advance client-to-client pubkey verification flow
 | ||||
| void UpdateChallenges(void); | ||||
|  |  | |||
|  | @ -864,6 +864,7 @@ void D_SRB2Loop(void) | |||
| 
 | ||||
| 	if (dedicated) | ||||
| 		server = true; | ||||
| 	connectedtodedicated = dedicated; | ||||
| 
 | ||||
| 	// Pushing of + parameters is now done back in D_SRB2Main, not here.
 | ||||
| 
 | ||||
|  | @ -1597,6 +1598,7 @@ void D_SRB2Main(void) | |||
| 
 | ||||
| 	// for dedicated server
 | ||||
| 	dedicated = M_CheckParm("-dedicated") != 0; | ||||
| 	connectedtodedicated = dedicated; | ||||
| 	if (dedicated) | ||||
| 	{ | ||||
| 		usedTourney = true; | ||||
|  |  | |||
|  | @ -3517,15 +3517,7 @@ void G_DoPlayDemoEx(const char *defdemoname, lumpnum_t deflumpnum) | |||
| 	} | ||||
| 
 | ||||
| 	// end of player read (the 0xFF marker)
 | ||||
| 	// so this is where we are to read our lua variables (if possible!)
 | ||||
| 	if (demoflags & DF_LUAVARS)	// again, used for compability, lua shit will be saved to replays regardless of if it's even been loaded
 | ||||
| 	{ | ||||
| 		if (!gL) // No Lua state! ...I guess we'll just start one...
 | ||||
| 			LUA_ClearState(); | ||||
| 
 | ||||
| 		// No modeattacking check, DF_LUAVARS won't be present here.
 | ||||
| 		LUA_UnArchive(&demobuf, false); | ||||
| 	} | ||||
| 	// see the DF_LUAVARS if later, though.
 | ||||
| 
 | ||||
| 	splitscreen = 0; | ||||
| 
 | ||||
|  | @ -3547,6 +3539,18 @@ void G_DoPlayDemoEx(const char *defdemoname, lumpnum_t deflumpnum) | |||
| 
 | ||||
| 	G_InitNew((demoflags & DF_ENCORE) != 0, gamemap, true, true); // Doesn't matter whether you reset or not here, given changes to resetplayer.
 | ||||
| 
 | ||||
| 	// so this is where we are to read our lua variables (if possible!)
 | ||||
| 	// we read it here because Lua player variables can have mobj references,
 | ||||
| 	// and not having the map loaded causes crashes if that's the case.
 | ||||
| 	if (demoflags & DF_LUAVARS)	// again, used for compability, lua shit will be saved to replays regardless of if it's even been loaded
 | ||||
| 	{ | ||||
| 		if (!gL) // No Lua state! ...I guess we'll just start one...
 | ||||
| 			LUA_ClearState(); | ||||
| 
 | ||||
| 		// No modeattacking check, DF_LUAVARS won't be present here.
 | ||||
| 		LUA_UnArchive(&demobuf, false); | ||||
| 	} | ||||
| 
 | ||||
| 	for (i = 0; i < numslots; i++) | ||||
| 	{ | ||||
| 		UINT8 j; | ||||
|  |  | |||
|  | @ -1229,6 +1229,7 @@ boolean I_InitTcpNetwork(void) | |||
| 	if (M_CheckParm("-server") || dedicated) | ||||
| 	{ | ||||
| 		server = true; | ||||
| 		connectedtodedicated = dedicated; | ||||
| 
 | ||||
| 		// If a number of clients (i.e. nodes) is specified, the server will wait for the clients
 | ||||
| 		// to connect before starting.
 | ||||
|  |  | |||
|  | @ -740,8 +740,11 @@ static void K_SpawnOvertimeLaser(fixed_t x, fixed_t y, fixed_t scale) | |||
| 				case 0: | ||||
| 					P_SetMobjState(mo, S_OVERTIME_BULB1); | ||||
| 
 | ||||
| 					if (leveltime & 1) | ||||
| 						mo->frame += 1; | ||||
| 					if (!cv_reducevfx.value) | ||||
| 					{ | ||||
| 						if (leveltime & 1) | ||||
| 							mo->frame += 1; | ||||
| 					} | ||||
| 
 | ||||
| 					//P_SetScale(mo, mapobjectscale);
 | ||||
| 					zpos += 35 * mo->scale * flip; | ||||
|  | @ -749,10 +752,13 @@ static void K_SpawnOvertimeLaser(fixed_t x, fixed_t y, fixed_t scale) | |||
| 				case 1: | ||||
| 					P_SetMobjState(mo, S_OVERTIME_LASER); | ||||
| 
 | ||||
| 					if (leveltime & 1) | ||||
| 						mo->frame += 3; | ||||
| 					else | ||||
| 						mo->frame += (leveltime / 2) % 3; | ||||
| 					if (!cv_reducevfx.value) | ||||
| 					{ | ||||
| 						if (leveltime & 1) | ||||
| 							mo->frame += 3; | ||||
| 						else | ||||
| 							mo->frame += (leveltime / 2) % 3; | ||||
| 					} | ||||
| 
 | ||||
| 					//P_SetScale(mo, scale);
 | ||||
| 					zpos += 346 * mo->scale * flip; | ||||
|  | @ -763,8 +769,11 @@ static void K_SpawnOvertimeLaser(fixed_t x, fixed_t y, fixed_t scale) | |||
| 				case 2: | ||||
| 					P_SetMobjState(mo, S_OVERTIME_BULB2); | ||||
| 
 | ||||
| 					if (leveltime & 1) | ||||
| 						mo->frame += 1; | ||||
| 					if (!cv_reducevfx.value) | ||||
| 					{ | ||||
| 						if (leveltime & 1) | ||||
| 							mo->frame += 1; | ||||
| 					} | ||||
| 
 | ||||
| 					//P_SetScale(mo, mapobjectscale);
 | ||||
| 					break; | ||||
|  |  | |||
|  | @ -227,7 +227,7 @@ void K_UpdateMatchRaceBots(void) | |||
| { | ||||
| 	const UINT16 defaultbotskin = R_BotDefaultSkin(); | ||||
| 	UINT8 difficulty; | ||||
| 	UINT8 pmax = (dedicated ? MAXPLAYERS-1 : MAXPLAYERS); | ||||
| 	UINT8 pmax = (InADedicatedServer() ? MAXPLAYERS-1 : MAXPLAYERS); | ||||
| 	UINT8 numplayers = 0; | ||||
| 	UINT8 numbots = 0; | ||||
| 	UINT8 numwaiting = 0; | ||||
|  | @ -343,12 +343,7 @@ void K_UpdateMatchRaceBots(void) | |||
| 	if (numbots < wantedbots) | ||||
| 	{ | ||||
| 		// We require MORE bots!
 | ||||
| 		UINT8 newplayernum = 0; | ||||
| 
 | ||||
| 		if (dedicated) | ||||
| 		{ | ||||
| 			newplayernum = 1; | ||||
| 		} | ||||
| 		UINT8 newplayernum = InADedicatedServer() ? 1 : 0; | ||||
| 
 | ||||
| 		// Rearrange usable bot skins list to prevent gaps for randomised selection
 | ||||
| 		if (tutorialchallenge == TUTORIALSKIP_INPROGRESS) | ||||
|  |  | |||
|  | @ -1098,7 +1098,7 @@ void M_UpdateMenuCMD(UINT8 i, boolean bailrequired, boolean chat_open) | |||
| 	menucmd[i].buttons = 0; | ||||
| 
 | ||||
| 	// Eat inputs made when chat is open
 | ||||
| 	if (chat_open) | ||||
| 	if (chat_open && pausemenu.closing) | ||||
| 		return; | ||||
| 
 | ||||
| 	if (G_PlayerInputDown(i, gc_screenshot,    mp)) { menucmd[i].buttons |= MBT_SCREENSHOT; } | ||||
|  |  | |||
|  | @ -489,7 +489,8 @@ static int lib_mMusicRemap(lua_State *L) | |||
| 	} | ||||
| 	 | ||||
| 	// Do not allow Lua to remap Stereo Mode tunes.
 | ||||
| 	if (strncmp("stere", tune_id, 5)) | ||||
| 	if (strlen(tune_id) > 5 | ||||
| 	    && toupper(tune_id[0]) == 'S' && toupper(tune_id[1]) == 'T' && toupper(tune_id[2]) == 'E' && toupper(tune_id[3]) == 'R' && toupper(tune_id[4]) == 'E') | ||||
| 	{ | ||||
| 		return LUA_ErrStereo(L, tune_id); | ||||
| 	} | ||||
|  |  | |||
|  | @ -351,13 +351,12 @@ static int cup_get(lua_State *L) | |||
| 			lua_pushstring(L, cup->levellist[i]); | ||||
| 			lua_rawseti(L, -2, 1 + i); | ||||
| 		} | ||||
| 		//return UNIMPLEMENTED;
 | ||||
| 		break; | ||||
| 	case cup_cachedlevels: | ||||
| 		lua_createtable(L, ((cup->numlevels) + (cup->numbonus)), 0); | ||||
| 		for (size_t i = 0; i < ((cup->numlevels) + (cup->numbonus)); i++) | ||||
| 		for (size_t i = 0; i < CUPCACHE_MAX; i++) | ||||
| 		{ | ||||
| 			lua_pushnumber(L, cup->cachedlevels[i]); | ||||
| 			lua_pushnumber(L, (cup->cachedlevels[i])+1); | ||||
| 			lua_rawseti(L, -2, 1 + i); | ||||
| 		} | ||||
| 		break; | ||||
|  |  | |||
|  | @ -525,7 +525,7 @@ void M_CupSelectHandler(INT32 choice) | |||
| 	{ | ||||
| 		M_SetMenuDelay(pid); | ||||
| 		 | ||||
| 		if (cupgrid.builtgrid[CUPMENU_CURSORID] == &dummy_lostandfound) | ||||
| 		if ((cupgrid.builtgrid[CUPMENU_CURSORID] == &dummy_lostandfound) || (cupgrid.builtgrid[CUPMENU_CURSORID] == NULL)) | ||||
| 			S_StartSound(NULL, sfx_gshe7); | ||||
| 			 | ||||
| 		else if (!M_IsCupQueueable(cupgrid.builtgrid[CUPMENU_CURSORID])) | ||||
|  |  | |||
|  | @ -15,6 +15,7 @@ | |||
| #include "../../d_netcmd.h" | ||||
| #include "../../i_time.h" | ||||
| #include "../../k_menu.h" | ||||
| #include "../../hu_stuff.h" | ||||
| #include "../../k_grandprix.h" // K_CanChangeRules | ||||
| #include "../../m_cond.h" | ||||
| #include "../../s_sound.h" | ||||
|  | @ -125,6 +126,9 @@ void M_OpenPauseMenu(void) | |||
| 	pausemenu.openoffset.dist = 0; | ||||
| 	pausemenu.closing = false; | ||||
| 
 | ||||
| 	// Fix specific input error regarding closing netgame chat with escape while a controller is connected (only on Windows?)
 | ||||
| 	chat_keydown = false; | ||||
| 
 | ||||
| 	itemOn = currentMenu->lastOn = mpause_continue;	// Make sure we select "RESUME GAME" by default
 | ||||
| 
 | ||||
| 	// Now the hilarious balancing act of deciding what options should be enabled and which ones shouldn't be!
 | ||||
|  |  | |||
|  | @ -1330,7 +1330,7 @@ void P_DoPlayerExit(player_t *player, pflags_t flags) | |||
| 
 | ||||
| 			if (grandprixinfo.gp == true | ||||
| 				&& grandprixinfo.eventmode != GPEVENT_SPECIAL | ||||
| 				&& player->bot == false && losing == false) | ||||
| 				&& player->bot == false && losing == false && player->hudrings > 0) | ||||
| 			{ | ||||
| 				const UINT8 lifethreshold = 20; | ||||
| 
 | ||||
|  |  | |||
|  | @ -358,6 +358,7 @@ boolean I_InitNetwork(void) | |||
| 	if (M_CheckParm("-server") || dedicated) | ||||
| 	{ | ||||
| 		server = true; | ||||
| 		connectedtodedicated = dedicated; | ||||
| 
 | ||||
| 		// If a number of clients (i.e. nodes) is specified, the server will wait for the clients
 | ||||
| 		// to connect before starting.
 | ||||
|  |  | |||
|  | @ -260,6 +260,7 @@ static inline VOID OpenTextConsole(void) | |||
| 	HANDLE ci, co; | ||||
| 	const BOOL tco = M_CheckParm("-console") != 0; | ||||
| 	dedicated = M_CheckParm("-dedicated") != 0; | ||||
| 	connectedtodedicated = dedicated; | ||||
| 	if (!(dedicated || tco)) | ||||
| 		return; | ||||
| 	FreeConsole(); | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue