summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/char/int_guild.c11
-rw-r--r--src/common/mmo.h1
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/guild.c4
-rw-r--r--src/map/guild.h2
-rw-r--r--src/map/intif.c4
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc12
8 files changed, 23 insertions, 17 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);
}
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 04daedca0..577901e96 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -746,6 +746,7 @@ struct guild_member {
char name[NAME_LENGTH];
struct map_session_data *sd;
unsigned char modified;
+ uint32 last_login;
};
struct guild_position {
diff --git a/src/map/clif.c b/src/map/clif.c
index 7c314b075..f998778a2 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7700,7 +7700,7 @@ void clif_guild_memberlist(struct map_session_data *sd)
memset(WFIFOP(fd, c * size + 34), 0, 50); //[Ind] - This is displayed in the 'note' column but being you can't edit it it's sent empty.
memcpy(WFIFOP(fd, c * size + 84), m->name, NAME_LENGTH);
#else
- WFIFOL(fd, c * size + 34) = 0; // [4144] this is member last login time. But in hercules it not present.
+ WFIFOL(fd, c * size + 34) = m->last_login; // [Megasantos] - Shows last date online
#endif
c++;
}
diff --git a/src/map/guild.c b/src/map/guild.c
index 11609ec81..d33df5e08 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -275,6 +275,7 @@ void guild_makemember(struct guild_member *m,struct map_session_data *sd)
m->online = 1;
m->position = MAX_GUILDPOSITION-1;
memcpy(m->name,sd->status.name,NAME_LENGTH);
+ m->last_login = (uint32)time(NULL); // When player create or join a guild the date is updated
return;
}
@@ -1001,7 +1002,7 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
return 0;
}
-int guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int16 class)
+int guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int16 class, uint32 last_login)
{ // cleaned up [LuzZza]
int i, alv, c, idx = INDEX_NOT_FOUND, om = 0, oldonline = -1;
struct guild *g = guild->search(guild_id);
@@ -1017,6 +1018,7 @@ int guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, int on
m->online=online;
m->lv=lv;
m->class = class;
+ m->last_login = last_login;
idx=i;
}
alv+=m->lv;
diff --git a/src/map/guild.h b/src/map/guild.h
index 9296f9ec0..d6bba2a56 100644
--- a/src/map/guild.h
+++ b/src/map/guild.h
@@ -126,7 +126,7 @@ struct guild_interface {
int (*check_alliance) (int guild_id1, int guild_id2, int flag);
/* */
int (*send_memberinfoshort) (struct map_session_data *sd,int online);
- int (*recv_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int16 class);
+ int (*recv_memberinfoshort) (int guild_id, int account_id, int char_id, int online, int lv, int16 class, uint32 last_login);
int (*change_memberposition) (int guild_id,int account_id,int char_id,short idx);
int (*memberposition_changed) (struct guild *g,int idx,int pos);
int (*change_position) (int guild_id,int idx,int mode,int exp_mode,const char *name);
diff --git a/src/map/intif.c b/src/map/intif.c
index 0e5cd3db2..858652af2 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -1494,7 +1494,7 @@ void intif_parse_GuildMemberWithdraw(int fd) {
// ACK guild member basic info
void intif_parse_GuildMemberInfoShort(int fd) {
- guild->recv_memberinfoshort(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17));
+ guild->recv_memberinfoshort(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17),RFIFOL(fd,19));
}
// ACK guild break
@@ -2842,7 +2842,7 @@ void intif_defaults(void) {
-1,-1,27,-1, -1,-1,37,-1, 7, 0, 0, 0, 0, 0, 0, 0, //0x3800-0x380f
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
+ 10,-1,15, 0, 79,23, 7,-1, 0,-1,-1,-1, 14,67,186,-1, //0x3830
-1, 0, 0,14, 0, 0, 0, 0, -1,74,-1,11, 11,-1, 0, 0, //0x3840
-1,-1, 7, 7, 7,11, 8, 0, 10, 0, 0, 0, 0, 0, 0, 0, //0x3850 Auctions [Zephyrus] itembound[Akinari] Clan System[Murilo BiO]
-1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3860 Quests [Kevin] [Inkfish]
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 822faa0cd..9b4b88f17 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -2668,8 +2668,8 @@ typedef int (*HPMHOOK_pre_guild_check_alliance) (int *guild_id1, int *guild_id2,
typedef int (*HPMHOOK_post_guild_check_alliance) (int retVal___, int guild_id1, int guild_id2, int flag);
typedef int (*HPMHOOK_pre_guild_send_memberinfoshort) (struct map_session_data **sd, int *online);
typedef int (*HPMHOOK_post_guild_send_memberinfoshort) (int retVal___, struct map_session_data *sd, int online);
-typedef int (*HPMHOOK_pre_guild_recv_memberinfoshort) (int *guild_id, int *account_id, int *char_id, int *online, int *lv, int16 *class);
-typedef int (*HPMHOOK_post_guild_recv_memberinfoshort) (int retVal___, int guild_id, int account_id, int char_id, int online, int lv, int16 class);
+typedef int (*HPMHOOK_pre_guild_recv_memberinfoshort) (int *guild_id, int *account_id, int *char_id, int *online, int *lv, int16 *class, uint32 *last_login);
+typedef int (*HPMHOOK_post_guild_recv_memberinfoshort) (int retVal___, int guild_id, int account_id, int char_id, int online, int lv, int16 class, uint32 last_login);
typedef int (*HPMHOOK_pre_guild_change_memberposition) (int *guild_id, int *account_id, int *char_id, short *idx);
typedef int (*HPMHOOK_post_guild_change_memberposition) (int retVal___, int guild_id, int account_id, int char_id, short idx);
typedef int (*HPMHOOK_pre_guild_memberposition_changed) (struct guild **g, int *idx, int *pos);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index f42f8fc1c..0d10eb6fe 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -29222,15 +29222,15 @@ int HP_guild_send_memberinfoshort(struct map_session_data *sd, int online) {
}
return retVal___;
}
-int HP_guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int16 class) {
+int HP_guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, int online, int lv, int16 class, uint32 last_login) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_guild_recv_memberinfoshort_pre > 0) {
- int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *online, int *lv, int16 *class);
+ int (*preHookFunc) (int *guild_id, int *account_id, int *char_id, int *online, int *lv, int16 *class, uint32 *last_login);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_memberinfoshort_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_recv_memberinfoshort_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &online, &lv, &class);
+ retVal___ = preHookFunc(&guild_id, &account_id, &char_id, &online, &lv, &class, &last_login);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -29238,13 +29238,13 @@ int HP_guild_recv_memberinfoshort(int guild_id, int account_id, int char_id, int
}
}
{
- retVal___ = HPMHooks.source.guild.recv_memberinfoshort(guild_id, account_id, char_id, online, lv, class);
+ retVal___ = HPMHooks.source.guild.recv_memberinfoshort(guild_id, account_id, char_id, online, lv, class, last_login);
}
if (HPMHooks.count.HP_guild_recv_memberinfoshort_post > 0) {
- int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id, int online, int lv, int16 class);
+ int (*postHookFunc) (int retVal___, int guild_id, int account_id, int char_id, int online, int lv, int16 class, uint32 last_login);
for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_recv_memberinfoshort_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_recv_memberinfoshort_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id, online, lv, class);
+ retVal___ = postHookFunc(retVal___, guild_id, account_id, char_id, online, lv, class, last_login);
}
}
return retVal___;