diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-12-12 00:44:38 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-12-12 00:44:38 +0000 |
commit | 2ce7aa656df82a7261c94fe14b9abc59ab6e4826 (patch) | |
tree | e1333f9d1a0ee3fb8b81648e3b577a8fa7de8015 /src/char_sql | |
parent | 9d66536843f514671766257c54ad9350923548fe (diff) | |
download | hercules-2ce7aa656df82a7261c94fe14b9abc59ab6e4826.tar.gz hercules-2ce7aa656df82a7261c94fe14b9abc59ab6e4826.tar.bz2 hercules-2ce7aa656df82a7261c94fe14b9abc59ab6e4826.tar.xz hercules-2ce7aa656df82a7261c94fe14b9abc59ab6e4826.zip |
* Updates to dynamic server information `ragsrvinfo` on SQL.
- Fixed exp and drop rates (int) getting truncated (short) when sent to char-server.
- Removed `motd` from `ragsrvinfo` as it is not dynamically changed by the server and as such can be read by 3rd party applications directly from conf/motd.txt if required.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14579 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r-- | src/char_sql/char.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 36944cd35..95e4b3471 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -2738,22 +2738,17 @@ int parse_frommap(int fd) break; case 0x2b16: // Receive rates [Wizputer] - if (RFIFOREST(fd) < 6 || RFIFOREST(fd) < RFIFOW(fd,8)) + if( RFIFOREST(fd) < 14 ) return 0; { - char motd[256]; - char esc_motd[sizeof(motd)*2+1]; char esc_server_name[sizeof(server_name)*2+1]; - strncpy(motd, (char*)RFIFOP(fd,10), 255); //First copy it to make sure the motd fits. - motd[255] = '\0'; - Sql_EscapeString(sql_handle, esc_motd, motd); Sql_EscapeString(sql_handle, esc_server_name, server_name); - if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `ragsrvinfo` SET `index`='%d',`name`='%s',`exp`='%d',`jexp`='%d',`drop`='%d',`motd`='%s'", - fd, esc_server_name, RFIFOW(fd,2), RFIFOW(fd,4), RFIFOW(fd,6), esc_motd) ) + if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `ragsrvinfo` SET `index`='%d',`name`='%s',`exp`='%d',`jexp`='%d',`drop`='%d'", + fd, esc_server_name, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)) ) Sql_ShowDebug(sql_handle); - RFIFOSKIP(fd,RFIFOW(fd,8)); + RFIFOSKIP(fd,14); } break; |