diff options
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/int_guild.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 0102f11a0..3f34e883b 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -417,8 +417,8 @@ struct guild * inter_guild_fromsql(int guild_id) } // load guild member info - if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `account_id`,`char_id`,`hair`,`hair_color`,`gender`,`class`,`lv`,`exp`,`exp_payper`,`online`,`position`,`name` " - "FROM `%s` WHERE `guild_id`='%d' ORDER BY `position`", guild_member_db, guild_id) ) + if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT g.`account_id`,g.`char_id`,g.`hair`,g.`hair_color`,g.`gender`,g.`class`,g.`lv`,g.`exp`,g.`exp_payper`,g.`online`,g.`position`,g.`name`,c.`last_login`" + "FROM `%s` g LEFT JOIN `%s` c ON c.`char_id` = g.`char_id` WHERE g.`guild_id`='%d' ORDER BY `position`", guild_member_db, char_db, guild_id) ) { Sql_ShowDebug(inter->sql_handle); aFree(g); @@ -442,6 +442,7 @@ struct guild * inter_guild_fromsql(int guild_id) if( m->position >= MAX_GUILDPOSITION ) // Fix reduction of MAX_GUILDPOSITION [PoW] m->position = MAX_GUILDPOSITION - 1; SQL->GetData(inter->sql_handle, 11, &data, &len); memcpy(m->name, data, min(len, NAME_LENGTH)); + SQL->GetData(inter->sql_handle, 12, &data, NULL); m->last_login = atoi(data); m->modified = GS_MEMBER_UNMODIFIED; } @@ -975,7 +976,7 @@ int mapif_guild_withdraw(int guild_id,int account_id,int char_id,int flag, const // Send short member's info int mapif_guild_memberinfoshort(struct guild *g, int idx) { - unsigned char buf[19]; + unsigned char buf[23]; nullpo_ret(g); Assert_ret(idx >= 0 && idx < MAX_GUILD); WBUFW(buf, 0)=0x3835; @@ -985,7 +986,8 @@ int mapif_guild_memberinfoshort(struct guild *g, int idx) WBUFB(buf,14)=(unsigned char)g->member[idx].online; WBUFW(buf,15)=g->member[idx].lv; WBUFW(buf,17)=g->member[idx].class; - mapif->sendall(buf,19); + WBUFL(buf,19)=g->member[idx].last_login; + mapif->sendall(buf,23); return 0; } @@ -1366,6 +1368,7 @@ int mapif_parse_GuildChangeMemberInfoShort(int fd, int guild_id, int account_id, g->member[i].online = online; g->member[i].lv = lv; g->member[i].class = class; + g->member[i].last_login = (uint32)time(NULL); g->member[i].modified = GS_MEMBER_MODIFIED; mapif->guild_memberinfoshort(g,i); } |