Page 1 of 1
Bug 147: (Faux) Guild MOTD delay
Posted: Wed Mar 18, 2015 4:33 pm
by BugTracker
Bug ID : 147 - Guild MOTD delay
Bug Date : 2015/03/16 10:35:09
Assigned To : Faux
Priority : Medium
Category : VGClient
Sub-Category : User Interface: (Default)
Severity : Minor (e.g. Cosmetic)
Reproducible : Some of the time
Details:
Guild MOTD does not show up when I log in, but sends to chat when I open the Guild Social window
Originated From World: New Telon (1)
Chunk : New Targonor (141)
Location : -33648 6332 381
Re: Bug 147: (Faux) Guild MOTD delay
Posted: Wed Mar 18, 2015 7:09 pm
by Faux
Guild motd is a funny little bugger. I commented out the section of HandleClientAuthConfirm where I sent the guildmotd after initial login. I was getting double motd's, but not always. Just sometimes. Its something I need to look more into. I'll remove the commenting for that section of code and let me know what you see on New Telon. On my dev server, I see it when I log in, and don't get a new one if I open up the Guild Social window.
Re: Bug 147: (Faux) Guild MOTD delay
Posted: Wed Mar 18, 2015 7:11 pm
by John Adams
Yeah, correction to my /bug up there... it was just good timing that I happened to hit the Social window just as the text came in. On further testing, if I log in and just sit there for a moment, the Guild MOTD comes in after my client gets into the game and sits for a few seconds.
Maybe check how the server MOTD is sent, and send it after that in the same place? If you already are, then it's good enough.
Re: Bug 147: (Faux) Guild MOTD delay
Posted: Mon Mar 23, 2015 11:30 am
by Xinux
The double guild MOTD comes from having it send on login and having it in this function also.
Code: Select all
void Net::HandleClientGuildMemberListRequest(shared_ptr<Client> &client, PacketStruct *packet) {
// Check arguments first.
if (!client || !packet) {
LogDebug(LOG_NET, 0, "Net::HandleClientGuildMemberListRequest: A null client or null packet object was received.");
return;
}
// Get character
auto character = client->GetCharacter();
if (!character) {
client->SendMessageFromServer("Your character is null. Please report.");
LogWarn(LOG_CHUNK, 0, "Net::HandleClientGuildMemberListRequest from client with character == null");
return;
}
// Construct and send the guild member list packets from the world server.
guilds_list.SendGuildUpdate(client, character);
guilds_list.SendGuildMemberList(client, character);
guilds_list.SendGuildMotd(client, character);
}
Some time the client will hit this function on login also so it get's sent once on login then again when this function get's called. If you comment out the one from this function then when a player join's a guild he does not get the motd sent to him tho until he camps and log's back in.
Re: Bug 147: (Faux) Guild MOTD delay
Posted: Mon Mar 23, 2015 4:34 pm
by John Adams
We probably need to implement the "first_time_login" global like we have in EQ2, so when the login process completes the flag is set to false and we can then check that against all these billion other loops we end up in.
Is no one but me concerned how many times our code gets called, repeatedly? Turn up debug logging, you'll see what I mean.
Re: Bug 147: (Faux) Guild MOTD delay
Posted: Mon Mar 23, 2015 6:08 pm
by Xinux
It is under first time login the issue is sometimes the client also hit's HandleClientGuildMemberListRequest when you log in.
Re: Bug 147: (Faux) Guild MOTD delay
Posted: Mon Mar 23, 2015 6:18 pm
by John Adams
"sometimes" isn't acceptable. It's our code, we're in control not the code lol. There should be no "oh maybe one day I'll do this and the next I'll do that" The code is not alive, I promise.
Re: Bug 147: (Faux) Guild MOTD delay
Posted: Mon Mar 23, 2015 6:59 pm
by Faux
John, when I was writing this, I was actually talking to Xinux because I wasn't seeing the client ask for the packets it was supposed to ask for. When we updated the guild id within SGOPCPawn, the client started requesting the OP_GuildMemberList. If there is a consistency issue, it could be related to that, since the guild member list only gets sent when the client specifically requests it.
Re: Bug 147: (Faux) Guild MOTD delay
Posted: Tue Mar 24, 2015 3:45 pm
by John Adams
Btw, I am on a tirade because I watched our logging the other day, full on debug level="9" mode and was aghast by some of the repeated function calls. Things generally run pretty good, but I am concluding if we cleaned up our act, things would run even better. (not speaking to MOTDs in this, just generally)
Try it sometime, if you're bored. You'll see what I mean.
Re: Bug 147: (Faux) Guild MOTD delay
Posted: Sat Apr 04, 2015 11:33 am
by Faux
[quote="Xinux"]The double guild MOTD comes from having it send on login and having it in this function also.
Code: Select all
void Net::HandleClientGuildMemberListRequest(shared_ptr<Client> &client, PacketStruct *packet) {
// Check arguments first.
if (!client || !packet) {
LogDebug(LOG_NET, 0, "Net::HandleClientGuildMemberListRequest: A null client or null packet object was received.");
return;
}
// Get character
auto character = client->GetCharacter();
if (!character) {
client->SendMessageFromServer("Your character is null. Please report.");
LogWarn(LOG_CHUNK, 0, "Net::HandleClientGuildMemberListRequest from client with character == null");
return;
}
// Construct and send the guild member list packets from the world server.
guilds_list.SendGuildUpdate(client, character);
guilds_list.SendGuildMemberList(client, character);
guilds_list.SendGuildMotd(client, character);
}
Some time the client will hit this function on login also so it get's sent once on login then again when this function get's called. If you comment out the one from this function then when a player join's a guild he does not get the motd sent to him tho until he camps and log's back in.[/quote]
I could always move the the guild motd out of OP_ServerGuildMembersList and just add a call to send the guild motd at the end of the handler for inviting a player to the guild. That seems like it should solve it. So it would get sent once on login. And it would get sent once when being added to a guild.