コード例 #1
0
ファイル: LeagueServer.cs プロジェクト: zkitX/LeaguePackets
        private bool SendEncrypted(Peer peer, ChannelID channel, BasePacket packet,
                                   bool reliable = true, bool unsequenced = false)
        {
            var data = packet.GetBytes();

            data = _blowfish.Encrypt(data);
            return(peer.Send(channel, data, reliable, unsequenced));
        }
コード例 #2
0
 private bool SendEncrypted(Peer peer, ChannelID channel, BasePacket packet,
                            bool reliable = true, bool unsequenced = false)
 {
     byte[] data;
     using (var stream = new MemoryStream())
     {
         using (var writer = new PacketWriter(stream, true))
         {
             packet.Write(writer);
         }
         data = stream.GetBuffer().Take((int)stream.Length).ToArray();
     }
     data = _blowfish.Encrypt(data);
     return(peer.Send(channel, data, reliable, unsequenced));
 }