public void initialize(int capacity) { this.socketListener = new SocketListener(capacity, 32768); this.socketListener.SocketClosed += this.SocketClosed; this.socketListener.SocketConnected += this.SocketConnected; this.socketListener.SocketReceived += this.SocketReceived; this.socketListener.SocketSended += this.SocketSended; this.tcpInPacketPool = new TCPInPacketPool(capacity); this.tcpOutPacketPool = TCPOutPacketPool.getInstance(); this.tcpOutPacketPool.initialize(capacity * 5); TCPCmdDispatcher.getInstance().initialize(); this.dictInPackets = new Dictionary <Socket, TCPInPacket>(capacity); this.gameServerClients = new Dictionary <Socket, GameServerClient>(); }
public static TCPProcessCmdResults ProcessCmd(GameServerClient client, DBManager dbMgr, TCPOutPacketPool pool, int nID, byte[] data, int count, out TCPOutPacket tcpOutPacket) { tcpOutPacket = null; TCPProcessCmdResults result; if (nID != 11001) { result = TCPCmdDispatcher.getInstance().dispathProcessor(client, nID, data, count); } else { result = TCPCmdHandler.ProcessOnlineServerHeartCmd(dbMgr, pool, nID, data, count, out tcpOutPacket); } return(result); }