diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index fe1152bd..00000000 --- a/.dockerignore +++ /dev/null @@ -1,30 +0,0 @@ -**/.classpath -**/.dockerignore -**/.env -**/.git -**/.gitignore -**/.project -**/.settings -**/.toolstarget -**/.vs -**/.vscode -**/*.*proj.user -**/*.dbmdl -**/*.jfm -**/azds.yaml -**/bin -**/charts -**/docker-compose* -**/Dockerfile* -**/node_modules -**/npm-debug.log -**/obj -**/secrets.dev.yaml -**/values.dev.yaml -LICENSE -README.md -!**/.gitignore -!.git/HEAD -!.git/config -!.git/packed-refs -!.git/refs/heads/** \ No newline at end of file diff --git a/SCHIZO/SwarmControl/Captcha.cs b/SCHIZO/SwarmControl/Captcha.cs index 5e90c8af..318647a6 100644 --- a/SCHIZO/SwarmControl/Captcha.cs +++ b/SCHIZO/SwarmControl/Captcha.cs @@ -33,7 +33,6 @@ public override void Awake() _data = [.. data]; _data.ForEach(d => d.regex = new Regex(d.textRegex, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)); gameObject.SetActive(false); - // i can't get my own blocker working so i'm just gonna yoink this one CoroutineHost.StartCoroutine(InitCoro()); } @@ -41,6 +40,7 @@ private IEnumerator InitCoro() { yield return new WaitUntil(() => uGUI.main && uGUI.main.confirmation && uGUI_FeedbackCollector.main); + // i couldn't get my own input blocker working so i'm just gonna yoink this one _inputBlocker = uGUI_FeedbackCollector.main.inputBlocker; Image redBackground = uGUI.main.confirmation.transform.GetChild(0).GetComponent(); diff --git a/SCHIZO/SwarmControl/EggTimer.cs b/SCHIZO/SwarmControl/EggTimer.cs index b0f664f1..a2f7af22 100644 --- a/SCHIZO/SwarmControl/EggTimer.cs +++ b/SCHIZO/SwarmControl/EggTimer.cs @@ -54,13 +54,13 @@ public void Start() { if (_active) return; _active = true; - _onStart(); + _onStart?.Invoke(); } public void End() { if (!_active) return; _active = false; - _onEnd(); + _onEnd?.Invoke(); } public void Dispose() diff --git a/SCHIZO/SwarmControl/Redeems/Annoying/HideVehicleSignal.cs b/SCHIZO/SwarmControl/Redeems/Annoying/HideVehicleSignal.cs index d789d8eb..2f3ca907 100644 --- a/SCHIZO/SwarmControl/Redeems/Annoying/HideVehicleSignal.cs +++ b/SCHIZO/SwarmControl/Redeems/Annoying/HideVehicleSignal.cs @@ -11,13 +11,13 @@ namespace SCHIZO.SwarmControl.Redeems.Annoying; [Redeem( Name = "redeem_hidecarpings", DisplayName = "Hide Vehicle Signals", - Description = "Hides vehicle and base signals for 30 seconds." + Description = "Hides vehicle and base signals for 1 minute." )] internal class HideVehicleSignal : Command, IParameters { public IReadOnlyList Parameters => []; - private EggTimer _timer; - private static float Duration = 30f; + private readonly EggTimer _timer; + private static float Duration = 60f; public HideVehicleSignal() { diff --git a/SCHIZO/SwarmControl/Redeems/Audio/NoiseRegistry.cs b/SCHIZO/SwarmControl/Redeems/Audio/NoiseRegistry.cs index 8e1b3ae8..3afec5be 100644 --- a/SCHIZO/SwarmControl/Redeems/Audio/NoiseRegistry.cs +++ b/SCHIZO/SwarmControl/Redeems/Audio/NoiseRegistry.cs @@ -15,7 +15,7 @@ internal static class NoiseRegistry [NormalNoise.ErmsharkAmbient] = "event:/SCHIZO/creatures/ermshark/ambient", [NormalNoise.ErmsharkAttack] = "event:/SCHIZO/creatures/ermshark/attack", [NormalNoise.ErmsharkHurt] = "event:/SCHIZO/creatures/ermshark/hurt", - [NormalNoise.TutelAmbient] = "event:/SCHIZO/creatures/tutel/ambient", + [NormalNoise.TutelAmbient] = "event:/SCHIZO/creatures/tutel/ambient_world", [NormalNoise.TutelCook] = "event:/SCHIZO/creatures/tutel/cook", [NormalNoise.TutelEat] = "event:/SCHIZO/creatures/tutel/eat" }; diff --git a/SCHIZO/SwarmControl/Redeems/Enums/AggressiveCreature.cs b/SCHIZO/SwarmControl/Redeems/Enums/AggressiveCreature.cs index 55d78706..cc55f655 100644 --- a/SCHIZO/SwarmControl/Redeems/Enums/AggressiveCreature.cs +++ b/SCHIZO/SwarmControl/Redeems/Enums/AggressiveCreature.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +//using System.Runtime.Serialization; namespace SCHIZO.SwarmControl.Redeems.Enums; @@ -7,6 +7,6 @@ public enum AggressiveCreature Ermshark, Brinewing, Cryptosuchus, - [EnumMember(Value = "Squid Shark")] - SquidShark, + //[EnumMember(Value = "Squid Shark")] + //SquidShark, } diff --git a/SwarmControl.Shared/Constants/ConnectionConstants.cs b/SwarmControl.Shared/Constants/ConnectionConstants.cs deleted file mode 100644 index e64ab45b..00000000 --- a/SwarmControl.Shared/Constants/ConnectionConstants.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SwarmControl.Constants; - -public static class ConnectionConstants -{ - public const string ServerHostWebsocketEndpoint = "/private/socket"; -} diff --git a/SwarmControl.Shared/Models/Game/Command.cs b/SwarmControl.Shared/Models/Game/Command.cs deleted file mode 100644 index 633c0ac1..00000000 --- a/SwarmControl.Shared/Models/Game/Command.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace SwarmControl.Shared.RemoteControl.Models.Game; -internal class Command -{ - public ParameterModel[] Parameters { get; set; } -} diff --git a/SwarmControl.Shared/Models/Game/EnumDefinitionModel.cs b/SwarmControl.Shared/Models/Game/EnumDefinitionModel.cs deleted file mode 100644 index 9b7ccb65..00000000 --- a/SwarmControl.Shared/Models/Game/EnumDefinitionModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace SwarmControl.Shared.Models.Game; -public class EnumDefinitionModel(Type enumType) -{ - public string Name { get; set; } = enumType.Name; - public string[] Values { get; set; } = enumType.GetEnumNames(); -} diff --git a/SwarmControl.Shared/Models/Game/HostAuthInfo.cs b/SwarmControl.Shared/Models/Game/HostAuthInfo.cs deleted file mode 100644 index 75ed94ea..00000000 --- a/SwarmControl.Shared/Models/Game/HostAuthInfo.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace SwarmControl.Shared.Models.Game; - -/// -/// Authentication information for a "host" connection to the backend. -/// -/// Identity of the user that logged into the backend. -/// Opaque token. -public readonly struct HostAuthInfo(string twitchUsername, string token) -{ - public string TwitchUsername { get; } = twitchUsername; - public string Token { get; } = token; -} diff --git a/SwarmControl.Shared/Models/Game/Messages/CommandAvailabilityChangedMessage.cs b/SwarmControl.Shared/Models/Game/Messages/CommandAvailabilityChangedMessage.cs deleted file mode 100644 index f4d6bc7f..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/CommandAvailabilityChangedMessage.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; - -namespace SwarmControl.Shared.Models.Game.Messages; - -#nullable enable -//internal record CommandAvailabilityChangedMessage : GameMessage -//{ -// public override MessageType MessageType => MessageType.CommandAvailabilityChanged; -// public List? BecameAvailable { get; set; } -// public List? BecameUnavailable { get; set; } -//} diff --git a/SwarmControl.Shared/Models/Game/Messages/CommandInvocationSource.cs b/SwarmControl.Shared/Models/Game/Messages/CommandInvocationSource.cs deleted file mode 100644 index 43f3e435..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/CommandInvocationSource.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace SwarmControl.Shared.Models.Game.Messages; - -public enum CommandInvocationSource -{ - Swarm, - Dev -} diff --git a/SwarmControl.Shared/Models/Game/Messages/ConsoleInputMessage.cs b/SwarmControl.Shared/Models/Game/Messages/ConsoleInputMessage.cs deleted file mode 100644 index 656699d7..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/ConsoleInputMessage.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace SwarmControl.Shared.Models.Game.Messages; - -public sealed record ConsoleInputMessage : BackendMessage -{ - public override MessageType MessageType => MessageType.ConsoleInput; - public string Input { get; set; } = string.Empty; -} diff --git a/SwarmControl.Shared/Models/Game/Messages/GameSocketMessage.cs b/SwarmControl.Shared/Models/Game/Messages/GameSocketMessage.cs deleted file mode 100644 index cb0a4daa..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/GameSocketMessage.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; - -namespace SwarmControl.Shared.Models.Game.Messages; - -#nullable enable -[JsonObject(MemberSerialization = MemberSerialization.OptOut, NamingStrategyType = typeof(CamelCaseNamingStrategy))] -public abstract record GameSocketMessage -{ - [JsonRequired] - public abstract MessageType MessageType { get; } - - public Guid Guid { get; init; } - public long Timestamp { get; } - - public GameSocketMessage() - { - Timestamp = Now(); - Guid = Guid.NewGuid(); - } - - private static long Now() => DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); -} -/// -/// Message sent from the game to the backend. -/// -public abstract record GameMessage : GameSocketMessage; -/// -/// Message sent from the backend to the game. -/// -public abstract record BackendMessage : GameSocketMessage -{ - public TwitchUser? User { get; set; } - - public string GetUsername() => User?.Username ?? "(Anonymous)"; - public string GetDisplayName() => User?.DisplayName ?? "(Anonymous)"; -} diff --git a/SwarmControl.Shared/Models/Game/Messages/HelloBackMessage.cs b/SwarmControl.Shared/Models/Game/Messages/HelloBackMessage.cs deleted file mode 100644 index 0286ae4e..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/HelloBackMessage.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace SwarmControl.Shared.Models.Game.Messages; - -[method: SetsRequiredMembers] -public sealed record HelloBackMessage() : BackendMessage() -{ - public override MessageType MessageType => MessageType.HelloBack; - public bool Allowed { get; init; } -} diff --git a/SwarmControl.Shared/Models/Game/Messages/HelloMessage.cs b/SwarmControl.Shared/Models/Game/Messages/HelloMessage.cs deleted file mode 100644 index aabc92e8..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/HelloMessage.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace SwarmControl.Shared.Models.Game.Messages; - -[method: SetsRequiredMembers] -public sealed record HelloMessage() : GameMessage() -{ - public override MessageType MessageType => MessageType.Hello; - public string Version { get; init; } -} diff --git a/SwarmControl.Shared/Models/Game/Messages/IngameStateChangedMessage.cs b/SwarmControl.Shared/Models/Game/Messages/IngameStateChangedMessage.cs deleted file mode 100644 index dd8d5d18..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/IngameStateChangedMessage.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace SwarmControl.Shared.Models.Game.Messages; - -internal record IngameStateChangedMessage : GameMessage -{ - public override MessageType MessageType => MessageType.IngameStateChanged; - public bool Ingame { get; set; } - public bool Paused { get; set; } - /// - /// Forbid spawning while inside a base or seatruck (prawn suit is fine) - /// - public bool Indoors { get; set; } - public bool OnLand { get; set; } -} diff --git a/SwarmControl.Shared/Models/Game/Messages/LogMessage.cs b/SwarmControl.Shared/Models/Game/Messages/LogMessage.cs deleted file mode 100644 index 6689d4d4..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/LogMessage.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace SwarmControl.Shared.Models.Game.Messages; - -#nullable enable -internal record LogMessage : GameMessage -{ - public override MessageType MessageType => MessageType.Log; - public bool Important { get; set; } - public string Message { get; set; } = ""; -} diff --git a/SwarmControl.Shared/Models/Game/Messages/MessageType.cs b/SwarmControl.Shared/Models/Game/Messages/MessageType.cs deleted file mode 100644 index 683c267f..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/MessageType.cs +++ /dev/null @@ -1,22 +0,0 @@ -//using Newtonsoft.Json; -//using Newtonsoft.Json.Converters; - -namespace SwarmControl.Shared.Models.Game.Messages; - -//[JsonConverter(typeof(StringEnumConverter))] -public enum MessageType -{ - // game to backend - Hello, // send command data - Ping, // ping - Log, - Result, // command/console result - IngameStateChanged, // (global) e.g. redeems dependent on Player.main, or stuff that freezes with time freezers (e.g. spawns?) - //CommandAvailabilityChanged, // individual command (for specific cases) - - // backend to game - HelloBack, // hello ack - Pong, // pong - ConsoleInput, // execute console string - Redeem, // invoke command with named args -} diff --git a/SwarmControl.Shared/Models/Game/Messages/PingMessage.cs b/SwarmControl.Shared/Models/Game/Messages/PingMessage.cs deleted file mode 100644 index 145e20c0..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/PingMessage.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace SwarmControl.Shared.Models.Game.Messages; -internal record PingMessage : GameMessage -{ - public override MessageType MessageType => MessageType.Ping; -} diff --git a/SwarmControl.Shared/Models/Game/Messages/PongMessage.cs b/SwarmControl.Shared/Models/Game/Messages/PongMessage.cs deleted file mode 100644 index 49d692a9..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/PongMessage.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SwarmControl.Shared.Models.Game.Messages; - -internal record PongMessage : BackendMessage -{ - public override MessageType MessageType => MessageType.Pong; -} diff --git a/SwarmControl.Shared/Models/Game/Messages/RedeemMessage.cs b/SwarmControl.Shared/Models/Game/Messages/RedeemMessage.cs deleted file mode 100644 index 4b5ce5a2..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/RedeemMessage.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; - -namespace SwarmControl.Shared.Models.Game.Messages; - -#nullable enable -[method: SetsRequiredMembers] -public sealed record RedeemMessage() : BackendMessage() -{ - public override MessageType MessageType => MessageType.Redeem; - - public CommandInvocationSource Source { get; set; } - public bool Announce { get; set; } = true; - public string Title { get; set; } = string.Empty; - public string Command { get; set; } = string.Empty; - public Dictionary? Args { get; set; } -} diff --git a/SwarmControl.Shared/Models/Game/Messages/ResultMessage.cs b/SwarmControl.Shared/Models/Game/Messages/ResultMessage.cs deleted file mode 100644 index a80d463d..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/ResultMessage.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace SwarmControl.Shared.Models.Game.Messages; - -#nullable enable -[method: SetsRequiredMembers] -public sealed record ResultMessage() : GameMessage() -{ - public override MessageType MessageType => MessageType.Result; - public bool Success { get; set; } - public string? Message { get; set; } -} diff --git a/SwarmControl.Shared/Models/Game/Messages/SocketMessage.cs b/SwarmControl.Shared/Models/Game/Messages/SocketMessage.cs deleted file mode 100644 index d2df4a90..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/SocketMessage.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; - -namespace SwarmControl.Shared.Models.Game.Messages; - -#nullable enable -[JsonObject(MemberSerialization = MemberSerialization.OptOut, NamingStrategyType = typeof(CamelCaseNamingStrategy))] -public abstract record SocketMessage -{ - [JsonRequired] - public abstract MessageType MessageType { get; } - - public Guid Guid { get; init; } - public long Timestamp { get; } - - public SocketMessage() - { - Timestamp = Now(); - Guid = Guid.NewGuid(); - } - - private static long Now() => DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); -} -/// -/// Message sent from the game to the backend. -/// -public abstract record GameMessage : SocketMessage; -/// -/// Message sent from the backend to the game. -/// -public abstract record BackendMessage : SocketMessage -{ - public TwitchUser? User { get; set; } - - public string GetUsername() => User?.Username ?? "(Anonymous)"; - public string GetDisplayName() => User?.DisplayName ?? "(Anonymous)"; -} diff --git a/SwarmControl.Shared/Models/Game/Messages/TwitchUser.cs b/SwarmControl.Shared/Models/Game/Messages/TwitchUser.cs deleted file mode 100644 index fd50c9f2..00000000 --- a/SwarmControl.Shared/Models/Game/Messages/TwitchUser.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace SwarmControl.Shared.Models.Game.Messages; - -#nullable enable -/// -/// Twitch user info. -/// -/// Channel ID. -/// Login name. -/// What's displayed in chat. -public record TwitchUser(int Id, string Username, string DisplayName); diff --git a/SwarmControl.Shared/Models/Game/NamedModel.cs b/SwarmControl.Shared/Models/Game/NamedModel.cs deleted file mode 100644 index 03a24f54..00000000 --- a/SwarmControl.Shared/Models/Game/NamedModel.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace SwarmControl.Shared.Models.Game; - -#nullable enable -public class NamedModel(string name, string? title = null, string? description = null) -{ - public string Name { get; set; } = name; - public string? Title { get; set; } = title; - public string? Description { get; set; } = description; - - protected internal NamedModel() - : this(null!) - { } - public NamedModel(NamedModel other) - : this(other.Name, other.Title, other.Description) - { } - public static implicit operator NamedModel(string name) - => new(name); -} diff --git a/SwarmControl.Shared/Models/Game/ParameterModel.cs b/SwarmControl.Shared/Models/Game/ParameterModel.cs deleted file mode 100644 index 87b24540..00000000 --- a/SwarmControl.Shared/Models/Game/ParameterModel.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using Newtonsoft.Json; -using SCHIZO.Commands.Base; -using UnityEngine; - -namespace SwarmControl.Shared.Models.Game; - -#nullable enable -public class ParameterModel : NamedModel -{ - public enum ParameterType - { - String, - Integer, - Float, - Boolean, - Vector3 - } - [JsonIgnore] - public Type ActualType { get; set; } - public object Type { get; set; } - public bool Required { get; set; } - public object? DefaultValue { get; set; } - - public ParameterModel(Parameter param) - : base(param) - { - ActualType = param.Type; - Type = GetTypeToken(param.Type); - Required = !param.IsOptional; - DefaultValue = param.HasDefaultValue ? param.DefaultValue : null; - } - - private static object GetTypeToken(Type type) - { - if (type.IsEnum) - return $"{char.ToLowerInvariant(type.Name[0])}{type.Name[1..]}"; // i cba to deal with json naming - if (type == typeof(string)) - return ParameterType.String; - if (type == typeof(int) || type == typeof(long)) - return ParameterType.Integer; - if (type == typeof(float) || type == typeof(double)) - return ParameterType.Float; - if (type == typeof(bool)) - return ParameterType.Boolean; - if (type == typeof(Vector3)) - return ParameterType.Vector3; - return "unk_"+type.Name; - } -} diff --git a/SwarmControl.Shared/SwarmControl.Shared.projitems b/SwarmControl.Shared/SwarmControl.Shared.projitems deleted file mode 100644 index ab75c0ca..00000000 --- a/SwarmControl.Shared/SwarmControl.Shared.projitems +++ /dev/null @@ -1,32 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - d410ad84-1eb0-4f43-b1af-2149ebc5e2f3 - - - SwarmControl.Shared - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/SwarmControl.Shared/SwarmControl.Shared.shproj b/SwarmControl.Shared/SwarmControl.Shared.shproj deleted file mode 100644 index a7c8b265..00000000 --- a/SwarmControl.Shared/SwarmControl.Shared.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - d410ad84-1eb0-4f43-b1af-2149ebc5e2f3 - 14.0 - - - - - - - -