Instance() public static method

public static Instance ( ) : SocketCallBack
return SocketCallBack
Esempio n. 1
0
        private static void OnConnect(Socket s)
        {
            SocketInfo info = new SocketInfo();

            info.type = SocketCallBack.TYPE_ONCONNECT;
            info.s    = s;
            SocketCallBack.Instance().AddData(info);
        }
Esempio n. 2
0
        private static void OnClose(Socket s)
        {
            SocketInfo info = new SocketInfo();

            info.type = SocketCallBack.TYPE_CLOSE;
            info.s    = s;
            SocketCallBack.Instance().AddData(info);
        }
Esempio n. 3
0
        private static void OnReceive(Socket s, byte[] data, int nSize)
        {
            SocketInfo info = new SocketInfo();

            info.type = SocketCallBack.TYPE_RECEIVE;
            info.s    = s;
            info.data = new byte[nSize];
            Buffer.BlockCopy(data, 0, info.data, 0, nSize);
            SocketCallBack.Instance().AddData(info);
        }
Esempio n. 4
0
        public static void LogicRun()
        {
            SocketCallBack.Instance().Run();           //玩家发过来的封包进行处理,加到数据队列
            DBServer.Instance().ProcessDBNetMsg();     //优先处理db数据库服务器发过来的消息
            SessionManager.Instance().ProcessNetMsg(); //处理玩家发过来的消息
            MapManager.Instance().Process();
            UserEngine.Instance().Run();
            ScriptTimerManager.Instance().Run(); //脚本定时器

            WorldPigeon.Instance().Run();        //魔法飞鸽
        }