diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-07-13 16:14:32 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-07-13 16:14:32 +0000 |
commit | fb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63 (patch) | |
tree | 52b66f102c20e6b47e060efe0e7ceabd36d5aa29 /src/char/char.c | |
parent | 2e7ba13554118cdc78c9bfa5a6f0e5e8e58baf7b (diff) | |
download | hercules-fb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63.tar.gz hercules-fb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63.tar.bz2 hercules-fb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63.tar.xz hercules-fb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63.zip |
Modified storage data loading
* storage is now loaded/saved along with character status
* as a consequence, a lot of storage handling code was removed
* there is no more locking done within storage data
* mapservers no longer cache the data (solves muiltimapserver exploit)
* loading storage on char select may decrease charserver performance
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12950 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char/char.c')
-rw-r--r-- | src/char/char.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c index c57ba86fa..19887b737 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -1003,6 +1003,8 @@ int mmo_char_init(void) ret = mmo_char_fromstr(line, &char_dat[char_num].status, char_dat[char_num].global, &char_dat[char_num].global_num); + // load storage + storage_load(char_dat[char_num].status.account_id, &char_dat[char_num].status.storage); // Initialize friends list parse_friend_txt(&char_dat[char_num].status); // Grab friends for the character // Initialize hotkey list @@ -2774,7 +2776,11 @@ int parse_frommap(int fd) break; } if (i != char_num) + { memcpy(&char_dat[i].status, RFIFOP(fd,13), sizeof(struct mmo_charstatus)); + storage_save(char_dat[i].status.account_id, &char_dat[i].status.storage); + } + if (RFIFOB(fd,12)) { //Flag, set character offline. [Skotlex] set_char_offline(RFIFOL(fd,8),RFIFOL(fd,4)); |