Beispiel #1
0
        public override void OnReceiveData(byte[] _buffer)
        {
            try
            {
                List <byte> mBuffer = new List <byte>();
                for (int I = 0; I < _buffer.Length; I++)
                {
                    mBuffer.Add((byte)(_buffer[I] ^ Core.BuildConfig.GameKey_Client));
                }

                InPacket _packet = new InPacket();
                _packet.Set(mBuffer.ToArray());

                Networking.PacketHandler _handler = Globals.GetInstance().ServerInstance.GetPacket(_packet.GetOPC());
                if (_handler != null && _handler is Networking.PacketHandler)
                {
                    _handler.Set(this, mBuffer.ToArray());

                    if (_handler != null)
                    {
                        _handler.Handle();
                    }
                }
                else
                {
                    Core.Log.WriteError("Received unhandled packet! [" + _packet.GetOPC() + "]");
                }
            }
            catch { }
        }