Greatly reduce var usage

This commit is contained in:
ineedbots 2021-05-27 16:14:44 -06:00
parent 556dac9171
commit 9cf2770ef5
2 changed files with 2827 additions and 2581 deletions

File diff suppressed because it is too large Load Diff

View File

@ -354,11 +354,8 @@ bot_set_difficulty( difficulty )
/* /*
A server thread for monitoring all bot's teams for custom server settings. A server thread for monitoring all bot's teams for custom server settings.
*/ */
teamBots() teamBots_loop()
{ {
for(;;)
{
wait 1.5;
teamAmount = getDvarInt("bots_team_amount"); teamAmount = getDvarInt("bots_team_amount");
toTeam = getDvar("bots_team"); toTeam = getDvar("bots_team");
@ -477,49 +474,25 @@ teamBots()
} }
} }
} }
}
/*
A server thread for monitoring all bot's teams for custom server settings.
*/
teamBots()
{
for(;;)
{
wait 1.5;
teamBots_loop();
} }
} }
/* /*
A server thread for monitoring all bot's in game. Will add and kick bots according to server settings. Loop
Dedis only spawn bots when developer is not 0
This makes the dedi unstable and can crash
Patch the executable to skip the pregame and make it so bots can spawn
pregame:
in the ShouldDoPregame sub:
B8 01 00 00 00: mov eax, 1
change to: B8 00 00 00 00: mov eax, 0
0x4F6C77 in rektmp
0x4598A7 in bg
spawnbots:
in the SV_AddTestClient sub:
0F 85 A4 00 00 00: jnz
change to: 0F 84 A4 00 00 00: jz
0x6B6180 in rektmp
0x4682F0 in bg
allow changing g_antilag dvar:
set the byte from 0x40 to 0x00
0x53B1B2 in rekt
0x59B6F2 in bg
*/ */
addBots() addBots_loop()
{ {
level endon ( "game_ended" );
bot_wait_for_host();
for (;;)
{
wait 1.5;
botsToAdd = GetDvarInt("bots_manage_add"); botsToAdd = GetDvarInt("bots_manage_add");
if(botsToAdd > 0) if(botsToAdd > 0)
@ -622,6 +595,49 @@ addBots()
if (isDefined(tempBot)) if (isDefined(tempBot))
kick( tempBot getEntityNumber(), "EXE_PLAYERKICKED" ); kick( tempBot getEntityNumber(), "EXE_PLAYERKICKED" );
} }
}
/*
A server thread for monitoring all bot's in game. Will add and kick bots according to server settings.
Dedis only spawn bots when developer is not 0
This makes the dedi unstable and can crash
Patch the executable to skip the pregame and make it so bots can spawn
pregame:
in the ShouldDoPregame sub:
B8 01 00 00 00: mov eax, 1
change to: B8 00 00 00 00: mov eax, 0
0x4F6C77 in rektmp
0x4598A7 in bg
spawnbots:
in the SV_AddTestClient sub:
0F 85 A4 00 00 00: jnz
change to: 0F 84 A4 00 00 00: jz
0x6B6180 in rektmp
0x4682F0 in bg
allow changing g_antilag dvar:
set the byte from 0x40 to 0x00
0x53B1B2 in rekt
0x59B6F2 in bg
*/
addBots()
{
level endon ( "game_ended" );
bot_wait_for_host();
for (;;)
{
wait 1.5;
addBots_loop();
} }
} }
@ -852,12 +868,8 @@ doFiringThread()
/* /*
Watches the planes Watches the planes
*/ */
bot_watch_planes() bot_watch_planes_loop()
{ {
for(;;)
{
level waittill("uav_update");
ents = GetEntArray("script_model", "classname"); ents = GetEntArray("script_model", "classname");
for(i = 0; i < ents.size; i++) for(i = 0; i < ents.size; i++)
{ {
@ -871,6 +883,18 @@ bot_watch_planes()
thread watch_plane(ent); thread watch_plane(ent);
} }
}
/*
Watches the planes
*/
bot_watch_planes()
{
for(;;)
{
level waittill("uav_update");
bot_watch_planes_loop();
} }
} }