public static void AddSession(byte[] packet, SocketClient sockstate)
{
int cid;
CMSG_ADD_SESSION cpkt = (CMSG_ADD_SESSION)packet;
cid = cpkt.cid;
lock (Program.CharacterList)
{
if (!Program.CharacterList.ContainsKey(cid))
{
Program.CharacterList.Add(cid, new Character(cid));
}
else
{
Logger.Log(Logger.LogLevel.Hack, "Hack Detection", "Session tampering detected : {0}", ((IPEndPoint)sockstate.Client.Socket.RemoteEndPoint).Address.ToString());
sockstate.Disconnect();
}
}
}