MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / FindCommandType

Function FindCommandType

engine/Poseidon/Network/NetworkClientActions.cpp:1059–1070  ·  view source on GitHub ↗

Find Network Command Type for text form of Network Command

Source from the content-addressed store, hash-verified

1057 {"mission", CMDMission}, {"missions", CMDMissions}, {"shutdown", CMDShutdown}, {"reassign", CMDReassign},
1058 {"monitor", CMDMonitor}, {"userlist", CMDUserlist}, {"vote", CMDVote}, {"admin", CMDAdmin},
1059 {"init", CMDInit}, {"debug", CMDDebug}, {"ban", CMDBan}, {"unban", CMDUnban},
1060 {"lock", CMDLock}, {"unlock", CMDUnlock}};
1061
1062// Find Network Command Type for text form of Network Command
1063static NetworkCommandType FindCommandType(const char* beg, int len)
1064{
1065 for (int i = 0; i < sizeof(NetworkCommands) / sizeof(NetworkCommand); i++)
1066 {
1067 NetworkCommand& item = NetworkCommands[i];
1068 if (strlen(item.command) == len && strnicmp(beg, item.command, len) == 0)
1069 {
1070 return item.type;
1071 }
1072 }
1073 return CMDNone;

Callers 1

ProcessCommandMethod · 0.85

Calls 1

strnicmpFunction · 0.50

Tested by

no test coverage detected