private static void OnClose(Socket s) { SocketInfo info = new SocketInfo(); info.type = SocketCallBack.TYPE_CLOSE; info.s = s; SocketCallBack.Instance().AddData(info); }
private static void OnConnect(Socket s) { SocketInfo info = new SocketInfo(); info.type = SocketCallBack.TYPE_ONCONNECT; info.s = s; SocketCallBack.Instance().AddData(info); }
public static SocketCallBack Instance() { if (mInstance == null) { mInstance = new SocketCallBack(); } return(mInstance); }
public static SocketCallBack Instance() { if (mInstance == null) { mInstance = new SocketCallBack(); } return mInstance; }
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); }
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(); //魔法飞鸽 }