• R/O
  • SSH

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

This is a fork of Zandronum Beta for TSPG.


Commit MetaInfo

修訂26ed63eab2c281a96b8b0f8498344d843380409f (tree)
時間2021-10-26 23:39:07
作者Adam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Merged CLC_VOTEYES and CLC_VOTENO into a single client command: CLC_VOTE.

Change Summary

差異

diff -r af0204bb60af -r 26ed63eab2c2 src/callvote.cpp
--- a/src/callvote.cpp Tue Oct 26 15:51:11 2021 +1100
+++ b/src/callvote.cpp Tue Oct 26 10:39:07 2021 -0400
@@ -1236,7 +1236,7 @@
12361236 if ( g_VoteState != VOTESTATE_INVOTE )
12371237 return;
12381238
1239- CLIENTCOMMANDS_VoteYes( );
1239+ CLIENTCOMMANDS_Vote( true );
12401240 /*
12411241 g_lBytesSent += g_LocalBuffer.cursize;
12421242 if ( g_lBytesSent > g_lMaxBytesSent )
@@ -1259,7 +1259,7 @@
12591259 if ( g_VoteState != VOTESTATE_INVOTE )
12601260 return;
12611261
1262- CLIENTCOMMANDS_VoteNo( );
1262+ CLIENTCOMMANDS_Vote( false );
12631263 /*
12641264 g_lBytesSent += g_LocalBuffer.cursize;
12651265 if ( g_lBytesSent > g_lMaxBytesSent )
@@ -1288,7 +1288,7 @@
12881288 // Just vote no; we're the original caller, so it will be cancelled.
12891289 if ( CLIENT_GetConnectionState( ) == CTS_ACTIVE )
12901290 {
1291- CLIENTCOMMANDS_VoteNo( );
1291+ CLIENTCOMMANDS_Vote( false );
12921292 NETWORK_LaunchPacket( CLIENT_GetLocalBuffer( ), CLIENT_GetServerAddress( ));
12931293 CLIENT_GetLocalBuffer( )->Clear();
12941294 }
diff -r af0204bb60af -r 26ed63eab2c2 src/cl_commands.cpp
--- a/src/cl_commands.cpp Tue Oct 26 15:51:11 2021 +1100
+++ b/src/cl_commands.cpp Tue Oct 26 10:39:07 2021 -0400
@@ -710,16 +710,10 @@
710710
711711 //*****************************************************************************
712712 //
713-void CLIENTCOMMANDS_VoteYes( void )
713+void CLIENTCOMMANDS_Vote( bool bVotedYes )
714714 {
715- CLIENT_GetLocalBuffer( )->ByteStream.WriteByte( CLC_VOTEYES );
716-}
717-
718-//*****************************************************************************
719-//
720-void CLIENTCOMMANDS_VoteNo( void )
721-{
722- CLIENT_GetLocalBuffer( )->ByteStream.WriteByte( CLC_VOTENO );
715+ CLIENT_GetLocalBuffer( )->ByteStream.WriteByte( CLC_VOTE );
716+ CLIENT_GetLocalBuffer( )->ByteStream.WriteByte( bVotedYes );
723717 }
724718
725719 //*****************************************************************************
diff -r af0204bb60af -r 26ed63eab2c2 src/cl_commands.h
--- a/src/cl_commands.h Tue Oct 26 15:51:11 2021 +1100
+++ b/src/cl_commands.h Tue Oct 26 10:39:07 2021 -0400
@@ -101,8 +101,7 @@
101101 void CLIENTCOMMANDS_ChangeDisplayPlayer( LONG lDisplayPlayer );
102102 void CLIENTCOMMANDS_AuthenticateLevel( void );
103103 void CLIENTCOMMANDS_CallVote( LONG lVoteCommand, const char *pszArgument, const char *pszReason );
104-void CLIENTCOMMANDS_VoteYes( void );
105-void CLIENTCOMMANDS_VoteNo( void );
104+void CLIENTCOMMANDS_Vote( bool bVotedYes );
106105 void CLIENTCOMMANDS_RequestInventoryUseAll( void );
107106 void CLIENTCOMMANDS_RequestInventoryUse( AInventory *item );
108107 void CLIENTCOMMANDS_RequestInventoryDrop( AInventory *pItem );
diff -r af0204bb60af -r 26ed63eab2c2 src/network_enums.h
--- a/src/network_enums.h Tue Oct 26 15:51:11 2021 +1100
+++ b/src/network_enums.h Tue Oct 26 10:39:07 2021 -0400
@@ -428,8 +428,7 @@
428428 ENUM_ELEMENT( CLC_CHANGEDISPLAYPLAYER ),
429429 ENUM_ELEMENT( CLC_AUTHENTICATELEVEL ),
430430 ENUM_ELEMENT( CLC_CALLVOTE ),
431- ENUM_ELEMENT( CLC_VOTEYES ),
432- ENUM_ELEMENT( CLC_VOTENO ),
431+ ENUM_ELEMENT( CLC_VOTE ),
433432 ENUM_ELEMENT( CLC_INVENTORYUSEALL ),
434433 ENUM_ELEMENT( CLC_INVENTORYUSE ),
435434 ENUM_ELEMENT( CLC_INVENTORYDROP ),
diff -r af0204bb60af -r 26ed63eab2c2 src/sv_main.cpp
--- a/src/sv_main.cpp Tue Oct 26 15:51:11 2021 +1100
+++ b/src/sv_main.cpp Tue Oct 26 10:39:07 2021 -0400
@@ -4945,15 +4945,13 @@
49454945
49464946 // Client wishes to call a vote.
49474947 return ( server_CallVote( pByteStream ));
4948- case CLC_VOTEYES:
4949-
4950- // Client wishes to vote "yes" on the current vote.
4951- CALLVOTE_VoteYes( g_lCurrentClient );
4952- return ( false );
4953- case CLC_VOTENO:
4954-
4955- // Client wishes to vote "no" on the current vote.
4956- CALLVOTE_VoteNo( g_lCurrentClient );
4948+ case CLC_VOTE:
4949+
4950+ // [AK] Check if the client wishes to vote "yes" or "no" on the current vote.
4951+ if ( !!pByteStream->ReadByte( ) == true )
4952+ CALLVOTE_VoteYes( g_lCurrentClient );
4953+ else
4954+ CALLVOTE_VoteNo( g_lCurrentClient );
49574955 return ( false );
49584956 case CLC_INVENTORYUSEALL:
49594957