• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Zone Agent v562

Junior Spellweaver
Joined
Nov 16, 2012
Messages
101
Reaction score
21

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.