summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-02-02 18:35:15 -0200
committershennetsind <ind@henn.et>2014-02-02 18:35:15 -0200
commit9132878d911cfe720eaad94ad3d4a5dd11958f99 (patch)
treee24e9668836c9cf8d6856b12a8f75a261502a3f4 /src/char
parent00ef66fb9261a50e6761cf77c11e7f468494c95f (diff)
downloadhercules-9132878d911cfe720eaad94ad3d4a5dd11958f99.tar.gz
hercules-9132878d911cfe720eaad94ad3d4a5dd11958f99.tar.bz2
hercules-9132878d911cfe720eaad94ad3d4a5dd11958f99.tar.xz
hercules-9132878d911cfe720eaad94ad3d4a5dd11958f99.zip
Fixed Bug 7962
Fixed issue with "permanent" (durationless) status changes (such as carts) integrity caused on server shutdown. Special Thanks to Haru! http://hercules.ws/board/tracker/issue-7962-command-at/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/char')
-rw-r--r--src/char/char.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c
index efe02031f..709148db1 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -3688,6 +3688,40 @@ int parse_frommap(int fd)
RFIFOFLUSH(fd);
}
break;
+
+ /* individual sc data insertion/update */
+ case 0x2740:
+ if( RFIFOREST(fd) < 28 )
+ return 0;
+ else {
+ int account_id = RFIFOL(fd, 2), char_id = RFIFOL(fd, 6),
+ val1 = RFIFOL(fd, 12), val2 = RFIFOL(fd, 16),
+ val3 = RFIFOL(fd, 20), val4 = RFIFOL(fd, 24);
+ short type = RFIFOW(fd, 10);
+
+ if( SQL_ERROR == SQL->Query(sql_handle, "REPLACE INTO `%s` (`account_id`,`char_id`,`type`,`tick`,`val1`,`val2`,`val3`,`val4`) VALUES ('%d','%d','%d',-1,'%d','%d','%d','%d')",
+ scdata_db, account_id, char_id, type, val1, val2, val3, val4) )
+ Sql_ShowDebug(sql_handle);
+
+ RFIFOSKIP(fd, 28);
+ }
+ break;
+
+ /* individual sc data delete */
+ case 0x2741:
+ if( RFIFOREST(fd) < 12 )
+ return 0;
+ else {
+ int account_id = RFIFOL(fd, 2), char_id = RFIFOL(fd, 6);
+ short type = RFIFOW(fd, 10);
+
+ if( SQL_ERROR == SQL->Query(sql_handle, "DELETE FROM `%s` WHERE `account_id` = '%d' AND `char_id` = '%d' AND `type` = '%d' LIMIT 1",
+ scdata_db, account_id, char_id, type) )
+ Sql_ShowDebug(sql_handle);
+
+ RFIFOSKIP(fd, 12);
+ }
+ break;
default: