ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/c_wiz.C
(Generate patch)

Comparing deliantra/server/server/c_wiz.C (file contents):
Revision 1.36 by pippijn, Thu Mar 1 12:28:16 2007 UTC vs.
Revision 1.37 by pippijn, Fri Mar 2 13:32:52 2007 UTC

172 172
173 become_follower (ob, god); 173 become_follower (ob, god);
174 return 1; 174 return 1;
175} 175}
176 176
177// TODO: Rewrite banish in perl and get rid of the following two functions
178int
179command_kick (object *op, char *params)
180{
181 for_all_players (pl)
182 if ((params == NULL || !strcmp (&pl->ob->name, params)) && !INVOKE_PLAYER (KICK, pl, ARG_STRING (params)))
183 {
184 object *op = pl->ob;
185
186 if (!QUERY_FLAG (op, FLAG_REMOVED) && !QUERY_FLAG (op, FLAG_FREED))
187 {
188 new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 5, op, "%s is kicked out of the game.", &op->name);
189 strcpy (op->contr->killer, "kicked");
190 }
191
192 pl->ns->destroy ();
193 }
194
195 return 1;
196}
197
177/** 198/**
178 * Add player's IP to ban_file and kick them off the server 199 * Add player's IP to ban_file and kick them off the server
179 * I know most people have dynamic IPs but this is more of a short term 200 * I know most people have dynamic IPs but this is more of a short term
180 * solution if they have to get a new IP to play maybe they'll calm down. 201 * solution if they have to get a new IP to play maybe they'll calm down.
181 * This uses the banish_file in the local directory *not* the ban_file 202 * This uses the banish_file in the local directory *not* the ban_file
219 240
220 LOG (llevDebug, "! %s banned %s from IP: %s.\n", &op->name, &pl->ob->name, pl->ns->host); 241 LOG (llevDebug, "! %s banned %s from IP: %s.\n", &op->name, &pl->ob->name, pl->ns->host);
221 new_draw_info_format (NDI_UNIQUE | NDI_RED, 0, op, "You banish %s", &pl->ob->name); 242 new_draw_info_format (NDI_UNIQUE | NDI_RED, 0, op, "You banish %s", &pl->ob->name);
222 new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 5, op, "%s banishes %s from the land!", &op->name, &pl->ob->name); 243 new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 5, op, "%s banishes %s from the land!", &op->name, &pl->ob->name);
223 command_kick (op, (char *) &pl->ob->name); 244 command_kick (op, (char *) &pl->ob->name);
224 return 1;
225}
226
227int
228command_kick (object *op, char *params)
229{
230 for_all_players (pl)
231 if ((params == NULL || !strcmp (&pl->ob->name, params)) && !INVOKE_PLAYER (KICK, pl, ARG_STRING (params)))
232 {
233 object *op = pl->ob;
234
235 if (!QUERY_FLAG (op, FLAG_REMOVED) && !QUERY_FLAG (op, FLAG_FREED))
236 {
237 new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 5, op, "%s is kicked out of the game.", &op->name);
238 strcpy (op->contr->killer, "kicked");
239 }
240
241 pl->ns->destroy ();
242 }
243
244 return 1; 245 return 1;
245} 246}
246 247
247//TODO 248//TODO
248#if 0 249#if 0

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines