Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
added cheepyt servers lol
Browse files Browse the repository at this point in the history
  • Loading branch information
DillyzThe1 committed Mar 11, 2021
1 parent 02124ff commit e1d7624
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Source Code/HarmonyMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
using Reactor;
using Essentials.Options;
using System;
using BepInEx.Configuration;
using System.Linq;
using System.Net;

namespace StopTime
{
Expand All @@ -16,9 +19,29 @@ public class HarmonyMain : BasePlugin
public Harmony Harmony { get; } = new Harmony(Id);
public static CustomNumberOption freezeCooldown = CustomOption.AddNumber("Freeze Button Cooldown", 10f, 15f, 60f, 2.5f);
public static CustomNumberOption freezeTimer = CustomOption.AddNumber("Freeze Time Active", 20f, 15f, 45f, 2.5f);
public ConfigEntry<string> Name { get; set; }
public ConfigEntry<string> Ip { get; set; }
public ConfigEntry<ushort> Port { get; set; }
public override void Load()
{
Harmony.PatchAll();
Name = Config.Bind("Server", "Name", "CheepYT - EU");
Ip = Config.Bind("Server", "Ipv4 or Hostname", "207.180.234.175");
Port = Config.Bind("Server", "Port", (ushort)22023);
var defReg = AOBNFCIHAJL.DefaultRegions.ToList();
if (Uri.CheckHostName(Ip.Value).ToString() == "Dns")
{
foreach (IPAddress adress in Dns.GetHostAddresses(Ip.Value))
{
if (adress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
{
Ip.Value = adress.ToString();
break;
}
}
}
defReg.Insert(0, new OIBMKGDLGOG(Name.Value, Ip.Value, new[] { new PLFDMKKDEMI($"{Name.Value}-Master-1", Ip.Value, Port.Value) }));
AOBNFCIHAJL.DefaultRegions = defReg.ToArray();
}
}
}

0 comments on commit e1d7624

Please sign in to comment.