Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 04-14-2009, 09:53 AM
apex67
Fire Beetle
 
Join Date: Apr 2009
Location: Zimbabwe
Posts: 1
Default Connection issues with multiple servers

I am relatively new to the EQEmu thing although I had played EQ for a good 4-5 years so I am very familiar with the original game.

I started playing EQEmu two days ago and I've had a lot of fun reacquainting myself with the environment and overall feel of the game. I played all last night with no issues, but when I try to login this morning, I just can't seem to pull it off.

I created a character on [PEQ] The Grand Creation (Preferred Server) two days previous and tried to play my Shaman just a few minutes ago. I get past the login screen, the server select screen, and then when I get to the character select screen and I select "Enter World", it dumps me to a black screen that says "YOU HAVE BEEN DISCONNECTED"

So I think, fair enough, the server is probably having issues. That doesn't seem to be the case. I created a new character on VZ/TZ PVP server and I have the same issues. I decided that maybe it wasn't a server issue, but a client issue, and I restarted the EQgame.exe (of course, with the appropriate shortcut parameters). I tried to login to "The Grand Creation" with my Shaman, and I was able to enter the Gloomingdeep Mines with no issues. I decided to exit the tutorial and return to Halas and when I did, I was returned to the same disconnect screen.

It seems now that I can not get past this disconnect screen no matter what I try to do. Are there any suggestions out there or is there a huge gaping hole in my troubleshooting logic? I don't want to reinstall the game if I don't have to so I'd like to exhaust all other troubleshooting options before hand.

Thanks in advance!
-Aegide Drekkenzin
Reply With Quote
  #2  
Old 04-16-2009, 06:18 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,447
Default

Bump. This seriously needs a solution, as it's an issue in current code related to the AccountSessionLimit implementation.

Basically, whenever you go LD, it won't let you in till your character is removed from the CLE list in world. This is a serious issue that deters people from playing, and if removed, opens up a can of worms related to logging in the same account twice.

I will make a post on the developer section if this gets ignored... :/
Reply With Quote
  #3  
Old 04-16-2009, 02:48 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Sounds like he was having issues with the session timeout limit from the character select screen and also maybe issues with logging in 2 characters on the same account (not sure I read that correctly).

Basically, if you wait at the character select for more than about 1 minute, you will get disconnected as soon as you try to enter world. This 1 minute also includes character creation, so you have to be quick about creating a new character.

I don't know why this limit is set so tightly, because it is pretty annoying. I don't even think it actually disconnects you from the server until you try to do something and get the disconnect message, so there isn't really a reason for it to time out like that. It isn't helping the server in any way at all as far as I can tell.

As for the account session limiting, I fully agree that it needs work. I think it is useful to stop certain hacks and other issues, but I don't even run it on my server because of some of the problems it causes with connections. Since I made it, I have been saying that it needs to be changed to kick the character in game and always let you log in, instead of blocking the new connection while it waits for the one that is logged in to time out. I just don't personally know how to make it do that atm. I basically just used TheLieka's code for IP Limiting and set it to do the same thing for accounts. It does what it is meant to do, but you are right that it needs to be looked at. I just don't personally know how to make it do what it needs to be doing.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 04-16-2009, 03:12 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Try this:

