summaryrefslogtreecommitdiff
path: root/src/map/intif.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-02-21 00:13:56 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-02-21 00:13:56 +0000
commitfd665092bbcd4be32f9d8319ffbb4aad30b40d08 (patch)
tree96fbf399d2704c89a5254a91994dd07a40fdfe39 /src/map/intif.c
parent5870b45487fde3bc3fef54062aab5fcce4ce39ca (diff)
downloadhercules-fd665092bbcd4be32f9d8319ffbb4aad30b40d08.tar.gz
hercules-fd665092bbcd4be32f9d8319ffbb4aad30b40d08.tar.bz2
hercules-fd665092bbcd4be32f9d8319ffbb4aad30b40d08.tar.xz
hercules-fd665092bbcd4be32f9d8319ffbb4aad30b40d08.zip
- Fixed new guilds displaying online-connect member count at 0 rather than 1, and the guild master not knowing it is one (eg: it cannot edit the guild notice of a newly created guild until relogging).
- Fixed acc_reg2 parsing screwing up the char_id and subtracting 2 from it rather than passing it as it is. - Extended the auth_node/auth_db system in chrif.c to handle log in/out and mapserver-change procedures. This way players are not in the main dbs when they are not "active", which blocks potential invalid accesses to them. - Replaced states auth, waiting_disconnect and finalsave with active. - Cleaned some the party/guild login and creation procedures, removed the party_sent/guild_sent states. - Removed a redundant guild_check_member call which is beyond not-needed and into the realm of wasting resources. - clif_parse will no longer process packets from !sd->state.active players, this also makes checking for finalsave uneccessary (since players re already removed from the maps and dbs by this point, so you can't access them in any other way) - Separated the roles of unit_free and map_quit, the former will handle cleaning structures from the player so it can be free'd safely, while the latter performs additional routines which are unique to characters logging out normally (map-server changes will invoke unit_free and bypass map_quit). - Removed pc_isplaying, quit_db, map_knowsaccount, MAPIT_PCISPLAYING among other functions/defines which are no longer needed due to the new login scheme. - Cleand up a bit some code in the clif_send(_sub) functions. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12223 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/intif.c')
-rw-r--r--src/map/intif.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/src/map/intif.c b/src/map/intif.c
index 3566e38c4..e04710218 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -919,12 +919,16 @@ int intif_parse_Registers(int fd)
struct map_session_data *sd;
struct global_reg *reg;
int *qty;
-
- if( (sd=map_id2sd(RFIFOL(fd,4)))==NULL)
- return 1;
-
- if (RFIFOB(fd,12) == 3 && sd->status.char_id != RFIFOL(fd,8))
- return 1; //Character registry from another character.
+ int account_id = RFIFOL(fd,4), char_id = RFIFOL(fd,8);
+ struct auth_node *node = chrif_auth_check(account_id, char_id, ST_LOGIN);
+ if (node)
+ sd = node->sd;
+ else { //Normally registries should arrive for in log-in chars.
+ sd = map_id2sd(account_id);
+ if (sd && RFIFOB(fd,12) == 3 && sd->status.char_id != char_id)
+ sd = NULL; //Character registry from another character.
+ }
+ if (!sd) return 1;
flag = (sd->save_reg.global_num == -1 || sd->save_reg.account_num == -1 || sd->save_reg.account2_num == -1);
@@ -975,9 +979,6 @@ int intif_parse_LoadStorage(int fd)
return 1;
}
- if (sd->state.finalsave)
- return 1; //Player is already scheduled to leave the server.
-
stor = account2storage( RFIFOL(fd,4));
if (stor->storage_status == 1) { // Already open.. lets ignore this update
@@ -1434,9 +1435,6 @@ int intif_parse_Mail_inboxreceived(int fd)
return 1;
}
- if (sd->state.finalsave)
- return 1;
-
if (RFIFOW(fd,2) - 9 != sizeof(struct mail_data))
{
ShowError("intif_parse_Mail_inboxreceived: data size error %d %d\n", RFIFOW(fd,2) - 9, sizeof(struct mail_data));
@@ -1502,9 +1500,6 @@ int intif_parse_Mail_getattach(int fd)
return 1;
}
- if (sd->state.finalsave)
- return 1;
-
if (RFIFOW(fd,2) - 12 != sizeof(struct item))
{
ShowError("intif_parse_Mail_getattach: data size error %d %d\n", RFIFOW(fd,2) - 16, sizeof(struct item));
@@ -1546,9 +1541,6 @@ int intif_parse_Mail_delete(int fd)
return 1;
}
- if (sd->state.finalsave)
- return 1;
-
if (!failed)
{
int i;
@@ -1595,9 +1587,6 @@ int intif_parse_Mail_return(int fd)
return 1;
}
- if( sd->state.finalsave )
- return 1;
-
if( !fail )
{
int i;