public override void OnEvent(AdminAuthed evnt) { if (evnt.IsAdmin) { CoopSteamClientStarter.IsAdmin = true; } }
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(); } } } }