# HG changeset patch # User Adam Kaminski # Date 1631148096 14400 # Wed Sep 08 20:41:36 2021 -0400 # Node ID 348fc8e6d7fc5659200effb2f77426bd6d6b1ec1 # Parent cea1464c98f9881ce3569eacf34238339b06362e Added the EVENT script type: GAMEEVENT_PLAYERCONNECT, indicating when a client or bot joins the server. diff -r cea1464c98f9 -r 348fc8e6d7fc docs/zandronum-history.txt --- a/docs/zandronum-history.txt Wed Sep 08 12:18:11 2021 -0400 +++ b/docs/zandronum-history.txt Wed Sep 08 20:41:36 2021 -0400 @@ -57,6 +57,7 @@ + - Added the GAMEMODE flag DONTPRINTPLAYERSLEFT to prevent printing the "waiting for players" or "x allies/opponents left" message at the bottom of the screen. [Kaminsky] + - Added all of the text colors from "New Text Colors", originally made by FuzzballFox. [Kaminsky] + - Added DMFlags: "sv_shootthroughallies" and "sv_dontpushallies", so a player's attacks can pass through and not push their allies. [Kaminsky] ++ - Added the EVENT script type: GAMEEVENT_PLAYERCONNECT, indicating when a client or bot joins the server. [Kaminsky] - - Fixed: Bots tries to jump to reach item when sv_nojump is true. [sleep] - - Fixed: ACS function SetSkyScrollSpeed didn't work online. [Edward-san] - - Fixed: color codes in callvote reasons weren't terminated properly. [Dusk] diff -r cea1464c98f9 -r 348fc8e6d7fc src/bots.cpp --- a/src/bots.cpp Wed Sep 08 12:18:11 2021 -0400 +++ b/src/bots.cpp Wed Sep 08 20:41:36 2021 -0400 @@ -1973,6 +1973,9 @@ if ( m_pPlayer->bSpectating ) PostEvent( BOTEVENT_SPECTATING ); + // [AK] The bot has successfully joined the game, trigger an event script to indicate that. + GAMEMODE_HandleEvent( GAMEEVENT_PLAYERCONNECT, NULL, ulPlayerNum ); + // Refresh the HUD since a new player is now here (this affects the number of players in the game). HUD_Refresh( ); } diff -r cea1464c98f9 -r 348fc8e6d7fc src/gamemode.h --- a/src/gamemode.h Wed Sep 08 12:18:11 2021 -0400 +++ b/src/gamemode.h Wed Sep 08 20:41:36 2021 -0400 @@ -113,6 +113,7 @@ GAMEEVENT_ROUND_ENDS, GAMEEVENT_ROUND_ABORTED, GAMEEVENT_CHAT, + GAMEEVENT_PLAYERCONNECT, } GAMEEVENT_e; //***************************************************************************** diff -r cea1464c98f9 -r 348fc8e6d7fc src/sv_main.cpp --- a/src/sv_main.cpp Wed Sep 08 12:18:11 2021 -0400 +++ b/src/sv_main.cpp Wed Sep 08 20:41:36 2021 -0400 @@ -1616,6 +1616,10 @@ // [RC] Clients may wish to ignore this new player. SERVERCOMMANDS_PotentiallyIgnorePlayer( g_lCurrentClient ); + + // [AK] Trigger an event script indicating that the client has connected to the server. + // Also indicate if they had previously connected to the server. + GAMEMODE_HandleEvent( GAMEEVENT_PLAYERCONNECT, NULL, g_lCurrentClient, !!pSavedInfo ); } //*****************************************************************************