mirror of
https://github.com/ineedbots/iw3_bot_warfare.git
synced 2025-04-22 02:15:42 +00:00
connection events
This commit is contained in:
parent
b3967606f4
commit
0ea6672804
@ -440,6 +440,21 @@ fixPerksAndScriptKick()
|
|||||||
self.pers[ "isBot" ] = true;
|
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.
|
When a bot disconnects.
|
||||||
*/
|
*/
|
||||||
@ -457,6 +472,14 @@ connected()
|
|||||||
{
|
{
|
||||||
self endon( "disconnect" );
|
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" ] ) )
|
if ( !isdefined( self.pers[ "bot_host" ] ) )
|
||||||
{
|
{
|
||||||
self thread doHostCheck();
|
self thread doHostCheck();
|
||||||
|
@ -252,10 +252,31 @@ start_chat_watch()
|
|||||||
case "sd":
|
case "sd":
|
||||||
self thread bot_chat_sd_watch( a, b, c, d, e, f, g );
|
self thread bot_chat_sd_watch( a, b, c, d, e, f, g );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "connection":
|
||||||
|
self thread bot_chat_connection_player_watch( a, b, c, d, e, f, g );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
When a player connected
|
||||||
|
*/
|
||||||
|
bot_chat_connection_player_watch( conn, player, playername, d, e, f, g )
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
|
||||||
|
switch ( conn )
|
||||||
|
{
|
||||||
|
case "connected":
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "disconnected":
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
start_startgame_watch
|
start_startgame_watch
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user