mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Save when quitting the game.
Also use default reason if not custom reason is given.
This commit is contained in:
		
							parent
							
								
									5e2cea3980
								
							
						
					
					
						commit
						141338c7c1
					
				
					 4 changed files with 21 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -2770,11 +2770,21 @@ static void Command_BanIP(void)
 | 
			
		|||
	if (server) // Only the server can use this, otherwise does nothing.
 | 
			
		||||
	{
 | 
			
		||||
		const char *address = (COM_Argv(1));
 | 
			
		||||
		const char *reason = (COM_Argv(2));
 | 
			
		||||
		const char *reason;
 | 
			
		||||
 | 
			
		||||
		if (COM_Argc() == 2)
 | 
			
		||||
			reason = NULL;
 | 
			
		||||
		else
 | 
			
		||||
			reason = COM_Argv(2);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		if (I_SetBanAddress && I_SetBanAddress(address, NULL))
 | 
			
		||||
		{
 | 
			
		||||
			CONS_Printf("Banned ip address for:%s\n", reason);
 | 
			
		||||
			if (reason)
 | 
			
		||||
				CONS_Printf("Banned ip address %s for: %s\n", address, reason);
 | 
			
		||||
			else
 | 
			
		||||
				CONS_Printf("Banned ip address %s\n", address);
 | 
			
		||||
 | 
			
		||||
			Ban_Add(reason);
 | 
			
		||||
			D_SaveBan();
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -615,6 +615,9 @@ void I_Quit (void)
 | 
			
		|||
	//added:16-02-98: when recording a demo, should exit using 'q' key,
 | 
			
		||||
	//        but sometimes we forget and use 'F10'.. so save here too.
 | 
			
		||||
	M_SaveConfig (NULL);   //save game config, cvars..
 | 
			
		||||
#ifndef NONET
 | 
			
		||||
	D_SaveBan(); // save the ban list
 | 
			
		||||
#endif
 | 
			
		||||
	G_SaveGameData(); // Tails 12-08-2002
 | 
			
		||||
	if (demorecording)
 | 
			
		||||
		G_CheckDemoStatus();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3054,6 +3054,9 @@ void I_Quit(void)
 | 
			
		|||
	quiting = SDL_FALSE;
 | 
			
		||||
	I_ShutdownConsole();
 | 
			
		||||
	M_SaveConfig(NULL); //save game config, cvars..
 | 
			
		||||
#ifndef NONET
 | 
			
		||||
	D_SaveBan(); // save the ban list
 | 
			
		||||
#endif
 | 
			
		||||
	G_SaveGameData(false); // Tails 12-08-2002
 | 
			
		||||
	//added:16-02-98: when recording a demo, should exit using 'q' key,
 | 
			
		||||
	//        but sometimes we forget and use 'F10'.. so save here too.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2975,6 +2975,9 @@ void I_Quit(void)
 | 
			
		|||
	quiting = SDL_FALSE;
 | 
			
		||||
	I_ShutdownConsole();
 | 
			
		||||
	M_SaveConfig(NULL); //save game config, cvars..
 | 
			
		||||
#ifndef NONET
 | 
			
		||||
	D_SaveBan(); // save the ban list
 | 
			
		||||
#endif
 | 
			
		||||
	G_SaveGameData(); // Tails 12-08-2002
 | 
			
		||||
	//added:16-02-98: when recording a demo, should exit using 'q' key,
 | 
			
		||||
	//        but sometimes we forget and use 'F10'.. so save here too.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue