public void ProcessGameServerPacket() { var packetList = ReadPacket(); if (packetList != null) { foreach (var packet in packetList) { if (packet.PacketID == ClientNetLib.PacketDef.SysPacketIDDisConnectdFromServer) { //SetDisconnectd(); Debug.Log("서버와 접속 종료 !!!"); } else { GameServerPacketHandler.Process(packet); } } } }
void ReadPacketQueueProcess() { try { PacketData packet = new PacketData(); lock (((System.Collections.ICollection)RecvPacketQueue).SyncRoot) { if (RecvPacketQueue.Count() > 0) { packet = RecvPacketQueue.Dequeue(); } } if (packet.PacketID != 0) { GameServerPacketHandler.Process(packet); } } catch (Exception ex) { Debug.LogError(ex.Message); } }