diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-03-02 17:36:59 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-03-02 17:36:59 +0000 |
commit | 767b08018e035e1d04e7d83ea923a146626761f0 (patch) | |
tree | b111819e70fb84200bef87bc8d567c84bff7130d /src/map/chrif.c | |
parent | 65b3428fad4d6371253e8492cb1d1149eefafbb1 (diff) | |
download | hercules-767b08018e035e1d04e7d83ea923a146626761f0.tar.gz hercules-767b08018e035e1d04e7d83ea923a146626761f0.tar.bz2 hercules-767b08018e035e1d04e7d83ea923a146626761f0.tar.xz hercules-767b08018e035e1d04e7d83ea923a146626761f0.zip |
Fixed wrong mvp format string for @mobinfo (would not show big mvp exp rewards correctly).
Added data length check to chrif_authok(), to detect a mismatch between charserver's and mapserver's mmo_charstatus structure size.
Corrected some typos in the cash shop code.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12277 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r-- | src/map/chrif.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c index 969157acd..db59e4097 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -543,6 +543,14 @@ void chrif_authok(int fd) struct mmo_charstatus *status = (struct mmo_charstatus *)RFIFOP(fd, 20); int char_id = status->char_id; TBL_PC* sd; + + //Check if both servers agree on the struct's size + if( RFIFOW(fd,2) - 20 != sizeof(struct mmo_charstatus) ) + { + ShowError("chrif_authok: Data size mismatch! %d != %d\n", RFIFOW(fd,2) - 20, sizeof(struct mmo_charstatus)); + return; + } + //Check if we don't already have player data in our server //Causes problems if the currently connected player tries to quit or this data belongs to an already connected player which is trying to re-auth. if ((sd = map_id2sd(account_id)) != NULL) |