Beispiel #1
0
        public void Process(SFNETPacket packet)
        {
            var packetID = packet.PacketID();

            if (packetID > (ushort)PACKET_ID.CLIENT_RANGE_FIRST && packetID < (ushort)PACKET_ID.CLIENT_RANGE_LAST)
            {
                if (ClientPacketHandlerMap.ContainsKey(packetID))
                {
                    var user = UserManager.GetUser(packet.SessionID());
                    ClientPacketHandlerMap[packetID](packet, user);
                    return;
                }
            }

            if (packetID > (ushort)PACKET_ID.SERVER_RANGE_FIRST && packetID < (ushort)PACKET_ID.SERVER_RANGE_LAST)
            {
                if (ServerPacketHandlerMap.ContainsKey(packetID))
                {
                    ServerPacketHandlerMap[packetID](packet);
                    return;
                }
            }

            DevLog.Write(string.Format("[PacketProcess] Invalid PacketID:{0}", packetID), LOG_LEVEL.ERROR);
        }
Beispiel #2
0
        public void Process(SFNETPacket packet)
        {
            var packetID = packet.PacketID();

            if (packetID > (ushort)PACKET_ID.CLIENT_RANGE_FIRST && packetID < (ushort)PACKET_ID.CLIENT_RANGE_LAST)
            {
                if (ClientPacketHandlerMap.ContainsKey(packetID))
                {
                    var user = UserManager.GetUser(packet.SessionID());
                    ClientPacketHandlerMap[packetID](packet, user);
                    return;
                }
            }

            if (packetID > (ushort)PACKET_ID.SERVER_RANGE_FIRST && packetID < (ushort)PACKET_ID.SERVER_RANGE_LAST)
            {
                if (ServerPacketHandlerMap.ContainsKey(packetID))
                {
                    ServerPacketHandlerMap[packetID](packet);
                    return;
                }
            }

            DevLog.Write(string.Format("[PacketProcess] Invalid PacketID:{0}", packetID), LOG_LEVEL.ERROR);
        }
        void Process()
        {
            SFNETPacket packet = null;

            while (IsThreadRunning)
            {
                try
                {
                    if (PacketQueue.TryDequeue(out packet) == false)
                    {
                        System.Threading.Thread.Sleep(1);
                        continue;
                    }

                    var packetID = packet.PacketID();

                    if (PacketHandlerMap.ContainsKey(packetID))
                    {
                        PacketHandlerMap[packetID](packet);
                    }
                    else
                    {
                        System.Diagnostics.Debug.WriteLine("세션 번호 {0}, PacketID {1}, 받은 데이터 크기: {2}", packet.SessionID(), packetID, packet.GetData().Length);
                    }
                }
                catch (Exception ex)
                {
                    DevLog.Write(ex.ToString(), LOG_LEVEL.ERROR);
                }
            }
        }
Beispiel #4
0
        public void Process(SFNETPacket packet)
        {
            var packetID = packet.PacketID();

            if (PacketHandlerMap.ContainsKey(packetID))
            {
                PacketHandlerMap[packetID](packet);
            }
            else
            {
                DevLog.Write(string.Format("[PacketProcess] Invalid PacketID:{0}", packetID), LOG_LEVEL.ERROR);
            }
        }
Beispiel #5
0
        public void Process(SFNETPacket packet)
        {
            var packetID = packet.PacketID();

            if (PacketHandlerMap.ContainsKey(packetID))
            {
                PacketHandlerMap[packetID](packet);
            }
            else
            {
                DevLog.Write(string.Format("[PacketProcess] Invalid PacketID:{0}", packetID), LOG_LEVEL.ERROR);
            }
        }
Beispiel #6
0
        public void Process(SFNETPacket packet)
        {
            var packetID = packet.PacketID();

            if (PacketHandlerMap.ContainsKey(packetID))
            {
                var user = UserManager.GetUser(packet.SessionID());

                PacketHandlerMap[packetID](packet, user);
            }
            else
            {
                DevLog.Write(string.Format("[PacketProcess] Invalid PacketID:{0}", packetID), LOG_LEVEL.ERROR);
            }
        }
Beispiel #7
0
        public void Process(SFNETPacket packet)
        {
            var packetID = packet.PacketID();

            if (PacketHandlerMap.ContainsKey(packetID))
            {
                var user = UserManager.GetUser(packet.SessionID());

                PacketHandlerMap[packetID](packet, user);
            }
            else
            {
                DevLog.Write(string.Format("[PacketProcess] Invalid PacketID:{0}", packetID), LOG_LEVEL.ERROR);
            }
        }
        public void ProcessPacket(SFNETPacket packet)
        {
            try
            {
                var packetID = packet.PacketID();

                if (PacketHandlerMap.ContainsKey(packetID))
                {
                    PacketHandlerMap[packetID](packet);
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("세션 번호 {0}, PacketID {1}, 받은 데이터 크기: {2}", packet.SessionID(), packetID, packet.GetData().Length);
                }
            }
            catch (Exception ex)
            {
                DevLog.Write(ex.ToString(), LOG_LEVEL.ERROR);
            }
        }
        public void ProcessPacket(SFNETPacket packet)
        {
            try
            {
                var packetID = packet.PacketID();

                if (PacketHandlerMap.ContainsKey(packetID))
                {
                    PacketHandlerMap[packetID](packet);
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("세션 번호 {0}, PacketID {1}, 받은 데이터 크기: {2}", packet.SessionID(), packetID, packet.GetData().Length);
                }
            }
            catch (Exception ex)
            {
                DevLog.Write(ex.ToString(), LOG_LEVEL.ERROR);
            }
        }