Ejemplo n.º 1
0
 public override void OnEvent(AdminAuthed evnt)
 {
     if (evnt.IsAdmin)
     {
         CoopSteamClientStarter.IsAdmin = true;
     }
 }
Ejemplo n.º 2
0
 public override void Connected(BoltConnection connection)
 {
     connection.SetCanReceiveEntities(false);
     if (CoopPeerStarter.DedicatedHost)
     {
         if (!string.IsNullOrEmpty(CoopDedicatedServerStarter.ServerPassword))
         {
             CoopJoinDedicatedServerToken coopJoinDedicatedServerToken = connection.ConnectToken as CoopJoinDedicatedServerToken;
             if (coopJoinDedicatedServerToken != null && coopJoinDedicatedServerToken.ServerPassword != CoopDedicatedServerStarter.ServerPassword)
             {
                 connection.Disconnect(new CoopJoinDedicatedServerFailed
                 {
                     Error = "Incorrect server password"
                 });
                 return;
             }
         }
         if (!string.IsNullOrEmpty(CoopDedicatedServerStarter.AdminPassword))
         {
             CoopJoinDedicatedServerToken coopJoinDedicatedServerToken2 = connection.ConnectToken as CoopJoinDedicatedServerToken;
             if (coopJoinDedicatedServerToken2 != null && coopJoinDedicatedServerToken2.AdminPassword == CoopDedicatedServerStarter.AdminPassword)
             {
                 AdminAuthed adminAuthed = AdminAuthed.Create(connection);
                 adminAuthed.IsAdmin = true;
                 adminAuthed.Send();
             }
         }
     }
 }