Exemplo n.º 1
0
        void gClient_ClientDisconnectHandler(ClientBase client)
        {
            GameClient gClient = client as GameClient;

            gClient.ClientDisconnectHandler -= new ClientBase.ClientDisconnectedDelegate(gClient_ClientDisconnectHandler);

            ClientMgr.RemoveClient(gClient);

            if (gClient.Socket != null)
            {
                byte[] temp = gClient.Socket.SendBuffer;
                gClient.Socket.SendBuffer = null;
                BufferMgr.ReleaseBuffer(temp);

                temp = gClient.Socket.ReceiveBuffer;
                gClient.Socket.ReceiveBuffer = null;
                BufferMgr.ReleaseBuffer(temp);
            }
        }
Exemplo n.º 2
0
        private void cClient_ClientDisconnectHandler(ClientBase client)
        {
            ServerClient sClient = client as ServerClient;

            sClient.ClientDisconnectHandler -= new ClientBase.ClientDisconnectedDelegate(cClient_ClientDisconnectHandler);

            GameServerMgr.RemoveClient(sClient);

            if (sClient.Socket != null)
            {
                byte[] temp = sClient.Socket.SendBuffer;
                sClient.Socket.SendBuffer = null;
                BufferMgr.ReleaseBuffer(temp);

                temp = sClient.Socket.ReceiveBuffer;
                sClient.Socket.ReceiveBuffer = null;
                BufferMgr.ReleaseBuffer(temp);
            }
        }
Exemplo n.º 3
0
        protected virtual void OnDisconnected()
        {
            BufferMgr.ReleaseBuffer(sBuffer);

            BufferMgr.ReleaseBuffer(rBuffer);
        }