|
@@ -37,7 +37,7 @@ static const int packet_len_table[0x3d] = {
|
|
6,30,-1,10,86, 7,44,34, // 2b08-2b0f: U->2b08, U->2b09, U->2b0a, U->2b0b, U->2b0c, U->2b0d, U->2b0e, U->2b0f
|
|
6,30,-1,10,86, 7,44,34, // 2b08-2b0f: U->2b08, U->2b09, U->2b0a, U->2b0b, U->2b0c, U->2b0d, U->2b0e, U->2b0f
|
|
0,-1,10, 6,11,-1, 0, 0, // 2b10-2b17: U->2b10, U->2b11, U->2b12, U->2b13, U->2b14, U->2b15, U->2b16, U->2b17
|
|
0,-1,10, 6,11,-1, 0, 0, // 2b10-2b17: U->2b10, U->2b11, U->2b12, U->2b13, U->2b14, U->2b15, U->2b16, U->2b17
|
|
-1,-1,-1,-1,-1,-1, 2, 7, // 2b18-2b1f: U->2b18, U->2b19, U->2b1a, U->2b1b, U->2b1c, U->2b1d, U->2b1e, U->2b1f
|
|
-1,-1,-1,-1,-1,-1, 2, 7, // 2b18-2b1f: U->2b18, U->2b19, U->2b1a, U->2b1b, U->2b1c, U->2b1d, U->2b1e, U->2b1f
|
|
- -1,-1,-1,-1,-1,-1,-1,-1, // 2b20-2b27: U->2b20, F->2b21, F->2b22, F->2b23, F->2b24, F->2b25, F->2b26, F->2b27
|
|
|
|
|
|
+ -1,10,-1,-1,-1,-1,-1,-1, // 2b20-2b27: U->2b20, U->2b21, F->2b22, F->2b23, F->2b24, F->2b25, F->2b26, F->2b27
|
|
};
|
|
};
|
|
|
|
|
|
//Used Packets:
|
|
//Used Packets:
|
|
@@ -82,7 +82,8 @@ static const int packet_len_table[0x3d] = {
|
|
//2b1e: Incoming, chrif_update_ip -> 'Reqest forwarded from char-server for interserver IP sync.' [Lance]
|
|
//2b1e: Incoming, chrif_update_ip -> 'Reqest forwarded from char-server for interserver IP sync.' [Lance]
|
|
//2b1f: Incomming, chrif_disconnectplayer -> 'disconnects a player (aid X) with the message XY ... 0x81 ..' [Sirius]
|
|
//2b1f: Incomming, chrif_disconnectplayer -> 'disconnects a player (aid X) with the message XY ... 0x81 ..' [Sirius]
|
|
//2b20: Incomming, chrif_removemap -> 'remove maps of a server (sample: its going offline)' [Sirius]
|
|
//2b20: Incomming, chrif_removemap -> 'remove maps of a server (sample: its going offline)' [Sirius]
|
|
-//2b21-2b27: FREE
|
|
|
|
|
|
+//2b21: Incomming, chrif_save_ack. Returned after a character has been "final saved" on the char-server. [Skotlex]
|
|
|
|
+//2b22-2b27: FREE
|
|
|
|
|
|
int chrif_connected;
|
|
int chrif_connected;
|
|
int char_fd = 0; //Using 0 instead of -1 is safer against crashes. [Skotlex]
|
|
int char_fd = 0; //Using 0 instead of -1 is safer against crashes. [Skotlex]
|
|
@@ -183,8 +184,13 @@ int chrif_isconnect(void)
|
|
int chrif_save(struct map_session_data *sd, int flag)
|
|
int chrif_save(struct map_session_data *sd, int flag)
|
|
{
|
|
{
|
|
nullpo_retr(-1, sd);
|
|
nullpo_retr(-1, sd);
|
|
- chrif_check(-1);
|
|
|
|
|
|
+
|
|
pc_makesavestatus(sd);
|
|
pc_makesavestatus(sd);
|
|
|
|
+ if(!chrif_isconnect())
|
|
|
|
+ {
|
|
|
|
+ if (flag) sd->state.finalsave = 1; //Will save character on reconnect.
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
|
|
if (sd->state.finalsave)
|
|
if (sd->state.finalsave)
|
|
return -1; //Refuse to save a char already tagged for final saving. [Skotlex]
|
|
return -1; //Refuse to save a char already tagged for final saving. [Skotlex]
|
|
@@ -193,6 +199,7 @@ int chrif_save(struct map_session_data *sd, int flag)
|
|
storage_storage_save(sd->status.account_id, flag);
|
|
storage_storage_save(sd->status.account_id, flag);
|
|
else if (sd->state.storage_flag == 2)
|
|
else if (sd->state.storage_flag == 2)
|
|
storage_guild_storagesave(sd->status.account_id, sd->status.guild_id, flag);
|
|
storage_guild_storagesave(sd->status.account_id, sd->status.guild_id, flag);
|
|
|
|
+ if (flag) sd->state.storage_flag = 0; //Force close it.
|
|
|
|
|
|
//Saving of registry values.
|
|
//Saving of registry values.
|
|
if (sd->state.reg_dirty&4)
|
|
if (sd->state.reg_dirty&4)
|
|
@@ -306,6 +313,14 @@ int chrif_removemap(int fd){
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+int chrif_save_ack(int fd) {
|
|
|
|
+ int aid = RFIFOL(fd,2), cid = RFIFOL(fd,6);
|
|
|
|
+ struct map_session_data *sd = map_id2sd(aid);
|
|
|
|
+ if (sd && sd->status.char_id == cid)
|
|
|
|
+ map_quit_ack(sd);
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
/*==========================================
|
|
/*==========================================
|
|
* マップ鯖間移動のためのデータ準備要求
|
|
* マップ鯖間移動のためのデータ準備要求
|
|
*------------------------------------------
|
|
*------------------------------------------
|
|
@@ -416,6 +431,7 @@ int chrif_sendmapack(int fd)
|
|
send_users_tochar(-1, gettick(), 0, 0);
|
|
send_users_tochar(-1, gettick(), 0, 0);
|
|
|
|
|
|
//Re-save any storages that were modified in the disconnection time. [Skotlex]
|
|
//Re-save any storages that were modified in the disconnection time. [Skotlex]
|
|
|
|
+ do_reconnect_map();
|
|
do_reconnect_storage();
|
|
do_reconnect_storage();
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
@@ -1493,7 +1509,8 @@ int chrif_parse(int fd)
|
|
case 0x2b1d: chrif_load_scdata(fd); break;
|
|
case 0x2b1d: chrif_load_scdata(fd); break;
|
|
case 0x2b1e: chrif_update_ip(fd); break;
|
|
case 0x2b1e: chrif_update_ip(fd); break;
|
|
case 0x2b1f: chrif_disconnectplayer(fd); break;
|
|
case 0x2b1f: chrif_disconnectplayer(fd); break;
|
|
- case 0x2b20: chrif_removemap(fd); break; //Remove maps of a server [Sirius]
|
|
|
|
|
|
+ case 0x2b20: chrif_removemap(fd); break;
|
|
|
|
+ case 0x2b21: chrif_save_ack(fd); break;
|
|
|
|
|
|
default:
|
|
default:
|
|
if (battle_config.error_log)
|
|
if (battle_config.error_log)
|