More stuff. Small changes
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using System.ComponentModel;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
using Lidgren.Network;
|
||||
|
||||
@ -55,6 +56,26 @@ namespace CoopClient
|
||||
return Main.MainNetworking.IsOnServer();
|
||||
}
|
||||
|
||||
public static bool IsMenuVisible()
|
||||
{
|
||||
return Main.MainMenu.MenuPool.AreAnyVisible;
|
||||
}
|
||||
|
||||
public static bool IsChatFocused()
|
||||
{
|
||||
return Main.MainChat.Focused;
|
||||
}
|
||||
|
||||
public static bool IsPlayerListVisible()
|
||||
{
|
||||
return Environment.TickCount - PlayerList.Pressed < 5000;
|
||||
}
|
||||
|
||||
public static string GetCurrentVersion()
|
||||
{
|
||||
return Main.CurrentVersion;
|
||||
}
|
||||
|
||||
public static void Configure(string playerName, bool shareNpcsWithPlayers, int streamedNpcs, bool debug = false)
|
||||
{
|
||||
Main.MainSettings.Username = playerName;
|
||||
|
@ -18,7 +18,7 @@ namespace CoopClient
|
||||
|
||||
private bool GameLoaded = false;
|
||||
|
||||
public static readonly string CurrentModVersion = "V0_7_0";
|
||||
public static readonly string CurrentVersion = "V0_8_0";
|
||||
|
||||
public static bool ShareNpcsWithPlayers = false;
|
||||
public static bool DisableTraffic = false;
|
||||
|
@ -25,7 +25,7 @@ namespace CoopClient.Menus
|
||||
private readonly NativeItem AboutItem = new NativeItem("About", "~y~SOURCE~s~~n~" +
|
||||
"https://github.com/GTACOOP-R~n~" +
|
||||
"~y~VERSION~s~~n~" +
|
||||
Main.CurrentModVersion.Replace("_", ".")) { LeftBadge = new LemonUI.Elements.ScaledTexture("commonmenu", "shop_new_star") };
|
||||
Main.CurrentVersion.Replace("_", ".")) { LeftBadge = new LemonUI.Elements.ScaledTexture("commonmenu", "shop_new_star") };
|
||||
#endregion
|
||||
|
||||
public MenusMain()
|
||||
|
@ -53,7 +53,7 @@ namespace CoopClient
|
||||
ID = 0,
|
||||
SocialClubName = Game.Player.Name,
|
||||
Username = Main.MainSettings.Username,
|
||||
ModVersion = Main.CurrentModVersion,
|
||||
ModVersion = Main.CurrentVersion,
|
||||
NpcsAllowed = false
|
||||
}.PacketToNetOutGoingMessage(outgoingMessage);
|
||||
|
||||
|
@ -3,6 +3,8 @@
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
||||
<FileVersion>1.0.0.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -11,7 +11,7 @@ namespace CoopServer
|
||||
{
|
||||
class Server
|
||||
{
|
||||
public static readonly string CurrentModVersion = "V0_7_0";
|
||||
private static readonly string CompatibleVersion = "V0_8";
|
||||
|
||||
public static readonly Settings MainSettings = Util.Read<Settings>("CoopSettings.xml");
|
||||
private readonly Blocklist MainBlocklist = Util.Read<Blocklist>("Blocklist.xml");
|
||||
@ -26,6 +26,11 @@ namespace CoopServer
|
||||
|
||||
public Server()
|
||||
{
|
||||
Logging.Info("================");
|
||||
Logging.Info($"Server version: {Assembly.GetCallingAssembly().GetName().Version}");
|
||||
Logging.Info($"Compatible GTACoOp:R versions: {CompatibleVersion.Replace('_', '.')}.x");
|
||||
Logging.Info("================");
|
||||
|
||||
// 6d4ec318f1c43bd62fe13d5a7ab28650 = GTACOOP:R
|
||||
NetPeerConfiguration config = new("6d4ec318f1c43bd62fe13d5a7ab28650")
|
||||
{
|
||||
@ -333,9 +338,9 @@ namespace CoopServer
|
||||
}
|
||||
}
|
||||
|
||||
if (packet.ModVersion != CurrentModVersion)
|
||||
if (!packet.ModVersion.StartsWith(CompatibleVersion))
|
||||
{
|
||||
local.Deny("Please update GTACoop:R to " + CurrentModVersion.Replace("_", "."));
|
||||
local.Deny($"GTACoOp:R version {CompatibleVersion.Replace('_', '.')}.x required!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user