summaryrefslogtreecommitdiff
path: root/src/map/intif.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-13 16:14:32 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-13 16:14:32 +0000
commitfb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63 (patch)
tree52b66f102c20e6b47e060efe0e7ceabd36d5aa29 /src/map/intif.c
parent2e7ba13554118cdc78c9bfa5a6f0e5e8e58baf7b (diff)
downloadhercules-fb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63.tar.gz
hercules-fb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63.tar.bz2
hercules-fb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63.tar.xz
hercules-fb45ace1b19f98add7e1d0a0fc6fe45bc1ebac63.zip
Modified storage data loading
* storage is now loaded/saved along with character status * as a consequence, a lot of storage handling code was removed * there is no more locking done within storage data * mapservers no longer cache the data (solves muiltimapserver exploit) * loading storage on char select may decrease charserver performance git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12950 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/intif.c')
-rw-r--r--src/map/intif.c77
1 files changed, 1 insertions, 76 deletions
diff --git a/src/map/intif.c b/src/map/intif.c
index 705171f7f..7b79fe452 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -32,7 +32,7 @@
static const int packet_len_table[]={
-1,-1,27,-1, -1, 0,37, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3800-0x380f
- -1, 7, 0, 0, 0, 0, 0, 0, -1,11, 0, 0, 0, 0, 0, 0, //0x3810
+ 0, 0, 0, 0, 0, 0, 0, 0, -1,11, 0, 0, 0, 0, 0, 0, //0x3810
39,-1,15,15, 14,19, 7,-1, 0, 0, 0, 0, 0, 0, 0, 0, //0x3820
10,-1,15, 0, 79,19, 7,-1, 0,-1,-1,-1, 14,67,186,-1, //0x3830
9, 9,-1,14, 0, 0, 0, 0, -1,74,-1,11, 11,-1, 0, 0, //0x3840
@@ -326,32 +326,6 @@ int intif_request_registry(struct map_session_data *sd, int flag)
return 0;
}
-// 倉庫データ要求
-int intif_request_storage(int account_id)
-{
- if (CheckForCharServer())
- return 0;
- WFIFOHEAD(inter_fd,6);
- WFIFOW(inter_fd,0) = 0x3010;
- WFIFOL(inter_fd,2) = account_id;
- WFIFOSET(inter_fd,6);
- return 0;
-}
-// 倉庫データ送信
-int intif_send_storage(struct storage_data *stor)
-{
- if (CheckForCharServer())
- return 0;
- nullpo_retr(0, stor);
- WFIFOHEAD(inter_fd,sizeof(struct storage_data)+8);
- WFIFOW(inter_fd,0) = 0x3011;
- WFIFOW(inter_fd,2) = sizeof(struct storage_data)+8;
- WFIFOL(inter_fd,4) = stor->account_id;
- memcpy( WFIFOP(inter_fd,8),stor, sizeof(struct storage_data) );
- WFIFOSET(inter_fd,WFIFOW(inter_fd,2));
- return 0;
-}
-
int intif_request_guild_storage(int account_id,int guild_id)
{
if (CheckForCharServer())
@@ -968,53 +942,6 @@ int intif_parse_Registers(int fd)
return 1;
}
-// 倉庫データ受信
-int intif_parse_LoadStorage(int fd)
-{
- struct storage_data *stor;
- struct map_session_data *sd;
-
- sd=map_id2sd( RFIFOL(fd,4) );
- if(sd==NULL){
- ShowError("intif_parse_LoadStorage: user not found %d\n",RFIFOL(fd,4));
- return 1;
- }
-
- stor = account2storage( RFIFOL(fd,4));
-
- if (stor->storage_status == 1) { // Already open.. lets ignore this update
- ShowWarning("intif_parse_LoadStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
- return 1;
- }
- if (stor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
- ShowWarning("intif_parse_LoadStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
- return 1;
- }
- if (RFIFOW(fd,2)-8 != sizeof(struct storage_data)) {
- ShowError("intif_parse_LoadStorage: data size error %d %d\n", RFIFOW(fd,2)-8, sizeof(struct storage_data));
- return 1;
- }
- if(battle_config.save_log)
- ShowInfo("intif_openstorage: %d\n",RFIFOL(fd,4) );
- memcpy(stor,RFIFOP(fd,8),sizeof(struct storage_data));
- stor->dirty=0;
- stor->storage_status=1;
- sd->state.storage_flag = 1;
- clif_storagelist(sd,stor);
- clif_updatestorageamount(sd,stor->storage_amount);
-
- return 0;
-}
-
-// 倉庫データ送信成功
-int intif_parse_SaveStorage(int fd)
-{
- if(battle_config.save_log)
- ShowInfo("intif_savestorage: done %d %d\n",RFIFOL(fd,2),RFIFOB(fd,6) );
- storage_storage_saved(RFIFOL(fd,2));
- return 0;
-}
-
int intif_parse_LoadGuildStorage(int fd)
{
struct guild_storage *gstor;
@@ -1988,8 +1915,6 @@ int intif_parse(int fd)
case 0x3803: mapif_parse_WisToGM(fd); break;
case 0x3804: intif_parse_Registers(fd); break;
case 0x3806: intif_parse_ChangeNameOk(fd); break;
- case 0x3810: intif_parse_LoadStorage(fd); break;
- case 0x3811: intif_parse_SaveStorage(fd); break;
case 0x3818: intif_parse_LoadGuildStorage(fd); break;
case 0x3819: intif_parse_SaveGuildStorage(fd); break;
case 0x3820: intif_parse_PartyCreated(fd); break;