Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

/home/groups/n/no/noxwizard/cvs/src/cmds.h

Go to the documentation of this file.
00001   /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
00002     || NoX-Wizard UO Server Emulator (NXW) [http://noxwizard.sourceforge.net]  ||
00003     ||                                                                         ||
00004     || This software is free software released under GPL2 license.             ||
00005     || You can find detailed license information in nox-wizard.cpp file.       ||
00006     ||                                                                         ||
00007     || For any question post to NoX-Wizard forums.                             ||
00008     -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
00009 
00010 
00011 //file cmds.h
00012 //by Frodo & Stonedz
00013 
00014 
00015 #ifndef __CMDS_H
00016 #define __CMDS_H
00017 
00018 #include "common_libs.h"
00019 #include "nxwcommn.h"           //for std classes
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 \brief Declaration of cCommand Class
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 \brief Declaration of cCommandMap Class
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 
SourceForge.net Logo