mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-07-07 20:38:09 -05:00
Remove dedicated server code
This commit is contained in:
@ -86,17 +86,22 @@ init()
|
||||
set_lethal_grenade_init();
|
||||
set_dvars();
|
||||
|
||||
level thread initial_print();
|
||||
|
||||
level thread onplayerconnect();
|
||||
level thread post_all_players_spawned();
|
||||
|
||||
level thread server_message_watcher();
|
||||
level thread start_game_message();
|
||||
level thread end_game_message();
|
||||
|
||||
level thread enemy_counter_hud();
|
||||
level thread timer_hud();
|
||||
}
|
||||
|
||||
initial_print()
|
||||
{
|
||||
flag_wait("initial_players_connected");
|
||||
|
||||
iprintln("Reimagined Loaded");
|
||||
}
|
||||
|
||||
onplayerconnect()
|
||||
{
|
||||
while(true)
|
||||
@ -325,63 +330,6 @@ set_perks()
|
||||
self setperk( "specialty_fastladderclimb" );
|
||||
}
|
||||
|
||||
server_message_watcher()
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
level waittill("say", message, player);
|
||||
|
||||
server_message(message);
|
||||
}
|
||||
}
|
||||
|
||||
server_message(message)
|
||||
{
|
||||
if(message == "version")
|
||||
{
|
||||
iprintln("Reimagined Loaded");
|
||||
}
|
||||
else if(message == "changelog")
|
||||
{
|
||||
iprintln("View changelog: github.com/Jbleezy/BO2-Reimagined");
|
||||
}
|
||||
else if(message == "discord")
|
||||
{
|
||||
iprintln("Join the Discord: discord.io/Jbleezy");
|
||||
}
|
||||
else if(message == "donate")
|
||||
{
|
||||
iprintln("Donate: paypal.me/Jbleezy");
|
||||
}
|
||||
}
|
||||
|
||||
start_game_message()
|
||||
{
|
||||
flag_wait("initial_players_connected");
|
||||
|
||||
server_message("version");
|
||||
|
||||
if(!isDedicated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
server_message("changelog");
|
||||
}
|
||||
|
||||
end_game_message()
|
||||
{
|
||||
if(!isDedicated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
level waittill("end_game");
|
||||
|
||||
server_message("discord");
|
||||
server_message("donate");
|
||||
}
|
||||
|
||||
health_bar_hud()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
@ -71,7 +71,6 @@ init()
|
||||
level thread remove_round_number();
|
||||
level thread remove_status_icons_on_intermission();
|
||||
level thread all_voice_on_intermission();
|
||||
level thread random_map_rotation();
|
||||
level thread spawn_bots();
|
||||
}
|
||||
|
||||
@ -771,6 +770,11 @@ grief_onplayerdisconnect(disconnecting_player)
|
||||
}
|
||||
|
||||
level thread update_players_on_disconnect(disconnecting_player);
|
||||
|
||||
if(isDefined(level.grief_update_records))
|
||||
{
|
||||
[[level.grief_update_records]](disconnecting_player);
|
||||
}
|
||||
}
|
||||
|
||||
on_player_spawned()
|
||||
@ -2750,6 +2754,8 @@ containment_think()
|
||||
|
||||
increment_score(team)
|
||||
{
|
||||
level endon("end_game");
|
||||
|
||||
encounters_team = "A";
|
||||
if(team == "allies")
|
||||
{
|
||||
@ -2790,83 +2796,6 @@ increment_score(team)
|
||||
}
|
||||
}
|
||||
|
||||
random_map_rotation()
|
||||
{
|
||||
if(!isDedicated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
initial_map = 0;
|
||||
if(getDvar("sv_mapRotationRandom") == "")
|
||||
{
|
||||
initial_map = 1;
|
||||
setDvar("sv_mapRotationRandom", 1);
|
||||
}
|
||||
|
||||
if(!initial_map && getDvar("sv_mapRotationCurrent") != "")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
rotation_array = [];
|
||||
rotation_string = getDvar("sv_mapRotation");
|
||||
tokens = strTok(rotation_string, " ");
|
||||
for(i = 0; i < tokens.size; i += 4)
|
||||
{
|
||||
rotation_array[rotation_array.size] = tokens[i] + " " + tokens[i+1] + " " + tokens[i+2] + " " + tokens[i+3];
|
||||
}
|
||||
|
||||
if(rotation_array.size < 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// randomize maps
|
||||
rotation_array = array_randomize(rotation_array);
|
||||
|
||||
// make sure current map isn't first
|
||||
// except for initially since map hasn't been played
|
||||
if(!initial_map)
|
||||
{
|
||||
tokens = strTok(rotation_array[0], " ");
|
||||
|
||||
location = tokens[1]; // zm_gamemode_location.cfg
|
||||
location = strTok(location, ".");
|
||||
location = location[0]; // zm_gamemode_location
|
||||
location = strTok(location, "_");
|
||||
location = location[2]; // location
|
||||
|
||||
mapname = tokens[3];
|
||||
|
||||
if(level.scr_zm_map_start_location == location && level.script == mapname)
|
||||
{
|
||||
num = randomIntRange(1, rotation_array.size);
|
||||
rotation_array = array_swap(rotation_array, 0, num);
|
||||
}
|
||||
}
|
||||
|
||||
rotation_string = "";
|
||||
for(i = 0; i < rotation_array.size; i++)
|
||||
{
|
||||
rotation_string += rotation_array[i];
|
||||
|
||||
if(i < rotation_array.size - 1)
|
||||
{
|
||||
rotation_string += " ";
|
||||
}
|
||||
}
|
||||
|
||||
setDvar("sv_mapRotation", rotation_string);
|
||||
setDvar("sv_mapRotationCurrent", rotation_string);
|
||||
|
||||
// make initial map random
|
||||
if(initial_map)
|
||||
{
|
||||
exitLevel(0);
|
||||
}
|
||||
}
|
||||
|
||||
spawn_bots()
|
||||
{
|
||||
bot_amount = getDvarIntDefault("scr_bot_count_zm", 0);
|
||||
|
Reference in New Issue
Block a user