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

Comparing deliantra/server/server/c_party.C (file contents):
Revision 1.2 by root, Tue Aug 29 08:01:37 2006 UTC vs.
Revision 1.3 by root, Sun Sep 3 00:18:42 2006 UTC

1/* 1/*
2 * static char *rcsid_c_party_c = 2 * static char *rcsid_c_party_c =
3 * "$Id: c_party.C,v 1.2 2006/08/29 08:01:37 root Exp $"; 3 * "$Id: c_party.C,v 1.3 2006/09/03 00:18:42 root 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
181 char buf[ MAX_BUF ]; 181 char buf[ MAX_BUF ];
182 op->contr->party = op->contr->party_to_join; 182 op->contr->party = op->contr->party_to_join;
183 op->contr->party_to_join = NULL; 183 op->contr->party_to_join = NULL;
184 new_draw_info_format(NDI_UNIQUE, 0,op, 184 new_draw_info_format(NDI_UNIQUE, 0,op,
185 "You have joined party: %s\n",joined_party->partyname); 185 "You have joined party: %s\n",joined_party->partyname);
186 snprintf( buf, MAX_BUF, "%s joins party %s", op->name, joined_party->partyname ); 186 snprintf( buf, MAX_BUF, "%s joins party %s", &op->name, joined_party->partyname );
187 send_party_message( op, buf ); 187 send_party_message( op, buf );
188 op->contr->state = ST_PLAYING; 188 op->contr->state = ST_PLAYING;
189 return; 189 return;
190 } 190 }
191 else { 191 else {
306 new_draw_info(NDI_UNIQUE, 0,op,"You are not a member of any party."); 306 new_draw_info(NDI_UNIQUE, 0,op,"You are not a member of any party.");
307 return 1; 307 return 1;
308 } 308 }
309 params += 4; 309 params += 4;
310 currentparty = op->contr->party->partyname; 310 currentparty = op->contr->party->partyname;
311 snprintf(buf,MAX_BUF-1, "[%s] %s says: %s", currentparty, op->name, params); 311 snprintf(buf,MAX_BUF-1, "[%s] %s says: %s", currentparty, &op->name, params);
312 send_party_message(op,buf); 312 send_party_message(op,buf);
313 new_draw_info_format(NDI_WHITE, 0,op,"[%s] You say: %s", currentparty, params); 313 new_draw_info_format(NDI_WHITE, 0,op,"[%s] You say: %s", currentparty, params);
314 return 1; 314 return 1;
315 } 315 }
316 316
359 return 1; 359 return 1;
360 } 360 }
361 currentparty = op->contr->party->partyname; 361 currentparty = op->contr->party->partyname;
362 new_draw_info_format(NDI_UNIQUE, 0, op, 362 new_draw_info_format(NDI_UNIQUE, 0, op,
363 "You leave party %s.",currentparty); 363 "You leave party %s.",currentparty);
364 sprintf(buf,"%s leaves party %s.",op->name,currentparty); 364 sprintf(buf,"%s leaves party %s.",&op->name,currentparty);
365 send_party_message(op,buf); 365 send_party_message(op,buf);
366 op->contr->party=NULL; 366 op->contr->party=NULL;
367 return 1; 367 return 1;
368 } 368 }
369 if(strcmp(params, "who")==0) { 369 if(strcmp(params, "who")==0) {
378 for(pl=first_player;pl!=NULL;pl=pl->next) 378 for(pl=first_player;pl!=NULL;pl=pl->next)
379 if(pl->ob->contr->party==op->contr->party) { 379 if(pl->ob->contr->party==op->contr->party) {
380 if (settings.set_title == TRUE) { 380 if (settings.set_title == TRUE) {
381 if(pl->ob->contr->own_title[0]!='\0') 381 if(pl->ob->contr->own_title[0]!='\0')
382 sprintf(buf,"%3d %s the %s", 382 sprintf(buf,"%3d %s the %s",
383 pl->ob->level,pl->ob->name,pl->ob->contr->own_title); 383 pl->ob->level,&pl->ob->name,pl->ob->contr->own_title);
384 else 384 else
385 sprintf(buf,"%3d %s the %s", 385 sprintf(buf,"%3d %s the %s",
386 pl->ob->level,pl->ob->name,pl->ob->contr->title); 386 pl->ob->level,&pl->ob->name,pl->ob->contr->title);
387 } else 387 } else
388 sprintf(buf,"%3d %s the %s", 388 sprintf(buf,"%3d %s the %s",
389 pl->ob->level,pl->ob->name,pl->ob->contr->title); 389 pl->ob->level,&pl->ob->name,pl->ob->contr->title);
390 new_draw_info(NDI_UNIQUE, 0,op,buf); 390 new_draw_info(NDI_UNIQUE, 0,op,buf);
391 } 391 }
392 return 1; 392 return 1;
393 } /* leave */ 393 } /* leave */
394 394
412 if(tmplist == op->contr->party) { 412 if(tmplist == op->contr->party) {
413 strcpy(tmplist->passwd,params); 413 strcpy(tmplist->passwd,params);
414 new_draw_info_format(NDI_UNIQUE, 0, op, 414 new_draw_info_format(NDI_UNIQUE, 0, op,
415 "The password for party %s is %s", tmplist->partyname,tmplist->passwd); 415 "The password for party %s is %s", tmplist->partyname,tmplist->passwd);
416 snprintf( buf, MAX_BUF, "Password for party %s is now %s, changed by %s", 416 snprintf( buf, MAX_BUF, "Password for party %s is now %s, changed by %s",
417 tmplist->partyname, tmplist->passwd, op->name ); 417 tmplist->partyname, tmplist->passwd, &op->name );
418 send_party_message(op,buf); 418 send_party_message(op,buf);
419 return 0; 419 return 0;
420 } 420 }
421 tmplist = tmplist->next; 421 tmplist = tmplist->next;
422 } 422 }
473 /* found party player wants to join */ 473 /* found party player wants to join */
474 if(firstparty->passwd[0] == '\0') { 474 if(firstparty->passwd[0] == '\0') {
475 op->contr->party = firstparty; 475 op->contr->party = firstparty;
476 new_draw_info_format(NDI_UNIQUE, 0, op, 476 new_draw_info_format(NDI_UNIQUE, 0, op,
477 "You have joined party: %s",firstparty->partyname); 477 "You have joined party: %s",firstparty->partyname);
478 snprintf( buf, MAX_BUF, "%s joins party %s", op->name, firstparty->partyname ); 478 snprintf( buf, MAX_BUF, "%s joins party %s", &op->name, firstparty->partyname );
479 send_party_message( op, buf ); 479 send_party_message( op, buf );
480 return 0; 480 return 0;
481 } 481 }
482 else { 482 else {
483 get_party_password(op,firstparty); 483 get_party_password(op,firstparty);
498 else { 498 else {
499 if(tmpparty->passwd[0] == '\0') { 499 if(tmpparty->passwd[0] == '\0') {
500 new_draw_info_format(NDI_UNIQUE, 0, op, 500 new_draw_info_format(NDI_UNIQUE, 0, op,
501 "You have joined party: %s",tmpparty->partyname); 501 "You have joined party: %s",tmpparty->partyname);
502 op->contr->party = tmpparty; 502 op->contr->party = tmpparty;
503 snprintf( buf, MAX_BUF, "%s joins party %s", op->name, tmpparty->partyname ); 503 snprintf( buf, MAX_BUF, "%s joins party %s", &op->name, tmpparty->partyname );
504 send_party_message( op, buf ); 504 send_party_message( op, buf );
505 return 0; 505 return 0;
506 } 506 }
507 else { 507 else {
508 get_party_password(op, tmpparty); 508 get_party_password(op, tmpparty);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines