View Single Post
  #1  
Old 12-31-2002, 12:06 AM
Edgar1898
Senior Member
Former EQEmu Developer
Current EQ2Emu Lead Developer
 
Join Date: Dec 2002
Posts: 1,065
Default New Look to Client.cpp

I recoded Client.cpp from the beginning to make the code flow better and to get rid of the 10000 mile long if then else loop that it had. What I do was replaced that with a switch that sent you to the function that holds the commands. There are 8 functions each of them represents a status on the server. (Normal,Privuser,Vprivuser,Questtroupe,GM,LeadGM,S erverOP, and VHServerOp). Each other these functions contains only the information for their status. It starts at the highest level that you can access, then is flows downhill from there until it gets to a Normal User. Let me explain: Your a GM and you use the command #kill (somemob) instead of having to go through every command trying to find the one it was looking for (like the old version did), it simply calls the function for that status group, and it retrieves it much faster since it has about 80% less information to sort through. If the command is a lower status command, it then goes down a step in the status chain to the next rung, and it looks for it there, and so on until it gets to the lowest one. Since most users dont have access to the large list of commands at the top there was no reason to have them search through it. Okies Im done rambling on hehe time to goto bed Anyways to sum it up this will save quite a bit of time and overhead by using this method.

Add the following to client.h:
Code:
bool NormalUser(const char* message, const char* targetname);
	bool PrivUser(const char* message, const char* targetname);
	bool VeryPrivUser(const char* message, const char* targetname);
	bool QuestTroupe(const char* message, const char* targetname);
	bool NormalGM(const char* message, const char* targetname);
	bool LeadGM(const char* message, const char* targetname);
	bool ServerOP(const char* message, const char* targetname);
	bool VHServerOP(const char* message, const char* targetname);
Reply With Quote