basic banning
This commit is contained in:
parent
45b27bce4c
commit
1a377ba206
|
@ -18,6 +18,23 @@ internal class Commands : IDisposable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCommand(string command, string arguments) {
|
private void OnCommand(string command, string arguments) {
|
||||||
|
switch (arguments) {
|
||||||
|
case "ban":
|
||||||
|
this.Plugin.Config.BannedTerritories.Add(this.Plugin.ClientState.TerritoryType);
|
||||||
|
this.Plugin.SaveConfig();
|
||||||
|
this.Plugin.Messages.SpawnVfx();
|
||||||
|
break;
|
||||||
|
case "unban":
|
||||||
|
this.Plugin.Config.BannedTerritories.Remove(this.Plugin.ClientState.TerritoryType);
|
||||||
|
this.Plugin.SaveConfig();
|
||||||
|
this.Plugin.Messages.SpawnVfx();
|
||||||
|
break;
|
||||||
|
case "refresh":
|
||||||
|
this.Plugin.Messages.SpawnVfx();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
this.Plugin.Ui.MainWindow.Visible ^= true;
|
this.Plugin.Ui.MainWindow.Visible ^= true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,4 +7,5 @@ public class Configuration : IPluginConfiguration {
|
||||||
public int Version { get; set; } = 1;
|
public int Version { get; set; } = 1;
|
||||||
|
|
||||||
public string ApiKey { get; set; } = string.Empty;
|
public string ApiKey { get; set; } = string.Empty;
|
||||||
|
public HashSet<uint> BannedTerritories { get; set; } = new();
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ internal class Messages : IDisposable {
|
||||||
|
|
||||||
internal void SpawnVfx() {
|
internal void SpawnVfx() {
|
||||||
var territory = this.Plugin.ClientState.TerritoryType;
|
var territory = this.Plugin.ClientState.TerritoryType;
|
||||||
if (territory == 0) {
|
if (territory == 0 || this.Plugin.Config.BannedTerritories.Contains(territory)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user