Find Network Command Type for text form of Network Command
| 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 |
| 1063 | static 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; |
no test coverage detected