This is a fork of Zandronum Beta for Mac Os (Silicon and Intel)
修訂 | 850eeed37215b9dfe3baeeb9d083d47c27a67f21 (tree) |
---|---|
時間 | 2022-11-22 00:56:35 |
作者 | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
- The server skips sending a SVC2_SETPLAYERSTATUS command to the client that initially sent the CLC_STARTCHAT, CLC_ENTERCONSOLE, CLC_ENTERMENU, etc. command, as they already updated the status on their end.
- Added the helper function PLAYER_SetStatus.
@@ -2056,9 +2056,7 @@ | ||
2056 | 2056 | } |
2057 | 2057 | |
2058 | 2058 | // We can now get rid of the chat bubble above the bot's head. |
2059 | - pBot->GetPlayer( )->bChatting = false; | |
2060 | - if ( NETWORK_GetState( ) == NETSTATE_SERVER ) | |
2061 | - SERVERCOMMANDS_SetPlayerStatus( pBot->GetPlayer( ) - players, PLAYERSTATUS_CHATTING ); | |
2059 | + PLAYER_SetStatus( pBot->GetPlayer( ), PLAYERSTATUS_CHATTING, false ); | |
2062 | 2060 | } |
2063 | 2061 | |
2064 | 2062 | //***************************************************************************** |
@@ -2071,9 +2069,7 @@ | ||
2071 | 2069 | CChatFile *pFile; |
2072 | 2070 | |
2073 | 2071 | // We can now get rid of the chat bubble above the bot's head. |
2074 | - pBot->GetPlayer( )->bChatting = false; | |
2075 | - if ( NETWORK_GetState( ) == NETSTATE_SERVER ) | |
2076 | - SERVERCOMMANDS_SetPlayerStatus( pBot->GetPlayer( ) - players, PLAYERSTATUS_CHATTING ); | |
2072 | + PLAYER_SetStatus( pBot->GetPlayer( ), PLAYERSTATUS_CHATTING, false ); | |
2077 | 2073 | |
2078 | 2074 | sprintf( szSection, "%s", pBot->m_ScriptData.aszStringStack[pBot->m_ScriptData.lStringStackPosition - 1] ); |
2079 | 2075 | pBot->PopStringStack( ); |
@@ -2129,9 +2125,7 @@ | ||
2129 | 2125 | CChatFile *pFile; |
2130 | 2126 | |
2131 | 2127 | // We can now get rid of the chat bubble above the bot's head. |
2132 | - pBot->GetPlayer( )->bChatting = false; | |
2133 | - if ( NETWORK_GetState( ) == NETSTATE_SERVER ) | |
2134 | - SERVERCOMMANDS_SetPlayerStatus( pBot->GetPlayer( ) - players, PLAYERSTATUS_CHATTING ); | |
2128 | + PLAYER_SetStatus( pBot->GetPlayer( ), PLAYERSTATUS_CHATTING, false ); | |
2135 | 2129 | |
2136 | 2130 | sprintf( szSection, "%s", pBot->m_ScriptData.aszStringStack[pBot->m_ScriptData.lStringStackPosition - 1] ); |
2137 | 2131 | pBot->PopStringStack( ); |
@@ -2180,18 +2174,14 @@ | ||
2180 | 2174 | // |
2181 | 2175 | static void botcmd_BeginChatting( CSkullBot *pBot ) |
2182 | 2176 | { |
2183 | - pBot->GetPlayer( )->bChatting = true; | |
2184 | - if ( NETWORK_GetState( ) == NETSTATE_SERVER ) | |
2185 | - SERVERCOMMANDS_SetPlayerStatus( pBot->GetPlayer( ) - players, PLAYERSTATUS_CHATTING ); | |
2177 | + PLAYER_SetStatus( pBot->GetPlayer( ), PLAYERSTATUS_CHATTING, true ); | |
2186 | 2178 | } |
2187 | 2179 | |
2188 | 2180 | //***************************************************************************** |
2189 | 2181 | // |
2190 | 2182 | static void botcmd_StopChatting( CSkullBot *pBot ) |
2191 | 2183 | { |
2192 | - pBot->GetPlayer( )->bChatting = false; | |
2193 | - if ( NETWORK_GetState( ) == NETSTATE_SERVER ) | |
2194 | - SERVERCOMMANDS_SetPlayerStatus( pBot->GetPlayer( ) - players, PLAYERSTATUS_CHATTING ); | |
2184 | + PLAYER_SetStatus( pBot->GetPlayer( ), PLAYERSTATUS_CHATTING, false ); | |
2195 | 2185 | } |
2196 | 2186 | |
2197 | 2187 | //***************************************************************************** |
@@ -2608,9 +2598,7 @@ | ||
2608 | 2598 | CChatFile *pFile; |
2609 | 2599 | |
2610 | 2600 | // We can now get rid of the chat bubble above the bot's head. |
2611 | - pBot->GetPlayer( )->bChatting = false; | |
2612 | - if ( NETWORK_GetState( ) == NETSTATE_SERVER ) | |
2613 | - SERVERCOMMANDS_SetPlayerStatus( pBot->GetPlayer( ) - players, PLAYERSTATUS_CHATTING ); | |
2601 | + PLAYER_SetStatus( pBot->GetPlayer( ), PLAYERSTATUS_CHATTING, false ); | |
2614 | 2602 | |
2615 | 2603 | sprintf( szSection, "%s", pBot->m_ScriptData.aszStringStack[pBot->m_ScriptData.lStringStackPosition - 1] ); |
2616 | 2604 | pBot->PopStringStack( ); |
@@ -2666,9 +2654,7 @@ | ||
2666 | 2654 | CChatFile *pFile; |
2667 | 2655 | |
2668 | 2656 | // We can now get rid of the chat bubble above the bot's head. |
2669 | - pBot->GetPlayer( )->bChatting = false; | |
2670 | - if ( NETWORK_GetState( ) == NETSTATE_SERVER ) | |
2671 | - SERVERCOMMANDS_SetPlayerStatus( pBot->GetPlayer( ) - players, PLAYERSTATUS_CHATTING ); | |
2657 | + PLAYER_SetStatus( pBot->GetPlayer( ), PLAYERSTATUS_CHATTING, false ); | |
2672 | 2658 | |
2673 | 2659 | sprintf( szSection, "%s", pBot->m_ScriptData.aszStringStack[pBot->m_ScriptData.lStringStackPosition - 1] ); |
2674 | 2660 | pBot->PopStringStack( ); |
@@ -1693,27 +1693,14 @@ | ||
1693 | 1693 | TabbedLast = false; |
1694 | 1694 | TabbedList = false; |
1695 | 1695 | |
1696 | - // [BB] Don't change the displayed console status when a demo is played. | |
1697 | - if ( CLIENTDEMO_IsPlaying( ) == false ) | |
1698 | - players[consoleplayer].bInConsole = true; | |
1699 | - | |
1700 | - // [RC] Tell the server so we get an "in console" icon. | |
1701 | - if ( NETWORK_GetState( ) == NETSTATE_CLIENT ) | |
1702 | - CLIENTCOMMANDS_EnterConsole( ); | |
1696 | + PLAYER_SetStatus( &players[consoleplayer], PLAYERSTATUS_INCONSOLE, true, PLAYERSTATUS_CLIENTSHOULDSENDUPDATE ); | |
1703 | 1697 | } |
1704 | 1698 | else if (gamestate != GS_FULLCONSOLE && gamestate != GS_STARTUP) |
1705 | 1699 | { |
1706 | 1700 | ConsoleState = c_rising; |
1707 | 1701 | C_FlushDisplay (); |
1708 | 1702 | |
1709 | - // [BB] Don't change the displayed console status when a demo is played. | |
1710 | - if ( CLIENTDEMO_IsPlaying( ) == false ) | |
1711 | - players[consoleplayer].bInConsole = false; | |
1712 | - | |
1713 | - // [RC] Tell the server so our "in console" icon is removed. | |
1714 | - if ( NETWORK_GetState( ) == NETSTATE_CLIENT ) | |
1715 | - CLIENTCOMMANDS_ExitConsole( ); | |
1716 | - | |
1703 | + PLAYER_SetStatus( &players[consoleplayer], PLAYERSTATUS_INCONSOLE, false, PLAYERSTATUS_CLIENTSHOULDSENDUPDATE ); | |
1717 | 1704 | } |
1718 | 1705 | } |
1719 | 1706 |
@@ -1733,13 +1720,7 @@ | ||
1733 | 1720 | // [BB] We are not in console anymore, so set bInConsole if necessary. |
1734 | 1721 | if ( players[consoleplayer].bInConsole ) |
1735 | 1722 | { |
1736 | - // [BB] Don't change the displayed console status when a demo is played. | |
1737 | - if ( CLIENTDEMO_IsPlaying( ) == false ) | |
1738 | - players[consoleplayer].bInConsole = false; | |
1739 | - | |
1740 | - // [RC] Tell the server so our "in console" icon is removed. | |
1741 | - if ( NETWORK_GetState( ) == NETSTATE_CLIENT ) | |
1742 | - CLIENTCOMMANDS_ExitConsole( ); | |
1723 | + PLAYER_SetStatus( &players[consoleplayer], PLAYERSTATUS_INCONSOLE, false, PLAYERSTATUS_CLIENTSHOULDSENDUPDATE ); | |
1743 | 1724 | } |
1744 | 1725 | } |
1745 | 1726 | } |
@@ -845,22 +845,14 @@ | ||
845 | 845 | |
846 | 846 | if ( ulMode != CHATMODE_NONE ) |
847 | 847 | { |
848 | - pPlayer->bChatting = true; | |
849 | - | |
850 | - // Tell the server we're beginning to chat. | |
851 | - if ( NETWORK_GetState( ) == NETSTATE_CLIENT ) | |
852 | - CLIENTCOMMANDS_StartChat( ); | |
848 | + PLAYER_SetStatus( pPlayer, PLAYERSTATUS_CHATTING, true, PLAYERSTATUS_CLIENTSHOULDSENDUPDATE ); | |
853 | 849 | |
854 | 850 | // [AK] Ensure that the cursor starts off as white. |
855 | 851 | g_ulChatTicker = 0; |
856 | 852 | } |
857 | 853 | else |
858 | 854 | { |
859 | - pPlayer->bChatting = false; | |
860 | - | |
861 | - // Tell the server we're done chatting. | |
862 | - if ( NETWORK_GetState( ) == NETSTATE_CLIENT ) | |
863 | - CLIENTCOMMANDS_EndChat( ); | |
855 | + PLAYER_SetStatus( pPlayer, PLAYERSTATUS_CHATTING, false, PLAYERSTATUS_CLIENTSHOULDSENDUPDATE ); | |
864 | 856 | } |
865 | 857 | |
866 | 858 | } |
@@ -4190,28 +4190,7 @@ | ||
4190 | 4190 | // |
4191 | 4191 | void ServerCommands::SetPlayerStatus::Execute() |
4192 | 4192 | { |
4193 | - switch ( type ) | |
4194 | - { | |
4195 | - case PLAYERSTATUS_CHATTING: | |
4196 | - player->bChatting = value; | |
4197 | - break; | |
4198 | - | |
4199 | - case PLAYERSTATUS_INCONSOLE: | |
4200 | - player->bInConsole = value; | |
4201 | - break; | |
4202 | - | |
4203 | - case PLAYERSTATUS_INMENU: | |
4204 | - player->bInMenu = value; | |
4205 | - break; | |
4206 | - | |
4207 | - case PLAYERSTATUS_LAGGING: | |
4208 | - player->bLagging = value; | |
4209 | - break; | |
4210 | - | |
4211 | - case PLAYERSTATUS_READYTOGOON: | |
4212 | - player->bReadyToGoOn = value; | |
4213 | - break; | |
4214 | - } | |
4193 | + PLAYER_SetStatus( player, type, value ); | |
4215 | 4194 | } |
4216 | 4195 | |
4217 | 4196 | //***************************************************************************** |
@@ -798,6 +798,7 @@ | ||
798 | 798 | void PLAYER_SetWins( player_t *pPlayer, ULONG ulWins ); |
799 | 799 | void PLAYER_SetKills( player_t *pPlayer, ULONG ulKills ); |
800 | 800 | void PLAYER_SetDeaths( player_t *pPlayer, ULONG ulDeaths, bool bInformClients = true ); |
801 | +void PLAYER_SetStatus( player_t *pPlayer, ULONG ulType, bool bEnable, ULONG ulFlags = 0 ); | |
801 | 802 | // [BB] PLAYER_GetHealth and PLAYER_GetLivesLeft are helper functions for PLAYER_GetPlayerWithSingleHighestValue. |
802 | 803 | LONG PLAYER_GetHealth( ULONG ulPlayer ); |
803 | 804 | LONG PLAYER_GetLivesLeft( ULONG ulPlayer ); |
@@ -341,13 +341,7 @@ | ||
341 | 341 | BackbuttonTime = 0; |
342 | 342 | BackbuttonAlpha = 0; |
343 | 343 | |
344 | - // [BB] Don't change the displayed menu status when a demo is played. | |
345 | - if ( CLIENTDEMO_IsPlaying() == false ) | |
346 | - players[consoleplayer].bInMenu = true; | |
347 | - | |
348 | - // [RC] Tell the server so we get an "in menu" icon. | |
349 | - if ( NETWORK_GetState() == NETSTATE_CLIENT ) | |
350 | - CLIENTCOMMANDS_EnterMenu(); | |
344 | + PLAYER_SetStatus( &players[consoleplayer], PLAYERSTATUS_INMENU, true, PLAYERSTATUS_CLIENTSHOULDSENDUPDATE ); | |
351 | 345 | } |
352 | 346 | |
353 | 347 | //============================================================================= |
@@ -870,17 +864,7 @@ | ||
870 | 864 | ServerSetupMenu = NULL; |
871 | 865 | ServerMenuEnabled = false; |
872 | 866 | |
873 | - // [BB] We are not in menu anymore, so set bInMenu if necessary. | |
874 | - if ( players[consoleplayer].bInMenu ) | |
875 | - { | |
876 | - // [BB] Don't change the displayed menu status when a demo is played. | |
877 | - if ( CLIENTDEMO_IsPlaying() == false ) | |
878 | - players[consoleplayer].bInMenu = false; | |
879 | - | |
880 | - // [RC] Tell the server so our "in Menu" icon is removed. | |
881 | - if ( NETWORK_GetState() == NETSTATE_CLIENT ) | |
882 | - CLIENTCOMMANDS_ExitMenu(); | |
883 | - } | |
867 | + PLAYER_SetStatus( &players[consoleplayer], PLAYERSTATUS_INMENU, false, PLAYERSTATUS_CLIENTSHOULDSENDUPDATE ); | |
884 | 868 | } |
885 | 869 | |
886 | 870 | //============================================================================= |
@@ -230,6 +230,12 @@ | ||
230 | 230 | PLAYERSTATUS_READYTOGOON, |
231 | 231 | }; |
232 | 232 | |
233 | +enum PlayerStatusFlag | |
234 | +{ | |
235 | + PLAYERSTATUS_CLIENTSHOULDSENDUPDATE = 1 << 0, | |
236 | + PLAYERSTATUS_SERVERSHOULDSKIPCLIENT = 1 << 1, | |
237 | +}; | |
238 | + | |
233 | 239 | // [AK] If we're updating the map rotation then what exactly are we doing? |
234 | 240 | enum UpdateMapRotationType |
235 | 241 | { |
@@ -2821,6 +2821,114 @@ | ||
2821 | 2821 | |
2822 | 2822 | //***************************************************************************** |
2823 | 2823 | // |
2824 | +void PLAYER_SetStatus( player_t *pPlayer, ULONG ulType, bool bEnable, ULONG ulFlags ) | |
2825 | +{ | |
2826 | + if ( pPlayer == NULL ) | |
2827 | + return; | |
2828 | + | |
2829 | + switch ( ulType ) | |
2830 | + { | |
2831 | + case PLAYERSTATUS_CHATTING: | |
2832 | + { | |
2833 | + if ( pPlayer->bChatting == bEnable ) | |
2834 | + return; | |
2835 | + | |
2836 | + pPlayer->bChatting = bEnable; | |
2837 | + | |
2838 | + // [AK] Tell the server we're beginning to or have stopped chatting. | |
2839 | + if (( NETWORK_GetState( ) == NETSTATE_CLIENT ) && ( ulFlags & PLAYERSTATUS_CLIENTSHOULDSENDUPDATE )) | |
2840 | + { | |
2841 | + if ( bEnable ) | |
2842 | + CLIENTCOMMANDS_StartChat( ); | |
2843 | + else | |
2844 | + CLIENTCOMMANDS_EndChat( ); | |
2845 | + } | |
2846 | + | |
2847 | + break; | |
2848 | + } | |
2849 | + | |
2850 | + case PLAYERSTATUS_INCONSOLE: | |
2851 | + { | |
2852 | + // [BB] Don't change the displayed console status when a demo is played. | |
2853 | + if (( CLIENTDEMO_IsPlaying( )) || ( pPlayer->bInConsole == bEnable )) | |
2854 | + return; | |
2855 | + | |
2856 | + pPlayer->bInConsole = bEnable; | |
2857 | + | |
2858 | + // [AK] Tell the server that we entered or exited the console. | |
2859 | + if (( NETWORK_GetState( ) == NETSTATE_CLIENT ) && ( ulFlags & PLAYERSTATUS_CLIENTSHOULDSENDUPDATE )) | |
2860 | + { | |
2861 | + if ( bEnable ) | |
2862 | + CLIENTCOMMANDS_EnterConsole( ); | |
2863 | + else | |
2864 | + CLIENTCOMMANDS_ExitConsole( ); | |
2865 | + } | |
2866 | + | |
2867 | + break; | |
2868 | + } | |
2869 | + | |
2870 | + case PLAYERSTATUS_INMENU: | |
2871 | + { | |
2872 | + // [BB] Don't change the displayed menu status when a demo is played. | |
2873 | + if (( CLIENTDEMO_IsPlaying( )) || ( pPlayer->bInMenu == bEnable )) | |
2874 | + return; | |
2875 | + | |
2876 | + pPlayer->bInMenu = bEnable; | |
2877 | + | |
2878 | + // [AK] Tell the server that we entered or exited the menu. | |
2879 | + if (( NETWORK_GetState( ) == NETSTATE_CLIENT ) && ( ulFlags & PLAYERSTATUS_CLIENTSHOULDSENDUPDATE )) | |
2880 | + { | |
2881 | + if ( bEnable ) | |
2882 | + CLIENTCOMMANDS_EnterMenu( ); | |
2883 | + else | |
2884 | + CLIENTCOMMANDS_ExitMenu( ); | |
2885 | + } | |
2886 | + | |
2887 | + break; | |
2888 | + } | |
2889 | + | |
2890 | + case PLAYERSTATUS_LAGGING: | |
2891 | + { | |
2892 | + if ( pPlayer->bLagging == bEnable ) | |
2893 | + return; | |
2894 | + | |
2895 | + pPlayer->bLagging = bEnable; | |
2896 | + break; | |
2897 | + } | |
2898 | + | |
2899 | + case PLAYERSTATUS_READYTOGOON: | |
2900 | + { | |
2901 | + if ( pPlayer->bReadyToGoOn == bEnable ) | |
2902 | + return; | |
2903 | + | |
2904 | + pPlayer->bReadyToGoOn = bEnable; | |
2905 | + break; | |
2906 | + } | |
2907 | + | |
2908 | + default: | |
2909 | + return; | |
2910 | + } | |
2911 | + | |
2912 | + // [AK] If we're the server, tell the clients that this player's status changed, | |
2913 | + // except when we update this player's "ready to go on" status if everyone's ready. | |
2914 | + if ( NETWORK_GetState( ) == NETSTATE_SERVER ) | |
2915 | + { | |
2916 | + if (( ulType != PLAYERSTATUS_READYTOGOON ) || ( SERVER_IsEveryoneReadyToGoOn( ) == false )) | |
2917 | + { | |
2918 | + const ULONG ulPlayer = pPlayer - players; | |
2919 | + | |
2920 | + // [AK] Should we skip sending an update to the client whose status we're changing? | |
2921 | + // This is if the client already changed the status on their end. | |
2922 | + if ( ulFlags & PLAYERSTATUS_SERVERSHOULDSKIPCLIENT ) | |
2923 | + SERVERCOMMANDS_SetPlayerStatus( ulPlayer, static_cast<PlayerStatusType>( ulType ), ulPlayer, SVCF_SKIPTHISCLIENT ); | |
2924 | + else | |
2925 | + SERVERCOMMANDS_SetPlayerStatus( ulPlayer, static_cast<PlayerStatusType>( ulType )); | |
2926 | + } | |
2927 | + } | |
2928 | +} | |
2929 | + | |
2930 | +//***************************************************************************** | |
2931 | +// | |
2824 | 2932 | LONG PLAYER_GetHealth( ULONG ulPlayer ) |
2825 | 2933 | { |
2826 | 2934 | return players[ulPlayer].health; |
@@ -1082,19 +1082,13 @@ | ||
1082 | 1082 | // Have not heard from the client in at least one second; mark him as |
1083 | 1083 | // lagging and tell clients. |
1084 | 1084 | if ( players[ulIdx].bLagging == false ) |
1085 | - { | |
1086 | - players[ulIdx].bLagging = true; | |
1087 | - SERVERCOMMANDS_SetPlayerStatus( ulIdx, PLAYERSTATUS_LAGGING ); | |
1088 | - } | |
1085 | + PLAYER_SetStatus( &players[ulIdx], PLAYERSTATUS_LAGGING, true ); | |
1089 | 1086 | } |
1090 | 1087 | else |
1091 | 1088 | { |
1092 | 1089 | // Player is no longer lagging. Tell clients. |
1093 | 1090 | if ( players[ulIdx].bLagging ) |
1094 | - { | |
1095 | - players[ulIdx].bLagging = false; | |
1096 | - SERVERCOMMANDS_SetPlayerStatus( ulIdx, PLAYERSTATUS_LAGGING ); | |
1097 | - } | |
1091 | + PLAYER_SetStatus( &players[ulIdx], PLAYERSTATUS_LAGGING, false ); | |
1098 | 1092 | } |
1099 | 1093 | } |
1100 | 1094 | } |
@@ -4767,48 +4761,25 @@ | ||
4767 | 4761 | if ( server_CheckForClientMinorCommandFlood ( g_lCurrentClient ) == true ) |
4768 | 4762 | return ( true ); |
4769 | 4763 | |
4764 | + // Client is beginning to type. | |
4770 | 4765 | if ( lCommand == CLC_STARTCHAT ) |
4771 | - { | |
4772 | - // Client is beginning to type. | |
4773 | - players[g_lCurrentClient].bChatting = true; | |
4774 | - | |
4775 | - // Tell clients about the change in this player's chatting status. | |
4776 | - SERVERCOMMANDS_SetPlayerStatus( g_lCurrentClient, PLAYERSTATUS_CHATTING ); | |
4777 | - } | |
4766 | + PLAYER_SetStatus( &players[g_lCurrentClient], PLAYERSTATUS_CHATTING, true, PLAYERSTATUS_SERVERSHOULDSKIPCLIENT ); | |
4767 | + // Client is done talking. | |
4778 | 4768 | else if ( lCommand == CLC_ENDCHAT ) |
4779 | - { | |
4780 | - // Client is done talking. | |
4781 | - players[g_lCurrentClient].bChatting = false; | |
4782 | - | |
4783 | - // Tell clients about the change in this player's chatting status. | |
4784 | - SERVERCOMMANDS_SetPlayerStatus( g_lCurrentClient, PLAYERSTATUS_CHATTING ); | |
4785 | - } | |
4769 | + PLAYER_SetStatus( &players[g_lCurrentClient], PLAYERSTATUS_CHATTING, false, PLAYERSTATUS_SERVERSHOULDSKIPCLIENT ); | |
4770 | + // Player has entered the console - give him an icon. | |
4786 | 4771 | else if ( lCommand == CLC_ENTERCONSOLE ) |
4787 | - { | |
4788 | - | |
4789 | - // Player has entered the console - give him an icon. | |
4790 | - players[g_lCurrentClient].bInConsole = true; | |
4791 | - SERVERCOMMANDS_SetPlayerStatus( g_lCurrentClient, PLAYERSTATUS_INCONSOLE ); | |
4792 | - } | |
4772 | + PLAYER_SetStatus( &players[g_lCurrentClient], PLAYERSTATUS_INCONSOLE, true, PLAYERSTATUS_SERVERSHOULDSKIPCLIENT ); | |
4773 | + // Player has left the console - remove his icon. | |
4793 | 4774 | else if ( lCommand == CLC_EXITCONSOLE ) |
4794 | - { | |
4795 | - // Player has left the console - remove his icon. | |
4796 | - players[g_lCurrentClient].bInConsole = false; | |
4797 | - SERVERCOMMANDS_SetPlayerStatus( g_lCurrentClient, PLAYERSTATUS_INCONSOLE ); | |
4798 | - } | |
4775 | + PLAYER_SetStatus( &players[g_lCurrentClient], PLAYERSTATUS_INCONSOLE, false, PLAYERSTATUS_SERVERSHOULDSKIPCLIENT ); | |
4776 | + // Player has entered the menu - give him an icon. | |
4799 | 4777 | else if ( lCommand == CLC_ENTERMENU ) |
4800 | - { | |
4801 | - | |
4802 | - // Player has entered the console - give him an icon. | |
4803 | - players[g_lCurrentClient].bInMenu = true; | |
4804 | - SERVERCOMMANDS_SetPlayerStatus( g_lCurrentClient, PLAYERSTATUS_INMENU ); | |
4805 | - } | |
4778 | + PLAYER_SetStatus( &players[g_lCurrentClient], PLAYERSTATUS_INMENU, true, PLAYERSTATUS_SERVERSHOULDSKIPCLIENT ); | |
4779 | + // Player has left the menu - remove his icon. | |
4806 | 4780 | else if ( lCommand == CLC_EXITMENU ) |
4807 | - { | |
4808 | - // Player has left the console - remove his icon. | |
4809 | - players[g_lCurrentClient].bInMenu = false; | |
4810 | - SERVERCOMMANDS_SetPlayerStatus( g_lCurrentClient, PLAYERSTATUS_INMENU ); | |
4811 | - } | |
4781 | + PLAYER_SetStatus( &players[g_lCurrentClient], PLAYERSTATUS_INMENU, false, PLAYERSTATUS_SERVERSHOULDSKIPCLIENT ); | |
4782 | + | |
4812 | 4783 | return false; |
4813 | 4784 | case CLC_IGNORE: |
4814 | 4785 |
@@ -4901,10 +4872,7 @@ | ||
4901 | 4872 | |
4902 | 4873 | // Toggle this player (specator)'s "ready to go on" status. |
4903 | 4874 | // [RC] Now a permanent choice. |
4904 | - players[g_lCurrentClient].bReadyToGoOn = true; | |
4905 | - | |
4906 | - if ( SERVER_IsEveryoneReadyToGoOn( ) == false ) | |
4907 | - SERVERCOMMANDS_SetPlayerStatus( g_lCurrentClient, PLAYERSTATUS_READYTOGOON ); | |
4875 | + PLAYER_SetStatus( &players[g_lCurrentClient], PLAYERSTATUS_READYTOGOON, true ); | |
4908 | 4876 | |
4909 | 4877 | return false; |
4910 | 4878 | case CLC_CHANGEDISPLAYPLAYER: |
@@ -6070,23 +6038,15 @@ | ||
6070 | 6038 | { |
6071 | 6039 | // [K6/BB] The client is pressing a button, so not afk. |
6072 | 6040 | g_aClients[ulClient].lLastActionTic = gametic; |
6041 | + | |
6073 | 6042 | if ( pPlayer->bChatting ) |
6074 | - { | |
6075 | - pPlayer->bChatting = false; | |
6076 | - SERVERCOMMANDS_SetPlayerStatus( ulClient, PLAYERSTATUS_CHATTING ); | |
6077 | - } | |
6043 | + PLAYER_SetStatus( &players[ulClient], PLAYERSTATUS_CHATTING, false ); | |
6078 | 6044 | |
6079 | 6045 | if ( pPlayer->bInConsole ) |
6080 | - { | |
6081 | - pPlayer->bInConsole = false; | |
6082 | - SERVERCOMMANDS_SetPlayerStatus( ulClient, PLAYERSTATUS_INCONSOLE ); | |
6083 | - } | |
6046 | + PLAYER_SetStatus( &players[ulClient], PLAYERSTATUS_INCONSOLE, false ); | |
6084 | 6047 | |
6085 | 6048 | if ( pPlayer->bInMenu ) |
6086 | - { | |
6087 | - pPlayer->bInMenu = false; | |
6088 | - SERVERCOMMANDS_SetPlayerStatus( ulClient, PLAYERSTATUS_INMENU ); | |
6089 | - } | |
6049 | + PLAYER_SetStatus( &players[ulClient], PLAYERSTATUS_INMENU, false ); | |
6090 | 6050 | } |
6091 | 6051 | |
6092 | 6052 | return ( false ); |