console_cmds.c
changeset 4716 d9ca1be9d04b
parent 4614 82d41ead0e22
child 4826 63b1eb7c966b
equal deleted inserted replaced
4715:7ab95d47d2eb 4716:d9ca1be9d04b
   607 	if (_network_game_info.spectators_max > 10) {
   607 	if (_network_game_info.spectators_max > 10) {
   608 		_network_game_info.spectators_max = 10;
   608 		_network_game_info.spectators_max = 10;
   609 		IConsoleError("Maximum spectators out of bounds, truncating to limit.");
   609 		IConsoleError("Maximum spectators out of bounds, truncating to limit.");
   610 	}
   610 	}
   611 
   611 
       
   612 	return true;
       
   613 }
       
   614 
       
   615 DEF_CONSOLE_HOOK(ConHookCheckMinPlayers)
       
   616 {
       
   617 	CheckMinPlayers();
   612 	return true;
   618 	return true;
   613 }
   619 }
   614 
   620 
   615 DEF_CONSOLE_CMD(ConKick)
   621 DEF_CONSOLE_CMD(ConKick)
   616 {
   622 {
  1578 	IConsoleVarRegister("autoclean_unprotected", &_network_autoclean_unprotected, ICONSOLE_VAR_BYTE, "Automatically shut down inactive companies after the given amount of months");
  1584 	IConsoleVarRegister("autoclean_unprotected", &_network_autoclean_unprotected, ICONSOLE_VAR_BYTE, "Automatically shut down inactive companies after the given amount of months");
  1579 	IConsoleVarHookAdd("autoclean_unprotected",  ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
  1585 	IConsoleVarHookAdd("autoclean_unprotected",  ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
  1580 	IConsoleVarRegister("restart_game_year",     &_network_restart_game_year, ICONSOLE_VAR_UINT16, "Auto-restart the server when Jan 1st of the set year is reached. Use '0' to disable this");
  1586 	IConsoleVarRegister("restart_game_year",     &_network_restart_game_year, ICONSOLE_VAR_UINT16, "Auto-restart the server when Jan 1st of the set year is reached. Use '0' to disable this");
  1581 	IConsoleVarHookAdd("restart_game_year",      ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
  1587 	IConsoleVarHookAdd("restart_game_year",      ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
  1582 
  1588 
       
  1589 	IConsoleVarRegister("min_players",           &_network_min_players, ICONSOLE_VAR_BYTE, "Automatically pause the game when the number of active players passes below the given amount");
       
  1590 	IConsoleVarHookAdd("min_players",            ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
       
  1591 	IConsoleVarHookAdd("min_players",            ICONSOLE_HOOK_POST_ACTION, ConHookCheckMinPlayers);
       
  1592 
  1583 #endif /* ENABLE_NETWORK */
  1593 #endif /* ENABLE_NETWORK */
  1584 
  1594 
  1585 	// debugging stuff
  1595 	// debugging stuff
  1586 #ifdef _DEBUG
  1596 #ifdef _DEBUG
  1587 	IConsoleDebugLibRegister();
  1597 	IConsoleDebugLibRegister();