Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Zone Agent v562

Junior Spellweaver
Joined
Nov 16, 2012
Messages
101
Reaction score
21
I was successfully able to debug this and now zoneagent doesn’t crash but their is one more problem which i encountered
The problem is when login limit is reached to 20 and then if 21st player try to login all other gets automatically disconnected

As far as I know, there is no limit set in the code that only allows 20 players. Check your code and may be debug where its failing to accept 21st client.
 
Newbie Spellweaver
Joined
May 1, 2020
Messages
24
Reaction score
2
Its networkstream error as found during debugging can any 1 give alternative
 
Newbie Spellweaver
Joined
Jul 16, 2020
Messages
12
Reaction score
0
Its not network stream error. Error is caused due to invalid Disconnection of client.

private void RemoveDisconnectedClient(object state)
{
for (int i = 0; i < _Players.Where(x => !isConnected(x.Value.TcpClient.Client)).ToList().Count; i++)
{
KeyValuePair<uint, Client> client = _Players.Where(x => !isConnected(x.Value.TcpClient.Client)).ToList();
if (client.Value.Reason == 1)
{
MSG_ZA2ZS_ACC_LOGOUT pDisconnect = new MSG_ZA2ZS_ACC_LOGOUT();
pDisconnect.MsgHeader.dwPCID = client.Value.Uid;
pDisconnect.byReason = client.Value.Reason;
ZoneServer.ZS[client.Value.ZoneStatus].Send(pDisconnect.Serialize());
}
MSG_ZA2LS_ACC_LOGOUT pLogout = new MSG_ZA2LS_ACC_LOGOUT();
pLogout.MsgHeader.dwPCID = client.Value.Uid;
pLogout.byReason = client.Value.Reason;
pLogout.szAccount = client.Value.Account;
LoginServer.LS.Send(pLogout.Serialize());
_Main.UpdateLogMsg(string.Format("{0} {1} DisconnectedUser.remove", client.Value.Account, client.Value.Uid));
_Players.Remove(client.Key); Main.UpdateConnectionCount(_Players.Count, MaxPlayerCount);
}
}



This was originally foreach loop , i tried for loop but still same issue za crashes.
 
Back
Top