Crossfire Server, Branch 1.12
R12190
|
Party-related functions and variables. More...
Go to the source code of this file.
Functions | |
int | command_gsay (object *op, char *params) |
'gsay' command, talks to party. | |
int | command_party (object *op, char *params) |
'party' command, subdivided in different sub commands. | |
int | command_party_rejoin (object *op, char *params) |
Handles the 'party_rejoin' command. | |
int | confirm_party_password (object *op) |
Is the password the player entered to join a party the right one? | |
partylist * | form_party (object *op, const char *params) |
Forms the party struct for a party called 'params'. | |
partylist * | get_firstparty (void) |
Simple wrapper to get firstparty. | |
void | obsolete_parties (void) |
Remove unused parties (no players), this could be made to scale a lot better. | |
static void | party_help (object *op) |
Give help for party commands. | |
void | receive_party_password (object *op) |
Player entered a party password. | |
void | remove_party (partylist *target_party) |
Remove and free party. | |
void | send_party_message (object *op, char *msg) |
Send a message to all party members except the speaker. | |
Variables | |
static partylist * | firstparty = NULL |
Keeps track of first party in list. | |
static partylist * | lastparty = NULL |
Keeps track of last party in list. | |
static const char * | rejoin_modes [] |
Valid modes for 'party_rejoin'. |
Party-related functions and variables.
Definition in file c_party.c.
int command_gsay | ( | object * | op, |
char * | params | ||
) |
'gsay' command, talks to party.
op | player. |
params | message. |
Definition at line 304 of file c_party.c.
References command_party(), draw_ext_info(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.
int command_party | ( | object * | op, |
char * | params | ||
) |
'party' command, subdivided in different sub commands.
op | player. |
params | additional parameters. 1. |
Definition at line 350 of file c_party.c.
References draw_ext_info(), draw_ext_info_format(), first_player, firstparty, form_party(), get_party_password(), party_struct::kills, list_players(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_PARTY, NDI_UNIQUE, NDI_WHITE, party_struct::next, pl::next, pl::party, party_help(), party_struct::partyleader, party_struct::partyname, party_struct::passwd, remove_party(), replace_unprintable_chars(), send_party_message(), snprintf(), and party_struct::total_exp.
Referenced by command_gsay().
int command_party_rejoin | ( | object * | op, |
char * | params | ||
) |
Handles the 'party_rejoin' command.
op | player. |
params | optional parameters. |
Definition at line 688 of file c_party.c.
References draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, and NDI_UNIQUE.
int confirm_party_password | ( | object * | op | ) |
Is the password the player entered to join a party the right one?
op | player. Must have party_to_join correctly set. |
0 | password is correct. |
1 | invalid password or party not found. |
Definition at line 228 of file c_party.c.
References party_struct::next, party_struct::partyname, and party_struct::passwd.
Referenced by receive_party_password().
partylist* form_party | ( | object * | op, |
const char * | params | ||
) |
Forms the party struct for a party called 'params'.
it is the responsibility of the caller to ensure that the name is unique. New item is placed on the party list.
op | party creator. |
params | party name. |
Definition at line 65 of file c_party.c.
References draw_ext_info_format(), firstparty, party_struct::kills, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, party_struct::next, party_struct::partyleader, party_struct::partyname, party_struct::passwd, replace_unprintable_chars(), send_party_message(), snprintf(), strdup_local(), and party_struct::total_exp.
Referenced by check_login(), command_party(), and START_TEST().
partylist* get_firstparty | ( | void | ) |
Simple wrapper to get firstparty.
Definition at line 48 of file c_party.c.
References firstparty.
Referenced by cfapi_party_get_property(), check_login(), and START_TEST().
void obsolete_parties | ( | void | ) |
Remove unused parties (no players), this could be made to scale a lot better.
Definition at line 165 of file c_party.c.
References first_player, party_struct::next, pl::next, pl::party, and remove_party().
Referenced by do_specials(), and START_TEST().
static void party_help | ( | object * | op | ) | [static] |
Give help for party commands.
op | player. |
Definition at line 323 of file c_party.c.
References draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_HELP, and NDI_UNIQUE.
Referenced by command_party().
void receive_party_password | ( | object * | op | ) |
Player entered a party password.
op | player. |
Definition at line 248 of file c_party.c.
References confirm_party_password(), draw_ext_info(), draw_ext_info_format(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, party_struct::partyname, send_party_message(), snprintf(), and ST_PLAYING.
Referenced by reply_cmd().
void remove_party | ( | partylist * | target_party | ) |
Remove and free party.
target_party | party to remove. |
Definition at line 106 of file c_party.c.
References first_player, llevError, LOG(), party_struct::next, pl::next, pl::party, party_struct::partyleader, and party_struct::partyname.
Referenced by command_party(), obsolete_parties(), and START_TEST().
void send_party_message | ( | object * | op, |
char * | msg | ||
) |
Send a message to all party members except the speaker.
op | player talking. |
msg | message to send. |
Definition at line 285 of file c_party.c.
References draw_ext_info(), first_player, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_PARTY, NDI_WHITE, pl::next, and pl::ob.
Referenced by check_login(), command_party(), form_party(), and receive_party_password().
partylist* firstparty = NULL [static] |
Keeps track of first party in list.
Definition at line 40 of file c_party.c.
Referenced by command_party(), form_party(), and get_firstparty().
const char* rejoin_modes[] [static] |