ACCEPTED_CONNECTION (102) / Friends bug
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
ACCEPTED_CONNECTION (102) / Friends bug
Scat, this bug is a problem that everytime a player zones, they are disconnected and reconnected, and we're counting that new connection as a brand new one, thus throwing this stat counter way off.
The same thing happens when I have Scatman on my Friend list, and Scatman zones. I see him logging in over and over everytime he zones.
Maybe both these checks are just in the wrong place?
The same thing happens when I have Scatman on my Friend list, and Scatman zones. I see him logging in over and over everytime he zones.
Maybe both these checks are just in the wrong place?
-
Secrets
- Retired
- Posts: 40
- Joined: Wed Jul 25, 2007 2:51 pm
- Location: Sleeping
Re: ACCEPTED_CONNECTION (102) / Friends bug
Think it might be related to putting it in a place (SetReadyForSpawns) instead of a place they first login. (SendLoginInfo)
If you put it under their firstlogin in Client::SendLoginInfo and send a login message, and when they leave the world server have them log out send a logout message to all clients. Probably would work better, instead of having it iterated to all clients per client logging in. (at least, I think that's what is happening!)
I'll try and fix it tonight if no one else gets around to it.
PS: Hi John!
If you put it under their firstlogin in Client::SendLoginInfo and send a login message, and when they leave the world server have them log out send a logout message to all clients. Probably would work better, instead of having it iterated to all clients per client logging in. (at least, I think that's what is happening!)
I'll try and fix it tonight if no one else gets around to it.
PS: Hi John!
-
Secrets
- Retired
- Posts: 40
- Joined: Wed Jul 25, 2007 2:51 pm
- Location: Sleeping
Re: ACCEPTED_CONNECTION (102) / Friends bug
Think I fixed this, i'll post a diff shortly.
Was definately related to iterating through a list of clients. You get a logged in message every time a match is found when it iterates through CheckFriendList(this) in function Client::SetReadyForSpawns. I moved that to when a player logged in, and replaced it to only update your friends list when you zone with an entirely new function. Diff inc shortly.
Was definately related to iterating through a list of clients. You get a logged in message every time a match is found when it iterates through CheckFriendList(this) in function Client::SetReadyForSpawns. I moved that to when a player logged in, and replaced it to only update your friends list when you zone with an entirely new function. Diff inc shortly.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: ACCEPTED_CONNECTION (102) / Friends bug
Right on, thanks Secrets. Post your diff and Scatman or LE will check it out.
-
Secrets
- Retired
- Posts: 40
- Joined: Wed Jul 25, 2007 2:51 pm
- Location: Sleeping
Re: ACCEPTED_CONNECTION (102) / Friends bug
Code: Select all
Index: client.cpp
===================================================================
--- client.cpp (revision 297)
+++ client.cpp (working copy)
@@ -232,6 +232,7 @@
if(firstlogin){
ClientPacketFunctions::SendMOTD ( this );
ClientPacketFunctions::SendCharacterMacros(this);
+ zone_list.CheckFriendList(this);
}
database.LoadPlayerFactions(this);
database.LoadCharacterQuests(this);
@@ -3736,7 +3737,7 @@
world.GroupMessage(GetPlayer()->GetGroup(), "%s has returned from Linkdead.", GetPlayer()->GetName());
}
}
- zone_list.CheckFriendList(this);
+ zone_list.CheckFriendZoned(this);
}
void Client::SendChatRelationship(int8 type, const char* name){
Index: World.cpp
===================================================================
--- World.cpp (revision 297)
+++ World.cpp (working copy)
@@ -328,6 +328,19 @@
MClientList.unlock();
}
+void ZoneList::CheckFriendZoned(Client* client){
+ MClientList.lock();
+ map<string,Client*>::iterator itr;
+ for(itr = client_map.begin(); itr != client_map.end(); itr++){
+ if(itr->second != client && itr->second){
+ if(itr->second->GetPlayer()->IsFriend(client->GetPlayer()->GetName())){
+ itr->second->SendFriendList();
+ }
+ }
+ }
+ MClientList.unlock();
+}
+
bool ZoneList::HandleGlobalChatMessage(Client* from, char* to, int16 channel, char* message, char* channel_name){
if(channel == CHANNEL_TELL){
Client* find_client = zone_list.GetClientByCharName(to);
Index: World.h
===================================================================
--- World.h (revision 297)
+++ World.h (working copy)
@@ -236,6 +236,7 @@
MClientList.unlock();
}
void CheckFriendList(Client* client);
+ void CheckFriendZoned(Client* client);
bool HandleGlobalChatMessage(Client* from, char* to, int16 channel, char* message, char* channel_name = 0);
void HandleGlobalBroadcast(const char* message);
void HandleGlobalAnnouncement(const char* message);
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: ACCEPTED_CONNECTION (102) / Friends bug
That's the exact same code I had. Go ahead and commit it, and I'll merge it with some other changes.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: ACCEPTED_CONNECTION (102) / Friends bug
I don't think Secrets has commit ability (only a few do). That's why the diff, ya silly hobbit. 
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: ACCEPTED_CONNECTION (102) / Friends bug
Ok since Scatman has the memory span of the average housefly (J/K!!!), I went ahead and added, tested, and committed this code from Secrets. 
Who is online
Users browsing this forum: No registered users and 0 guests