00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __CMDS_H
00016 #define __CMDS_H
00017
00018 #include "common_libs.h"
00019 #include "nxwcommn.h"
00020
00021
00022
00023
00024 enum PrivLevel
00025 {
00026 PRIVLEVEL_ADMIN = 255,
00027 PRIVLEVEL_GM = 200,
00028 PRIVLEVEL_SEER = 150,
00029 PRIVLEVEL_CNS = 100,
00030 PRIVLEVEL_PLAYER = 50,
00031 PRIVLEVEL_GUEST = 0,
00032 };
00033
00034
00035
00036 typedef class cCommand* P_COMMAND;
00037
00038
00039
00040 void Command( NXWSOCKET , char * );
00041
00042
00043
00044
00045
00046
00047
00048
00049 class cCommand {
00050
00051 private:
00052
00053 std::string cmd_name;
00054 UI08 cmd_level;
00055 std::string cmd_callback;
00056
00057 public:
00058
00059 cCommand( std::string cmd_name, UI08 cmd_number, std::string callback );
00060 UI08 getCommandLevel();
00061 void call( P_CHAR current );
00062
00063 };
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 class cCommandMap {
00074
00075 private:
00076
00077 static std::map< std::string, P_COMMAND > command_map;
00078
00079 public:
00080
00081 cCommandMap();
00082 P_COMMAND addGmCommand(std::string name, UI08 number ,std::string callback);
00083 P_COMMAND findCommand(char* name,NXWCLIENT client);
00084 void clearCommandMap(void);
00085 void fillCommandMap(void);
00086
00087 };
00088
00089
00090
00091
00092 #endif
00093