summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-07 16:28:41 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-07 16:28:41 +0000
commit959387743887e9a57cf31b950f23be9bd34b919f (patch)
tree8a472ad961a9d3df5dea73f84ae597735b02e52e /src/map/clif.c
parentae287ef89682be736bf1281d758e5cd3bad56895 (diff)
downloadhercules-959387743887e9a57cf31b950f23be9bd34b919f.tar.gz
hercules-959387743887e9a57cf31b950f23be9bd34b919f.tar.bz2
hercules-959387743887e9a57cf31b950f23be9bd34b919f.tar.xz
hercules-959387743887e9a57cf31b950f23be9bd34b919f.zip
- Okay, added a chrif_save_ack packet to the char-server so now the map server will know once a character was "final saved", and only then the character will be removed from memory. On char-server reconnection, all chars that are in final-save state are resent to save (if they are still in memory, it's because the ack hasn't gotten here from the char-server). This should effectively block all dupe problems due to heavy inter-server lag, however as it's untested, it currently prints some debug messages when people are saved and then removed from memory. Need testers so this can be debugged and merged to stable!
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7568 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 522199539..69dabc00e 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1683,12 +1683,9 @@ int clif_move(struct block_list *bl) {
static int clif_delayquit(int tid, unsigned int tick, int id, int data) {
struct map_session_data *sd = NULL;
- if (chrif_isconnect())
- { //Remove player from map server
- if ((sd = map_id2sd(id)) != NULL && sd->fd == 0) //Should be a disconnected player.
- map_quit(sd);
- } else //Save later.
- add_timer(tick + 10000, clif_delayquit, id, 0);
+ //Remove player from map server
+ if ((sd = map_id2sd(id)) != NULL && sd->fd == 0) //Should be a disconnected player.
+ map_quit(sd);
return 0;
}
@@ -1698,12 +1695,12 @@ static int clif_delayquit(int tid, unsigned int tick, int id, int data) {
*/
void clif_quitsave(int fd,struct map_session_data *sd)
{
- if (chrif_isconnect() && (sd->state.waitingdisconnect || //Was already waiting to be disconnected.
- !battle_config.prevent_logout || DIFF_TICK(gettick(), sd->canlog_tick) > battle_config.prevent_logout))
+ if (sd->state.waitingdisconnect || //Was already waiting to be disconnected.
+ !battle_config.prevent_logout || DIFF_TICK(gettick(), sd->canlog_tick) > battle_config.prevent_logout)
map_quit(sd);
else if (sd->fd)
{ //Disassociate session from player (session is deleted after this function was called)
- //And set a timer to delete this player later.
+ //And set a timer to make him quit later.
session[fd]->session_data = NULL;
sd->fd = 0;
add_timer(gettick() + 10000, clif_delayquit, sd->bl.id, 0);
@@ -8018,7 +8015,9 @@ void clif_parse_WantToConnection(int fd, struct map_session_data *sd)
if ((old_sd = map_id2sd(account_id)) != NULL)
{ // if same account already connected, we disconnect the 2 sessions
//Check for characters with no connection (includes those that are using autotrade) [durf],[Skotlex]
- if (!old_sd->fd)
+ if (old_sd->state.finalsave)
+ ; //Ack has not arrived yet from char-server, be patient!
+ else if (!old_sd->fd)
map_quit(old_sd);
else
clif_authfail_fd(old_sd->fd, 2); // same id