//////////////// /// @private public override void Action(CommandCaller caller, string input, string[] args) { if (Main.netMode == 1) { LogHelpers.Log("ModLockWorldToggleCommand - Not supposed to run on client."); return; } if (Main.netMode == 2 && caller.CommandType != CommandType.Console) { if (!UserHelpers.HasBasicServerPrivilege(caller.Player)) { caller.Reply("Access denied.", Color.Red); return; } } if (ModLockService.IsWorldLocked()) { caller.Reply("World unlocked.", Color.Lime); ModLockService.UnlockWorld(); } else { caller.Reply("World locked.", Color.Lime); ModLockService.LockWorld(); } }
private void ToggleModLock() { if (!ModLockService.IsWorldLocked()) { ModLockService.LockWorld(); } else { ModLockService.UnlockWorld(); } this.RefreshModLockButton(); }
public static void UnlockWorld() { ModLockService.UnlockWorld(); }