diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 683b60f..ec676e7 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -7,6 +7,7 @@ on: - '*/*' # matches every branch containing a single '/' - '**' # matches every branch - '!main' # excludes main + - '!dev-nightly' # excludes nightly pull_request: branches: [ "main", "dev-nightly" ] @@ -42,6 +43,6 @@ jobs: uses: actions/upload-artifact@v3 with: name: RageCoop.Client - path: bin/Release/Client/RageCoop + path: bin/Release/Client - uses: actions/checkout@v2 - \ No newline at end of file + diff --git a/RageCoop.Client.Installer/MainWindow.xaml.cs b/RageCoop.Client.Installer/MainWindow.xaml.cs index e9a80b8..12f415a 100644 --- a/RageCoop.Client.Installer/MainWindow.xaml.cs +++ b/RageCoop.Client.Installer/MainWindow.xaml.cs @@ -78,10 +78,10 @@ namespace RageCoop.Client.Installer Environment.Exit(1); } var shvdnVer = GetVer(shvdnPath); - if (shvdnVer < new Version(3, 5, 1)) + if (shvdnVer < new Version(3, 6, 0)) { MessageBox.Show("Please update ScriptHookVDotNet to latest version!" + - $"\nCurrent version is {shvdnVer}, 3.5.1 or higher is required"); + $"\nCurrent version is {shvdnVer}, 3.6.0 or higher is required"); Environment.Exit(1); } if (File.Exists(lemonPath)) diff --git a/RageCoop.Client/Main.cs b/RageCoop.Client/Main.cs index b91d69b..a853bc4 100644 --- a/RageCoop.Client/Main.cs +++ b/RageCoop.Client/Main.cs @@ -141,7 +141,9 @@ namespace RageCoop.Client } catch (Exception ex) { +#if DEBUG Main.Logger.Error(ex); +#endif } if (Networking.ShowNetworkInfo) @@ -347,7 +349,9 @@ namespace RageCoop.Client } catch (Exception ex) { +#if DEBUG Logger.Error(ex); +#endif QueuedActions.Remove(action); } } diff --git a/RageCoop.Client/Menus/CoopMenu.cs b/RageCoop.Client/Menus/CoopMenu.cs index 76ce769..f87b55c 100644 --- a/RageCoop.Client/Menus/CoopMenu.cs +++ b/RageCoop.Client/Menus/CoopMenu.cs @@ -67,16 +67,18 @@ namespace RageCoop.Client.Menus Menu.AddSubMenu(SettingsMenu.Menu); Menu.AddSubMenu(DevToolMenu.Menu); +#if DEBUG Menu.AddSubMenu(DebugMenu.Menu); - Menu.AddSubMenu(UpdateMenu.Menu); +#endif MenuPool.Add(Menu); MenuPool.Add(SettingsMenu.Menu); MenuPool.Add(DevToolMenu.Menu); +#if DEBUG MenuPool.Add(DebugMenu.Menu); MenuPool.Add(DebugMenu.DiagnosticMenu); +#endif MenuPool.Add(ServersMenu.Menu); - MenuPool.Add(UpdateMenu.Menu); MenuPool.Add(PopUp); Menu.Add(_aboutItem); diff --git a/RageCoop.Client/Menus/Sub/DebugMenu.cs b/RageCoop.Client/Menus/Sub/DebugMenu.cs index 4dd0b3c..83c8e6f 100644 --- a/RageCoop.Client/Menus/Sub/DebugMenu.cs +++ b/RageCoop.Client/Menus/Sub/DebugMenu.cs @@ -1,4 +1,5 @@ -using GTA; +#if DEBUG +using GTA; using LemonUI.Menus; using System; using System.Drawing; @@ -56,3 +57,4 @@ namespace RageCoop.Client } } +#endif diff --git a/RageCoop.Client/Menus/Sub/UpdateMenu.cs b/RageCoop.Client/Menus/Sub/UpdateMenu.cs deleted file mode 100644 index 8ea727e..0000000 --- a/RageCoop.Client/Menus/Sub/UpdateMenu.cs +++ /dev/null @@ -1,105 +0,0 @@ -using ICSharpCode.SharpZipLib.Zip; -using LemonUI.Menus; -using System; -using System.Drawing; -using System.IO; -using System.Net; -using System.Threading.Tasks; - -namespace RageCoop.Client.Menus -{ - internal class UpdateMenu - { - public static bool IsUpdating { get; private set; } = false; - private static readonly NativeItem _updatingItem = new NativeItem("Updating..."); - private static readonly NativeItem _downloadItem = new NativeItem("Download", "Download and update to latest nightly"); - - private static readonly string _downloadPath = Path.Combine(Main.Settings.DataDirectory, "RageCoop.Client.zip"); - public static NativeMenu Menu = new NativeMenu("Update", "Update", "Download and install latest nightly build from GitHub") - { - UseMouse = false, - Alignment = Main.Settings.FlipMenu ? GTA.UI.Alignment.Right : GTA.UI.Alignment.Left - }; - static UpdateMenu() - { - Menu.Banner.Color = Color.FromArgb(225, 0, 0, 0); - Menu.Title.Color = Color.FromArgb(255, 165, 0); - Menu.Opening += Opening; - _downloadItem.Activated += StartUpdate; - } - - private static void StartUpdate(object sender, EventArgs e) - { - IsUpdating = true; - Menu.Clear(); - Menu.Add(_updatingItem); - Task.Run(() => - { - try - { - if (File.Exists(_downloadPath)) { File.Delete(_downloadPath); } - WebClient client = new WebClient(); - - // TLS only - ServicePointManager.Expect100Continue = true; - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls13 | SecurityProtocolType.Tls12; - ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; - - client.DownloadProgressChanged += (s, e1) => { Main.QueueAction(() => { _updatingItem.AltTitle = $"{e1.ProgressPercentage}%"; }); }; - client.DownloadFileCompleted += (s, e2) => { Install(); }; - client.DownloadFileAsync(new Uri("https://github.com/RAGECOOP/RAGECOOP-V/releases/download/nightly/RageCoop.Client.zip"), _downloadPath); - } - catch (Exception ex) - { - Main.Logger.Error(ex); - } - }); - } - - private static void Install() - { - try - { - Main.QueueAction(() => - { - _updatingItem.AltTitle = "Installing..."; - }); - Directory.CreateDirectory(@"Scripts\RageCoop"); - foreach (var f in Directory.GetFiles(@"Scripts\RageCoop", "*.dll", SearchOption.AllDirectories)) - { - try { File.Delete(f); } - catch { } - } - new FastZip().ExtractZip(_downloadPath, "Scripts", FastZip.Overwrite.Always, null, null, null, true); - try { File.Delete(_downloadPath); } catch { } - try { File.Delete(Path.Combine("Scripts", "RageCoop.Client.Installer.exe")); } catch { } - Main.QueueAction(() => - { - Util.Reload(); - IsUpdating = false; - }); - } - catch (Exception ex) - { - Main.Logger.Error(ex); - } - } - - private static void Opening(object sender, System.ComponentModel.CancelEventArgs e) - { - Menu.Clear(); - if (Networking.IsOnServer) - { - Menu.Add(new NativeItem("Disconnect from the server first")); - } - else if (IsUpdating) - { - Menu.Add(_updatingItem); - } - else - { - Menu.Add(_downloadItem); - } - } - } -} diff --git a/RageCoop.Client/Networking/Networking.cs b/RageCoop.Client/Networking/Networking.cs index 703c779..6feec5d 100644 --- a/RageCoop.Client/Networking/Networking.cs +++ b/RageCoop.Client/Networking/Networking.cs @@ -53,13 +53,14 @@ namespace RageCoop.Client NetPeerConfiguration config = new NetPeerConfiguration("623c92c287cc392406e7aaaac1c0f3b0") { AutoFlushSendQueue = false, - SimulatedMinimumLatency = SimulatedLatency, - SimulatedRandomLatency = 0, AcceptIncomingConnections = true, MaximumConnections = 32, PingInterval = 5 }; - +#if DEBUG + config.SimulatedMinimumLatency = SimulatedLatency; + config.SimulatedRandomLatency = 0; +#endif config.EnableMessageType(NetIncomingMessageType.UnconnectedData); config.EnableMessageType(NetIncomingMessageType.NatIntroductionSuccess); @@ -96,7 +97,12 @@ namespace RageCoop.Client Peer.OnMessageReceived += (s, m) => { try { ProcessMessage(m); } - catch (Exception ex) { Main.Logger.Error(ex); } + catch (Exception ex) + { +#if DEBUG + Main.Logger.Error(ex); +#endif + } }; Main.QueueAction(() => { Notification.Show($"~y~Trying to connect..."); }); Menus.CoopMenu._serverConnectItem.Enabled = false; diff --git a/RageCoop.Client/Networking/Receive.cs b/RageCoop.Client/Networking/Receive.cs index e3b6a37..da05784 100644 --- a/RageCoop.Client/Networking/Receive.cs +++ b/RageCoop.Client/Networking/Receive.cs @@ -149,6 +149,7 @@ namespace RageCoop.Client } catch (Exception ex) { +#if DEBUG Main.QueueAction(() => { GTA.UI.Notification.Show($"~r~~h~Packet Error {ex.Message}"); @@ -157,6 +158,7 @@ namespace RageCoop.Client Main.Logger.Error($"[{packetType}] {ex.Message}"); Main.Logger.Error(ex); Peer.Shutdown($"Packet Error [{packetType}]"); +#endif } break; } diff --git a/RageCoop.Client/Properties/AssemblyInfo.cs b/RageCoop.Client/Properties/AssemblyInfo.cs index 726356d..2c99ea5 100644 --- a/RageCoop.Client/Properties/AssemblyInfo.cs +++ b/RageCoop.Client/Properties/AssemblyInfo.cs @@ -16,7 +16,7 @@ using System.Resources; // Version informationr( -[assembly: AssemblyVersion("1.5.4.1")] -[assembly: AssemblyFileVersion("1.5.4.1")] +[assembly: AssemblyVersion("1.5.4.4")] +[assembly: AssemblyFileVersion("1.5.4.4")] [assembly: NeutralResourcesLanguageAttribute( "en-US" )] diff --git a/RageCoop.Client/RageCoop.Client.csproj b/RageCoop.Client/RageCoop.Client.csproj index a24315a..d0d44ef 100644 --- a/RageCoop.Client/RageCoop.Client.csproj +++ b/RageCoop.Client/RageCoop.Client.csproj @@ -36,7 +36,6 @@ - @@ -67,6 +66,7 @@ + diff --git a/RageCoop.Client/Scripting/BaseScript.cs b/RageCoop.Client/Scripting/BaseScript.cs index 0a389af..8d489ae 100644 --- a/RageCoop.Client/Scripting/BaseScript.cs +++ b/RageCoop.Client/Scripting/BaseScript.cs @@ -46,7 +46,7 @@ namespace RageCoop.Client.Scripting int weather1 = default(int); int weather2 = default(int); float percent2 = default(float); - Function.Call(Hash._GET_WEATHER_TYPE_TRANSITION, &weather1, &weather2, &percent2); + Function.Call(Hash.GET_CURR_WEATHER_STATE, &weather1, &weather2, &percent2); API.SendCustomEvent(CustomEvents.WeatherTimeSync, time.Hours, time.Minutes, time.Seconds, weather1, weather2, percent2); } }); @@ -60,7 +60,7 @@ namespace RageCoop.Client.Scripting private void WeatherTimeSync(CustomEventReceivedArgs e) { World.CurrentTimeOfDay = new TimeSpan((int)e.Args[0], (int)e.Args[1], (int)e.Args[2]); - Function.Call(Hash._SET_WEATHER_TYPE_TRANSITION, (int)e.Args[3], (int)e.Args[4], (float)e.Args[5]); + Function.Call(Hash.SET_CURR_WEATHER_STATE, (int)e.Args[3], (int)e.Args[4], (float)e.Args[5]); } private void SetDisplayNameTag(CustomEventReceivedArgs e) diff --git a/RageCoop.Client/Settings.cs b/RageCoop.Client/Settings.cs index bd21ee1..654c49e 100644 --- a/RageCoop.Client/Settings.cs +++ b/RageCoop.Client/Settings.cs @@ -22,7 +22,7 @@ namespace RageCoop.Client /// /// Don't use it! /// - public string MasterServer { get; set; } = "https://masterserver.ragecoop.online/"; + public string MasterServer { get; set; } = "https://masterserver.ragecoop.com/"; /// /// Don't use it! /// @@ -51,7 +51,7 @@ namespace RageCoop.Client /// /// Disable world NPC traffic, mission entities won't be affected /// - public bool DisableTraffic { get; set; } = true; + public bool DisableTraffic { get; set; } = false; /// /// Bring up pause menu but don't freeze time when FrontEndPauseAlternate(Esc) is pressed. diff --git a/RageCoop.Client/Sync/Entities/Ped/SyncedPed.cs b/RageCoop.Client/Sync/Entities/Ped/SyncedPed.cs index 9660aaa..0a5d75e 100644 --- a/RageCoop.Client/Sync/Entities/Ped/SyncedPed.cs +++ b/RageCoop.Client/Sync/Entities/Ped/SyncedPed.cs @@ -28,7 +28,7 @@ namespace RageCoop.Client MainPed = p; OwnerID = Main.LocalPlayerID; - Function.Call(Hash._SET_PED_CAN_PLAY_INJURED_ANIMS, false); + Function.Call(Hash.SET_PED_IS_IGNORED_BY_AUTO_OPEN_DOORS, false); MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisableHurt, true); // MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisableMelee, true); @@ -235,7 +235,7 @@ namespace RageCoop.Client Function.Call(Hash.SET_PED_CAN_BE_TARGETTED_BY_PLAYER, MainPed.Handle, Game.Player, true); Function.Call(Hash.SET_PED_GET_OUT_UPSIDE_DOWN_VEHICLE, MainPed.Handle, false); Function.Call(Hash.SET_CAN_ATTACK_FRIENDLY, MainPed.Handle, true, true); - Function.Call(Hash._SET_PED_CAN_PLAY_INJURED_ANIMS, false); + Function.Call(Hash.SET_PED_IS_IGNORED_BY_AUTO_OPEN_DOORS, false); Function.Call(Hash.SET_PED_CAN_EVASIVE_DIVE, MainPed.Handle, false); MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DrownsInWater, false); @@ -713,7 +713,7 @@ namespace RageCoop.Client case 5: if (MainPed.VehicleTryingToEnter != CurrentVehicle.MainVehicle || MainPed.GetSeatTryingToEnter() != Seat) { - MainPed.Task.EnterVehicle(CurrentVehicle.MainVehicle, Seat, -1, 5, EnterVehicleFlags.AllowJacking); + MainPed.Task.EnterVehicle(CurrentVehicle.MainVehicle, Seat, -1, 5, EnterVehicleFlags.JackAnyone); } break; case 6: diff --git a/RageCoop.Client/Sync/Entities/Vehicle/SyncedVehicle.Members.cs b/RageCoop.Client/Sync/Entities/Vehicle/SyncedVehicle.Members.cs index 580a838..7a3c3b7 100644 --- a/RageCoop.Client/Sync/Entities/Vehicle/SyncedVehicle.Members.cs +++ b/RageCoop.Client/Sync/Entities/Vehicle/SyncedVehicle.Members.cs @@ -70,7 +70,6 @@ namespace RageCoop.Client private readonly List _predictedTrace = new List(); private readonly List _orgTrace = new List(); private Vector3 _predictedPosition; - private readonly float _elapsed; #endregion #region OUTGOING diff --git a/RageCoop.Client/Sync/Entities/Vehicle/SyncedVehicle.cs b/RageCoop.Client/Sync/Entities/Vehicle/SyncedVehicle.cs index 9c20dcb..d99e89b 100644 --- a/RageCoop.Client/Sync/Entities/Vehicle/SyncedVehicle.cs +++ b/RageCoop.Client/Sync/Entities/Vehicle/SyncedVehicle.cs @@ -197,13 +197,13 @@ namespace RageCoop.Client if (!_lastTransformed) { _lastTransformed = true; - Function.Call(Hash._TRANSFORM_VEHICLE_TO_SUBMARINE, MainVehicle.Handle, false); + Function.Call(Hash.TRANSFORM_TO_SUBMARINE, MainVehicle.Handle, false); } } else if (_lastTransformed) { _lastTransformed = false; - Function.Call(Hash._TRANSFORM_SUBMARINE_TO_VEHICLE, MainVehicle.Handle, false); + Function.Call(Hash.TRANSFORM_TO_CAR, MainVehicle.Handle, false); } } else if (IsDeluxo) @@ -364,7 +364,7 @@ namespace RageCoop.Client private void StartPedalingAnim(bool fast) { - MainVehicle.Driver?.Task.PlayAnimation(PedalingAnimDict(), PedalingAnimName(fast), 8.0f, -8.0f, -1, AnimationFlags.Loop | AnimationFlags.AllowRotation, 1.0f); + MainVehicle.Driver?.Task.PlayAnimation(PedalingAnimDict(), PedalingAnimName(fast), 8.0f, -8.0f, -1, AnimationFlags.Loop | AnimationFlags.Secondary, 1.0f); } diff --git a/RageCoop.Client/Sync/EntityPool.cs b/RageCoop.Client/Sync/EntityPool.cs index 928b7f7..6bc2022 100644 --- a/RageCoop.Client/Sync/EntityPool.cs +++ b/RageCoop.Client/Sync/EntityPool.cs @@ -365,7 +365,7 @@ namespace RageCoop.Client SyncedPed c = GetPedByHandle(p.Handle); if (c == null && (p != Game.Player.Character)) { - if (allPeds.Length > Main.Settings.WorldPedSoftLimit && p.PopulationType != EntityPopulationType.RandomAmbient) + if (allPeds.Length > Main.Settings.WorldPedSoftLimit && p.PopulationType == EntityPopulationType.RandomAmbient && !p.IsInVehicle()) { p.Delete(); continue; diff --git a/RageCoop.Client/Util/AddOnDataProvider.cs b/RageCoop.Client/Util/AddOnDataProvider.cs new file mode 100644 index 0000000..9936953 --- /dev/null +++ b/RageCoop.Client/Util/AddOnDataProvider.cs @@ -0,0 +1,64 @@ +using GTA; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RageCoop.Client +{ + /// + /// Class providing support for addon mods + /// + internal class AddOnDataProvider + { + public static int GetMuzzleIndex(Model model) + { + switch (model.Hash) + { + // f14a2 + case -848721350: + return 48; + + // f15e + case 881261972: + return 32; + + // f16c + case -2051171080: + return 25; + + // F22A + case 2061630439: + return 14; + + // f35c + case -343547392: + return 44; + + // mig29a + case 513887552: + return 18; + + // su30sm + case -733985185: + return 34; + + // su33 + case -722216722: + return 34; + + // su35s + case -268602544: + return 28; + + // su57 + case 1490050781: + return 21; + + default: + return -1; + } + } + } +} diff --git a/RageCoop.Client/Util/PedExtensions.cs b/RageCoop.Client/Util/PedExtensions.cs index fdf5f00..32c62d0 100644 --- a/RageCoop.Client/Util/PedExtensions.cs +++ b/RageCoop.Client/Util/PedExtensions.cs @@ -296,7 +296,7 @@ namespace RageCoop.Client { result = true; } - else + else if (veh.GetPedOnSeat(seat) != null) { bool isDead = veh.GetPedOnSeat(seat).IsDead; diff --git a/RageCoop.Client/Util/VehicleExtensions.cs b/RageCoop.Client/Util/VehicleExtensions.cs index 6b601f0..af5df8c 100644 --- a/RageCoop.Client/Util/VehicleExtensions.cs +++ b/RageCoop.Client/Util/VehicleExtensions.cs @@ -50,7 +50,7 @@ namespace RageCoop.Client flags |= VehicleDataFlags.IsHornActive; } - if (v.IsSubmarineCar && Function.Call(Hash._GET_IS_SUBMARINE_VEHICLE_TRANSFORMED, veh.Handle)) + if (v.IsSubmarineCar && Function.Call(Hash.IS_VEHICLE_IN_SUBMARINE_MODE, veh.Handle)) { flags |= VehicleDataFlags.IsTransformed; } @@ -89,7 +89,7 @@ namespace RageCoop.Client } public static bool IsRocketBoostActive(this Vehicle veh) { - return Function.Call(Hash._IS_VEHICLE_ROCKET_BOOST_ACTIVE, veh); + return Function.Call(Hash.IS_ROCKET_BOOST_ACTIVE, veh); } public static bool IsParachuteActive(this Vehicle veh) { @@ -97,7 +97,7 @@ namespace RageCoop.Client } public static void SetRocketBoostActive(this Vehicle veh, bool toggle) { - Function.Call(Hash._SET_VEHICLE_ROCKET_BOOST_ACTIVE, veh, toggle); + Function.Call(Hash.SET_ROCKET_BOOST_ACTIVE, veh, toggle); } public static void SetParachuteActive(this Vehicle veh, bool toggle) { @@ -242,7 +242,7 @@ namespace RageCoop.Client public static void SetDeluxoHoverState(this Vehicle deluxo, bool hover) { - Function.Call(Hash._SET_VEHICLE_HOVER_TRANSFORM_PERCENTAGE, deluxo, hover ? 1f : 0f); + Function.Call(Hash.SET_SPECIAL_FLIGHT_MODE_TARGET_RATIO, deluxo, hover ? 1f : 0f); } public static bool IsDeluxoHovering(this Vehicle deluxo) { @@ -250,7 +250,7 @@ namespace RageCoop.Client } public static void SetDeluxoWingRatio(this Vehicle v, float ratio) { - Function.Call(Hash._SET_SPECIALFLIGHT_WING_RATIO, v, ratio); + Function.Call(Hash.SET_HOVER_MODE_WING_RATIO, v, ratio); } public static float GetDeluxoWingRatio(this Vehicle v) { @@ -258,7 +258,7 @@ namespace RageCoop.Client } public static float GetNozzleAngel(this Vehicle plane) { - return Function.Call(Hash._GET_VEHICLE_FLIGHT_NOZZLE_POSITION, plane); + return Function.Call(Hash.GET_VEHICLE_FLIGHT_NOZZLE_POSITION, plane); } public static bool HasNozzle(this Vehicle v) { diff --git a/RageCoop.Client/Util/WeaponUtil.cs b/RageCoop.Client/Util/WeaponUtil.cs index 215f240..ca403e5 100644 --- a/RageCoop.Client/Util/WeaponUtil.cs +++ b/RageCoop.Client/Util/WeaponUtil.cs @@ -362,7 +362,7 @@ namespace RageCoop.Client return 30; default: - return -1; + return AddOnDataProvider.GetMuzzleIndex(v.Model.Hash); } } public static bool IsUsingProjectileWeapon(this Ped p) diff --git a/RageCoop.Core/CoreUtils.cs b/RageCoop.Core/CoreUtils.cs index 27a64c4..d2d97ad 100644 --- a/RageCoop.Core/CoreUtils.cs +++ b/RageCoop.Core/CoreUtils.cs @@ -240,14 +240,6 @@ namespace RageCoop.Core { return Encoding.UTF8.GetBytes(s); } - public static byte[] GetBytesWithLength(this string s) - { - var data = new List(100); - var sb = Encoding.UTF8.GetBytes(s); - data.AddInt(sb.Length); - data.AddRange(sb); - return data.ToArray(); - } public static string GetString(this byte[] data) { return Encoding.UTF8.GetString(data); diff --git a/RageCoop.Core/PacketExtensions.cs b/RageCoop.Core/PacketExtensions.cs index 22cf413..50c5cc2 100644 --- a/RageCoop.Core/PacketExtensions.cs +++ b/RageCoop.Core/PacketExtensions.cs @@ -63,65 +63,6 @@ namespace RageCoop.Core } #endregion - #region BYTE-LIST - public static void AddVector3(this List bytes, Vector3 vec3) - { - bytes.AddRange(BitConverter.GetBytes(vec3.X)); - bytes.AddRange(BitConverter.GetBytes(vec3.Y)); - bytes.AddRange(BitConverter.GetBytes(vec3.Z)); - } - public static void AddQuaternion(this List bytes, Quaternion quat) - { - bytes.AddRange(BitConverter.GetBytes(quat.X)); - bytes.AddRange(BitConverter.GetBytes(quat.Y)); - bytes.AddRange(BitConverter.GetBytes(quat.Z)); - bytes.AddRange(BitConverter.GetBytes(quat.W)); - } - public static void AddInt(this List bytes, int i) - { - bytes.AddRange(BitConverter.GetBytes(i)); - } - public static void AddUint(this List bytes, uint i) - { - bytes.AddRange(BitConverter.GetBytes(i)); - } - public static void AddShort(this List bytes, short i) - { - bytes.AddRange(BitConverter.GetBytes(i)); - } - public static void AddUshort(this List bytes, ushort i) - { - bytes.AddRange(BitConverter.GetBytes(i)); - } - public static void AddLong(this List bytes, long i) - { - bytes.AddRange(BitConverter.GetBytes(i)); - } - public static void AddUlong(this List bytes, ulong i) - { - bytes.AddRange(BitConverter.GetBytes(i)); - } - public static void AddFloat(this List bytes, float i) - { - bytes.AddRange(BitConverter.GetBytes(i)); - } - public static void AddBool(this List bytes, bool b) - { - bytes.Add(b ? (byte)1 : (byte)0); - } - public static void AddString(this List bytes, string s) - { - var sb = Encoding.UTF8.GetBytes(s); - bytes.AddInt(sb.Length); - bytes.AddRange(sb); - } - public static void AddArray(this List bytes, byte[] toadd) - { - bytes.AddInt(toadd.Length); - bytes.AddRange(toadd); - } - #endregion - internal static bool IsSyncEvent(this PacketType p) { return (30 <= (byte)p) && ((byte)p <= 40); diff --git a/RageCoop.Server/Networking/Server.Background.cs b/RageCoop.Server/Networking/Server.Background.cs index e5fcacc..77e7d90 100644 --- a/RageCoop.Server/Networking/Server.Background.cs +++ b/RageCoop.Server/Networking/Server.Background.cs @@ -81,7 +81,7 @@ namespace RageCoop.Server } if (!CanAnnounce) { - var existing = JsonConvert.DeserializeObject>(HttpHelper.DownloadString(Util.GetFinalRedirect(Settings.MasterServer))).Where(x => x.address == IpInfo.Address).FirstOrDefault(); + var existing = JsonConvert.DeserializeObject>(HttpHelper.DownloadString(Util.GetFinalRedirect(Settings.MasterServer))).Where(x => x.address == IpInfo.Address && x.port == Settings.Port.ToString()).FirstOrDefault(); if(existing != null) { Logger.Warning("Server info already present in master server, waiting for 10 seconds..."); diff --git a/RageCoop.Server/Properties/AssemblyInfo.cs b/RageCoop.Server/Properties/AssemblyInfo.cs index bea3fe6..f056db6 100644 --- a/RageCoop.Server/Properties/AssemblyInfo.cs +++ b/RageCoop.Server/Properties/AssemblyInfo.cs @@ -15,7 +15,7 @@ using System.Resources; [assembly: AssemblyCulture("")] // Version information -[assembly: AssemblyVersion("1.5.4.0")] -[assembly: AssemblyFileVersion("1.5.4.0")] +[assembly: AssemblyVersion("1.5.4.3")] +[assembly: AssemblyFileVersion("1.5.4.3")] [assembly: NeutralResourcesLanguageAttribute( "en-US" )] diff --git a/RageCoop.Server/RageCoop.Server.csproj b/RageCoop.Server/RageCoop.Server.csproj index ab0f1c3..d11cadd 100644 --- a/RageCoop.Server/RageCoop.Server.csproj +++ b/RageCoop.Server/RageCoop.Server.csproj @@ -49,12 +49,12 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/RageCoop.Server/Settings.cs b/RageCoop.Server/Settings.cs index da2ff24..21085e0 100644 --- a/RageCoop.Server/Settings.cs +++ b/RageCoop.Server/Settings.cs @@ -28,7 +28,7 @@ /// /// The website address to be shown on master server /// - public string Website { get; set; } = "https://ragecoop.online/"; + public string Website { get; set; } = "https://ragecoop.com/"; /// /// The description to be shown on master server @@ -58,7 +58,7 @@ /// /// Master server address, mostly doesn't need to be changed. /// - public string MasterServer { get; set; } = "https://masterserver.ragecoop.online/"; + public string MasterServer { get; set; } = "https://masterserver.ragecoop.com/"; /// /// See . diff --git a/libs/Lidgren.Network.dll b/libs/Lidgren.Network.dll index 0e3af9a..74148a9 100644 Binary files a/libs/Lidgren.Network.dll and b/libs/Lidgren.Network.dll differ diff --git a/libs/Lidgren.Network.pdb b/libs/Lidgren.Network.pdb deleted file mode 100644 index 4b90f31..0000000 Binary files a/libs/Lidgren.Network.pdb and /dev/null differ diff --git a/libs/ScriptHookVDotNet.dll b/libs/ScriptHookVDotNet.dll index d2aad63..50e4634 100644 Binary files a/libs/ScriptHookVDotNet.dll and b/libs/ScriptHookVDotNet.dll differ diff --git a/libs/ScriptHookVDotNet2.dll b/libs/ScriptHookVDotNet2.dll deleted file mode 100644 index 897cb26..0000000 Binary files a/libs/ScriptHookVDotNet2.dll and /dev/null differ diff --git a/libs/ScriptHookVDotNet3.dll b/libs/ScriptHookVDotNet3.dll index 6ab2498..c54ed76 100644 Binary files a/libs/ScriptHookVDotNet3.dll and b/libs/ScriptHookVDotNet3.dll differ