|
@@ -35,22 +35,22 @@ using namespace rathena;
|
|
|
|
|
|
static const char dataToHex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
|
|
|
|
|
|
-// int guild_id -> CharGuild*
|
|
|
+// int32 guild_id -> CharGuild*
|
|
|
static std::unordered_map<int32, std::shared_ptr<CharGuild>> guild_db;
|
|
|
static std::unordered_map<int32, std::shared_ptr<struct guild_castle>> castle_db;
|
|
|
|
|
|
-int mapif_parse_GuildLeave(int fd,int guild_id,uint32 account_id,uint32 char_id,int flag,const char *mes);
|
|
|
-int mapif_guild_broken(int guild_id,int flag);
|
|
|
+int32 mapif_parse_GuildLeave(int32 fd,int32 guild_id,uint32 account_id,uint32 char_id,int32 flag,const char *mes);
|
|
|
+int32 mapif_guild_broken(int32 guild_id,int32 flag);
|
|
|
bool guild_check_empty( std::shared_ptr<CharGuild> g );
|
|
|
-int guild_calcinfo( std::shared_ptr<CharGuild> g );
|
|
|
-int mapif_guild_basicinfochanged(int guild_id,int type,const void *data,int len);
|
|
|
-int mapif_guild_info( int fd, const struct mmo_guild &g );
|
|
|
-int inter_guild_tosql( mmo_guild &g, int flag );
|
|
|
-int guild_checkskill( std::shared_ptr<CharGuild> g, int id );
|
|
|
+int32 guild_calcinfo( std::shared_ptr<CharGuild> g );
|
|
|
+int32 mapif_guild_basicinfochanged(int32 guild_id,int32 type,const void *data,int32 len);
|
|
|
+int32 mapif_guild_info( int32 fd, const struct mmo_guild &g );
|
|
|
+int32 inter_guild_tosql( mmo_guild &g, int32 flag );
|
|
|
+int32 guild_checkskill( std::shared_ptr<CharGuild> g, int32 id );
|
|
|
|
|
|
TIMER_FUNC(guild_save_timer){
|
|
|
- static int last_id = 0; //To know in which guild we were.
|
|
|
- int state = 0; //0: Have not reached last guild. 1: Reached last guild, ready for save. 2: Some guild saved, don't do further saving.
|
|
|
+ static int32 last_id = 0; //To know in which guild we were.
|
|
|
+ int32 state = 0; //0: Have not reached last guild. 1: Reached last guild, ready for save. 2: Some guild saved, don't do further saving.
|
|
|
|
|
|
if( last_id == 0 ) //Save the first guild in the list.
|
|
|
state = 1;
|
|
@@ -91,7 +91,7 @@ TIMER_FUNC(guild_save_timer){
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int inter_guild_removemember_tosql(uint32 char_id)
|
|
|
+int32 inter_guild_removemember_tosql(uint32 char_id)
|
|
|
{
|
|
|
if( SQL_ERROR == Sql_Query(sql_handle, "DELETE from `%s` where `char_id` = '%d'", schema_config.guild_member_db, char_id) )
|
|
|
Sql_ShowDebug(sql_handle);
|
|
@@ -101,7 +101,7 @@ int inter_guild_removemember_tosql(uint32 char_id)
|
|
|
}
|
|
|
|
|
|
// Save mmo_guild into sql
|
|
|
-int inter_guild_tosql( mmo_guild &g, int flag ){
|
|
|
+int32 inter_guild_tosql( mmo_guild &g, int32 flag ){
|
|
|
// Table guild (GS_BASIC_MASK)
|
|
|
// GS_EMBLEM `emblem_len`,`emblem_id`,`emblem_data`
|
|
|
// GS_CONNECT `connect_member`,`average_lv`
|
|
@@ -121,7 +121,7 @@ int inter_guild_tosql( mmo_guild &g, int flag ){
|
|
|
char esc_name[NAME_LENGTH*2+1];
|
|
|
char esc_master[NAME_LENGTH*2+1];
|
|
|
char new_guild = 0;
|
|
|
- int i=0;
|
|
|
+ int32 i=0;
|
|
|
|
|
|
if (g.guild_id<=0 && g.guild_id != -1) return 0;
|
|
|
|
|
@@ -337,7 +337,7 @@ std::shared_ptr<CharGuild> inter_guild_fromsql( int32 guild_id ){
|
|
|
char* data;
|
|
|
size_t len;
|
|
|
char* p;
|
|
|
- int i;
|
|
|
+ int32 i;
|
|
|
|
|
|
if( guild_id <= 0 ){
|
|
|
return nullptr;
|
|
@@ -458,7 +458,7 @@ std::shared_ptr<CharGuild> inter_guild_fromsql( int32 guild_id ){
|
|
|
}
|
|
|
while( SQL_SUCCESS == Sql_NextRow(sql_handle) )
|
|
|
{
|
|
|
- int position;
|
|
|
+ int32 position;
|
|
|
struct guild_position* gpos;
|
|
|
|
|
|
Sql_GetData(sql_handle, 0, &data, nullptr); position = atoi(data);
|
|
@@ -516,7 +516,7 @@ std::shared_ptr<CharGuild> inter_guild_fromsql( int32 guild_id ){
|
|
|
|
|
|
while( SQL_SUCCESS == Sql_NextRow(sql_handle) )
|
|
|
{
|
|
|
- int id;
|
|
|
+ int32 id;
|
|
|
Sql_GetData(sql_handle, 0, &data, nullptr); id = atoi(data) - GD_SKILLBASE;
|
|
|
if( id < 0 || id >= MAX_GUILDSKILL )
|
|
|
continue;// invalid guild skill
|
|
@@ -541,7 +541,7 @@ std::shared_ptr<CharGuild> inter_guild_fromsql( int32 guild_id ){
|
|
|
* @param guild_id: Guild ID to search
|
|
|
* @return Guild storage max size
|
|
|
*/
|
|
|
-uint16 inter_guild_storagemax(int guild_id)
|
|
|
+uint16 inter_guild_storagemax(int32 guild_id)
|
|
|
{
|
|
|
#ifdef OFFICIAL_GUILD_STORAGE
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
@@ -563,9 +563,9 @@ uint16 inter_guild_storagemax(int guild_id)
|
|
|
}
|
|
|
|
|
|
// `guild_castle` (`castle_id`, `guild_id`, `economy`, `defense`, `triggerE`, `triggerD`, `nextTime`, `payTime`, `createTime`, `visibleC`, `visibleG0`, `visibleG1`, `visibleG2`, `visibleG3`, `visibleG4`, `visibleG5`, `visibleG6`, `visibleG7`)
|
|
|
-int inter_guildcastle_tosql( std::shared_ptr<struct guild_castle> gc ){
|
|
|
+int32 inter_guildcastle_tosql( std::shared_ptr<struct guild_castle> gc ){
|
|
|
StringBuf buf;
|
|
|
- int i;
|
|
|
+ int32 i;
|
|
|
|
|
|
StringBuf_Init(&buf);
|
|
|
StringBuf_Printf(&buf, "REPLACE INTO `%s` SET `castle_id`='%d', `guild_id`='%d', `economy`='%d', `defense`='%d', "
|
|
@@ -585,9 +585,9 @@ int inter_guildcastle_tosql( std::shared_ptr<struct guild_castle> gc ){
|
|
|
}
|
|
|
|
|
|
// Read guild_castle from SQL
|
|
|
-std::shared_ptr<struct guild_castle> inter_guildcastle_fromsql( int castle_id ){
|
|
|
+std::shared_ptr<struct guild_castle> inter_guildcastle_fromsql( int32 castle_id ){
|
|
|
char *data;
|
|
|
- int i;
|
|
|
+ int32 i;
|
|
|
StringBuf buf;
|
|
|
|
|
|
std::shared_ptr<struct guild_castle> gc = util::umap_find( castle_db, castle_id );
|
|
@@ -638,9 +638,9 @@ std::shared_ptr<struct guild_castle> inter_guildcastle_fromsql( int castle_id ){
|
|
|
}
|
|
|
|
|
|
|
|
|
-int inter_guild_CharOnline(uint32 char_id, int guild_id)
|
|
|
+int32 inter_guild_CharOnline(uint32 char_id, int32 guild_id)
|
|
|
{
|
|
|
- int i;
|
|
|
+ int32 i;
|
|
|
|
|
|
if (guild_id == -1) {
|
|
|
//Get guild_id from the database
|
|
@@ -688,9 +688,9 @@ int inter_guild_CharOnline(uint32 char_id, int guild_id)
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
-int inter_guild_CharOffline(uint32 char_id, int guild_id)
|
|
|
+int32 inter_guild_CharOffline(uint32 char_id, int32 guild_id)
|
|
|
{
|
|
|
- int online_count, i;
|
|
|
+ int32 online_count, i;
|
|
|
|
|
|
if (guild_id == -1)
|
|
|
{
|
|
@@ -824,9 +824,9 @@ void inter_guild_sql_final(void)
|
|
|
}
|
|
|
|
|
|
// Get guild_id by its name. Returns 0 if not found, -1 on error.
|
|
|
-int search_guildname(char *str)
|
|
|
+int32 search_guildname(char *str)
|
|
|
{
|
|
|
- int guild_id;
|
|
|
+ int32 guild_id;
|
|
|
char esc_name[NAME_LENGTH*2+1];
|
|
|
|
|
|
Sql_EscapeStringLen(sql_handle, esc_name, str, safestrnlen(str, NAME_LENGTH));
|
|
@@ -854,7 +854,7 @@ int search_guildname(char *str)
|
|
|
|
|
|
// Check if guild is empty
|
|
|
bool guild_check_empty( std::shared_ptr<CharGuild> g ){
|
|
|
- int i;
|
|
|
+ int32 i;
|
|
|
ARR_FIND( 0, g->guild.max_member, i, g->guild.member[i].account_id > 0 );
|
|
|
//Let the calling function handle the guild removal in case they need
|
|
|
//to do something else with it before freeing the data. [Skotlex]
|
|
@@ -867,13 +867,13 @@ t_exp GuildExpDatabase::get_nextexp(uint16 level) {
|
|
|
return ((guild_exp == nullptr) ? 0 : guild_exp->exp);
|
|
|
}
|
|
|
|
|
|
-int guild_checkskill( std::shared_ptr<CharGuild> g, int id ){
|
|
|
- int idx = id - GD_SKILLBASE;
|
|
|
+int32 guild_checkskill( std::shared_ptr<CharGuild> g, int32 id ){
|
|
|
+ int32 idx = id - GD_SKILLBASE;
|
|
|
return idx < 0 || idx >= MAX_GUILDSKILL ? 0 : g->guild.skill[idx].lv;
|
|
|
}
|
|
|
|
|
|
-int guild_calcinfo( std::shared_ptr<CharGuild> g ){
|
|
|
- int i,c;
|
|
|
+int32 guild_calcinfo( std::shared_ptr<CharGuild> g ){
|
|
|
+ int32 i,c;
|
|
|
struct mmo_guild before = g->guild; // Save guild current values
|
|
|
|
|
|
if(g->guild.guild_lv<=0)
|
|
@@ -934,7 +934,7 @@ int guild_calcinfo( std::shared_ptr<CharGuild> g ){
|
|
|
//-------------------------------------------------------------------
|
|
|
// Packet sent to map server
|
|
|
|
|
|
-int mapif_guild_created( int fd, uint32 account_id, struct mmo_guild *g ){
|
|
|
+int32 mapif_guild_created( int32 fd, uint32 account_id, struct mmo_guild *g ){
|
|
|
WFIFOHEAD(fd, 10);
|
|
|
WFIFOW(fd,0)=0x3830;
|
|
|
WFIFOL(fd,2)=account_id;
|
|
@@ -950,7 +950,7 @@ int mapif_guild_created( int fd, uint32 account_id, struct mmo_guild *g ){
|
|
|
}
|
|
|
|
|
|
// Guild not found
|
|
|
-int mapif_guild_noinfo(int fd,int guild_id)
|
|
|
+int32 mapif_guild_noinfo(int32 fd,int32 guild_id)
|
|
|
{
|
|
|
unsigned char buf[12];
|
|
|
WBUFW(buf,0)=0x3831;
|
|
@@ -965,7 +965,7 @@ int mapif_guild_noinfo(int fd,int guild_id)
|
|
|
}
|
|
|
|
|
|
// Send guild info
|
|
|
-int mapif_guild_info( int fd, const struct mmo_guild &g ){
|
|
|
+int32 mapif_guild_info( int32 fd, const struct mmo_guild &g ){
|
|
|
unsigned char buf[8+sizeof(struct mmo_guild)];
|
|
|
WBUFW(buf,0)=0x3831;
|
|
|
WBUFW(buf,2)=4+sizeof(struct mmo_guild);
|
|
@@ -978,7 +978,7 @@ int mapif_guild_info( int fd, const struct mmo_guild &g ){
|
|
|
}
|
|
|
|
|
|
// ACK member add
|
|
|
-int mapif_guild_memberadded(int fd,int guild_id,uint32 account_id,uint32 char_id,int flag)
|
|
|
+int32 mapif_guild_memberadded(int32 fd,int32 guild_id,uint32 account_id,uint32 char_id,int32 flag)
|
|
|
{
|
|
|
WFIFOHEAD(fd, 15);
|
|
|
WFIFOW(fd,0)=0x3832;
|
|
@@ -991,7 +991,7 @@ int mapif_guild_memberadded(int fd,int guild_id,uint32 account_id,uint32 char_id
|
|
|
}
|
|
|
|
|
|
// ACK member leave
|
|
|
-int mapif_guild_withdraw(int guild_id,uint32 account_id,uint32 char_id,int flag, const char *name, const char *mes)
|
|
|
+int32 mapif_guild_withdraw(int32 guild_id,uint32 account_id,uint32 char_id,int32 flag, const char *name, const char *mes)
|
|
|
{
|
|
|
unsigned char buf[55+NAME_LENGTH];
|
|
|
WBUFW(buf, 0)=0x3834;
|
|
@@ -1007,7 +1007,7 @@ int mapif_guild_withdraw(int guild_id,uint32 account_id,uint32 char_id,int flag,
|
|
|
}
|
|
|
|
|
|
// Send short member's info
|
|
|
-int mapif_guild_memberinfoshort( const struct mmo_guild &g, int idx ){
|
|
|
+int32 mapif_guild_memberinfoshort( const struct mmo_guild &g, int32 idx ){
|
|
|
unsigned char buf[19];
|
|
|
WBUFW(buf, 0)=0x3835;
|
|
|
WBUFL(buf, 2)=g.guild_id;
|
|
@@ -1021,7 +1021,7 @@ int mapif_guild_memberinfoshort( const struct mmo_guild &g, int idx ){
|
|
|
}
|
|
|
|
|
|
// Send guild broken
|
|
|
-int mapif_guild_broken(int guild_id,int flag)
|
|
|
+int32 mapif_guild_broken(int32 guild_id,int32 flag)
|
|
|
{
|
|
|
unsigned char buf[7];
|
|
|
WBUFW(buf,0)=0x3836;
|
|
@@ -1033,7 +1033,7 @@ int mapif_guild_broken(int guild_id,int flag)
|
|
|
}
|
|
|
|
|
|
// Send guild message
|
|
|
-int mapif_guild_message(int guild_id,uint32 account_id,char *mes,int len, int sfd)
|
|
|
+int32 mapif_guild_message(int32 guild_id,uint32 account_id,char *mes,int32 len, int32 sfd)
|
|
|
{
|
|
|
unsigned char buf[512];
|
|
|
if (len > 500)
|
|
@@ -1048,7 +1048,7 @@ int mapif_guild_message(int guild_id,uint32 account_id,char *mes,int len, int sf
|
|
|
}
|
|
|
|
|
|
// Send basic info
|
|
|
-int mapif_guild_basicinfochanged(int guild_id,int type,const void *data,int len)
|
|
|
+int32 mapif_guild_basicinfochanged(int32 guild_id,int32 type,const void *data,int32 len)
|
|
|
{
|
|
|
unsigned char buf[2048];
|
|
|
if (len > 2038)
|
|
@@ -1063,7 +1063,7 @@ int mapif_guild_basicinfochanged(int guild_id,int type,const void *data,int len)
|
|
|
}
|
|
|
|
|
|
// Send member info
|
|
|
-int mapif_guild_memberinfochanged(int guild_id,uint32 account_id,uint32 char_id, int type,const void *data,int len)
|
|
|
+int32 mapif_guild_memberinfochanged(int32 guild_id,uint32 account_id,uint32 char_id, int32 type,const void *data,int32 len)
|
|
|
{
|
|
|
unsigned char buf[2048];
|
|
|
if (len > 2030)
|
|
@@ -1080,7 +1080,7 @@ int mapif_guild_memberinfochanged(int guild_id,uint32 account_id,uint32 char_id,
|
|
|
}
|
|
|
|
|
|
// ACK guild skill up
|
|
|
-int mapif_guild_skillupack(int guild_id,uint16 skill_id,uint32 account_id)
|
|
|
+int32 mapif_guild_skillupack(int32 guild_id,uint16 skill_id,uint32 account_id)
|
|
|
{
|
|
|
unsigned char buf[14];
|
|
|
WBUFW(buf, 0)=0x383c;
|
|
@@ -1092,7 +1092,7 @@ int mapif_guild_skillupack(int guild_id,uint16 skill_id,uint32 account_id)
|
|
|
}
|
|
|
|
|
|
// ACK guild alliance
|
|
|
-int mapif_guild_alliance(int guild_id1,int guild_id2,uint32 account_id1,uint32 account_id2,int flag,const char *name1,const char *name2)
|
|
|
+int32 mapif_guild_alliance(int32 guild_id1,int32 guild_id2,uint32 account_id1,uint32 account_id2,int32 flag,const char *name1,const char *name2)
|
|
|
{
|
|
|
unsigned char buf[19+2*NAME_LENGTH];
|
|
|
WBUFW(buf, 0)=0x383d;
|
|
@@ -1108,7 +1108,7 @@ int mapif_guild_alliance(int guild_id1,int guild_id2,uint32 account_id1,uint32 a
|
|
|
}
|
|
|
|
|
|
// Send a guild position desc
|
|
|
-int mapif_guild_position( const struct mmo_guild &g, int idx ){
|
|
|
+int32 mapif_guild_position( const struct mmo_guild &g, int32 idx ){
|
|
|
unsigned char buf[12 + sizeof(struct guild_position)];
|
|
|
WBUFW(buf,0)=0x383b;
|
|
|
WBUFW(buf,2)=sizeof(struct guild_position)+12;
|
|
@@ -1120,7 +1120,7 @@ int mapif_guild_position( const struct mmo_guild &g, int idx ){
|
|
|
}
|
|
|
|
|
|
// Send the guild notice
|
|
|
-int mapif_guild_notice( const struct mmo_guild &g ){
|
|
|
+int32 mapif_guild_notice( const struct mmo_guild &g ){
|
|
|
unsigned char buf[256];
|
|
|
WBUFW(buf,0)=0x383e;
|
|
|
WBUFL(buf,2)=g.guild_id;
|
|
@@ -1131,7 +1131,7 @@ int mapif_guild_notice( const struct mmo_guild &g ){
|
|
|
}
|
|
|
|
|
|
// Send emblem data
|
|
|
-int mapif_guild_emblem( const struct mmo_guild &g ){
|
|
|
+int32 mapif_guild_emblem( const struct mmo_guild &g ){
|
|
|
unsigned char buf[12 + sizeof(g.emblem_data)];
|
|
|
WBUFW(buf,0)=0x383f;
|
|
|
WBUFW(buf,2)=g.emblem_len+12;
|
|
@@ -1143,7 +1143,7 @@ int mapif_guild_emblem( const struct mmo_guild &g ){
|
|
|
}
|
|
|
|
|
|
// Send the guild emblem_id (version)
|
|
|
-int mapif_guild_emblem_version( const struct mmo_guild &g ){
|
|
|
+int32 mapif_guild_emblem_version( const struct mmo_guild &g ){
|
|
|
unsigned char buf[10];
|
|
|
WBUFW(buf, 0) = 0x3841;
|
|
|
WBUFL(buf, 2) = g.guild_id;
|
|
@@ -1153,7 +1153,7 @@ int mapif_guild_emblem_version( const struct mmo_guild &g ){
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int mapif_guild_master_changed( const struct mmo_guild &g, int aid, int cid, time_t time ){
|
|
|
+int32 mapif_guild_master_changed( const struct mmo_guild &g, int32 aid, int32 cid, time_t time ){
|
|
|
unsigned char buf[18];
|
|
|
WBUFW(buf,0)=0x3843;
|
|
|
WBUFL(buf,2)=g.guild_id;
|
|
@@ -1164,11 +1164,11 @@ int mapif_guild_master_changed( const struct mmo_guild &g, int aid, int cid, tim
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int mapif_guild_castle_dataload(int fd, int sz, int *castle_ids)
|
|
|
+int32 mapif_guild_castle_dataload(int32 fd, int32 sz, int32 *castle_ids)
|
|
|
{
|
|
|
- int num = (sz - 4) / sizeof(int);
|
|
|
- int len = 4 + num * sizeof( struct guild_castle );
|
|
|
- int i;
|
|
|
+ int32 num = (sz - 4) / sizeof(int);
|
|
|
+ int32 len = 4 + num * sizeof( struct guild_castle );
|
|
|
+ int32 i;
|
|
|
|
|
|
WFIFOHEAD(fd, len);
|
|
|
WFIFOW(fd, 0) = 0x3840;
|
|
@@ -1186,9 +1186,9 @@ int mapif_guild_castle_dataload(int fd, int sz, int *castle_ids)
|
|
|
|
|
|
|
|
|
// Guild creation request
|
|
|
-int mapif_parse_CreateGuild(int fd,uint32 account_id,char *name,struct guild_member *master)
|
|
|
+int32 mapif_parse_CreateGuild(int32 fd,uint32 account_id,char *name,struct guild_member *master)
|
|
|
{
|
|
|
- int i=0;
|
|
|
+ int32 i=0;
|
|
|
#ifdef NOISY
|
|
|
ShowInfo("Creating Guild (%s)\n", name);
|
|
|
#endif
|
|
@@ -1262,7 +1262,7 @@ int mapif_parse_CreateGuild(int fd,uint32 account_id,char *name,struct guild_mem
|
|
|
}
|
|
|
|
|
|
// Return guild info to client
|
|
|
-int mapif_parse_GuildInfo(int fd,int guild_id)
|
|
|
+int32 mapif_parse_GuildInfo(int32 fd,int32 guild_id)
|
|
|
{
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
|
|
|
@@ -1275,7 +1275,7 @@ int mapif_parse_GuildInfo(int fd,int guild_id)
|
|
|
}
|
|
|
|
|
|
// Add member to guild
|
|
|
-int mapif_parse_GuildAddMember(int fd,int guild_id,struct guild_member *m)
|
|
|
+int32 mapif_parse_GuildAddMember(int32 fd,int32 guild_id,struct guild_member *m)
|
|
|
{
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
|
|
|
@@ -1286,7 +1286,7 @@ int mapif_parse_GuildAddMember(int fd,int guild_id,struct guild_member *m)
|
|
|
}
|
|
|
|
|
|
// Find an empty slot
|
|
|
- for( int i = 0; i < g->guild.max_member; i++ ){
|
|
|
+ for( int32 i = 0; i < g->guild.max_member; i++ ){
|
|
|
if(g->guild.member[i].account_id==0)
|
|
|
{
|
|
|
memcpy(&g->guild.member[i],m,sizeof(struct guild_member));
|
|
@@ -1308,9 +1308,9 @@ int mapif_parse_GuildAddMember(int fd,int guild_id,struct guild_member *m)
|
|
|
}
|
|
|
|
|
|
// Delete member from guild
|
|
|
-int mapif_parse_GuildLeave(int fd, int guild_id, uint32 account_id, uint32 char_id, int flag, const char *mes)
|
|
|
+int32 mapif_parse_GuildLeave(int32 fd, int32 guild_id, uint32 account_id, uint32 char_id, int32 flag, const char *mes)
|
|
|
{
|
|
|
- int i;
|
|
|
+ int32 i;
|
|
|
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
|
|
|
@@ -1333,7 +1333,7 @@ int mapif_parse_GuildLeave(int fd, int guild_id, uint32 account_id, uint32 char_
|
|
|
if( flag )
|
|
|
{ // Write expulsion reason
|
|
|
// Find an empty slot
|
|
|
- int j;
|
|
|
+ int32 j;
|
|
|
ARR_FIND( 0, MAX_GUILDEXPULSION, j, g->guild.expulsion[j].account_id == 0 );
|
|
|
if( j == MAX_GUILDEXPULSION )
|
|
|
{
|
|
@@ -1367,11 +1367,11 @@ int mapif_parse_GuildLeave(int fd, int guild_id, uint32 account_id, uint32 char_
|
|
|
}
|
|
|
|
|
|
// Change member info
|
|
|
-int mapif_parse_GuildChangeMemberInfoShort(int fd,int guild_id,uint32 account_id,uint32 char_id,int online,int lv,int class_)
|
|
|
+int32 mapif_parse_GuildChangeMemberInfoShort(int32 fd,int32 guild_id,uint32 account_id,uint32 char_id,int32 online,int32 lv,int32 class_)
|
|
|
{
|
|
|
// Could speed up by manipulating only guild_member
|
|
|
- int i,sum,c;
|
|
|
- int prev_count, prev_alv;
|
|
|
+ int32 i,sum,c;
|
|
|
+ int32 prev_count, prev_alv;
|
|
|
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
|
|
|
@@ -1421,7 +1421,7 @@ int mapif_parse_GuildChangeMemberInfoShort(int fd,int guild_id,uint32 account_id
|
|
|
}
|
|
|
|
|
|
// BreakGuild
|
|
|
-int mapif_parse_BreakGuild(int fd,int guild_id)
|
|
|
+int32 mapif_parse_BreakGuild(int32 fd,int32 guild_id)
|
|
|
{
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
|
|
|
@@ -1471,13 +1471,13 @@ int mapif_parse_BreakGuild(int fd,int guild_id)
|
|
|
}
|
|
|
|
|
|
// Forward Guild message to others map servers
|
|
|
-int mapif_parse_GuildMessage(int fd,int guild_id,uint32 account_id,char *mes,int len)
|
|
|
+int32 mapif_parse_GuildMessage(int32 fd,int32 guild_id,uint32 account_id,char *mes,int32 len)
|
|
|
{
|
|
|
return mapif_guild_message(guild_id,account_id,mes,len, fd);
|
|
|
}
|
|
|
|
|
|
// Modification of the guild
|
|
|
-int mapif_parse_GuildBasicInfoChange(int fd,int guild_id,int type,const char *data,int len)
|
|
|
+int32 mapif_parse_GuildBasicInfoChange(int32 fd,int32 guild_id,int32 type,const char *data,int32 len)
|
|
|
{
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
|
|
|
@@ -1517,10 +1517,10 @@ int mapif_parse_GuildBasicInfoChange(int fd,int guild_id,int type,const char *da
|
|
|
* @param len : Size of value
|
|
|
* @return
|
|
|
*/
|
|
|
-int mapif_parse_GuildMemberInfoChange(int fd,int guild_id,uint32 account_id,uint32 char_id,int type,const char *data,int len)
|
|
|
+int32 mapif_parse_GuildMemberInfoChange(int32 fd,int32 guild_id,uint32 account_id,uint32 char_id,int32 type,const char *data,int32 len)
|
|
|
{
|
|
|
// Could make some improvement in speed, because only change guild_member
|
|
|
- int i;
|
|
|
+ int32 i;
|
|
|
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
|
|
|
@@ -1622,14 +1622,14 @@ int mapif_parse_GuildMemberInfoChange(int fd,int guild_id,uint32 account_id,uint
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int inter_guild_sex_changed(int guild_id,uint32 account_id,uint32 char_id, short gender)
|
|
|
+int32 inter_guild_sex_changed(int32 guild_id,uint32 account_id,uint32 char_id, short gender)
|
|
|
{
|
|
|
return mapif_parse_GuildMemberInfoChange(0, guild_id, account_id, char_id, GMI_GENDER, (const char*)&gender, sizeof(gender));
|
|
|
}
|
|
|
|
|
|
-int inter_guild_charname_changed(int guild_id,uint32 account_id, uint32 char_id, char *name)
|
|
|
+int32 inter_guild_charname_changed(int32 guild_id,uint32 account_id, uint32 char_id, char *name)
|
|
|
{
|
|
|
- int i, flag = 0;
|
|
|
+ int32 i, flag = 0;
|
|
|
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
|
|
|
@@ -1663,7 +1663,7 @@ int inter_guild_charname_changed(int guild_id,uint32 account_id, uint32 char_id,
|
|
|
}
|
|
|
|
|
|
// Change a position desc
|
|
|
-int mapif_parse_GuildPosition(int fd,int guild_id,int idx,struct guild_position *p)
|
|
|
+int32 mapif_parse_GuildPosition(int32 fd,int32 guild_id,int32 idx,struct guild_position *p)
|
|
|
{
|
|
|
// Could make some improvement in speed, because only change guild_position
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
@@ -1680,9 +1680,9 @@ int mapif_parse_GuildPosition(int fd,int guild_id,int idx,struct guild_position
|
|
|
}
|
|
|
|
|
|
// Guild Skill UP
|
|
|
-int mapif_parse_GuildSkillUp(int fd,int guild_id,uint16 skill_id,uint32 account_id,int max)
|
|
|
+int32 mapif_parse_GuildSkillUp(int32 fd,int32 guild_id,uint16 skill_id,uint32 account_id,int32 max)
|
|
|
{
|
|
|
- int idx = skill_id - GD_SKILLBASE;
|
|
|
+ int32 idx = skill_id - GD_SKILLBASE;
|
|
|
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
|
|
|
@@ -1705,8 +1705,8 @@ int mapif_parse_GuildSkillUp(int fd,int guild_id,uint16 skill_id,uint32 account_
|
|
|
}
|
|
|
|
|
|
//Manual deletion of an alliance when partnering guild does not exists. [Skotlex]
|
|
|
-int mapif_parse_GuildDeleteAlliance( std::shared_ptr<CharGuild> &g, int guild_id, uint32 account_id1, uint32 account_id2, int flag ){
|
|
|
- int i;
|
|
|
+int32 mapif_parse_GuildDeleteAlliance( std::shared_ptr<CharGuild> &g, int32 guild_id, uint32 account_id1, uint32 account_id2, int32 flag ){
|
|
|
+ int32 i;
|
|
|
char name[NAME_LENGTH];
|
|
|
|
|
|
ARR_FIND( 0, MAX_GUILDALLIANCE, i, g->guild.alliance[i].guild_id == guild_id );
|
|
@@ -1731,11 +1731,11 @@ int mapif_parse_GuildDeleteAlliance( std::shared_ptr<CharGuild> &g, int guild_id
|
|
|
* @param flag
|
|
|
* @return
|
|
|
*/
|
|
|
-int mapif_parse_GuildAlliance(int fd,int guild_id1,int guild_id2,uint32 account_id1,uint32 account_id2,int flag)
|
|
|
+int32 mapif_parse_GuildAlliance(int32 fd,int32 guild_id1,int32 guild_id2,uint32 account_id1,uint32 account_id2,int32 flag)
|
|
|
{
|
|
|
// Could speed up
|
|
|
std::shared_ptr<CharGuild> g[2];
|
|
|
- int j,i;
|
|
|
+ int32 j,i;
|
|
|
g[0] = inter_guild_fromsql(guild_id1);
|
|
|
g[1] = inter_guild_fromsql(guild_id2);
|
|
|
|
|
@@ -1785,7 +1785,7 @@ int mapif_parse_GuildAlliance(int fd,int guild_id1,int guild_id2,uint32 account_
|
|
|
}
|
|
|
|
|
|
// Change guild message
|
|
|
-int mapif_parse_GuildNotice(int fd,int guild_id,const char *mes1,const char *mes2)
|
|
|
+int32 mapif_parse_GuildNotice(int32 fd,int32 guild_id,const char *mes1,const char *mes2)
|
|
|
{
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
|
|
|
@@ -1800,7 +1800,7 @@ int mapif_parse_GuildNotice(int fd,int guild_id,const char *mes1,const char *mes
|
|
|
return mapif_guild_notice(g->guild);
|
|
|
}
|
|
|
|
|
|
-int mapif_parse_GuildEmblem(int fd,int len,int guild_id,int dummy,const char *data)
|
|
|
+int32 mapif_parse_GuildEmblem(int32 fd,int32 len,int32 guild_id,int32 dummy,const char *data)
|
|
|
{
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
|
|
|
@@ -1818,12 +1818,12 @@ int mapif_parse_GuildEmblem(int fd,int len,int guild_id,int dummy,const char *da
|
|
|
return mapif_guild_emblem(g->guild);
|
|
|
}
|
|
|
|
|
|
-int mapif_parse_GuildCastleDataLoad(int fd, int len, int *castle_ids)
|
|
|
+int32 mapif_parse_GuildCastleDataLoad(int32 fd, int32 len, int32 *castle_ids)
|
|
|
{
|
|
|
return mapif_guild_castle_dataload(fd, len, castle_ids);
|
|
|
}
|
|
|
|
|
|
-int mapif_parse_GuildCastleDataSave(int fd, int castle_id, int index, int value)
|
|
|
+int32 mapif_parse_GuildCastleDataSave(int32 fd, int32 castle_id, int32 index, int32 value)
|
|
|
{
|
|
|
std::shared_ptr<struct guild_castle> gc = inter_guildcastle_fromsql( castle_id );
|
|
|
|
|
@@ -1835,7 +1835,7 @@ int mapif_parse_GuildCastleDataSave(int fd, int castle_id, int index, int value)
|
|
|
switch (index) {
|
|
|
case CD_GUILD_ID:
|
|
|
if (charserv_config.log_inter && gc->guild_id != value) {
|
|
|
- int gid = (value) ? value : gc->guild_id;
|
|
|
+ int32 gid = (value) ? value : gc->guild_id;
|
|
|
auto g = util::umap_find( guild_db, gid );
|
|
|
inter_log("guild %s (id=%d) %s castle id=%d\n",
|
|
|
(g) ? g->guild.name : "??", gid, (value) ? "occupy" : "abandon", castle_id);
|
|
@@ -1862,10 +1862,10 @@ int mapif_parse_GuildCastleDataSave(int fd, int castle_id, int index, int value)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int mapif_parse_GuildMasterChange(int fd, int guild_id, const char* name, int len)
|
|
|
+int32 mapif_parse_GuildMasterChange(int32 fd, int32 guild_id, const char* name, int32 len)
|
|
|
{
|
|
|
struct guild_member gm;
|
|
|
- int pos;
|
|
|
+ int32 pos;
|
|
|
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
|
|
|
@@ -1902,7 +1902,7 @@ int mapif_parse_GuildMasterChange(int fd, int guild_id, const char* name, int le
|
|
|
return mapif_guild_master_changed(g->guild, g->guild.member[0].account_id, g->guild.member[0].char_id, g->guild.last_leader_change);
|
|
|
}
|
|
|
|
|
|
-int mapif_parse_GuildEmblemVersion(int fd, int guild_id, int version)
|
|
|
+int32 mapif_parse_GuildEmblemVersion(int32 fd, int32 guild_id, int32 version)
|
|
|
{
|
|
|
auto g = inter_guild_fromsql( guild_id );
|
|
|
|
|
@@ -1925,7 +1925,7 @@ int mapif_parse_GuildEmblemVersion(int fd, int guild_id, int version)
|
|
|
// Must Return
|
|
|
// 1 : ok
|
|
|
// 0 : error
|
|
|
-int inter_guild_parse_frommap(int fd)
|
|
|
+int32 inter_guild_parse_frommap(int32 fd)
|
|
|
{
|
|
|
RFIFOHEAD(fd);
|
|
|
switch(RFIFOW(fd,0)) {
|
|
@@ -1944,7 +1944,7 @@ int inter_guild_parse_frommap(int fd)
|
|
|
case 0x303D: mapif_parse_GuildAlliance(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14),RFIFOB(fd,18)); break;
|
|
|
case 0x303E: mapif_parse_GuildNotice(fd,RFIFOL(fd,2),RFIFOCP(fd,6),RFIFOCP(fd,66)); break;
|
|
|
case 0x303F: mapif_parse_GuildEmblem(fd,RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8),RFIFOCP(fd,12)); break;
|
|
|
- case 0x3040: mapif_parse_GuildCastleDataLoad(fd,RFIFOW(fd,2),(int *)RFIFOP(fd,4)); break;
|
|
|
+ case 0x3040: mapif_parse_GuildCastleDataLoad(fd,RFIFOW(fd,2),(int32 *)RFIFOP(fd,4)); break;
|
|
|
case 0x3041: mapif_parse_GuildCastleDataSave(fd,RFIFOW(fd,2),RFIFOB(fd,4),RFIFOL(fd,5)); break;
|
|
|
case 0x3042: mapif_parse_GuildEmblemVersion(fd, RFIFOL(fd, 2), RFIFOL(fd, 6)); break;
|
|
|
|
|
@@ -1956,12 +1956,12 @@ int inter_guild_parse_frommap(int fd)
|
|
|
}
|
|
|
|
|
|
//Leave request from the server (for deleting character from guild)
|
|
|
-int inter_guild_leave(int guild_id, uint32 account_id, uint32 char_id)
|
|
|
+int32 inter_guild_leave(int32 guild_id, uint32 account_id, uint32 char_id)
|
|
|
{
|
|
|
return mapif_parse_GuildLeave(-1, guild_id, account_id, char_id, 0, "** Character Deleted **");
|
|
|
}
|
|
|
|
|
|
-int inter_guild_broken(int guild_id)
|
|
|
+int32 inter_guild_broken(int32 guild_id)
|
|
|
{
|
|
|
return mapif_guild_broken(guild_id, 0);
|
|
|
}
|