summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-04-01 22:35:32 -0300
committershennetsind <ind@henn.et>2013-04-01 22:35:32 -0300
commitc2d78c0b9e152190d3e1703fce01e02fd7cc6d34 (patch)
treef0f229e215cfb1044160cbc56c518c3cde92c831 /src/map/chrif.c
parenta4e273d9bed24286002bed8f2909f0ff1b5c4f91 (diff)
downloadhercules-c2d78c0b9e152190d3e1703fce01e02fd7cc6d34.tar.gz
hercules-c2d78c0b9e152190d3e1703fce01e02fd7cc6d34.tar.bz2
hercules-c2d78c0b9e152190d3e1703fce01e02fd7cc6d34.tar.xz
hercules-c2d78c0b9e152190d3e1703fce01e02fd7cc6d34.zip
Introducing socket_datasync
a user-friendly way to notify users when their servers are out of sync, e.g. http://hercules.ws/board/topic/328-intif-guild-data-size-error/ http://hercules.ws/board/topic/315-error-chrif-authok-data-size-mismatch-52224-52228/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r--src/map/chrif.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 3672aa52f..b816ca4b5 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -42,7 +42,7 @@ static DBMap* auth_db; // int id -> struct auth_node*
static const int packet_len_table[0x3d] = { // U - used, F - free
60, 3,-1,27,10,-1, 6,-1, // 2af8-2aff: U->2af8, U->2af9, U->2afa, U->2afb, U->2afc, U->2afd, U->2afe, U->2aff
6,-1,18, 7,-1,39,30, 10, // 2b00-2b07: U->2b00, U->2b01, U->2b02, U->2b03, U->2b04, U->2b05, U->2b06, U->2b07
- 6,30, 0, 0,86, 7,44,34, // 2b08-2b0f: U->2b08, U->2b09, F->2b0a, F->2b0b, U->2b0c, U->2b0d, U->2b0e, U->2b0f
+ 6,30, -1, 0,86, 7,44,34, // 2b08-2b0f: U->2b08, U->2b09, U->2b0a, F->2b0b, U->2b0c, U->2b0d, U->2b0e, U->2b0f
11,10,10, 0,11, 0,266,10, // 2b10-2b17: U->2b10, U->2b11, U->2b12, F->2b13, U->2b14, F->2b15, U->2b16, U->2b17
2,10, 2,-1,-1,-1, 2, 7, // 2b18-2b1f: U->2b18, U->2b19, U->2b1a, U->2b1b, U->2b1c, U->2b1d, U->2b1e, U->2b1f
-1,10, 8, 2, 2,14,19,19, // 2b20-2b27: U->2b20, U->2b21, U->2b22, U->2b23, U->2b24, U->2b25, U->2b26, U->2b27
@@ -67,7 +67,7 @@ static const int packet_len_table[0x3d] = { // U - used, F - free
//2b07: Outgoing, chrif_removefriend -> 'Tell charserver to remove friend_id from char_id friend list'
//2b08: Outgoing, chrif_searchcharid -> '...'
//2b09: Incoming, map_addchariddb -> 'Adds a name to the nick db'
-//2b0a: FREE
+//2b0a: Incoming/Outgoing, socket_datasync()
//2b0b: FREE
//2b0c: Outgoing, chrif_changeemail -> 'change mail address ...'
//2b0d: Incoming, chrif_changedsex -> 'Change sex of acc XY'
@@ -468,6 +468,8 @@ int chrif_connectack(int fd) {
ShowStatus("Event '"CL_WHITE"OnInterIfInitOnce"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n", npc_event_doall("OnInterIfInitOnce"));
guild_castle_map_init();
}
+
+ socket_datasync(fd, true);
return 0;
}
@@ -1429,6 +1431,7 @@ int chrif_parse(int fd) {
case 0x2b04: chrif_recvmap(fd); break;
case 0x2b06: chrif_changemapserverack(RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOL(fd,14), RFIFOW(fd,18), RFIFOW(fd,20), RFIFOW(fd,22), RFIFOL(fd,24), RFIFOW(fd,28)); break;
case 0x2b09: map_addnickdb(RFIFOL(fd,2), (char*)RFIFOP(fd,6)); break;
+ case 0x2b0a: socket_datasync(fd, false); break;
case 0x2b0d: chrif_changedsex(fd); break;
case 0x2b0f: chrif_char_ask_name_answer(RFIFOL(fd,2), (char*)RFIFOP(fd,6), RFIFOW(fd,30), RFIFOW(fd,32)); break;
case 0x2b12: chrif_divorceack(RFIFOL(fd,2), RFIFOL(fd,6)); break;