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

Comparing deliantra/server/server/login.C (file contents):
Revision 1.11 by root, Sun Sep 3 22:45:57 2006 UTC vs.
Revision 1.13 by pippijn, Thu Sep 7 10:01:58 2006 UTC

1/* 1/*
2 * static char *rcsid_login_c = 2 * static char *rcsid_login_c =
3 * "$Id: login.C,v 1.11 2006/09/03 22:45:57 root Exp $"; 3 * "$Id: login.C,v 1.13 2006/09/07 10:01:58 pippijn Exp $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
226 226
227int save_player(object *op, int flag) { 227int save_player(object *op, int flag) {
228 object *tmp, *container=NULL; 228 object *tmp, *container=NULL;
229 player *pl = op->contr; 229 player *pl = op->contr;
230 int i,wiz=QUERY_FLAG(op,FLAG_WIZ); 230 int i,wiz=QUERY_FLAG(op,FLAG_WIZ);
231 long checksum;
232#ifdef BACKUP_SAVE_AT_HOME 231#ifdef BACKUP_SAVE_AT_HOME
233 sint16 backup_x, backup_y; 232 sint16 backup_x, backup_y;
234#endif 233#endif
235 234
236 if (!op->stats.exp) return 0; /* no experience, no save */ 235 if (!op->stats.exp) return 0; /* no experience, no save */
371} 370}
372 371
373void check_login(object *op) { 372void check_login(object *op) {
374 char filename[MAX_BUF]; 373 char filename[MAX_BUF];
375 char buf[MAX_BUF],bufall[MAX_BUF]; 374 char buf[MAX_BUF],bufall[MAX_BUF];
376 int i,value,comp; 375 int i, value;
377 long checksum = 0;
378 player *pl = op->contr; 376 player *pl = op->contr;
379 int correct = 0; 377 int correct = 0;
380 378
381 strcpy (pl->maplevel,first_map_path); 379 strcpy (pl->maplevel,first_map_path);
382 sprintf(filename,"%s/%s/%s/%s.pl",settings.localdir,settings.playerdir,&op->name,&op->name); 380 sprintf(filename,"%s/%s/%s/%s.pl",settings.localdir,settings.playerdir,&op->name,&op->name);
389 if (!thawer) { 387 if (!thawer) {
390 confirm_password(op); 388 confirm_password(op);
391 return; 389 return;
392 } 390 }
393 391
394 if(fgets(bufall,MAX_BUF,thawer) != NULL) { 392 if (fgets(bufall, MAX_BUF, thawer) != NULL)
395 if(!strncmp(bufall,"checksum ",9)) { 393 {
396 checksum = strtol(bufall+9,(char **) NULL, 16);
397 (void) fgets(bufall,MAX_BUF,thawer);
398 }
399 if(sscanf(bufall,"password %s\n",buf)) { 394 if (sscanf(bufall, "password %s\n", buf))
395 {
400 /* New password scheme: */ 396 /* New password scheme: */
401 correct=check_password(pl->write_buf+1,buf); 397 correct = check_password(pl->write_buf + 1, buf);
402 } 398 }
403 /* Old password mode removed - I have no idea what it
404 * was, and the current password mechanism has been used
405 * for at least several years.
406 */
407 } 399 }
408 if (!correct) { 400 if (!correct) {
409 new_draw_info(NDI_UNIQUE, 0,op," "); 401 new_draw_info(NDI_UNIQUE, 0,op," ");
410 new_draw_info(NDI_UNIQUE, 0,op,"Wrong Password!"); 402 new_draw_info(NDI_UNIQUE, 0,op,"Wrong Password!");
411 new_draw_info(NDI_UNIQUE, 0,op," "); 403 new_draw_info(NDI_UNIQUE, 0,op," ");
412 op->name = 404 op->name =
549 if(i==NROFREALSPELLS) 541 if(i==NROFREALSPELLS)
550 LOG(llevDebug, "Error: unknown spell (%s)\n",cp); 542 LOG(llevDebug, "Error: unknown spell (%s)\n",cp);
551#endif 543#endif
552 } 544 }
553 } /* End of loop loading the character file */ 545 } /* End of loop loading the character file */
554 leave_map(op); 546 leave_map (op);
555 op->speed=0; 547 op->speed = 0;
556 update_ob_speed(op); 548 update_ob_speed (op);
549
557 reset_object(op); 550 free_object (op);
551 op = get_object ();
552
558 op->contr = pl; 553 op->contr = pl;
559 pl->ob = op; 554 pl->ob = op;
560 555
561 /* this loads the standard objects values. */ 556 /* this loads the standard objects values. */
562 load_object (thawer, op, 0); 557 load_object (thawer, op, 0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines