Changes for the upcoming update

This commit is contained in:
EntenKoeniq
2022-04-06 02:18:24 +02:00
parent f07ab2ddd0
commit fedc036e76
15 changed files with 120 additions and 28 deletions

View File

@ -158,7 +158,7 @@ namespace CoopClient
}
/// <summary>
/// Check if a GTACOOP:R menu is visible
/// Check if a RAGECOOP menu is visible
/// </summary>
public static bool IsMenuVisible()
{
@ -170,7 +170,7 @@ namespace CoopClient
}
/// <summary>
/// Check if the GTACOOP:R chat is visible
/// Check if the RAGECOOP chat is visible
/// </summary>
public static bool IsChatFocused()
{
@ -178,7 +178,7 @@ namespace CoopClient
}
/// <summary>
/// Check if the GTACOOP:R list of players is visible
/// Check if the RAGECOOP list of players is visible
/// </summary>
public static bool IsPlayerListVisible()
{
@ -186,7 +186,7 @@ namespace CoopClient
}
/// <summary>
/// Get the version of GTACOOP:R
/// Get the version of RAGECOOP
/// </summary>
public static string GetCurrentVersion()
{

View File

@ -22,7 +22,7 @@ namespace CoopClient
private bool GameLoaded = false;
internal static readonly string CurrentVersion = "V1_3_0";
internal static readonly string CurrentVersion = "V1_4_0";
internal static bool ShareNPCsWithPlayers = false;
internal static bool DisableTraffic = false;
@ -100,7 +100,7 @@ namespace CoopClient
RelationshipGroup = World.AddRelationshipGroup("SYNCPED");
Game.Player.Character.RelationshipGroup.SetRelationshipBetweenGroups(RelationshipGroup, Relationship.Neutral, true);
#if !NON_INTERACTIVE
GTA.UI.Notification.Show(GTA.UI.NotificationIcon.AllPlayersConf, "GTACOOP:R", "Welcome!", "Press ~g~F9~s~ to open the menu.");
GTA.UI.Notification.Show(GTA.UI.NotificationIcon.AllPlayersConf, "RAGECOOP", "Welcome!", "Press ~g~F9~s~ to open the menu.");
#endif
}

View File

@ -1,5 +1,7 @@
using GTA;
using System.Drawing;
using LemonUI;
using LemonUI.Menus;
@ -10,12 +12,31 @@ namespace CoopClient.Menus
/// </summary>
public class MenusMain
{
class MenuColor : LemonUI.Elements.I2Dimensional
{
public PointF Position { get; set; }
public SizeF Size { get; set; }
public Color Color { get; set; }
public void Draw()
{
}
public void Recalculate()
{
}
}
internal ObjectPool MenuPool = new ObjectPool();
internal NativeMenu MainMenu = new NativeMenu("GTACOOP:R", "MAIN")
// new MenuColor() { Position = new PointF(0, 0), Size = new SizeF(0, 0), Color = Color.FromArgb(0,0,0,0) }
internal NativeMenu MainMenu = new NativeMenu("RAGECOOP", "MAIN")
{
UseMouse = false,
Alignment = Main.MainSettings.FlipMenu ? GTA.UI.Alignment.Right : GTA.UI.Alignment.Left
};
#region SUB
internal Sub.Settings SubSettings = new Sub.Settings();
@ -27,7 +48,7 @@ namespace CoopClient.Menus
internal readonly NativeItem ServerIpItem = new NativeItem("Server IP") { AltTitle = Main.MainSettings.LastServerAddress };
private readonly NativeItem ServerConnectItem = new NativeItem("Connect");
private readonly NativeItem AboutItem = new NativeItem("About", "~y~SOURCE~s~~n~" +
"https://github.com/GTACOOP-R~n~" +
"https://github.com/RAGECOOP~n~" +
"~y~VERSION~s~~n~" +
Main.CurrentVersion.Replace("_", ".")) { LeftBadge = new LemonUI.Elements.ScaledTexture("commonmenu", "shop_new_star") };
#endregion
@ -37,6 +58,9 @@ namespace CoopClient.Menus
/// </summary>
public MenusMain()
{
MainMenu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
MainMenu.Title.Color = Color.FromArgb(255, 165, 0);
UsernameItem.Activated += UsernameActivated;
ServerIpItem.Activated += ServerIpActivated;
ServerConnectItem.Activated += (sender, item) => { Main.MainNetworking.DisConnectFromServer(Main.MainSettings.LastServerAddress); };

View File

@ -1,5 +1,6 @@
using System;
using System.Net;
using System.Drawing;
using System.Collections.Generic;
using Newtonsoft.Json;
@ -37,7 +38,7 @@ namespace CoopClient.Menus.Sub
/// </summary>
internal class Servers
{
internal NativeMenu MainMenu = new NativeMenu("GTACOOP:R", "Servers", "Go to the server list")
internal NativeMenu MainMenu = new NativeMenu("RAGECOOP", "Servers", "Go to the server list")
{
UseMouse = false,
Alignment = Main.MainSettings.FlipMenu ? GTA.UI.Alignment.Right : GTA.UI.Alignment.Left
@ -49,6 +50,9 @@ namespace CoopClient.Menus.Sub
/// </summary>
public Servers()
{
MainMenu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
MainMenu.Title.Color = Color.FromArgb(255, 165, 0);
MainMenu.Opening += (object sender, System.ComponentModel.CancelEventArgs e) =>
{
MainMenu.Add(ResultItem = new NativeItem("Loading..."));

View File

@ -1,4 +1,6 @@
using LemonUI.Menus;
using System.Drawing;
using LemonUI.Menus;
namespace CoopClient.Menus.Sub
{
@ -7,7 +9,7 @@ namespace CoopClient.Menus.Sub
/// </summary>
public class Settings
{
internal NativeMenu MainMenu = new NativeMenu("GTACOOP:R", "Settings", "Go to the settings")
internal NativeMenu MainMenu = new NativeMenu("RAGECOOP", "Settings", "Go to the settings")
{
UseMouse = false,
Alignment = Main.MainSettings.FlipMenu ? GTA.UI.Alignment.Right : GTA.UI.Alignment.Left
@ -26,6 +28,9 @@ namespace CoopClient.Menus.Sub
/// </summary>
public Settings()
{
MainMenu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
MainMenu.Title.Color = Color.FromArgb(255, 165, 0);
DisableTraffic.CheckboxChanged += DisableTrafficCheckboxChanged;
ShareNPCsItem.CheckboxChanged += (item, check) => { Main.ShareNPCsWithPlayers = ShareNPCsItem.Checked; };
FlipMenuItem.CheckboxChanged += FlipMenuCheckboxChanged;

View File

@ -32,8 +32,8 @@ namespace CoopClient
}
else
{
// 6d4ec318f1c43bd62fe13d5a7ab28650 = GTACOOP:R
NetPeerConfiguration config = new NetPeerConfiguration("6d4ec318f1c43bd62fe13d5a7ab28650")
// 623c92c287cc392406e7aaaac1c0f3b0 = RAGECOOP
NetPeerConfiguration config = new NetPeerConfiguration("623c92c287cc392406e7aaaac1c0f3b0")
{
AutoFlushSendQueue = false
};

View File

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

View File

@ -1363,6 +1363,11 @@
If a custom colored background should be used.
</summary>
</member>
<member name="P:LemonUI.Menus.NativeItem.IsHovered">
<summary>
If this item is being hovered.
</summary>
</member>
<member name="E:LemonUI.Menus.NativeItem.Selected">
<summary>
Event triggered when the item is selected.
@ -2380,6 +2385,11 @@
The current value of the slider.
</summary>
</member>
<member name="P:LemonUI.Menus.NativeSliderItem.SliderColor">
<summary>
The color of the Slider.
</summary>
</member>
<member name="P:LemonUI.Menus.NativeSliderItem.Maximum">
<summary>
The maximum value of the slider.
@ -2999,6 +3009,15 @@
Updates the Message information in the Scaleform.
</summary>
</member>
<member name="M:LemonUI.Scaleform.BigMessage.FadeOut(System.Int32)">
<summary>
Fades the big message out.
</summary>
<param name="time">The time it will take to do the fade.</param>
</member>
<member name="M:LemonUI.Scaleform.BigMessage.DrawFullScreen">
<inheritdoc/>
</member>
<member name="T:LemonUI.Scaleform.BruteForceBackground">
<summary>
The Background of the BruteForce Hack Minigame.
@ -3307,6 +3326,46 @@
Updates the Title, Description and Image of the loading screen.
</summary>
</member>
<member name="T:LemonUI.Scaleform.PopUp">
<summary>
A warning pop-up.
</summary>
</member>
<member name="P:LemonUI.Scaleform.PopUp.Title">
<summary>
The title of the Pop-up.
</summary>
</member>
<member name="P:LemonUI.Scaleform.PopUp.Subtitle">
<summary>
The subtitle of the Pop-up.
</summary>
</member>
<member name="P:LemonUI.Scaleform.PopUp.Prompt">
<summary>
The prompt of the Pop-up.
</summary>
</member>
<member name="P:LemonUI.Scaleform.PopUp.ShowBackground">
<summary>
If the black background should be shown.
</summary>
</member>
<member name="P:LemonUI.Scaleform.PopUp.Error">
<summary>
The error message to show.
</summary>
</member>
<member name="M:LemonUI.Scaleform.PopUp.#ctor">
<summary>
Creates a new Pop-up instance.
</summary>
</member>
<member name="M:LemonUI.Scaleform.PopUp.Update">
<summary>
Updates the texts of the Pop-up.
</summary>
</member>
<member name="T:LemonUI.GFXAlignment">
<summary>
Represents the internal alignment of screen elements.

View File

@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<AssemblyVersion>1.43.4.0001</AssemblyVersion>
<AssemblyVersion>1.47.0.0001</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<RepositoryUrl>https://github.com/GTACOOP-R/GTACoop-R</RepositoryUrl>
</PropertyGroup>

View File

@ -18,13 +18,13 @@ namespace CoopServer
{
do
{
Console.Title = string.Format("GTAC:R [{0,5:P2}] [{1:F}MB]", await GetCpuUsageForProcess(), Process.GetCurrentProcess().PrivateMemorySize64 * 0.000001);
Console.Title = string.Format("RAGECOOP [{0,5:P2}] [{1:F}MB]", await GetCpuUsageForProcess(), Process.GetCurrentProcess().PrivateMemorySize64 * 0.000001);
Thread.Sleep(500);
} while (true);
}).Start();
#else
Console.Title = "GTACOOP:R";
Console.Title = "RAGECOOP";
#endif
if (File.Exists("log.txt"))

View File

@ -22,10 +22,10 @@ namespace CoopServer
internal class Server
{
private static readonly string CompatibleVersion = "V1_3";
private static readonly string CompatibleVersion = "V1_4";
private static long CurrentTick = 0;
public static readonly Settings MainSettings = Util.Read<Settings>("CoopSettings.xml");
public static readonly Settings MainSettings = Util.Read<Settings>("Settings.xml");
private readonly Blocklist MainBlocklist = Util.Read<Blocklist>("Blocklist.xml");
private readonly Allowlist MainAllowlist = Util.Read<Allowlist>("Allowlist.xml");
@ -40,11 +40,11 @@ namespace CoopServer
{
Logging.Info("================");
Logging.Info($"Server version: {Assembly.GetCallingAssembly().GetName().Version}");
Logging.Info($"Compatible GTACoOp:R versions: {CompatibleVersion.Replace('_', '.')}.x");
Logging.Info($"Compatible RAGECOOP versions: {CompatibleVersion.Replace('_', '.')}.x");
Logging.Info("================");
// 6d4ec318f1c43bd62fe13d5a7ab28650 = GTACOOP:R
NetPeerConfiguration config = new("6d4ec318f1c43bd62fe13d5a7ab28650")
// 623c92c287cc392406e7aaaac1c0f3b0 = RAGECOOP
NetPeerConfiguration config = new("623c92c287cc392406e7aaaac1c0f3b0")
{
MaximumConnections = MainSettings.MaxPlayers,
Port = MainSettings.Port,
@ -63,14 +63,14 @@ namespace CoopServer
{
Logging.Info(string.Format("Attempting to forward port {0}", MainSettings.Port));
if (MainNetServer.UPnP.ForwardPort(MainSettings.Port, "GTACOOP:R server"))
if (MainNetServer.UPnP.ForwardPort(MainSettings.Port, "RAGECOOP server"))
{
Logging.Info(string.Format("Server available on {0}:{1}", MainNetServer.UPnP.GetExternalIP().ToString(), config.Port));
}
else
{
Logging.Error("Port forwarding failed! Your router may not support UPnP.");
Logging.Warning("If you and your friends can join this server, please ignore this error or set UPnP in CoopSettings.xml to false!");
Logging.Warning("If you and your friends can join this server, please ignore this error or set UPnP in Settings.xml to false!");
}
}
@ -137,7 +137,7 @@ namespace CoopServer
if (response.StatusCode != System.Net.HttpStatusCode.OK)
{
Logging.Error($"MasterServer: [{(int)response.StatusCode}]{response.StatusCode}");
Logging.Error($"MasterServer: [{(int)response.StatusCode}]");
// Wait 5 seconds before trying again
Thread.Sleep(5000);
@ -609,7 +609,7 @@ namespace CoopServer
if (!packet.ModVersion.StartsWith(CompatibleVersion))
{
local.Deny($"GTACoOp:R version {CompatibleVersion.Replace('_', '.')}.x required!");
local.Deny($"RAGECOOP version {CompatibleVersion.Replace('_', '.')}.x required!");
return;
}
if (string.IsNullOrWhiteSpace(packet.Username))

View File

@ -5,14 +5,14 @@
public int Port { get; set; } = 4499;
public int MaxPlayers { get; set; } = 16;
public int MaxLatency { get; set; } = 300;
public string Name { get; set; } = "GTACoop:R server";
public string Name { get; set; } = "RAGECOOP server";
public string WelcomeMessage { get; set; } = "Welcome on this server :)";
public string Resource { get; set; } = "";
public bool NpcsAllowed { get; set; } = true;
public bool ModsAllowed { get; set; } = false;
public bool UPnP { get; set; } = true;
public bool AnnounceSelf { get; set; } = false;
public string MasterServer { get; set; } = "https://gtacoopr.000webhostapp.com/servers.php";
public string MasterServer { get; set; } = "https://ragecoop.online/servers";
public bool DebugMode { get; set; } = false;
}
}