Cleaned struct tokens for map_session_data and status_change (#7490)
Fixes #7492
This commit is contained in:
@@ -69,9 +69,9 @@ int CheckForCharServer(void)
|
||||
* @param char_id
|
||||
* @return sd Found sd or NULL if not found
|
||||
*/
|
||||
struct map_session_data *inter_search_sd(uint32 account_id, uint32 char_id)
|
||||
map_session_data *inter_search_sd(uint32 account_id, uint32 char_id)
|
||||
{
|
||||
struct map_session_data *sd = NULL;
|
||||
map_session_data *sd = NULL;
|
||||
struct auth_node *node = chrif_auth_check(account_id, char_id, ST_LOGIN);
|
||||
if (node)
|
||||
sd = node->sd;
|
||||
@@ -182,7 +182,7 @@ int intif_delete_petdata(int pet_id)
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
int intif_rename(struct map_session_data *sd, int type, char *name)
|
||||
int intif_rename(map_session_data *sd, int type, char *name)
|
||||
{
|
||||
if (CheckForCharServer())
|
||||
return 0;
|
||||
@@ -283,7 +283,7 @@ int intif_broadcast2(const char* mes, int len, unsigned long fontColor, short fo
|
||||
* @param message : the message to sent
|
||||
* @return
|
||||
*/
|
||||
int intif_main_message(struct map_session_data* sd, const char* message)
|
||||
int intif_main_message(map_session_data* sd, const char* message)
|
||||
{
|
||||
char output[256];
|
||||
|
||||
@@ -310,7 +310,7 @@ int intif_main_message(struct map_session_data* sd, const char* message)
|
||||
* @param mes_len : Size of message
|
||||
* @return 0=Message not send, 1=Message send
|
||||
*/
|
||||
int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, int mes_len)
|
||||
int intif_wis_message(map_session_data *sd, char *nick, char *mes, int mes_len)
|
||||
{
|
||||
int headersize = 8 + 2 * NAME_LENGTH;
|
||||
|
||||
@@ -393,7 +393,7 @@ int intif_wis_message_to_gm(char *wisp_name, int permission, char *mes)
|
||||
* @param sd : Player to save registry
|
||||
* @return 1=msg sent, -1=error
|
||||
*/
|
||||
int intif_saveregistry(struct map_session_data *sd)
|
||||
int intif_saveregistry(map_session_data *sd)
|
||||
{
|
||||
DBIterator *iter;
|
||||
DBKey key;
|
||||
@@ -521,7 +521,7 @@ int intif_saveregistry(struct map_session_data *sd)
|
||||
* @param flag : Type of registry to load, &1=acc (login-serv), &2=acc (char-serv), &4=char
|
||||
* @return
|
||||
*/
|
||||
int intif_request_registry(struct map_session_data *sd, int flag)
|
||||
int intif_request_registry(map_session_data *sd, int flag)
|
||||
{
|
||||
nullpo_ret(sd);
|
||||
|
||||
@@ -690,7 +690,7 @@ int intif_party_leave(int party_id, uint32 account_id, uint32 char_id, const cha
|
||||
* @param online : If the player will stay online or no
|
||||
* @return 0=error, 1=msg sent
|
||||
*/
|
||||
int intif_party_changemap(struct map_session_data *sd,int online)
|
||||
int intif_party_changemap(map_session_data *sd,int online)
|
||||
{
|
||||
int16 m, mapindex;
|
||||
|
||||
@@ -1280,7 +1280,7 @@ int intif_homunculus_requestdelete(int homun_id)
|
||||
*/
|
||||
int intif_parse_WisMessage(int fd)
|
||||
{
|
||||
struct map_session_data* sd;
|
||||
map_session_data* sd;
|
||||
char *wisp_source;
|
||||
char name[NAME_LENGTH];
|
||||
int id, i, gmlvl;
|
||||
@@ -1323,11 +1323,11 @@ int intif_parse_WisMessage(int fd)
|
||||
*/
|
||||
int intif_parse_WisEnd(int fd)
|
||||
{
|
||||
struct map_session_data* sd;
|
||||
map_session_data* sd;
|
||||
|
||||
if (battle_config.etc_log)
|
||||
ShowInfo("intif_parse_wisend: player: %s, flag: %d\n", RFIFOP(fd,2), RFIFOB(fd,26)); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
|
||||
sd = (struct map_session_data *)map_nick2sd(RFIFOCP(fd,2),false);
|
||||
sd = (map_session_data *)map_nick2sd(RFIFOCP(fd,2),false);
|
||||
if (sd != NULL)
|
||||
clif_wis_end(sd->fd, RFIFOB(fd,26));
|
||||
|
||||
@@ -1340,7 +1340,7 @@ int intif_parse_WisEnd(int fd)
|
||||
* @param va : list of arguments ( wisp_name, message, len)
|
||||
* @return 0=error, 1=msg sent
|
||||
*/
|
||||
static int mapif_parse_WisToGM_sub(struct map_session_data* sd,va_list va)
|
||||
static int mapif_parse_WisToGM_sub(map_session_data* sd,va_list va)
|
||||
{
|
||||
e_pc_permission permission = static_cast<e_pc_permission>(va_arg(va, uint32));
|
||||
char *wisp_name;
|
||||
@@ -1390,7 +1390,7 @@ int mapif_parse_WisToGM(int fd)
|
||||
void intif_parse_Registers(int fd)
|
||||
{
|
||||
int flag;
|
||||
struct map_session_data *sd;
|
||||
map_session_data *sd;
|
||||
uint32 account_id = RFIFOL(fd,4), char_id = RFIFOL(fd,8);
|
||||
struct auth_node *node = chrif_auth_check(account_id, char_id, ST_LOGIN);
|
||||
char type = RFIFOB(fd, 13);
|
||||
@@ -1489,7 +1489,7 @@ void intif_parse_Registers(int fd)
|
||||
int intif_parse_LoadGuildStorage(int fd)
|
||||
{
|
||||
struct s_storage *gstor;
|
||||
struct map_session_data *sd;
|
||||
map_session_data *sd;
|
||||
int guild_id, flag;
|
||||
|
||||
guild_id = RFIFOL(fd,8);
|
||||
@@ -1942,7 +1942,7 @@ int intif_parse_DeletePetOk(int fd)
|
||||
*/
|
||||
int intif_parse_ChangeNameOk(int fd)
|
||||
{
|
||||
struct map_session_data *sd = NULL;
|
||||
map_session_data *sd = NULL;
|
||||
if((sd=map_id2sd(RFIFOL(fd,2)))==NULL ||
|
||||
sd->status.char_id != RFIFOL(fd,6))
|
||||
return 0;
|
||||
@@ -2037,7 +2037,7 @@ QUESTLOG SYSTEM FUNCTIONS
|
||||
* Requests a character's quest log entries to the inter server.
|
||||
* @param sd Character's data
|
||||
*/
|
||||
void intif_request_questlog(struct map_session_data *sd)
|
||||
void intif_request_questlog(map_session_data *sd)
|
||||
{
|
||||
if (CheckForCharServer())
|
||||
return;
|
||||
@@ -2120,7 +2120,7 @@ void intif_parse_questsave(int fd)
|
||||
* @param sd Character's data
|
||||
* @return 0 in case of success, nonzero otherwise
|
||||
*/
|
||||
int intif_quest_save(struct map_session_data *sd)
|
||||
int intif_quest_save(map_session_data *sd)
|
||||
{
|
||||
int len = sizeof(struct quest) * sd->num_quests + 8;
|
||||
|
||||
@@ -2164,7 +2164,7 @@ void intif_request_achievements(uint32 char_id)
|
||||
void intif_parse_achievements(int fd)
|
||||
{
|
||||
uint32 char_id = RFIFOL(fd, 4), num_received = (RFIFOW(fd, 2) - 8) / sizeof(struct achievement);
|
||||
struct map_session_data *sd = map_charid2sd(char_id);
|
||||
map_session_data *sd = map_charid2sd(char_id);
|
||||
|
||||
if (!sd) // User not online anymore
|
||||
return;
|
||||
@@ -2229,7 +2229,7 @@ void intif_parse_achievements(int fd)
|
||||
void intif_parse_achievementsave(int fd)
|
||||
{
|
||||
int cid = RFIFOL(fd, 2);
|
||||
struct map_session_data *sd = map_charid2sd(cid);
|
||||
map_session_data *sd = map_charid2sd(cid);
|
||||
|
||||
if (!sd) // User not online anymore
|
||||
return;
|
||||
@@ -2243,7 +2243,7 @@ void intif_parse_achievementsave(int fd)
|
||||
* @param sd: Character's data
|
||||
* @return 0 in case of success, nonzero otherwise
|
||||
*/
|
||||
int intif_achievement_save(struct map_session_data *sd)
|
||||
int intif_achievement_save(map_session_data *sd)
|
||||
{
|
||||
int len = sizeof(struct achievement) * sd->achievement_data.count + 8;
|
||||
|
||||
@@ -2269,7 +2269,7 @@ int intif_achievement_save(struct map_session_data *sd)
|
||||
* @param fd : char-serv link
|
||||
*/
|
||||
void intif_parse_achievementreward(int fd){
|
||||
struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
|
||||
// User not online anymore
|
||||
if( !sd ){
|
||||
@@ -2282,7 +2282,7 @@ void intif_parse_achievementreward(int fd){
|
||||
/**
|
||||
* Request the achievement rewards from the inter server.
|
||||
*/
|
||||
int intif_achievement_reward(struct map_session_data *sd, struct s_achievement_db *adb){
|
||||
int intif_achievement_reward(map_session_data *sd, struct s_achievement_db *adb){
|
||||
if( CheckForCharServer() ){
|
||||
return 0;
|
||||
}
|
||||
@@ -2334,7 +2334,7 @@ int intif_Mail_requestinbox(uint32 char_id, unsigned char flag, enum mail_inbox_
|
||||
*/
|
||||
int intif_parse_Mail_inboxreceived(int fd)
|
||||
{
|
||||
struct map_session_data *sd;
|
||||
map_session_data *sd;
|
||||
unsigned char flag = RFIFOB(fd,8);
|
||||
|
||||
sd = map_charid2sd(RFIFOL(fd,4));
|
||||
@@ -2396,7 +2396,7 @@ int intif_Mail_read(int mail_id)
|
||||
* @param mail_id : Mail identification
|
||||
* @return 0=error, 1=msg sent
|
||||
*/
|
||||
bool intif_mail_getattach( struct map_session_data* sd, struct mail_message *msg, enum mail_attachment_type type){
|
||||
bool intif_mail_getattach( map_session_data* sd, struct mail_message *msg, enum mail_attachment_type type){
|
||||
if (CheckForCharServer())
|
||||
return false;
|
||||
|
||||
@@ -2417,7 +2417,7 @@ bool intif_mail_getattach( struct map_session_data* sd, struct mail_message *msg
|
||||
*/
|
||||
int intif_parse_Mail_getattach(int fd)
|
||||
{
|
||||
struct map_session_data *sd;
|
||||
map_session_data *sd;
|
||||
struct item item[MAIL_MAX_ITEM];
|
||||
int i, mail_id, zeny;
|
||||
|
||||
@@ -2480,7 +2480,7 @@ int intif_parse_Mail_delete(int fd)
|
||||
int mail_id = RFIFOL(fd,6);
|
||||
bool failed = RFIFOB(fd,10) > 0;
|
||||
|
||||
struct map_session_data *sd = map_charid2sd(char_id);
|
||||
map_session_data *sd = map_charid2sd(char_id);
|
||||
if (sd == NULL)
|
||||
{
|
||||
ShowError("intif_parse_Mail_delete: char not found %d\n", char_id);
|
||||
@@ -2537,7 +2537,7 @@ int intif_Mail_return(uint32 char_id, int mail_id)
|
||||
*/
|
||||
int intif_parse_Mail_return(int fd)
|
||||
{
|
||||
struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
int mail_id = RFIFOL(fd,6);
|
||||
short fail = RFIFOB(fd,10);
|
||||
|
||||
@@ -2600,7 +2600,7 @@ int intif_Mail_send(uint32 account_id, struct mail_message *msg)
|
||||
static void intif_parse_Mail_send(int fd)
|
||||
{
|
||||
struct mail_message msg;
|
||||
struct map_session_data *sd;
|
||||
map_session_data *sd;
|
||||
bool fail;
|
||||
|
||||
if( RFIFOW(fd,2) - 4 != sizeof(struct mail_message) )
|
||||
@@ -2633,7 +2633,7 @@ static void intif_parse_Mail_send(int fd)
|
||||
*/
|
||||
static void intif_parse_Mail_new(int fd)
|
||||
{
|
||||
struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
int mail_id = RFIFOL(fd,6);
|
||||
const char* sender_name = RFIFOCP(fd,10);
|
||||
const char* title = RFIFOCP(fd,34);
|
||||
@@ -2650,7 +2650,7 @@ static void intif_parse_Mail_new(int fd)
|
||||
}
|
||||
|
||||
static void intif_parse_Mail_receiver( int fd ){
|
||||
struct map_session_data *sd;
|
||||
map_session_data *sd;
|
||||
|
||||
sd = map_charid2sd( RFIFOL( fd, 2 ) );
|
||||
|
||||
@@ -2660,8 +2660,8 @@ static void intif_parse_Mail_receiver( int fd ){
|
||||
}
|
||||
}
|
||||
|
||||
bool intif_mail_checkreceiver( struct map_session_data* sd, char* name ){
|
||||
struct map_session_data *tsd;
|
||||
bool intif_mail_checkreceiver( map_session_data* sd, char* name ){
|
||||
map_session_data *tsd;
|
||||
|
||||
tsd = map_nick2sd( name, false );
|
||||
|
||||
@@ -2723,7 +2723,7 @@ int intif_Auction_requestlist(uint32 char_id, short type, int price, const char*
|
||||
*/
|
||||
static void intif_parse_Auction_results(int fd)
|
||||
{
|
||||
struct map_session_data *sd = map_charid2sd(RFIFOL(fd,4));
|
||||
map_session_data *sd = map_charid2sd(RFIFOL(fd,4));
|
||||
short count = RFIFOW(fd,8);
|
||||
short pages = RFIFOW(fd,10);
|
||||
uint8* data = RFIFOP(fd,12);
|
||||
@@ -2761,7 +2761,7 @@ int intif_Auction_register(struct auction_data *auction)
|
||||
*/
|
||||
static void intif_parse_Auction_register(int fd)
|
||||
{
|
||||
struct map_session_data *sd;
|
||||
map_session_data *sd;
|
||||
struct auction_data auction;
|
||||
|
||||
if( RFIFOW(fd,2) - 4 != sizeof(struct auction_data) )
|
||||
@@ -2817,7 +2817,7 @@ int intif_Auction_cancel(uint32 char_id, unsigned int auction_id)
|
||||
*/
|
||||
static void intif_parse_Auction_cancel(int fd)
|
||||
{
|
||||
struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
int result = RFIFOB(fd,6);
|
||||
|
||||
if( sd == NULL )
|
||||
@@ -2858,7 +2858,7 @@ int intif_Auction_close(uint32 char_id, unsigned int auction_id)
|
||||
*/
|
||||
static void intif_parse_Auction_close(int fd)
|
||||
{
|
||||
struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
unsigned char result = RFIFOB(fd,6);
|
||||
|
||||
if( sd == NULL )
|
||||
@@ -2907,7 +2907,7 @@ int intif_Auction_bid(uint32 char_id, const char* name, unsigned int auction_id,
|
||||
*/
|
||||
static void intif_parse_Auction_bid(int fd)
|
||||
{
|
||||
struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
int bid = RFIFOL(fd,6);
|
||||
unsigned char result = RFIFOB(fd,10);
|
||||
|
||||
@@ -2932,7 +2932,7 @@ static void intif_parse_Auction_bid(int fd)
|
||||
*/
|
||||
static void intif_parse_Auction_message(int fd)
|
||||
{
|
||||
struct map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
map_session_data *sd = map_charid2sd(RFIFOL(fd,2));
|
||||
unsigned char result = RFIFOB(fd,6);
|
||||
|
||||
if( sd == NULL )
|
||||
@@ -3239,7 +3239,7 @@ void intif_parse_MessageToFD(int fd) {
|
||||
|
||||
if( session[u_fd] && session[u_fd]->session_data ) { //check if the player still online
|
||||
int aid = RFIFOL(fd,8);
|
||||
struct map_session_data * sd = (struct map_session_data *)session[u_fd]->session_data;
|
||||
map_session_data * sd = (map_session_data *)session[u_fd]->session_data;
|
||||
/* matching e.g. previous fd owner didn't dc during request or is still the same */
|
||||
if( sd->bl.id == aid ) {
|
||||
char msg[512];
|
||||
@@ -3263,7 +3263,7 @@ void intif_parse_MessageToFD(int fd) {
|
||||
* @param type Obtain type @see enum BROADCASTING_SPECIAL_ITEM_OBTAIN
|
||||
* @return
|
||||
**/
|
||||
int intif_broadcast_obtain_special_item(struct map_session_data *sd, t_itemid nameid, t_itemid sourceid, unsigned char type) {
|
||||
int intif_broadcast_obtain_special_item(map_session_data *sd, t_itemid nameid, t_itemid sourceid, unsigned char type) {
|
||||
nullpo_retr(0, sd);
|
||||
|
||||
// Should not be here!
|
||||
@@ -3302,7 +3302,7 @@ int intif_broadcast_obtain_special_item(struct map_session_data *sd, t_itemid na
|
||||
* @param srcname Source name
|
||||
* @return
|
||||
**/
|
||||
int intif_broadcast_obtain_special_item_npc(struct map_session_data *sd, t_itemid nameid) {
|
||||
int intif_broadcast_obtain_special_item_npc(map_session_data *sd, t_itemid nameid) {
|
||||
nullpo_retr(0, sd);
|
||||
|
||||
// Send local
|
||||
@@ -3424,7 +3424,7 @@ static bool intif_parse_StorageReceived(int fd)
|
||||
{
|
||||
char type = RFIFOB(fd,4);
|
||||
uint32 account_id = RFIFOL(fd, 5);
|
||||
struct map_session_data *sd = map_id2sd(account_id);
|
||||
map_session_data *sd = map_id2sd(account_id);
|
||||
struct s_storage *stor, *p; //storage
|
||||
size_t sz_stor = sizeof(struct s_storage);
|
||||
|
||||
@@ -3547,7 +3547,7 @@ static void intif_parse_StorageSaved(int fd)
|
||||
break;
|
||||
case TABLE_STORAGE: //storage
|
||||
{
|
||||
struct map_session_data *sd = map_id2sd( RFIFOL( fd, 2 ) );
|
||||
map_session_data *sd = map_id2sd( RFIFOL( fd, 2 ) );
|
||||
struct s_storage* stor = nullptr;
|
||||
|
||||
if( RFIFOB( fd, 8 ) ){
|
||||
@@ -3572,7 +3572,7 @@ static void intif_parse_StorageSaved(int fd)
|
||||
case TABLE_CART: // cart
|
||||
//ShowInfo("Cart has been saved (AID: %d).\n", RFIFOL(fd, 2));
|
||||
{
|
||||
struct map_session_data *sd = map_id2sd(RFIFOL(fd, 2));
|
||||
map_session_data *sd = map_id2sd(RFIFOL(fd, 2));
|
||||
|
||||
if( sd && sd->state.prevend ){
|
||||
intif_storage_request(sd,TABLE_CART,0,STOR_MODE_ALL);
|
||||
@@ -3620,7 +3620,7 @@ void intif_parse_StorageInfo_recv(int fd) {
|
||||
* @param mode: Storage mode
|
||||
* @return false - error, true - message sent
|
||||
*/
|
||||
bool intif_storage_request(struct map_session_data *sd, enum storage_type type, uint8 stor_id, uint8 mode)
|
||||
bool intif_storage_request(map_session_data *sd, enum storage_type type, uint8 stor_id, uint8 mode)
|
||||
{
|
||||
if (CheckForCharServer())
|
||||
return false;
|
||||
@@ -3643,7 +3643,7 @@ bool intif_storage_request(struct map_session_data *sd, enum storage_type type,
|
||||
* @param stor: Storage data
|
||||
* @ return false - error, true - message sent
|
||||
*/
|
||||
bool intif_storage_save(struct map_session_data *sd, struct s_storage *stor)
|
||||
bool intif_storage_save(map_session_data *sd, struct s_storage *stor)
|
||||
{
|
||||
int stor_size = sizeof(struct s_storage);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user