Code:
Index: world/clientlist.cpp
===================================================================
--- world/clientlist.cpp        (revision 432)
+++ world/clientlist.cpp        (working copy)
@@ -100,17 +100,32 @@
 //Account Limiting Code to limit the number of characters allowed on from a single account at once.
 void ClientList::GetCLEAccount(int32 iAccID) {
        ClientListEntry* count_Chars_On = 0;
-       LinkedListIterator<ClientListEntry*> iterator(clientlist);
+       LinkedListIterator<ClientListEntry*> iterator(clientlist, BACKWARD);

        int Chars_On = 0;
        iterator.Reset();
        while(iterator.MoreElements()) {
                count_Chars_On = iterator.GetData();
-               if ((count_Chars_On->AccountID() == iAccID) && ((count_Chars_On->Admin() <= (RuleI(World, ExemptAccountLimitStatus))) || (RuleI(World, ExemptAccountLimitStatus) < 0))) {
+               if ((count_Chars_On->LSAccountID() == iAccID) && ((count_Chars_On->Admin() <= (RuleI(World, ExemptAccountLimitStatus))) || (RuleI(World, ExemptAccountLimitStatus) < 0))) {
                        Chars_On++;
-                       if (Chars_On > (RuleI(World, AccountSessionLimit))){
+                       _log(NET__ERROR, "LSAccount: %i has %i connections.", iAccID, Chars_On);
+                       if (Chars_On >= (RuleI(World, AccountSessionLimit))){
+                               // If we have a char name, they are in a zone, so send a kick to the zone server
+                               if(strlen(count_Chars_On->name())) {
+                                       _log(NET__ERROR, "Sending kick to %s", count_Chars_On->name());
+
+                                       ServerPacket* pack = new ServerPacket(ServerOP_KickPlayer, sizeof(ServerKickPlayer_Struct));
+                                       ServerKickPlayer_Struct* skp = (ServerKickPlayer_Struct*) pack->pBuffer;
+                                       strcpy(skp->adminname, "SessionLimit");
+                                       strcpy(skp->name, count_Chars_On->name());
+                                       skp->adminrank = 255;
+                                       zoneserver_list.SendPacket(pack);
+                                       safe_delete(pack);
+                               }
+                               _log(NET__ERROR, "Putting CLE offline");
                                count_Chars_On->SetOnline(CLE_Status_Offline);
                                iterator.RemoveCurrent();
+                               continue;
                        }
                }
                iterator.Advance();
Index: world/LoginServer.cpp
===================================================================
--- world/LoginServer.cpp       (revision 432)
+++ world/LoginServer.cpp       (working copy)
@@ -151,6 +151,11 @@
                }
                case ServerOP_LSClientAuth: {
                        ServerLSClientAuth* slsca = (ServerLSClientAuth*) pack->pBuffer;
+
+                       if (RuleI(World, AccountSessionLimit) >= 0) {
+                               client_list.GetCLEAccount(slsca->lsaccount_id);  //Check current CLE Accounts against incoming connection
+                       }
+
                        client_list.CLEAdd(slsca->lsaccount_id, slsca->name, slsca->key, slsca->worldadmin, slsca->ip, slsca->local);
                        break;
                }
Index: world/client.cpp
===================================================================
--- world/client.cpp    (revision 432)
+++ world/client.cpp    (working copy)
@@ -490,10 +490,6 @@
                                break;
                        }

-                       if (RuleI(World, AccountSessionLimit) >= 0) {
-                               client_list.GetCLEAccount(this->GetAccountID());  //Check current CLE Accounts against incoming connection
-                       }
-
                        if (RuleI(World, MaxClientsPerIP) >= 0) {
                    client_list.GetCLEIP(this->GetIP());  //Lieka Edit Begin:  Check current CLE Entry IPs against incoming connection
             }
In my limited testing on my private server, this seems to have the desired effect of kicking the existing connection and letting the new one in.

I moved the check, so it will kick the existing connection before the new one even gets to Character Select.

Edit: Code updated to remove memory leak.

Last edited by Derision; 04-17-2009 at 12:22 AM.. Reason: Code updated to remove memory leak.
Reply With Quote
  #5  
Old 04-16-2009, 07:01 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I will try to get that running on SH tonight for testing. If players aren't reporting any issues with it, I will let you know, so you can commit it if you like. I am sure that any server using account session limiting would much prefer to use that way over the existing one! Thanks again, Derision!
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #6  
Old 04-17-2009, 06:02 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,447
Default

Quote:
Originally Posted by Derision View Post
Try this:

In my limited testing on my private server, this seems to have the desired effect of kicking the existing connection and letting the new one in.

I moved the check, so it will kick the existing connection before the new one even gets to Character Select.

Edit: Code updated to remove memory leak.
Thank you! This is exactly what some of us need. I'm sure it will take a lot of stress off of both server admins and players.
Reply With Quote
  #7  
Old 04-17-2009, 06:58 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I got Derision's code running on SH right now and it seems to work fine so far. I will leave it running and see if I get any reports of issues with it. I bet that PEQ and other servers using the old Session Limiting would love the new code for handling it. I didn't even run the old code because of the issues with it, but with this new code, I will definitely keep it enabled

Also, I moved this thread to Code Submissions, since it contains a nice bit of code
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 04-17-2009 at 03:02 PM..
Reply With Quote
  #8  
Old 04-17-2009, 09:52 AM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

Quote:
Originally Posted by trevius View Post
I got Derision's code running on SH right now and it seems to work fine so far. I will leave it running and see if I get any reports of issues with it. I bet that PEQ and other servers using the old Session Limiting would love the new code for handling it. I didn't even run the old code because of the issues with it, but with this new code, I will definitely keep it enabled

Also, I moved this thread to Code Submissions, since it contains a nice bit of code
You got that right, I might even bring PEQ down to get this in today! Derision, once again (for the millionth time) you sir, rock!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:23 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3