Пример #1
0
 public void OnUserAuthSuccess(Connection _connection)
 {
     using (ProtoBuf.Approval approval = new ProtoBuf.Approval())
     {
         uint encryption = (uint)Settings.NetworkEncryptionLevel;
         approval.level      = Settings.MapName;
         approval.levelSeed  = (uint)Settings.MapSeed;
         approval.levelSize  = (uint)Settings.MapSize;
         approval.checksum   = "null";
         approval.hostname   = Settings.Hostname;
         approval.official   = false;
         approval.encryption = encryption;
         if (BaseNetworkServer.write.Start())
         {
             BaseNetworkServer.write.PacketID(Message.Type.Approved);
             approval.WriteToStream(BaseNetworkServer.write);
             BaseNetworkServer.write.Send(new SendInfo(_connection));
         }
         _connection.encryptionLevel = encryption;
         _connection.encryptOutgoing = true;
     }
     _connection.connected = true;
     ConsoleSystem.Log(String.Format(DefaultMessages.Network_Connection_NewConnection_Authed, _connection.userid, _connection.username));
 }
Пример #2
0
 public Approved(Packet p)
 {
     protobuf = ProtoBuf.Approval.Deserialize(p);
 }