Skip to content

Commit

Permalink
slight fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
winnpixie committed Apr 17, 2024
1 parent 8140372 commit 1b9fee6
Show file tree
Hide file tree
Showing 45 changed files with 97 additions and 56 deletions.
6 changes: 6 additions & 0 deletions Assembly-CSharp/Guardian/AntiAbuse/ModDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ public static List<string> GetMods(PhotonPlayer player)
mods.Add("[EE66FF][TRAP]");
}

// Prolonpo x RC
if (player.IsProlonpoRC)
{
mods.Add("[FFFFFF][Prolonpo-RC]");
}

// RC83
if (player.IsRC83Mod)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public override void Load()
base.Add(new CommandScreenshot());
base.Add(new CommandSetGuild());
base.Add(new CommandSetLighting());
base.Add(new CommandSetName());
base.Add(new CommandSetUsername());
base.Add(new CommandTranslate());
base.Add(new CommandUnignore());
base.Add(new CommandUnmute());
Expand Down
10 changes: 5 additions & 5 deletions Assembly-CSharp/Guardian/Features/Commands/Impl/CommandClear.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ namespace Guardian.Features.Commands.Impl
{
class CommandClear : Command
{
public CommandClear() : base("clear", new string[0], "[log|global|id]", false) { }
public CommandClear() : base("clear", new string[0], "[global|log|id]", false) { }

public override void Execute(InRoomChat irc, string[] args)
{
if (args.Length > 0)
{
switch (args[0].ToLower())
{
case "log":
GuardianClient.Logger.Entries = new SynchronizedList<Logger.Entry>();
GuardianClient.Logger.Info("Event log has been cleared!");
break;
case "global":
if (!PhotonNetwork.isMasterClient) break;

Expand All @@ -28,6 +24,10 @@ public override void Execute(InRoomChat irc, string[] args)
}
GameHelper.Broadcast("Global chat has been cleared!".AsColor("AAFF00"));
break;
case "log":
GuardianClient.Logger.Entries = new SynchronizedList<Logger.Entry>();
GuardianClient.Logger.Info("Event log has been cleared!");
break;
default:
if (!PhotonNetwork.isMasterClient || !int.TryParse(args[0], out int id)) break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
class CommandSay : Command
{
public CommandSay() : base("say", new string[0], "<message>", false) { }
public CommandSay() : base("say", new string[0], "[message]", false) { }

public override void Execute(InRoomChat irc, string[] args)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Guardian.Features.Commands.Impl
{
class CommandSetLighting : Command
{
public CommandSetLighting() : base("setlighting", new string[] { "lighting", "settime", "time" }, "<day|dawn|night>", false) { }
public CommandSetLighting() : base("setlighting", new string[] { "lighting", "settime", "time" }, "<lightlevel>", false) { }

public override void Execute(InRoomChat irc, string[] args)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace Guardian.Features.Commands.Impl
{
class CommandSetName : Command
class CommandSetUsername : Command
{
public CommandSetName() : base("setname", new string[] { "name" }, "[name]", false) { }
public CommandSetUsername() : base("setusername", new string[] { "username", "setname", "name" }, "[name]", false) { }

public override void Execute(InRoomChat irc, string[] args)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
class CommandUnignore : Command
{
public CommandUnignore() : base("unignore", new string[] { "unig" }, "<id>", false) { }
public CommandUnignore() : base("unignore", new string[0], "<id>", false) { }

public override void Execute(InRoomChat irc, string[] args)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Guardian.Features.Commands.Impl.Debug
{
class CommandHorse : Command
{
public CommandHorse() : base("horse", new string[0], "<follow/stay>", false) { }
public CommandHorse() : base("horse", new string[0], "<action>", false) { }

public override void Execute(InRoomChat irc, string[] args)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class CommandLogProperties : Command
{
private readonly string SaveDir = GuardianClient.RootDir + "\\Properties";

public CommandLogProperties() : base("logpr", new string[0], "<id>", false) { }
public CommandLogProperties() : base("logproperties", new string[] { "logprops", "logpr" }, "<id>", false) { }

public override void Execute(InRoomChat irc, string[] args)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CommandStopwatch : Command
{
private readonly MsTimer Watch = new MsTimer();

public CommandStopwatch() : base("stopwatch", new string[] { "sw", "timer" }, "<start|end>", false) { }
public CommandStopwatch() : base("stopwatch", new string[] { "sw", "timer" }, "<action>", false) { }

public override void Execute(InRoomChat irc, string[] args)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Guardian.Features.Commands.Impl.MasterClient
{
class CommandDifficulty : Command
{
public CommandDifficulty() : base("difficulty", new string[0], "<training|normal|hard|abnormal>", true) { }
public CommandDifficulty() : base("difficulty", new string[0], "<level>", true) { }

public override void Execute(InRoomChat irc, string[] args)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Guardian.Features.Commands.Impl.MasterClient
{
class CommandScatterTitans : Command
{
public CommandScatterTitans() : base("scatter", new string[0], string.Empty, true) { }
public CommandScatterTitans() : base("scattertitans", new string[] { "scatter" }, string.Empty, true) { }

public override void Execute(InRoomChat irc, string[] args)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Guardian.Features.Commands.Impl.MasterClient
{
class CommandSetMap : Command
{
public CommandSetMap() : base("setmap", new string[] { "map" }, "<name>", true) { }
public CommandSetMap() : base("setmap", new string[] { "map" }, "<map>", true) { }

public override void Execute(InRoomChat irc, string[] args)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Guardian.Features.Commands.Impl.MasterClient
{
class CommandSetTitans : Command
{
public CommandSetTitans() : base("settitans", new string[0], "<normal|aberrant|jumper|crawler|punk>", true) { }
public CommandSetTitans() : base("settitans", new string[0], "<type>", true) { }

public override void Execute(InRoomChat irc, string[] args)
{
Expand Down
2 changes: 1 addition & 1 deletion Assembly-CSharp/Guardian/GuardianClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Guardian
{
class GuardianClient : MonoBehaviour
{
public static readonly string Build = "1.5.2";
public static readonly string Build = "1.5.2.1";
public static readonly string RootDir = Application.dataPath + "\\..";

public static readonly CommandManager Commands = new CommandManager();
Expand Down
28 changes: 18 additions & 10 deletions Assembly-CSharp/Guardian/UI/WindowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,15 @@ public static void ToggleFullscreen()
}
}

public static void HandleWindowFocusEvent(bool hasFocus)
// TODO: I believe Exclusive Fullscreen still requires more testing.
private static void HandleExclusiveFullscreen(bool hasFocus)
{
// TODO: I believe Exclusive Fullscreen still requires more testing.
if (hasFocus)
{
if (Fullscreen)
{
Fullscreen = false;
Screen.SetResolution(ScreenWidth, ScreenHeight, true);

GameObject mainCam = GameObject.Find("MainCamera");
if (mainCam != null)
{
IN_GAME_MAIN_CAMERA mainCamera = mainCam.GetComponent<IN_GAME_MAIN_CAMERA>();
mainCamera.StartCoroutine(MarkHudDirty(mainCamera));
}
}
}
else if (!Fullscreen)
Expand All @@ -122,6 +115,21 @@ public static void HandleWindowFocusEvent(bool hasFocus)
ShowWindow(GetActiveWindow(), 2); // SW_SHOWMINIMIZED
}
}
}

public static void HandleWindowFocusEvent(bool hasFocus)
{
// HandleExclusiveFullscreen(hasFocus);

if (hasFocus)
{
GameObject mainCam = GameObject.Find("MainCamera");
if (mainCam != null)
{
IN_GAME_MAIN_CAMERA mainCamera = mainCam.GetComponent<IN_GAME_MAIN_CAMERA>();
mainCamera.StartCoroutine(MarkHudDirty(mainCamera));
}
}

if (GuardianClient.Properties.RestrainCursor.Value)
{
Expand All @@ -138,7 +146,7 @@ public static void HandleWindowFocusEvent(bool hasFocus)
}
else if (GuardianClient.Properties.LimitUnfocusedFPS.Value && GuardianClient.Properties.MaxUnfocusedFPS.Value > 0)
{
// FPS under ~15-30 as MasterClient provides a borderline non-playable experience to others, this should prevent that.
// FPS under 51 could potentially affect Physics-related logic, ensure the MasterClient does not attempt to go below that.
Application.targetFrameRate = Utilities.MathHelper.MaxInt(GuardianClient.Properties.MaxUnfocusedFPS.Value, PhotonNetwork.isMasterClient ? 51 : 1);
}
}
Expand Down
6 changes: 6 additions & 0 deletions Assembly-CSharp/PUN/NetworkingPeer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,12 @@ public void ExecuteRPC(ExitGames.Client.Photon.Hashtable rpcData, PhotonPlayer s

switch (rpcName)
{
case "CheckEquipmentAttachPointRPC": // Prolonpo x RC
case "DeleteFireRPC":
case "ResetAllSupplierGearRPC":
case "throwBladesRPC":
sender.IsProlonpoRC = true;
break;
case "FlareColour":
sender.IsAnarchyExpMod = true;
break;
Expand Down
1 change: 1 addition & 0 deletions Assembly-CSharp/PUN/PhotonPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public Hashtable allProperties
public bool IsNRCMod;
public bool IsPBMod;
public bool IsPhotonMod;
public bool IsProlonpoRC;
public bool IsRC83Mod;
public bool IsRRCMod;
public bool IsTRAPMod;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions ModLauncher/Constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;

namespace Guardian
{
internal class Constants
{
public static readonly string AppVersion = "1.0.6";
public static readonly string InstallDir = Environment.CurrentDirectory;
public static readonly int OSArch = Environment.Is64BitOperatingSystem ? 64 : 32;

public static readonly string BaseURL = "https://aottgfan.site/clients/guardian";
public static readonly string VersionsURL = BaseURL + "/version.txt";
public static readonly string BinaryName = "Guardian_Win" + OSArch + ".zip";
public static readonly string GameDataURL = BaseURL + "/" + BinaryName;
}
}
20 changes: 13 additions & 7 deletions ModLauncher/MainWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1b9fee6

Please sign in to comment.