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.39 by pippijn, Fri Mar 2 15:04:35 2007 UTC vs.
Revision 1.40 by root, Tue Mar 6 19:02:36 2007 UTC

193 } 193 }
194 194
195 return 1; 195 return 1;
196} 196}
197 197
198/**
199 * Add player's IP to ban_file and kick them off the server
200 * I know most people have dynamic IPs but this is more of a short term
201 * solution if they have to get a new IP to play maybe they'll calm down.
202 * This uses the banish_file in the local directory *not* the ban_file
203 * The action is logged with a ! for easy searching. -tm
204 */
205int
206command_banish (object *op, char *params)
207{
208 player *pl;
209 FILE *banishfile;
210 char buf[MAX_BUF];
211 time_t now;
212
213 if (!params)
214 {
215 new_draw_info (NDI_UNIQUE, 0, op, "Usage: banish <player>.");
216 return 1;
217 }
218
219 pl = get_other_player_from_name (op, params);
220 if (!pl)
221 return 1;
222
223 sprintf (buf, "%s/%s", settings.localdir, BANISHFILE);
224
225 if ((banishfile = fopen (buf, "a")) == NULL)
226 {
227 LOG (llevDebug, "Could not find file banish_file.\n");
228 new_draw_info (NDI_UNIQUE, 0, op, "Could not find banish_file.");
229 return 0;
230 }
231
232 now = time (NULL);
233 /*
234 * Record this as a comment - then we don't have to worry about changing
235 * the parsing code.
236 */
237 fprintf (banishfile, "# %s (%s) banned by %s at %s\n", &pl->ob->name, pl->ns->host, &op->name, ctime (&now));
238 fprintf (banishfile, "*@%s\n", pl->ns->host);
239 fclose (banishfile);
240
241 LOG (llevDebug, "! %s banned %s from IP: %s.\n", &op->name, &pl->ob->name, pl->ns->host);
242 new_draw_info_format (NDI_UNIQUE | NDI_RED, 0, op, "You banish %s", &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);
244 command_kick (op, (char *) &pl->ob->name);
245 return 1;
246}
247
248//TODO 198//TODO
249#if 0 199#if 0
250int 200int
251command_save_overlay (object *op, char *params) 201command_save_overlay (object *op, char *params)
252{ 202{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines