New MasterServer address

This commit is contained in:
EntenKoeniq
2021-12-14 21:18:12 +01:00
parent 5f3b94dd37
commit 721da34e36
3 changed files with 11 additions and 8 deletions

View File

@ -10,8 +10,10 @@ namespace CoopClient.Menus.Sub
{ {
internal class ServerListClass internal class ServerListClass
{ {
[JsonProperty("ip")] [JsonProperty("address")]
public string IP { get; set; } public string Address { get; set; }
[JsonProperty("port")]
public string Port { get; set; }
[JsonProperty("name")] [JsonProperty("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("version")] [JsonProperty("version")]
@ -88,21 +90,22 @@ namespace CoopClient.Menus.Sub
foreach (ServerListClass server in serverList) foreach (ServerListClass server in serverList)
{ {
string address = $"{server.Address}:{server.Port}";
NativeItem tmpItem = null; NativeItem tmpItem = null;
MainMenu.Add(tmpItem = new NativeItem($"[{server.Country}] {server.Name}", $"~b~{server.IP}~s~~n~~g~Version {server.Version}.x~s~~n~Mods = {server.Mods}~n~NPCs = {server.NPCs}") { AltTitle = $"[{server.Players}/{server.MaxPlayers}][{(server.AllowList ? "~r~X~s~" : "~g~O~s~")}]"}); MainMenu.Add(tmpItem = new NativeItem($"[{server.Country}] {server.Name}", $"~b~{address}~s~~n~~g~Version {server.Version}.x~s~~n~Mods = {server.Mods}~n~NPCs = {server.NPCs}") { AltTitle = $"[{server.Players}/{server.MaxPlayers}][{(server.AllowList ? "~r~X~s~" : "~g~O~s~")}]"});
tmpItem.Activated += (object sender, EventArgs e) => tmpItem.Activated += (object sender, EventArgs e) =>
{ {
try try
{ {
MainMenu.Visible = false; MainMenu.Visible = false;
Main.MainNetworking.DisConnectFromServer(server.IP); Main.MainNetworking.DisConnectFromServer(address);
Main.MainMenu.ServerIpItem.AltTitle = server.IP; Main.MainMenu.ServerIpItem.AltTitle = address;
Main.MainMenu.MainMenu.Visible = true; Main.MainMenu.MainMenu.Visible = true;
Main.MainSettings.LastServerAddress = server.IP; Main.MainSettings.LastServerAddress = address;
Util.SaveSettings(); Util.SaveSettings();
} }
catch (Exception ex) catch (Exception ex)

View File

@ -16,7 +16,7 @@
/// <summary> /// <summary>
/// Don't use it! /// Don't use it!
/// </summary> /// </summary>
public string MasterServer { get; set; } = "http://gtacoopr.000webhostapp.com/servers.php"; public string MasterServer { get; set; } = "https://coop.entenkoeniq.de/servers";
/// <summary> /// <summary>
/// Don't use it! /// Don't use it!
/// </summary> /// </summary>

View File

@ -12,7 +12,7 @@
public bool ModsAllowed { get; set; } = false; public bool ModsAllowed { get; set; } = false;
public bool UPnP { get; set; } = true; public bool UPnP { get; set; } = true;
public bool AnnounceSelf { get; set; } = false; public bool AnnounceSelf { get; set; } = false;
public string MasterServer { get; set; } = "http://gtacoopr.000webhostapp.com/servers.php"; public string MasterServer { get; set; } = "https://coop.entenkoeniq.de/servers";
public bool DebugMode { get; set; } = false; public bool DebugMode { get; set; } = false;
} }
} }