Beispiel #1
0
        private void Game_DataToServer(object sender, DataToEventArgs e)
        {
            if (_packetloggerF.ViewOutgoing)
            {
                _packetloggerF.PushToQueue(e.Packet);
            }

            _contractor.ProcessOutgoing(e.Packet.ToBytes());
        }
Beispiel #2
0
        private void Game_DataToServer(object sender, DataToEventArgs e)
        {
            try
            {
                switch (e.Step)
                {
                case 3:
                {
                    _fakeServerKey = _fakeServer.GetSharedKey(e.Packet.ReadString());
                    e.Replacement.Replace <string>(_fakeClient.PublicKey);
                    break;
                }

                case 4:
                {
                    if (e.Packet.IsCorrupted)
                    {
                        Game.OutgoingEncrypt = new Rc4(_fakeClientKey);
                        Game.OutgoingDecrypt = new Rc4(_fakeServerKey);

                        byte[] decrypted = Game.OutgoingDecrypt.SafeParse(e.Packet.ToBytes());
                        e.Replacement = new HMessage(decrypted, HDestination.Server);
                    }
                    break;
                }
                }
            }
            catch { }
            finally
            {
                if (_packetlogger.ViewOutgoing)
                {
                    _packetlogger.PushToQueue(e);
                }

                _contractor.ProcessOutgoing(e.Replacement.ToBytes());
            }
        }