-
Notifications
You must be signed in to change notification settings - Fork 0
/
AutoRagenaline.cs
31 lines (30 loc) · 1.06 KB
/
AutoRagenaline.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using Terraria.ModLoader;
using Terraria;
namespace AutoRagenaline
{
public class AutoRagenaline : Mod
{
internal static ModKeybind ragee;
internal static ModKeybind adrenalinee;
internal static ModKeybind secretmode;
internal static ModKeybind disableall;
public override void Load() {
ragee = KeybindLoader.RegisterKeybind(this, "Auto Rage", "H");
adrenalinee = KeybindLoader.RegisterKeybind(this, "Auto Adrenaline", "G");
secretmode = KeybindLoader.RegisterKeybind(this, "Secret Mode", "J");
disableall = KeybindLoader.RegisterKeybind(this, "Disable All", "K");
}
public static bool IsPlayerLocalServerOwner(Player player) {
if (AutoRagenalineServerConfig.Instance.Owner == player.name) {
return true;
}
if (Main.netMode == 1) {
return Netplay.Connection.Socket.GetRemoteAddress().IsLocalHost();
}
for (int plr = 0; plr < Main.maxPlayers; plr++)
if (Netplay.Clients[plr].State == 10 && Main.player[plr] == player && Netplay.Clients[plr].Socket.GetRemoteAddress().IsLocalHost())
return true;
return false;
}
}
}