console_cmds.c
changeset 1602 08783e4287dc
parent 1596 c1c439a2d5b2
child 1739 4f3082735fbc
equal deleted inserted replaced
1601:9fd461d00287 1602:08783e4287dc
   434 				status = "inactive";
   434 				status = "inactive";
   435 				break;
   435 				break;
   436 			case STATUS_AUTH:
   436 			case STATUS_AUTH:
   437 				status = "authorized";
   437 				status = "authorized";
   438 				break;
   438 				break;
       
   439 			case STATUS_MAP_WAIT:
       
   440 				status = "waiting";
       
   441 				break;
   439 			case STATUS_MAP:
   442 			case STATUS_MAP:
   440 				status = "loading map";
   443 				status = "loading map";
   441 				break;
   444 				break;
   442 			case STATUS_DONE_MAP:
   445 			case STATUS_DONE_MAP:
   443 				status = "done map";
   446 				status = "done map";
  1059 			IConsolePrint(_iconsole_color_warning, "Usage: set server_bind_ip <ip>.");
  1062 			IConsolePrint(_iconsole_color_warning, "Usage: set server_bind_ip <ip>.");
  1060 		}
  1063 		}
  1061 		return NULL;
  1064 		return NULL;
  1062 	}
  1065 	}
  1063 
  1066 
       
  1067 	// setting max-join-time
       
  1068 	if (strcmp(argv[1],"max_join_time") == 0) {
       
  1069 		if (argc == 3 && atoi(argv[2]) != 0) {
       
  1070 			_network_max_join_time = atoi(argv[2]);
       
  1071 			IConsolePrintF(_iconsole_color_warning, "Max-join-time changed to '%d'", _network_max_join_time);
       
  1072 			IConsolePrintF(_iconsole_color_warning, "Changes will take effect immediatly.");
       
  1073 		} else {
       
  1074 			IConsolePrintF(_iconsole_color_default, "Current max-join-time is '%d'", _network_max_join_time);
       
  1075 			IConsolePrint(_iconsole_color_warning, "Usage: set max_join_time <ticks> (default = 500).");
       
  1076 		}
       
  1077 		return NULL;
       
  1078 	}
       
  1079 
       
  1080 
  1064 	// setting the server advertising on/off
  1081 	// setting the server advertising on/off
  1065 	if (strcmp(argv[1],"server_advertise") == 0) {
  1082 	if (strcmp(argv[1],"server_advertise") == 0) {
  1066 		if (!_network_server) {
  1083 		if (!_network_server) {
  1067 			IConsolePrintF(_iconsole_color_error, "You are not the server");
  1084 			IConsolePrintF(_iconsole_color_error, "You are not the server");
  1068 			return NULL;
  1085 			return NULL;
  1080 			IConsolePrint(_iconsole_color_warning, "Usage: set server_advertise on/off.");
  1097 			IConsolePrint(_iconsole_color_warning, "Usage: set server_advertise on/off.");
  1081 		}
  1098 		}
  1082 		return NULL;
  1099 		return NULL;
  1083 	}
  1100 	}
  1084 
  1101 
       
  1102 	// setting the server 'pause on client join' on/off
       
  1103 	if (strcmp(argv[1],"pause_on_join") == 0) {
       
  1104 		if (!_network_server) {
       
  1105 			IConsolePrintF(_iconsole_color_error, "You are not the server");
       
  1106 			return NULL;
       
  1107 		}
       
  1108 		if (argc == 3) {
       
  1109 			if (strcmp(argv[2], "on") == 0 || atoi(argv[2]) == 1)
       
  1110 				_network_pause_on_join = true;
       
  1111 			else
       
  1112 				_network_pause_on_join = false;
       
  1113 			IConsolePrintF(_iconsole_color_warning, "Pause-on-join changed to '%s'", (_network_pause_on_join)?"on":"off");
       
  1114 		} else {
       
  1115 			IConsolePrintF(_iconsole_color_default, "Current pause-on-join is '%s'", (_network_pause_on_join)?"on":"off");
       
  1116 			IConsolePrint(_iconsole_color_warning, "Usage: set pause_on_join on/off.");
       
  1117 		}
       
  1118 		return NULL;
       
  1119 	}
       
  1120 
  1085 	// setting the server autoclean on/off
  1121 	// setting the server autoclean on/off
  1086 	if (strcmp(argv[1],"autoclean_companies") == 0) {
  1122 	if (strcmp(argv[1],"autoclean_companies") == 0) {
  1087 		if (!_network_server) {
  1123 		if (!_network_server) {
  1088 			IConsolePrintF(_iconsole_color_error, "You are not the server");
  1124 			IConsolePrintF(_iconsole_color_error, "You are not the server");
  1089 			return NULL;
  1125 			return NULL;
  1173 #ifdef ENABLE_NETWORK
  1209 #ifdef ENABLE_NETWORK
  1174 	IConsolePrint(_iconsole_color_error, " - autoclean_companies on/off");
  1210 	IConsolePrint(_iconsole_color_error, " - autoclean_companies on/off");
  1175 	IConsolePrint(_iconsole_color_error, " - autoclean_protected <months>");
  1211 	IConsolePrint(_iconsole_color_error, " - autoclean_protected <months>");
  1176 	IConsolePrint(_iconsole_color_error, " - autoclean_unprotected <months>");
  1212 	IConsolePrint(_iconsole_color_error, " - autoclean_unprotected <months>");
  1177 	IConsolePrint(_iconsole_color_error, " - company_pw \"<password>\"");
  1213 	IConsolePrint(_iconsole_color_error, " - company_pw \"<password>\"");
       
  1214 	IConsolePrint(_iconsole_color_error, " - max_join_time <frames>");
  1178 	IConsolePrint(_iconsole_color_error, " - name \"<playername>\"");
  1215 	IConsolePrint(_iconsole_color_error, " - name \"<playername>\"");
       
  1216 	IConsolePrint(_iconsole_color_error, " - pause_on_join on/off");
  1179 	IConsolePrint(_iconsole_color_error, " - rcon_pw \"<password>\"");
  1217 	IConsolePrint(_iconsole_color_error, " - rcon_pw \"<password>\"");
  1180 	IConsolePrint(_iconsole_color_error, " - server_name \"<name>\"");
  1218 	IConsolePrint(_iconsole_color_error, " - server_name \"<name>\"");
  1181 	IConsolePrint(_iconsole_color_error, " - server_advertise on/off");
  1219 	IConsolePrint(_iconsole_color_error, " - server_advertise on/off");
  1182 	IConsolePrint(_iconsole_color_error, " - server_bind_ip <ip>");
  1220 	IConsolePrint(_iconsole_color_error, " - server_bind_ip <ip>");
  1183 	IConsolePrint(_iconsole_color_error, " - server_port <port>");
  1221 	IConsolePrint(_iconsole_color_error, " - server_port <port>");