summaryrefslogtreecommitdiff
path: root/src/char
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/char
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/char')
-rw-r--r--src/char/char.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 1556c10a3..a0d34e14e 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -2752,8 +2752,14 @@ int parse_frommap(int fd) {
}
if (i != char_num)
memcpy(&char_dat[i].status, RFIFOP(fd,13), sizeof(struct mmo_charstatus));
- if (RFIFOB(fd,12)) //Flag, set character offline. [Skotlex]
+ if (RFIFOB(fd,12))
+ { //Flag, set character offline. [Skotlex]
set_char_offline(RFIFOL(fd,8),RFIFOL(fd,4));
+ WFIFOW(fd, 0) = 0x2b21; //Save ack only needed on final save.
+ WFIFOL(fd, 2) = RFIFOL(fd,4);
+ WFIFOL(fd, 6) = RFIFOL(fd,8);
+ WFIFOSET(fd, 10);
+ }
RFIFOSKIP(fd,RFIFOW(fd,2));
break;