]>
jfr.im git - irc/gameservirc.git/blob - gameserv/gameserv.cpp
22 #if defined(HAVE_CRYPT_H)
26 #elif defined(HAVE_UNISTD_H)
33 Level levels
[LEVELS
]; // The newest way to store monsters
34 list
<item
*> Items
; // The master list of items
35 list
<tavernItem
> tavern
; // The list of items available at the tavern
36 list
<item
*> store
; // List of items available at the store
38 toplist myToplist
; // List of the top 10 players
46 int hpbonus
[11] = {10, 15, 20, 30, 50, 75, 125, 185, 250, 350, 550};
47 int strbonus
[11] = {5, 7, 10, 12, 20, 35, 50, 75, 110, 150, 200};
48 int defbonus
[11] = {2, 3, 5, 10, 15, 22, 35, 60, 80, 120, 150};
50 void gameserv(char *source
, char *buf
)
53 cmd
= strtok(buf
, " ");
56 source
++; // Get rid of that : at the beginning of a :Nick privmsg Gameserv :text
61 cmd
++; // Get rid of that : at the beginning of the :text (command)
64 log("Source: %s Command: %s", source
, cmd
);
67 if (strnicmp(cmd
, "\1PING", 6) == 0)
70 ts
= strtok(NULL
, "\1");
71 notice(s_GameServ
, source
, "\1PING %s\1", ts
);
73 else if (stricmp(cmd
, "\1VERSION\1") == 0)
75 notice(s_GameServ
, source
, "\1VERSION %s %s\1", PACKAGE
, VERSION
);
77 else if (stricmp(cmd
, "SEARCH") == 0)
79 cmd
= strtok(NULL
, " ");
82 notice(s_GameServ
, source
, "SYNTAX: /msg <S SEARCH FOREST");
87 else if (stricmp(cmd
, "ADMIN") == 0)
91 else if (stricmp(cmd
, "ATTACK") == 0)
95 else if (stricmp(cmd
, "BANK") == 0)
99 else if (stricmp(cmd
, "CHECK") == 0)
103 else if (stricmp(cmd
, "DRAGON") == 0)
107 else if (stricmp(cmd
, "EQUIP") == 0)
111 else if (stricmp(cmd
, "FIGHT") == 0)
115 else if (stricmp(cmd
, "HEAL") == 0)
119 else if (stricmp(cmd
, "HELP") == 0)
123 else if (stricmp(cmd
, "IDENTIFY") == 0)
127 else if (stricmp(cmd
, "INVENTORY") == 0)
129 do_inventory(source
);
131 else if (stricmp(cmd
, "LIST") == 0)
135 else if (stricmp(cmd
, "LOGOUT") == 0)
139 else if (stricmp(cmd
, "MASTER") == 0)
143 else if (stricmp(cmd
, "NEWS") == 0)
147 else if (stricmp(cmd
, "REGISTER") == 0)
151 else if (stricmp(cmd
, "REFRESH") == 0)
155 else if (stricmp(cmd
, "RESET") == 0)
159 else if (stricmp(cmd
, "RUN") == 0)
163 else if (stricmp(cmd
, "SET") == 0)
167 else if (stricmp(cmd
, "STATS") == 0)
171 else if (stricmp(cmd
, "STORE") == 0)
175 else if (stricmp(cmd
, "TAVERN") == 0)
179 else if (stricmp(cmd
, "USE") == 0)
183 else if (stricmp(cmd
, "SHUTDOWN") == 0)
187 else if (stricmp(cmd
, "SAVE") == 0)
191 else if (stricmp(cmd
, "LOAD") == 0)
196 else if (stricmp(cmd
, "RAW") == 0)
204 if ((user
= find(source
)))
209 log("Ignoring %s.", user
->getNick());
214 notice(s_GameServ
, source
, "Unknown command \002%s\002. Type /msg <S \002HELP\002 to get a list of commands.", cmd
);
220 source
--; // Bring the ':' back
223 cmd
--; // Same thing :)