Skip to content

[GEN][ZH] Reduce cost of GameMessage::getCommandTypeAsAsciiString by 70% #1259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions Generals/Code/GameEngine/Include/Common/MessageStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,8 @@ class GameMessage : public MemoryPoolObject
Type getType( void ) const { return m_type; } ///< Return the message type
UnsignedByte getArgumentCount( void ) const { return m_argCount; } ///< Return the number of arguments for this msg

AsciiString getCommandAsAsciiString( void ); ///< returns a string representation of the command type.
static AsciiString getCommandTypeAsAsciiString(GameMessage::Type t);
const char *getCommandAsString( void ) const; ///< returns a string representation of the command type.
static const char *getCommandTypeAsString(GameMessage::Type t);

Int getPlayerIndex( void ) const { return m_playerIndex; } ///< Return the originating player

Expand Down
6 changes: 0 additions & 6 deletions Generals/Code/GameEngine/Include/GameNetwork/NetCommandMsg.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ class NetCommandMsg : public MemoryPoolObject
void attach();
void detach();

// For debugging purposes
virtual AsciiString getContentsAsAsciiString(void) { return AsciiString::TheEmptyString; }

protected:
UnsignedInt m_timestamp;
UnsignedInt m_executionFrame;
Expand Down Expand Up @@ -86,9 +83,6 @@ class NetGameCommandMsg : public NetCommandMsg
void addArgument(const GameMessageArgumentDataType type, GameMessageArgumentType arg);
void setGameMessageType(GameMessage::Type type);

// For debugging purposes
virtual AsciiString getContentsAsAsciiString(void);

protected:
Int m_numArgs;
Int m_argSize;
Expand Down
Loading
Loading