mirror of
https://github.com/ineedbots/t4_bot_warfare.git
synced 2025-09-23 07:06:39 +00:00
connection events
This commit is contained in:
@@ -207,8 +207,11 @@ init()
|
||||
if ( !isdefined( game[ "botWarfare" ] ) )
|
||||
{
|
||||
game[ "botWarfare" ] = true;
|
||||
game[ "botWarfareInitTime" ] = gettime();
|
||||
}
|
||||
|
||||
level.bot_inittime = gettime();
|
||||
|
||||
level.defuseobject = undefined;
|
||||
level.bots_smokelist = List();
|
||||
level.tbl_perkdata[ 0 ][ "reference_full" ] = true;
|
||||
@@ -439,6 +442,21 @@ fixPerksAndScriptKick()
|
||||
self.pers[ "isBot" ] = true;
|
||||
}
|
||||
|
||||
/*
|
||||
When a bot disconnects.
|
||||
*/
|
||||
onDisconnectPlayer()
|
||||
{
|
||||
self waittill( "disconnect" );
|
||||
waittillframeend;
|
||||
|
||||
for ( i = 0; i < level.bots.size; i++ )
|
||||
{
|
||||
bot = level.bots[ i ];
|
||||
bot BotNotifyBotEvent( "connection", "disconnected", self, self.name );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
When a bot disconnects.
|
||||
*/
|
||||
@@ -456,6 +474,14 @@ connected()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
for ( i = 0; i < level.bots.size; i++ )
|
||||
{
|
||||
bot = level.bots[ i ];
|
||||
bot BotNotifyBotEvent( "connection", "connected", self, self.name );
|
||||
}
|
||||
|
||||
self thread onDisconnectPlayer();
|
||||
|
||||
if ( !isdefined( self.pers[ "bot_host" ] ) )
|
||||
{
|
||||
self thread doHostCheck();
|
||||
|
Reference in New Issue
Block a user