summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
Diffstat (limited to 'src/char')
-rw-r--r--src/char/char.c34
-rw-r--r--src/char/char.h6
-rw-r--r--src/char/int_auction.h6
-rw-r--r--src/char/int_elemental.h6
-rw-r--r--src/char/int_guild.h6
-rw-r--r--src/char/int_homun.h6
-rw-r--r--src/char/int_mail.h6
-rw-r--r--src/char/int_mercenary.h6
-rw-r--r--src/char/int_party.h6
-rw-r--r--src/char/int_pet.h6
-rw-r--r--src/char/int_quest.h6
-rw-r--r--src/char/int_storage.h6
-rw-r--r--src/char/inter.h6
-rw-r--r--src/char/pincode.h6
14 files changed, 73 insertions, 39 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 4079e10bb..4ea1f8451 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -3718,6 +3718,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:
diff --git a/src/char/char.h b/src/char/char.h
index 1fb3b543f..372af91f7 100644
--- a/src/char/char.h
+++ b/src/char/char.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _CHAR_SQL_H_
-#define _CHAR_SQL_H_
+#ifndef _COMMON_CHAR_H_
+#define _COMMON_CHAR_H_
#include "../config/core.h"
#include "../common/core.h" // CORE_ST_LAST
@@ -122,4 +122,4 @@ void global_accreg_to_login_start (int account_id, int char_id);
void global_accreg_to_login_send (void);
void global_accreg_to_login_add (const char *key, unsigned int index, intptr_t val, bool is_string);
-#endif /* _CHAR_SQL_H_ */
+#endif /* _COMMON_CHAR_H_ */
diff --git a/src/char/int_auction.h b/src/char/int_auction.h
index bf26b152c..f10794f73 100644
--- a/src/char/int_auction.h
+++ b/src/char/int_auction.h
@@ -1,12 +1,12 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#ifndef _INT_AUCTION_SQL_H_
-#define _INT_AUCTION_SQL_H_
+#ifndef _CHAR_INT_AUCTION_H_
+#define _CHAR_INT_AUCTION_H_
int inter_auction_parse_frommap(int fd);
int inter_auction_sql_init(void);
void inter_auction_sql_final(void);
-#endif /* _INT_AUCTION_SQL_H_ */
+#endif /* _CHAR_INT_AUCTION_H_ */
diff --git a/src/char/int_elemental.h b/src/char/int_elemental.h
index 7eb5c2958..c90891fc4 100644
--- a/src/char/int_elemental.h
+++ b/src/char/int_elemental.h
@@ -1,8 +1,8 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#ifndef _INT_ELEMENTAL_SQL_H_
-#define _INT_ELEMENTAL_SQL_H_
+#ifndef _CHAR_INT_ELEMENTAL_H_
+#define _CHAR_INT_ELEMENTAL_H_
struct s_elemental;
@@ -12,4 +12,4 @@ int inter_elemental_parse_frommap(int fd);
bool mapif_elemental_delete(int ele_id);
-#endif /* _INT_ELEMENTAL_SQL_H_ */
+#endif /* _CHAR_INT_ELEMENTAL_H_ */
diff --git a/src/char/int_guild.h b/src/char/int_guild.h
index 47c42dcc5..4eb7d310b 100644
--- a/src/char/int_guild.h
+++ b/src/char/int_guild.h
@@ -1,8 +1,8 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#ifndef _INT_GUILD_SQL_H_
-#define _INT_GUILD_SQL_H_
+#ifndef _CHAR_INT_GUILD_H_
+#define _CHAR_INT_GUILD_H_
enum {
GS_BASIC = 0x0001,
@@ -34,4 +34,4 @@ int inter_guild_charname_changed(int guild_id,int account_id, int char_id, char
int inter_guild_CharOnline(int char_id, int guild_id);
int inter_guild_CharOffline(int char_id, int guild_id);
-#endif /* _INT_GUILD_SQL_H_ */
+#endif /* _CHAR_INT_GUILD_H_ */
diff --git a/src/char/int_homun.h b/src/char/int_homun.h
index 1c0d76269..561dc848f 100644
--- a/src/char/int_homun.h
+++ b/src/char/int_homun.h
@@ -1,8 +1,8 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#ifndef _INT_HOMUN_SQL_H_
-#define _INT_HOMUN_SQL_H_
+#ifndef _CHAR_INT_HOMUN_H_
+#define _CHAR_INT_HOMUN_H_
struct s_homunculus;
@@ -15,4 +15,4 @@ bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd);
bool mapif_homunculus_delete(int homun_id);
bool mapif_homunculus_rename(char *name);
-#endif /* _INT_HOMUN_SQL_H_ */
+#endif /* _CHAR_INT_HOMUN_H_ */
diff --git a/src/char/int_mail.h b/src/char/int_mail.h
index 77db51e5b..7c06cdc1f 100644
--- a/src/char/int_mail.h
+++ b/src/char/int_mail.h
@@ -1,8 +1,8 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#ifndef _INT_MAIL_SQL_H_
-#define _INT_MAIL_SQL_H_
+#ifndef _CHAR_INT_MAIL_H_
+#define _CHAR_INT_MAIL_H_
int inter_mail_parse_frommap(int fd);
void mail_sendmail(int send_id, const char* send_name, int dest_id, const char* dest_name, const char* title, const char* body, int zeny, struct item *item);
@@ -13,4 +13,4 @@ void inter_mail_sql_final(void);
int mail_savemessage(struct mail_message* msg);
void mapif_Mail_new(struct mail_message *msg);
-#endif /* _INT_MAIL_SQL_H_ */
+#endif /* _CHAR_INT_MAIL_H_ */
diff --git a/src/char/int_mercenary.h b/src/char/int_mercenary.h
index 01e4a841f..b614b8cf7 100644
--- a/src/char/int_mercenary.h
+++ b/src/char/int_mercenary.h
@@ -1,8 +1,8 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#ifndef _INT_MERCENARY_SQL_H_
-#define _INT_MERCENARY_SQL_H_
+#ifndef _CHAR_INT_MERCENARY_H_
+#define _CHAR_INT_MERCENARY_H_
struct s_mercenary;
@@ -17,4 +17,4 @@ bool mercenary_owner_delete(int char_id);
bool mapif_mercenary_delete(int merc_id);
-#endif /* _INT_MERCENARY_SQL_H_ */
+#endif /* _CHAR_INT_MERCENARY_H_ */
diff --git a/src/char/int_party.h b/src/char/int_party.h
index d8cdcdc6a..84f00635a 100644
--- a/src/char/int_party.h
+++ b/src/char/int_party.h
@@ -1,8 +1,8 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#ifndef _INT_PARTY_SQL_H_
-#define _INT_PARTY_SQL_H_
+#ifndef _CHAR_INT_PARTY_H_
+#define _CHAR_INT_PARTY_H_
//Party Flags on what to save/delete.
enum {
@@ -23,4 +23,4 @@ int inter_party_leave(int party_id,int account_id, int char_id);
int inter_party_CharOnline(int char_id, int party_id);
int inter_party_CharOffline(int char_id, int party_id);
-#endif /* _INT_PARTY_SQL_H_ */
+#endif /* _CHAR_INT_PARTY_H_ */
diff --git a/src/char/int_pet.h b/src/char/int_pet.h
index 733468c77..a16cb7a37 100644
--- a/src/char/int_pet.h
+++ b/src/char/int_pet.h
@@ -1,8 +1,8 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#ifndef _INT_PET_SQL_H_
-#define _INT_PET_SQL_H_
+#ifndef _CHAR_INT_PET_H_
+#define _CHAR_INT_PET_H_
struct s_pet;
@@ -18,4 +18,4 @@ int inter_pet_sql_init(void);
//Exported for use in the TXT-SQL converter.
int inter_pet_tosql(int pet_id, struct s_pet *p);
-#endif /* _INT_PET_SQL_H_ */
+#endif /* _CHAR_INT_PET_H_ */
diff --git a/src/char/int_quest.h b/src/char/int_quest.h
index b0403f436..6267c74ad 100644
--- a/src/char/int_quest.h
+++ b/src/char/int_quest.h
@@ -1,10 +1,10 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#ifndef _QUEST_H_
-#define _QUEST_H_
+#ifndef _CHAR_QUEST_H_
+#define _CHAR_QUEST_H_
int inter_quest_parse_frommap(int fd);
-#endif
+#endif /* _CHAR_QUEST_H_ */
diff --git a/src/char/int_storage.h b/src/char/int_storage.h
index 811608f82..1693499a5 100644
--- a/src/char/int_storage.h
+++ b/src/char/int_storage.h
@@ -1,8 +1,8 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#ifndef _INT_STORAGE_SQL_H_
-#define _INT_STORAGE_SQL_H_
+#ifndef _CHAR_INT_STORAGE_H_
+#define _CHAR_INT_STORAGE_H_
struct storage_data;
struct guild_storage;
@@ -19,4 +19,4 @@ int storage_fromsql(int account_id, struct storage_data* p);
int storage_tosql(int account_id,struct storage_data *p);
int guild_storage_tosql(int guild_id, struct guild_storage *p);
-#endif /* _INT_STORAGE_SQL_H_ */
+#endif /* _CHAR_INT_STORAGE_H_ */
diff --git a/src/char/inter.h b/src/char/inter.h
index aa47496a1..b484a1610 100644
--- a/src/char/inter.h
+++ b/src/char/inter.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _INTER_SQL_H_
-#define _INTER_SQL_H_
+#ifndef _CHAR_INTER_H_
+#define _CHAR_INTER_H_
struct accreg;
#include "../common/sql.h"
@@ -42,4 +42,4 @@ uint64 inter_chk_lastuid(int8 flag, uint64 value);
#define updateLastUid(val_)
#endif
-#endif /* _INTER_SQL_H_ */
+#endif /* _CHAR_INTER_H_ */
diff --git a/src/char/pincode.h b/src/char/pincode.h
index a17f70de5..3b71eec7c 100644
--- a/src/char/pincode.h
+++ b/src/char/pincode.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _PINCODE_H_
-#define _PINCODE_H_
+#ifndef _CHAR_PINCODE_H_
+#define _CHAR_PINCODE_H_
#include "char.h"
@@ -40,4 +40,4 @@ struct pincode_interface *pincode;
void pincode_defaults(void);
-#endif /* _PINCODE_H_ */
+#endif /* _CHAR_PINCODE_H_ */