Compare commits
25 Commits
resource-b
...
dev-nightl
Author | SHA1 | Date | |
---|---|---|---|
85706518fe | |||
49208371d1 | |||
761156a574 | |||
8bd6ea15a3 | |||
3c7f16f7a4 | |||
393a401860 | |||
4a54851c51 | |||
f0eefa575c | |||
3fc813b2d8 | |||
fbff72ff14 | |||
4e52407591 | |||
4e6fde129d | |||
92e1a970a8 | |||
d0eb0b7818 | |||
14151d7b2c | |||
1f8d70a520 | |||
2cb5baf5f7 | |||
9287aba0f9 | |||
99642fd40c | |||
2fbf06b504 | |||
13b771ec9f | |||
3b987f59e0 | |||
de96f29097 | |||
6136cbfc14 | |||
ed145aedd6 |
21
.github/workflows/nightly-build.yaml
vendored
21
.github/workflows/nightly-build.yaml
vendored
@ -28,8 +28,6 @@ jobs:
|
|||||||
run: dotnet publish RageCoop.Server/RageCoop.Server.csproj --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=false -r win-x64 -o bin/Release/Server/win-x64 -c Release
|
run: dotnet publish RageCoop.Server/RageCoop.Server.csproj --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=false -r win-x64 -o bin/Release/Server/win-x64 -c Release
|
||||||
- name: Build server linux-x64
|
- name: Build server linux-x64
|
||||||
run: dotnet publish RageCoop.Server/RageCoop.Server.csproj --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=false -r linux-x64 -o bin/Release/Server/linux-x64 -c Release
|
run: dotnet publish RageCoop.Server/RageCoop.Server.csproj --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=false -r linux-x64 -o bin/Release/Server/linux-x64 -c Release
|
||||||
- name: Build server linux-arm
|
|
||||||
run: dotnet publish RageCoop.Server/RageCoop.Server.csproj --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=false -r linux-arm -o bin/Release/Server/linux-arm -c Release
|
|
||||||
- uses: vimtor/action-zip@v1
|
- uses: vimtor/action-zip@v1
|
||||||
with:
|
with:
|
||||||
files: bin/Release/Client
|
files: bin/Release/Client
|
||||||
@ -45,11 +43,6 @@ jobs:
|
|||||||
files: bin/Release/Server/linux-x64
|
files: bin/Release/Server/linux-x64
|
||||||
dest: RageCoop.Server-linux-x64.zip
|
dest: RageCoop.Server-linux-x64.zip
|
||||||
|
|
||||||
- uses: vimtor/action-zip@v1
|
|
||||||
with:
|
|
||||||
files: bin/Release/Server/linux-arm
|
|
||||||
dest: RageCoop.Server-linux-arm.zip
|
|
||||||
|
|
||||||
- uses: WebFreak001/deploy-nightly@v1.1.0
|
- uses: WebFreak001/deploy-nightly@v1.1.0
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # automatically provided by github actions
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # automatically provided by github actions
|
||||||
@ -82,17 +75,3 @@ jobs:
|
|||||||
asset_name: RageCoop.Server-linux-x64.zip
|
asset_name: RageCoop.Server-linux-x64.zip
|
||||||
asset_content_type: application/zip
|
asset_content_type: application/zip
|
||||||
max_releases: 7
|
max_releases: 7
|
||||||
|
|
||||||
|
|
||||||
- uses: WebFreak001/deploy-nightly@v1.1.0
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # automatically provided by github actions
|
|
||||||
with:
|
|
||||||
upload_url: https://uploads.github.com/repos/RAGECOOP/RAGECOOP-V/releases/70603992/assets{?name,label}
|
|
||||||
release_id: 70603992
|
|
||||||
asset_path: RageCoop.Server-linux-arm.zip
|
|
||||||
asset_name: RageCoop.Server-linux-arm.zip
|
|
||||||
asset_content_type: application/zip
|
|
||||||
max_releases: 7
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ RAGECOOP brings multiplayer experience to the story mode, you can complete missi
|
|||||||
|
|
||||||
# 👁 Requirements
|
# 👁 Requirements
|
||||||
- ScriptHookV
|
- ScriptHookV
|
||||||
- ScriptHookVDotNet 3.5.1 or later
|
- ScriptHookVDotNet 3.6.0 or later
|
||||||
- .NET Framework 4.8 Runtime or SDK
|
- .NET Framework 4.8 Runtime or SDK
|
||||||
|
|
||||||
# 📋 Building the project
|
# 📋 Building the project
|
||||||
@ -49,7 +49,7 @@ Then run `dotnet build` in the solution directory, built binaries are in the `bi
|
|||||||
5. Decent compatibility with other mods, set up a private modded server to have some fun!
|
5. Decent compatibility with other mods, set up a private modded server to have some fun!
|
||||||
6. Weaponized vehicle sync(WIP).
|
6. Weaponized vehicle sync(WIP).
|
||||||
7. Optimization for high-Ping condition, play with friends around the world!
|
7. Optimization for high-Ping condition, play with friends around the world!
|
||||||
8. Powerful scripting API and resource system, easily [add multiplayer functionality to your mod](HTTPS://docs.ragecoop.online).
|
8. Powerful scripting API and resource system, easily [add multiplayer functionality to your mod](HTTPS://docs.ragecoop.com).
|
||||||
|
|
||||||
# ⚠ Known issues
|
# ⚠ Known issues
|
||||||
|
|
||||||
|
@ -78,10 +78,10 @@ namespace RageCoop.Client.Installer
|
|||||||
Environment.Exit(1);
|
Environment.Exit(1);
|
||||||
}
|
}
|
||||||
var shvdnVer = GetVer(shvdnPath);
|
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!" +
|
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);
|
Environment.Exit(1);
|
||||||
}
|
}
|
||||||
if (File.Exists(lemonPath))
|
if (File.Exists(lemonPath))
|
||||||
|
@ -43,7 +43,7 @@ namespace RageCoop.Client
|
|||||||
public static void ShowTimeStamps()
|
public static void ShowTimeStamps()
|
||||||
{
|
{
|
||||||
GTA.UI.Notification.Hide(_lastNfHandle);
|
GTA.UI.Notification.Hide(_lastNfHandle);
|
||||||
_lastNfHandle = GTA.UI.Notification.Show(Debug.TimeStamps.Dump());
|
_lastNfHandle = GTA.UI.Notification.PostTicker(TimeStamps.Dump(), false).Handle;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ namespace RageCoop.Client
|
|||||||
thread.SetApartmentState(ApartmentState.STA);
|
thread.SetApartmentState(ApartmentState.STA);
|
||||||
thread.Start();
|
thread.Start();
|
||||||
thread.Join();
|
thread.Join();
|
||||||
GTA.UI.Notification.Show("Copied to clipboard, please paste it on the GitHub issue page!");
|
GTA.UI.Notification.PostTicker("Copied to clipboard, please paste it on the GitHub issue page!", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
GTA.UI.Notification.Show("Malformed configuration, overwriting with default values...");
|
GTA.UI.Notification.PostTicker("Malformed configuration, overwriting with default values...", false);
|
||||||
Settings = new Settings();
|
Settings = new Settings();
|
||||||
Util.SaveSettings();
|
Util.SaveSettings();
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
if (!_gameLoaded)
|
if (!_gameLoaded)
|
||||||
{
|
{
|
||||||
GTA.UI.Notification.Show("~r~Please update your GTA5 to v1.0.1290 or newer!", true);
|
GTA.UI.Notification.PostTicker("~r~Please update your GTA5 to v1.0.1290 or newer!", true);
|
||||||
_gameLoaded = true;
|
_gameLoaded = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -117,7 +117,7 @@ namespace RageCoop.Client
|
|||||||
else if (!_gameLoaded && (_gameLoaded = true))
|
else if (!_gameLoaded && (_gameLoaded = true))
|
||||||
{
|
{
|
||||||
#if !NON_INTERACTIVE
|
#if !NON_INTERACTIVE
|
||||||
GTA.UI.Notification.Show(GTA.UI.NotificationIcon.AllPlayersConf, "RAGECOOP", "Welcome!", $"Press ~g~{Main.Settings.MenuKey}~s~ to open the menu.");
|
GTA.UI.Notification.PostMessageText($"Press ~g~{Settings.MenuKey}~s~ to open the menu.", new GTA.Graphics.TextureAsset("CHAR_ALL_PLAYERS_CONF", "CHAR_ALL_PLAYERS_CONF"), false, GTA.UI.FeedTextIcon.Message, "RAGECOOP", "Welcome!");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,9 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
Main.Logger.Error(ex);
|
Main.Logger.Error(ex);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Networking.ShowNetworkInfo)
|
if (Networking.ShowNetworkInfo)
|
||||||
@ -168,7 +170,7 @@ namespace RageCoop.Client
|
|||||||
P.Health = 1;
|
P.Health = 1;
|
||||||
Game.Player.WantedLevel = 0;
|
Game.Player.WantedLevel = 0;
|
||||||
Main.Logger.Debug("Player died.");
|
Main.Logger.Debug("Player died.");
|
||||||
Scripting.API.Events.InvokePlayerDied();
|
Scripting.API.Events.InvokePlayerDied(KillMessage());
|
||||||
}
|
}
|
||||||
GTA.UI.Screen.StopEffects();
|
GTA.UI.Screen.StopEffects();
|
||||||
}
|
}
|
||||||
@ -179,7 +181,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
else if (P.IsDead && !_lastDead)
|
else if (P.IsDead && !_lastDead)
|
||||||
{
|
{
|
||||||
Scripting.API.Events.InvokePlayerDied();
|
Scripting.API.Events.InvokePlayerDied(KillMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
_lastDead = P.IsDead;
|
_lastDead = P.IsDead;
|
||||||
@ -302,7 +304,7 @@ namespace RageCoop.Client
|
|||||||
Function.Call(Hash.SET_ENABLE_VEHICLE_SLIPSTREAMING, true);
|
Function.Call(Hash.SET_ENABLE_VEHICLE_SLIPSTREAMING, true);
|
||||||
CoopMenu.ConnectedMenuSetting();
|
CoopMenu.ConnectedMenuSetting();
|
||||||
MainChat.Init();
|
MainChat.Init();
|
||||||
GTA.UI.Notification.Show("~g~Connected!");
|
GTA.UI.Notification.PostTicker("~g~Connected!", false);
|
||||||
});
|
});
|
||||||
|
|
||||||
Logger.Info(">> Connected <<");
|
Logger.Info(">> Connected <<");
|
||||||
@ -324,7 +326,8 @@ namespace RageCoop.Client
|
|||||||
WorldThread.Traffic(true);
|
WorldThread.Traffic(true);
|
||||||
Function.Call(Hash.SET_ENABLE_VEHICLE_SLIPSTREAMING, false);
|
Function.Call(Hash.SET_ENABLE_VEHICLE_SLIPSTREAMING, false);
|
||||||
CoopMenu.DisconnectedMenuSetting();
|
CoopMenu.DisconnectedMenuSetting();
|
||||||
GTA.UI.Notification.Show("~r~Disconnected: " + reason);
|
if (reason != "Abort")
|
||||||
|
GTA.UI.Notification.PostTicker("~r~Disconnected: " + reason, false);
|
||||||
LocalPlayerID = default;
|
LocalPlayerID = default;
|
||||||
});
|
});
|
||||||
Memory.RestorePatches();
|
Memory.RestorePatches();
|
||||||
@ -347,7 +350,9 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
Logger.Error(ex);
|
Logger.Error(ex);
|
||||||
|
#endif
|
||||||
QueuedActions.Remove(action);
|
QueuedActions.Remove(action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -389,5 +394,15 @@ namespace RageCoop.Client
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string KillMessage()
|
||||||
|
{
|
||||||
|
if (P.Killer != null)
|
||||||
|
{
|
||||||
|
var killer = EntityPool.GetPedByHandle(P.Killer.Handle);
|
||||||
|
if (killer != null && killer.ID == killer.Owner.ID)
|
||||||
|
return $"~h~{PlayerList.GetPlayer(LocalPlayerID).Username}~h~ was killed by ~h~{killer.Owner.Username}~h~ ({P.CauseOfDeath})";
|
||||||
|
}
|
||||||
|
return $"~h~{PlayerList.GetPlayer(LocalPlayerID).Username}~h~ died";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ namespace RageCoop.Client.Menus
|
|||||||
{
|
{
|
||||||
|
|
||||||
Menu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
|
Menu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
|
||||||
Menu.Title.Color = Color.FromArgb(255, 165, 0);
|
Menu.BannerText.Color = Color.FromArgb(255, 165, 0);
|
||||||
|
|
||||||
_usernameItem.Activated += UsernameActivated;
|
_usernameItem.Activated += UsernameActivated;
|
||||||
_passwordItem.Activated += _passwordActivated;
|
_passwordItem.Activated += _passwordActivated;
|
||||||
@ -67,16 +67,18 @@ namespace RageCoop.Client.Menus
|
|||||||
|
|
||||||
Menu.AddSubMenu(SettingsMenu.Menu);
|
Menu.AddSubMenu(SettingsMenu.Menu);
|
||||||
Menu.AddSubMenu(DevToolMenu.Menu);
|
Menu.AddSubMenu(DevToolMenu.Menu);
|
||||||
|
#if DEBUG
|
||||||
Menu.AddSubMenu(DebugMenu.Menu);
|
Menu.AddSubMenu(DebugMenu.Menu);
|
||||||
Menu.AddSubMenu(UpdateMenu.Menu);
|
#endif
|
||||||
|
|
||||||
MenuPool.Add(Menu);
|
MenuPool.Add(Menu);
|
||||||
MenuPool.Add(SettingsMenu.Menu);
|
MenuPool.Add(SettingsMenu.Menu);
|
||||||
MenuPool.Add(DevToolMenu.Menu);
|
MenuPool.Add(DevToolMenu.Menu);
|
||||||
|
#if DEBUG
|
||||||
MenuPool.Add(DebugMenu.Menu);
|
MenuPool.Add(DebugMenu.Menu);
|
||||||
MenuPool.Add(DebugMenu.DiagnosticMenu);
|
MenuPool.Add(DebugMenu.DiagnosticMenu);
|
||||||
|
#endif
|
||||||
MenuPool.Add(ServersMenu.Menu);
|
MenuPool.Add(ServersMenu.Menu);
|
||||||
MenuPool.Add(UpdateMenu.Menu);
|
|
||||||
MenuPool.Add(PopUp);
|
MenuPool.Add(PopUp);
|
||||||
|
|
||||||
Menu.Add(_aboutItem);
|
Menu.Add(_aboutItem);
|
||||||
@ -97,7 +99,7 @@ namespace RageCoop.Client.Menus
|
|||||||
Game.DisableAllControlsThisFrame();
|
Game.DisableAllControlsThisFrame();
|
||||||
MenuPool.Process();
|
MenuPool.Process();
|
||||||
|
|
||||||
var scaleform = new Scaleform("instructional_buttons");
|
var scaleform = Scaleform.RequestMovie("instructional_buttons");
|
||||||
scaleform.CallFunction("CLEAR_ALL");
|
scaleform.CallFunction("CLEAR_ALL");
|
||||||
scaleform.CallFunction("TOGGLE_MOUSE_BUTTONS", 0);
|
scaleform.CallFunction("TOGGLE_MOUSE_BUTTONS", 0);
|
||||||
scaleform.CallFunction("CREATE_CONTAINER");
|
scaleform.CallFunction("CREATE_CONTAINER");
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using GTA;
|
#if DEBUG
|
||||||
|
using GTA;
|
||||||
using LemonUI.Menus;
|
using LemonUI.Menus;
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
@ -24,7 +25,7 @@ namespace RageCoop.Client
|
|||||||
static DebugMenu()
|
static DebugMenu()
|
||||||
{
|
{
|
||||||
Menu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
|
Menu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
|
||||||
Menu.Title.Color = Color.FromArgb(255, 165, 0);
|
Menu.BannerText.Color = Color.FromArgb(255, 165, 0);
|
||||||
|
|
||||||
|
|
||||||
DiagnosticMenu.Opening += (sender, e) =>
|
DiagnosticMenu.Opening += (sender, e) =>
|
||||||
@ -56,3 +57,4 @@ namespace RageCoop.Client
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -22,7 +22,7 @@ namespace RageCoop.Client
|
|||||||
static DevToolMenu()
|
static DevToolMenu()
|
||||||
{
|
{
|
||||||
Menu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
|
Menu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
|
||||||
Menu.Title.Color = Color.FromArgb(255, 165, 0);
|
Menu.BannerText.Color = Color.FromArgb(255, 165, 0);
|
||||||
|
|
||||||
enableItem.Activated += enableItem_Activated;
|
enableItem.Activated += enableItem_Activated;
|
||||||
enableItem.Checked = false;
|
enableItem.Checked = false;
|
||||||
|
@ -30,7 +30,7 @@ namespace RageCoop.Client.Menus
|
|||||||
static ServersMenu()
|
static ServersMenu()
|
||||||
{
|
{
|
||||||
Menu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
|
Menu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
|
||||||
Menu.Title.Color = Color.FromArgb(255, 165, 0);
|
Menu.BannerText.Color = Color.FromArgb(255, 165, 0);
|
||||||
|
|
||||||
Menu.Opening += (object sender, System.ComponentModel.CancelEventArgs e) =>
|
Menu.Opening += (object sender, System.ComponentModel.CancelEventArgs e) =>
|
||||||
{
|
{
|
||||||
@ -76,7 +76,7 @@ namespace RageCoop.Client.Menus
|
|||||||
foreach (ServerInfo server in serverList)
|
foreach (ServerInfo server in serverList)
|
||||||
{
|
{
|
||||||
string address = $"{server.address}:{server.port}";
|
string address = $"{server.address}:{server.port}";
|
||||||
NativeItem tmpItem = new NativeItem($"[{server.country}] {server.name}", $"~b~{address}~s~~n~~g~Version {server.version}.x~s~") { AltTitle = $"[{server.players}/{server.maxPlayers}]" };
|
NativeItem tmpItem = new NativeItem($"[{server.country}] {server.name}", $"~b~{address}~s~~n~~g~Version {server.version}~s~") { AltTitle = $"[{server.players}/{server.maxPlayers}]" };
|
||||||
tmpItem.Activated += (object sender, EventArgs e) =>
|
tmpItem.Activated += (object sender, EventArgs e) =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -85,7 +85,7 @@ namespace RageCoop.Client.Menus
|
|||||||
if (server.useZT)
|
if (server.useZT)
|
||||||
{
|
{
|
||||||
address = $"{server.ztAddress}:{server.port}";
|
address = $"{server.ztAddress}:{server.port}";
|
||||||
Notification.Show($"~y~Joining ZeroTier network... {server.ztID}");
|
Notification.PostTicker($"~y~Joining ZeroTier network... {server.ztID}", false);
|
||||||
if (ZeroTierHelper.Join(server.ztID) == null)
|
if (ZeroTierHelper.Join(server.ztID) == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Failed to obtain ZeroTier network IP");
|
throw new Exception("Failed to obtain ZeroTier network IP");
|
||||||
@ -102,10 +102,10 @@ namespace RageCoop.Client.Menus
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Notification.Show($"~r~{ex.Message}");
|
Notification.PostTicker($"~r~{ex.Message}", false);
|
||||||
if (server.useZT)
|
if (server.useZT)
|
||||||
{
|
{
|
||||||
Notification.Show($"Make sure ZeroTier is correctly installed, download it from https://www.zerotier.com/");
|
Notification.PostTicker($"Make sure ZeroTier is correctly installed, download it from https://www.zerotier.com/", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -17,16 +17,19 @@ namespace RageCoop.Client.Menus
|
|||||||
private static readonly NativeCheckboxItem _disableTrafficItem = new NativeCheckboxItem("Disable Traffic (NPCs/Vehicles)", "Local traffic only", Main.Settings.DisableTraffic);
|
private static readonly NativeCheckboxItem _disableTrafficItem = new NativeCheckboxItem("Disable Traffic (NPCs/Vehicles)", "Local traffic only", Main.Settings.DisableTraffic);
|
||||||
private static readonly NativeCheckboxItem _flipMenuItem = new NativeCheckboxItem("Flip menu", Main.Settings.FlipMenu);
|
private static readonly NativeCheckboxItem _flipMenuItem = new NativeCheckboxItem("Flip menu", Main.Settings.FlipMenu);
|
||||||
private static readonly NativeCheckboxItem _disablePauseAlt = new NativeCheckboxItem("Disable Alternate Pause", "Don't freeze game time when Esc pressed", Main.Settings.DisableAlternatePause);
|
private static readonly NativeCheckboxItem _disablePauseAlt = new NativeCheckboxItem("Disable Alternate Pause", "Don't freeze game time when Esc pressed", Main.Settings.DisableAlternatePause);
|
||||||
|
private static readonly NativeCheckboxItem _showBlip = new NativeCheckboxItem("Show player blip", "Show other player's blip on map", Main.Settings.ShowPlayerBlip);
|
||||||
|
private static readonly NativeCheckboxItem _showNametag = new NativeCheckboxItem("Show player nametag", "Show other player's nametag on your screen", Main.Settings.ShowPlayerNameTag);
|
||||||
private static readonly NativeCheckboxItem _disableVoice = new NativeCheckboxItem("Enable voice", "Check your GTA:V settings to find the right key on your keyboard for PushToTalk and talk to your friends", Main.Settings.Voice);
|
private static readonly NativeCheckboxItem _disableVoice = new NativeCheckboxItem("Enable voice", "Check your GTA:V settings to find the right key on your keyboard for PushToTalk and talk to your friends", Main.Settings.Voice);
|
||||||
|
|
||||||
private static readonly NativeItem _menuKey = new NativeItem("Menu Key", "The key to open menu", Main.Settings.MenuKey.ToString());
|
private static readonly NativeItem _menuKey = new NativeItem("Menu Key", "The key to open menu", Main.Settings.MenuKey.ToString());
|
||||||
private static readonly NativeItem _passengerKey = new NativeItem("Passenger Key", "The key to enter a vehicle as passenger", Main.Settings.PassengerKey.ToString());
|
private static readonly NativeItem _passengerKey = new NativeItem("Passenger Key", "The key to enter a vehicle as passenger", Main.Settings.PassengerKey.ToString());
|
||||||
private static readonly NativeItem _vehicleSoftLimit = new NativeItem("Vehicle limit (soft)", "The game won't spawn more NPC traffic if the limit is exceeded. \n-1 for unlimited (not recommended).", Main.Settings.WorldVehicleSoftLimit.ToString());
|
private static readonly NativeItem _vehicleSoftLimit = new NativeItem("Vehicle limit (soft)", "The game won't spawn more NPC traffic if the limit is exceeded. \n-1 for unlimited (not recommended).", Main.Settings.WorldVehicleSoftLimit.ToString());
|
||||||
|
private static readonly NativeItem _pedSoftLimit = new NativeItem("Ped limit (soft)", "The game won't spawn more NPCs if the limit is exceeded. \n-1 for unlimited (not recommended).", Main.Settings.WorldPedSoftLimit.ToString());
|
||||||
|
|
||||||
static SettingsMenu()
|
static SettingsMenu()
|
||||||
{
|
{
|
||||||
Menu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
|
Menu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
|
||||||
Menu.Title.Color = Color.FromArgb(255, 165, 0);
|
Menu.BannerText.Color = Color.FromArgb(255, 165, 0);
|
||||||
|
|
||||||
_disableTrafficItem.CheckboxChanged += DisableTrafficCheckboxChanged;
|
_disableTrafficItem.CheckboxChanged += DisableTrafficCheckboxChanged;
|
||||||
_disablePauseAlt.CheckboxChanged += DisablePauseAltCheckboxChanged;
|
_disablePauseAlt.CheckboxChanged += DisablePauseAltCheckboxChanged;
|
||||||
@ -35,6 +38,17 @@ namespace RageCoop.Client.Menus
|
|||||||
_menuKey.Activated += ChaneMenuKey;
|
_menuKey.Activated += ChaneMenuKey;
|
||||||
_passengerKey.Activated += ChangePassengerKey;
|
_passengerKey.Activated += ChangePassengerKey;
|
||||||
_vehicleSoftLimit.Activated += VehicleSoftLimitActivated;
|
_vehicleSoftLimit.Activated += VehicleSoftLimitActivated;
|
||||||
|
_pedSoftLimit.Activated += PedSoftLimitActivated;
|
||||||
|
_showBlip.Activated += (s, e) =>
|
||||||
|
{
|
||||||
|
Main.Settings.ShowPlayerBlip = _showBlip.Checked;
|
||||||
|
Util.SaveSettings();
|
||||||
|
};
|
||||||
|
_showNametag.Activated += (s, e) =>
|
||||||
|
{
|
||||||
|
Main.Settings.ShowPlayerNameTag = _showNametag.Checked;
|
||||||
|
Util.SaveSettings();
|
||||||
|
};
|
||||||
|
|
||||||
Menu.Add(_disableTrafficItem);
|
Menu.Add(_disableTrafficItem);
|
||||||
Menu.Add(_disablePauseAlt);
|
Menu.Add(_disablePauseAlt);
|
||||||
@ -43,6 +57,9 @@ namespace RageCoop.Client.Menus
|
|||||||
Menu.Add(_menuKey);
|
Menu.Add(_menuKey);
|
||||||
Menu.Add(_passengerKey);
|
Menu.Add(_passengerKey);
|
||||||
Menu.Add(_vehicleSoftLimit);
|
Menu.Add(_vehicleSoftLimit);
|
||||||
|
Menu.Add(_pedSoftLimit);
|
||||||
|
Menu.Add(_showBlip);
|
||||||
|
Menu.Add(_showNametag);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DisableVoiceCheckboxChanged(object sender, EventArgs e)
|
private static void DisableVoiceCheckboxChanged(object sender, EventArgs e)
|
||||||
@ -75,7 +92,19 @@ namespace RageCoop.Client.Menus
|
|||||||
Main.Settings.WorldVehicleSoftLimit = int.Parse(
|
Main.Settings.WorldVehicleSoftLimit = int.Parse(
|
||||||
Game.GetUserInput(WindowTitle.EnterMessage20,
|
Game.GetUserInput(WindowTitle.EnterMessage20,
|
||||||
Main.Settings.WorldVehicleSoftLimit.ToString(), 20));
|
Main.Settings.WorldVehicleSoftLimit.ToString(), 20));
|
||||||
_menuKey.AltTitle = Main.Settings.WorldVehicleSoftLimit.ToString();
|
_vehicleSoftLimit.AltTitle = Main.Settings.WorldVehicleSoftLimit.ToString();
|
||||||
|
Util.SaveSettings();
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
private static void PedSoftLimitActivated(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Main.Settings.WorldPedSoftLimit = int.Parse(
|
||||||
|
Game.GetUserInput(WindowTitle.EnterMessage20,
|
||||||
|
Main.Settings.WorldPedSoftLimit.ToString(), 20));
|
||||||
|
_pedSoftLimit.AltTitle = Main.Settings.WorldPedSoftLimit.ToString();
|
||||||
Util.SaveSettings();
|
Util.SaveSettings();
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -31,6 +31,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ulong LastMessageTime { get; set; }
|
private ulong LastMessageTime { get; set; }
|
||||||
|
private Keys LastKey { get; set; }
|
||||||
|
|
||||||
private bool CurrentHidden { get; set; }
|
private bool CurrentHidden { get; set; }
|
||||||
private bool Hidden
|
private bool Hidden
|
||||||
@ -56,7 +57,7 @@ namespace RageCoop.Client
|
|||||||
|
|
||||||
public Chat()
|
public Chat()
|
||||||
{
|
{
|
||||||
MainScaleForm = new Scaleform("multiplayer_chat");
|
MainScaleForm = Scaleform.RequestMovie("multiplayer_chat");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
@ -115,6 +116,10 @@ namespace RageCoop.Client
|
|||||||
MainScaleForm.CallFunction("PAGE_DOWN");
|
MainScaleForm.CallFunction("PAGE_DOWN");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (key == Keys.Menu && LastKey == Keys.ShiftKey)
|
||||||
|
ActivateKeyboardLayout(1, 0);
|
||||||
|
LastKey = key;
|
||||||
|
|
||||||
string keyChar = GetCharFromKey(key, Game.IsKeyPressed(Keys.ShiftKey), false);
|
string keyChar = GetCharFromKey(key, Game.IsKeyPressed(Keys.ShiftKey), false);
|
||||||
|
|
||||||
if (keyChar.Length == 0)
|
if (keyChar.Length == 0)
|
||||||
@ -174,5 +179,8 @@ namespace RageCoop.Client
|
|||||||
ToUnicodeEx((uint)key, 0, keyboardState, buf, 256, 0, InputLanguage.CurrentInputLanguage.Handle);
|
ToUnicodeEx((uint)key, 0, keyboardState, buf, 256, 0, InputLanguage.CurrentInputLanguage.Handle);
|
||||||
return buf.ToString();
|
return buf.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
public static extern int ActivateKeyboardLayout(int hkl, uint flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,16 +30,16 @@ namespace RageCoop.Client
|
|||||||
public static void ToggleConnection(string address, string username = null, string password = null, PublicKey publicKey = null)
|
public static void ToggleConnection(string address, string username = null, string password = null, PublicKey publicKey = null)
|
||||||
{
|
{
|
||||||
Menus.CoopMenu.Menu.Visible = false;
|
Menus.CoopMenu.Menu.Visible = false;
|
||||||
Peer?.Shutdown("Bye");
|
if (IsConnecting)
|
||||||
if (IsOnServer)
|
|
||||||
{
|
|
||||||
// ?
|
|
||||||
}
|
|
||||||
else if (IsConnecting)
|
|
||||||
{
|
{
|
||||||
_publicKeyReceived.Set();
|
_publicKeyReceived.Set();
|
||||||
IsConnecting = false;
|
IsConnecting = false;
|
||||||
Notification.Show("Connection has been canceled");
|
Main.QueueAction(() => Notification.PostTicker("Connection has been canceled", false));
|
||||||
|
Peer?.Shutdown("Bye");
|
||||||
|
}
|
||||||
|
else if (IsOnServer)
|
||||||
|
{
|
||||||
|
Peer?.Shutdown("Bye");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -53,13 +53,14 @@ namespace RageCoop.Client
|
|||||||
NetPeerConfiguration config = new NetPeerConfiguration("623c92c287cc392406e7aaaac1c0f3b0")
|
NetPeerConfiguration config = new NetPeerConfiguration("623c92c287cc392406e7aaaac1c0f3b0")
|
||||||
{
|
{
|
||||||
AutoFlushSendQueue = false,
|
AutoFlushSendQueue = false,
|
||||||
SimulatedMinimumLatency = SimulatedLatency,
|
|
||||||
SimulatedRandomLatency = 0,
|
|
||||||
AcceptIncomingConnections = true,
|
AcceptIncomingConnections = true,
|
||||||
MaximumConnections = 32,
|
MaximumConnections = 32,
|
||||||
PingInterval = 5
|
PingInterval = 5
|
||||||
};
|
};
|
||||||
|
#if DEBUG
|
||||||
|
config.SimulatedMinimumLatency = SimulatedLatency;
|
||||||
|
config.SimulatedRandomLatency = 0;
|
||||||
|
#endif
|
||||||
config.EnableMessageType(NetIncomingMessageType.UnconnectedData);
|
config.EnableMessageType(NetIncomingMessageType.UnconnectedData);
|
||||||
config.EnableMessageType(NetIncomingMessageType.NatIntroductionSuccess);
|
config.EnableMessageType(NetIncomingMessageType.NatIntroductionSuccess);
|
||||||
|
|
||||||
@ -96,9 +97,14 @@ namespace RageCoop.Client
|
|||||||
Peer.OnMessageReceived += (s, m) =>
|
Peer.OnMessageReceived += (s, m) =>
|
||||||
{
|
{
|
||||||
try { ProcessMessage(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..."); });
|
Main.QueueAction(() => { Notification.PostTicker($"~y~Trying to connect...", false); });
|
||||||
Menus.CoopMenu._serverConnectItem.Enabled = false;
|
Menus.CoopMenu._serverConnectItem.Enabled = false;
|
||||||
Security.Regen();
|
Security.Regen();
|
||||||
if (publicKey == null)
|
if (publicKey == null)
|
||||||
@ -133,7 +139,7 @@ namespace RageCoop.Client
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Main.Logger.Error("Cannot connect to server: ", ex);
|
Main.Logger.Error("Cannot connect to server: ", ex);
|
||||||
Main.QueueAction(() => Notification.Show("Cannot connect to server: " + ex.Message));
|
Main.QueueAction(() => Notification.PostTicker("Cannot connect to server: " + ex.Message, false));
|
||||||
}
|
}
|
||||||
IsConnecting = false;
|
IsConnecting = false;
|
||||||
});
|
});
|
||||||
@ -153,7 +159,7 @@ namespace RageCoop.Client
|
|||||||
|
|
||||||
Main.Logger.Debug($"player connected:{p.Username}");
|
Main.Logger.Debug($"player connected:{p.Username}");
|
||||||
Main.QueueAction(() =>
|
Main.QueueAction(() =>
|
||||||
GTA.UI.Notification.Show($"~h~{p.Username}~h~ connected."));
|
Notification.PostTicker($"~h~{p.Username}~h~ connected.", false));
|
||||||
}
|
}
|
||||||
private static void PlayerDisconnect(Packets.PlayerDisconnect packet)
|
private static void PlayerDisconnect(Packets.PlayerDisconnect packet)
|
||||||
{
|
{
|
||||||
@ -163,7 +169,7 @@ namespace RageCoop.Client
|
|||||||
Main.QueueAction(() =>
|
Main.QueueAction(() =>
|
||||||
{
|
{
|
||||||
EntityPool.RemoveAllFromPlayer(packet.PedID);
|
EntityPool.RemoveAllFromPlayer(packet.PedID);
|
||||||
GTA.UI.Notification.Show($"~h~{player.Username}~h~ left.");
|
Notification.PostTicker($"~h~{player.Username}~h~ left.", false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ using Lidgren.Network;
|
|||||||
using RageCoop.Client.Menus;
|
using RageCoop.Client.Menus;
|
||||||
using RageCoop.Core;
|
using RageCoop.Core;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace RageCoop.Client
|
namespace RageCoop.Client
|
||||||
@ -149,6 +150,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
Main.QueueAction(() =>
|
Main.QueueAction(() =>
|
||||||
{
|
{
|
||||||
GTA.UI.Notification.Show($"~r~~h~Packet Error {ex.Message}");
|
GTA.UI.Notification.Show($"~r~~h~Packet Error {ex.Message}");
|
||||||
@ -157,6 +159,8 @@ namespace RageCoop.Client
|
|||||||
Main.Logger.Error($"[{packetType}] {ex.Message}");
|
Main.Logger.Error($"[{packetType}] {ex.Message}");
|
||||||
Main.Logger.Error(ex);
|
Main.Logger.Error(ex);
|
||||||
Peer.Shutdown($"Packet Error [{packetType}]");
|
Peer.Shutdown($"Packet Error [{packetType}]");
|
||||||
|
#endif
|
||||||
|
_recycle = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -291,7 +295,7 @@ namespace RageCoop.Client
|
|||||||
{
|
{
|
||||||
recycle = false;
|
recycle = false;
|
||||||
// Dispatch to script thread
|
// Dispatch to script thread
|
||||||
Main.QueueAction(() => { SyncEvents.HandleEvent(packetType, msg); Peer.Recycle(msg); return true; });
|
Main.QueueAction(() => { SyncEvents.HandleEvent(packetType, msg); return true; });
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -302,10 +306,15 @@ namespace RageCoop.Client
|
|||||||
SyncedPed c = EntityPool.GetPedByID(packet.ID);
|
SyncedPed c = EntityPool.GetPedByID(packet.ID);
|
||||||
if (c == null)
|
if (c == null)
|
||||||
{
|
{
|
||||||
// Main.Logger.Debug($"Creating character for incoming sync:{packet.ID}");
|
if (EntityPool.PedsByID.Count(x => x.Value.OwnerID == packet.OwnerID) < Main.Settings.WorldPedSoftLimit / PlayerList.Players.Count ||
|
||||||
EntityPool.ThreadSafe.Add(c = new SyncedPed(packet.ID));
|
/*EntityPool.VehiclesByID.Any(x => x.Value.Position.DistanceTo(packet.Position) < 2) ||*/ // allows players to exceed the peds limit
|
||||||
|
packet.ID == packet.OwnerID)
|
||||||
|
{
|
||||||
|
// Main.Logger.Debug($"Creating character for incoming sync:{packet.ID}");
|
||||||
|
EntityPool.ThreadSafe.Add(c = new SyncedPed(packet.ID));
|
||||||
|
}
|
||||||
|
else return;
|
||||||
}
|
}
|
||||||
PedDataFlags flags = packet.Flags;
|
|
||||||
c.ID = packet.ID;
|
c.ID = packet.ID;
|
||||||
c.OwnerID = packet.OwnerID;
|
c.OwnerID = packet.OwnerID;
|
||||||
c.Health = packet.Health;
|
c.Health = packet.Health;
|
||||||
@ -351,7 +360,13 @@ namespace RageCoop.Client
|
|||||||
SyncedVehicle v = EntityPool.GetVehicleByID(packet.ID);
|
SyncedVehicle v = EntityPool.GetVehicleByID(packet.ID);
|
||||||
if (v == null)
|
if (v == null)
|
||||||
{
|
{
|
||||||
EntityPool.ThreadSafe.Add(v = new SyncedVehicle(packet.ID));
|
if (EntityPool.VehiclesByID.Count(x => x.Value.OwnerID == packet.OwnerID) < Main.Settings.WorldVehicleSoftLimit / PlayerList.Players.Count ||
|
||||||
|
EntityPool.PedsByID.Any(x => x.Value.VehicleID == packet.ID || x.Value.Position.DistanceTo(packet.Position) < 2))
|
||||||
|
{
|
||||||
|
// Main.Logger.Debug($"Creating vehicle for incoming sync:{packet.ID}");
|
||||||
|
EntityPool.ThreadSafe.Add(v = new SyncedVehicle(packet.ID));
|
||||||
|
}
|
||||||
|
else return;
|
||||||
}
|
}
|
||||||
if (v.IsLocal) { return; }
|
if (v.IsLocal) { return; }
|
||||||
v.ID = packet.ID;
|
v.ID = packet.ID;
|
||||||
@ -385,7 +400,6 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
private static void ProjectileSync(Packets.ProjectileSync packet)
|
private static void ProjectileSync(Packets.ProjectileSync packet)
|
||||||
{
|
{
|
||||||
|
|
||||||
var p = EntityPool.GetProjectileByID(packet.ID);
|
var p = EntityPool.GetProjectileByID(packet.ID);
|
||||||
if (p == null)
|
if (p == null)
|
||||||
{
|
{
|
||||||
|
@ -126,7 +126,7 @@ namespace RageCoop.Client
|
|||||||
packet.Position = veh.ReadPosition();
|
packet.Position = veh.ReadPosition();
|
||||||
packet.Velocity = veh.Velocity;
|
packet.Velocity = veh.Velocity;
|
||||||
packet.Quaternion = veh.ReadQuaternion();
|
packet.Quaternion = veh.ReadQuaternion();
|
||||||
packet.RotationVelocity = veh.RotationVelocity;
|
packet.RotationVelocity = veh.LocalRotationVelocity;
|
||||||
packet.ThrottlePower = veh.ThrottlePower;
|
packet.ThrottlePower = veh.ThrottlePower;
|
||||||
packet.BrakePower = veh.BrakePower;
|
packet.BrakePower = veh.BrakePower;
|
||||||
v.LastSentStopWatch.Restart();
|
v.LastSentStopWatch.Restart();
|
||||||
|
@ -13,7 +13,7 @@ namespace RageCoop.Client
|
|||||||
{
|
{
|
||||||
private const float LEFT_POSITION = 0.122f;
|
private const float LEFT_POSITION = 0.122f;
|
||||||
private const float RIGHT_POSITION = 0.9f;
|
private const float RIGHT_POSITION = 0.9f;
|
||||||
private static readonly Scaleform _mainScaleform = new Scaleform("mp_mm_card_freemode");
|
private static readonly Scaleform _mainScaleform = Scaleform.RequestMovie("mp_mm_card_freemode");
|
||||||
private static ulong _lastUpdate = Util.GetTickCount64();
|
private static ulong _lastUpdate = Util.GetTickCount64();
|
||||||
public static ulong Pressed { get; set; }
|
public static ulong Pressed { get; set; }
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ using System.Resources;
|
|||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
|
||||||
// Version informationr(
|
// Version information
|
||||||
[assembly: AssemblyVersion("1.5.4.3")]
|
[assembly: AssemblyVersion("1.5.4.7")]
|
||||||
[assembly: AssemblyFileVersion("1.5.4.3")]
|
[assembly: AssemblyFileVersion("1.5.4.7")]
|
||||||
[assembly: NeutralResourcesLanguageAttribute( "en-US" )]
|
[assembly: NeutralResourcesLanguageAttribute( "en-US" )]
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
<Compile Include="Menus\Sub\DevToolMenu.cs" />
|
<Compile Include="Menus\Sub\DevToolMenu.cs" />
|
||||||
<Compile Include="Menus\Sub\ServersMenu.cs" />
|
<Compile Include="Menus\Sub\ServersMenu.cs" />
|
||||||
<Compile Include="Menus\Sub\SettingsMenu.cs" />
|
<Compile Include="Menus\Sub\SettingsMenu.cs" />
|
||||||
<Compile Include="Menus\Sub\UpdateMenu.cs" />
|
|
||||||
<Compile Include="Networking\Chat.cs" />
|
<Compile Include="Networking\Chat.cs" />
|
||||||
<Compile Include="Networking\DownloadManager.cs" />
|
<Compile Include="Networking\DownloadManager.cs" />
|
||||||
<Compile Include="Networking\HolePunch.cs" />
|
<Compile Include="Networking\HolePunch.cs" />
|
||||||
@ -91,7 +90,7 @@
|
|||||||
<Reference Include="ICSharpCode.SharpZipLib, Version=1.3.3.11, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
<Reference Include="ICSharpCode.SharpZipLib, Version=1.3.3.11, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\SharpZipLib.1.3.3\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
|
<HintPath>..\packages\SharpZipLib.1.3.3\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="LemonUI.SHVDN3, Version=1.7.0.0, Culture=neutral, processorArchitecture=AMD64">
|
<Reference Include="LemonUI.SHVDN3, Version=1.10.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\libs\LemonUI.SHVDN3.dll</HintPath>
|
<HintPath>..\libs\LemonUI.SHVDN3.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
@ -91,7 +91,7 @@ namespace RageCoop.Client.Scripting
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The local player is dead
|
/// The local player is dead
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static event EmptyEvent OnPlayerDied;
|
public static event EventHandler<string> OnPlayerDied;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A local vehicle is spawned
|
/// A local vehicle is spawned
|
||||||
@ -133,7 +133,7 @@ namespace RageCoop.Client.Scripting
|
|||||||
internal static void InvokeVehicleDeleted(SyncedVehicle v) { OnVehicleDeleted?.Invoke(null, v); }
|
internal static void InvokeVehicleDeleted(SyncedVehicle v) { OnVehicleDeleted?.Invoke(null, v); }
|
||||||
internal static void InvokePedSpawned(SyncedPed p) { OnPedSpawned?.Invoke(null, p); }
|
internal static void InvokePedSpawned(SyncedPed p) { OnPedSpawned?.Invoke(null, p); }
|
||||||
internal static void InvokePedDeleted(SyncedPed p) { OnPedDeleted?.Invoke(null, p); }
|
internal static void InvokePedDeleted(SyncedPed p) { OnPedDeleted?.Invoke(null, p); }
|
||||||
internal static void InvokePlayerDied() { OnPlayerDied?.Invoke(); }
|
internal static void InvokePlayerDied(string m) { OnPlayerDied?.Invoke(null, m); }
|
||||||
internal static void InvokeTick() { OnTick?.Invoke(); }
|
internal static void InvokeTick() { OnTick?.Invoke(); }
|
||||||
|
|
||||||
internal static void InvokeKeyDown(object s, KeyEventArgs e) { OnKeyDown?.Invoke(s, e); }
|
internal static void InvokeKeyDown(object s, KeyEventArgs e) { OnKeyDown?.Invoke(s, e); }
|
||||||
|
@ -16,7 +16,7 @@ namespace RageCoop.Client.Scripting
|
|||||||
{
|
{
|
||||||
API.Events.OnPedDeleted += (s, p) => { API.SendCustomEvent(CustomEvents.OnPedDeleted, p.ID); };
|
API.Events.OnPedDeleted += (s, p) => { API.SendCustomEvent(CustomEvents.OnPedDeleted, p.ID); };
|
||||||
API.Events.OnVehicleDeleted += (s, p) => { API.SendCustomEvent(CustomEvents.OnVehicleDeleted, p.ID); };
|
API.Events.OnVehicleDeleted += (s, p) => { API.SendCustomEvent(CustomEvents.OnVehicleDeleted, p.ID); };
|
||||||
API.Events.OnPlayerDied += () => { API.SendCustomEvent(CustomEvents.OnPlayerDied); };
|
API.Events.OnPlayerDied += (s, m) => { API.SendCustomEvent(CustomEvents.OnPlayerDied, m); };
|
||||||
|
|
||||||
API.RegisterCustomEventHandler(CustomEvents.SetAutoRespawn, SetAutoRespawn);
|
API.RegisterCustomEventHandler(CustomEvents.SetAutoRespawn, SetAutoRespawn);
|
||||||
API.RegisterCustomEventHandler(CustomEvents.SetDisplayNameTag, SetDisplayNameTag);
|
API.RegisterCustomEventHandler(CustomEvents.SetDisplayNameTag, SetDisplayNameTag);
|
||||||
@ -31,7 +31,7 @@ namespace RageCoop.Client.Scripting
|
|||||||
API.RegisterCustomEventHandler(CustomEvents.UpdatePedBlip, UpdatePedBlip);
|
API.RegisterCustomEventHandler(CustomEvents.UpdatePedBlip, UpdatePedBlip);
|
||||||
API.RegisterCustomEventHandler(CustomEvents.IsHost, (e) => { _isHost = (bool)e.Args[0]; });
|
API.RegisterCustomEventHandler(CustomEvents.IsHost, (e) => { _isHost = (bool)e.Args[0]; });
|
||||||
API.RegisterCustomEventHandler(CustomEvents.WeatherTimeSync, WeatherTimeSync);
|
API.RegisterCustomEventHandler(CustomEvents.WeatherTimeSync, WeatherTimeSync);
|
||||||
API.RegisterCustomEventHandler(CustomEvents.OnPlayerDied, (e) => { GTA.UI.Notification.Show($"~h~{e.Args[0]}~h~ died."); });
|
API.RegisterCustomEventHandler(CustomEvents.OnPlayerDied, (e) => { GTA.UI.Notification.PostTicker((string)e.Args[0], false); });
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
@ -42,12 +42,11 @@ namespace RageCoop.Client.Scripting
|
|||||||
{
|
{
|
||||||
unsafe
|
unsafe
|
||||||
{
|
{
|
||||||
var time = World.CurrentTimeOfDay;
|
|
||||||
int weather1 = default(int);
|
int weather1 = default(int);
|
||||||
int weather2 = default(int);
|
int weather2 = default(int);
|
||||||
float percent2 = default(float);
|
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);
|
API.SendCustomEvent(CustomEvents.WeatherTimeSync, GTA.Chrono.GameClock.Hour, GTA.Chrono.GameClock.Minute, GTA.Chrono.GameClock.Second, weather1, weather2, percent2);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -59,8 +58,10 @@ namespace RageCoop.Client.Scripting
|
|||||||
|
|
||||||
private void WeatherTimeSync(CustomEventReceivedArgs e)
|
private void WeatherTimeSync(CustomEventReceivedArgs e)
|
||||||
{
|
{
|
||||||
World.CurrentTimeOfDay = new TimeSpan((int)e.Args[0], (int)e.Args[1], (int)e.Args[2]);
|
GTA.Chrono.GameClock.Hour = (int)e.Args[0];
|
||||||
Function.Call(Hash._SET_WEATHER_TYPE_TRANSITION, (int)e.Args[3], (int)e.Args[4], (float)e.Args[5]);
|
GTA.Chrono.GameClock.Minute = (int)e.Args[1];
|
||||||
|
GTA.Chrono.GameClock.Second = (int)e.Args[2];
|
||||||
|
Function.Call(Hash.SET_CURR_WEATHER_STATE, (int)e.Args[3], (int)e.Args[4], (float)e.Args[5]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetDisplayNameTag(CustomEventReceivedArgs e)
|
private void SetDisplayNameTag(CustomEventReceivedArgs e)
|
||||||
|
@ -22,7 +22,7 @@ namespace RageCoop.Client
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Don't use it!
|
/// Don't use it!
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string MasterServer { get; set; } = "https://masterserver.ragecoop.online/";
|
public string MasterServer { get; set; } = "https://masterserver.ragecoop.com/";
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Don't use it!
|
/// Don't use it!
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -51,7 +51,7 @@ namespace RageCoop.Client
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Disable world NPC traffic, mission entities won't be affected
|
/// Disable world NPC traffic, mission entities won't be affected
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool DisableTraffic { get; set; } = true;
|
public bool DisableTraffic { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Bring up pause menu but don't freeze time when FrontEndPauseAlternate(Esc) is pressed.
|
/// Bring up pause menu but don't freeze time when FrontEndPauseAlternate(Esc) is pressed.
|
||||||
@ -67,6 +67,7 @@ namespace RageCoop.Client
|
|||||||
/// The game won't spawn more NPC traffic if the limit is exceeded. -1 for unlimited (not recommended).
|
/// The game won't spawn more NPC traffic if the limit is exceeded. -1 for unlimited (not recommended).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int WorldPedSoftLimit { get; set; } = 30;
|
public int WorldPedSoftLimit { get; set; } = 30;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The directory where log and resources downloaded from server will be placed.
|
/// The directory where log and resources downloaded from server will be placed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -76,5 +77,15 @@ namespace RageCoop.Client
|
|||||||
/// Show the owner name of the entity you're aiming at
|
/// Show the owner name of the entity you're aiming at
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ShowEntityOwnerName { get; set; } = false;
|
public bool ShowEntityOwnerName { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Show other player's nametag on your screen
|
||||||
|
/// </summary>
|
||||||
|
public bool ShowPlayerNameTag { get; set; } = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Show other player's blip on map
|
||||||
|
/// </summary>
|
||||||
|
public bool ShowPlayerBlip { get; set; } = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,8 @@ namespace RageCoop.Client
|
|||||||
MainPed = p;
|
MainPed = p;
|
||||||
OwnerID = Main.LocalPlayerID;
|
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(PedConfigFlagToggles.DisableHurt, true);
|
||||||
// MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisableMelee, true);
|
// MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisableMelee, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -76,12 +76,13 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((byte)BlipColor == 255) && (PedBlip != null))
|
if (!Main.Settings.ShowPlayerBlip && (byte)BlipColor != 255) BlipColor = (BlipColor)255;
|
||||||
|
if ((byte)BlipColor == 255 && PedBlip != null)
|
||||||
{
|
{
|
||||||
PedBlip.Delete();
|
PedBlip.Delete();
|
||||||
PedBlip = null;
|
PedBlip = null;
|
||||||
}
|
}
|
||||||
else if (((byte)BlipColor != 255) && PedBlip == null)
|
else if ((byte)BlipColor != 255 && PedBlip == null)
|
||||||
{
|
{
|
||||||
PedBlip = MainPed.AddBlip();
|
PedBlip = MainPed.AddBlip();
|
||||||
|
|
||||||
@ -140,6 +141,12 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!IsPlayer && Health <= 0 && !MainPed.IsDead)
|
||||||
|
{
|
||||||
|
MainPed.Kill();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Speed >= 4)
|
if (Speed >= 4)
|
||||||
{
|
{
|
||||||
DisplayInVehicle();
|
DisplayInVehicle();
|
||||||
@ -170,7 +177,7 @@ namespace RageCoop.Client
|
|||||||
|
|
||||||
private void RenderNameTag()
|
private void RenderNameTag()
|
||||||
{
|
{
|
||||||
if (!Owner.DisplayNameTag || (MainPed == null) || !MainPed.IsVisible || !MainPed.IsInRange(Main.PlayerPosition, 40f))
|
if (!Owner.DisplayNameTag || !Main.Settings.ShowPlayerNameTag || MainPed == null || !MainPed.IsVisible || !MainPed.IsInRange(Main.PlayerPosition, 40f))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -204,7 +211,7 @@ namespace RageCoop.Client
|
|||||||
MainPed = null;
|
MainPed = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PedBlip != null && PedBlip.Exists())
|
if (PedBlip != null)
|
||||||
{
|
{
|
||||||
PedBlip.Delete();
|
PedBlip.Delete();
|
||||||
PedBlip = null;
|
PedBlip = null;
|
||||||
@ -235,19 +242,18 @@ namespace RageCoop.Client
|
|||||||
Function.Call(Hash.SET_PED_CAN_BE_TARGETTED_BY_PLAYER, MainPed.Handle, Game.Player, true);
|
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_PED_GET_OUT_UPSIDE_DOWN_VEHICLE, MainPed.Handle, false);
|
||||||
Function.Call(Hash.SET_CAN_ATTACK_FRIENDLY, MainPed.Handle, true, true);
|
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);
|
Function.Call(Hash.SET_PED_CAN_EVASIVE_DIVE, MainPed.Handle, false);
|
||||||
|
|
||||||
MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DrownsInWater, false);
|
MainPed.SetConfigFlag(PedConfigFlagToggles.DrownsInWater, false);
|
||||||
MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisableHurt, true);
|
MainPed.SetConfigFlag(PedConfigFlagToggles.DisableHurt, true);
|
||||||
MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisableExplosionReactions, true);
|
MainPed.SetConfigFlag(PedConfigFlagToggles.DisableExplosionReactions, true);
|
||||||
MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_AvoidTearGas, false);
|
MainPed.SetConfigFlag(PedConfigFlagToggles.AvoidTearGas, false);
|
||||||
MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_IgnoreBeingOnFire, true);
|
MainPed.SetConfigFlag(PedConfigFlagToggles.IgnoreBeingOnFire, true);
|
||||||
MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisableEvasiveDives, true);
|
MainPed.SetConfigFlag(PedConfigFlagToggles.DisableEvasiveDives, true);
|
||||||
MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisablePanicInVehicle, true);
|
MainPed.SetConfigFlag(PedConfigFlagToggles.DisablePanicInVehicle, true);
|
||||||
MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_BlockNonTemporaryEvents, true);
|
MainPed.SetConfigFlag(PedConfigFlagToggles.BlockNonTemporaryEvents, true);
|
||||||
MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisableShockingEvents, true);
|
MainPed.SetConfigFlag(PedConfigFlagToggles.DisableShockingEvents, true);
|
||||||
MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisableHurt, true);
|
|
||||||
|
|
||||||
SetClothes();
|
SetClothes();
|
||||||
|
|
||||||
@ -419,7 +425,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
_lastIsJumping = false;
|
_lastIsJumping = false;
|
||||||
|
|
||||||
if (IsRagdoll || Health == 0)
|
if (IsRagdoll || (IsPlayer && Health == 0))
|
||||||
{
|
{
|
||||||
if (!MainPed.IsRagdoll)
|
if (!MainPed.IsRagdoll)
|
||||||
{
|
{
|
||||||
@ -539,7 +545,7 @@ namespace RageCoop.Client
|
|||||||
{
|
{
|
||||||
if (Velocity == default)
|
if (Velocity == default)
|
||||||
{
|
{
|
||||||
MainPed.Task.AimAt(AimCoords, 1000);
|
MainPed.Task.AimGunAtPosition(AimCoords, 1000);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -597,6 +603,8 @@ namespace RageCoop.Client
|
|||||||
MainPed.Task.StandStill(2000);
|
MainPed.Task.StandStill(2000);
|
||||||
LastMoving = false;
|
LastMoving = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (MainPed.IsTaskActive(TaskType.CTaskDiveToGround)) MainPed.Task.ClearAll();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SmoothTransition();
|
SmoothTransition();
|
||||||
@ -713,7 +721,7 @@ namespace RageCoop.Client
|
|||||||
case 5:
|
case 5:
|
||||||
if (MainPed.VehicleTryingToEnter != CurrentVehicle.MainVehicle || MainPed.GetSeatTryingToEnter() != Seat)
|
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;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
|
@ -4,6 +4,7 @@ using GTA.Native;
|
|||||||
using RageCoop.Core;
|
using RageCoop.Core;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace RageCoop.Client
|
namespace RageCoop.Client
|
||||||
{
|
{
|
||||||
@ -141,7 +142,7 @@ namespace RageCoop.Client
|
|||||||
|
|
||||||
if (LightsOn != MainVehicle.AreLightsOn)
|
if (LightsOn != MainVehicle.AreLightsOn)
|
||||||
{
|
{
|
||||||
MainVehicle.AreLightsOn = LightsOn;
|
MainVehicle.SetScriptedLightSetting(LightsOn ? ScriptedVehicleLightSetting.SetVehicleLightsOn : ScriptedVehicleLightSetting.SetVehicleLightsOff);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HighBeamsOn != MainVehicle.AreHighBeamsOn)
|
if (HighBeamsOn != MainVehicle.AreHighBeamsOn)
|
||||||
@ -197,13 +198,13 @@ namespace RageCoop.Client
|
|||||||
if (!_lastTransformed)
|
if (!_lastTransformed)
|
||||||
{
|
{
|
||||||
_lastTransformed = true;
|
_lastTransformed = true;
|
||||||
Function.Call(Hash._TRANSFORM_VEHICLE_TO_SUBMARINE, MainVehicle.Handle, false);
|
Function.Call(Hash.TRANSFORM_TO_SUBMARINE, MainVehicle.Handle, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_lastTransformed)
|
else if (_lastTransformed)
|
||||||
{
|
{
|
||||||
_lastTransformed = false;
|
_lastTransformed = false;
|
||||||
Function.Call(Hash._TRANSFORM_SUBMARINE_TO_VEHICLE, MainVehicle.Handle, false);
|
Function.Call(Hash.TRANSFORM_TO_CAR, MainVehicle.Handle, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (IsDeluxo)
|
else if (IsDeluxo)
|
||||||
@ -284,10 +285,10 @@ namespace RageCoop.Client
|
|||||||
if (IsFlipped || (calirot = GetCalibrationRotation()).Length() > 50)
|
if (IsFlipped || (calirot = GetCalibrationRotation()).Length() > 50)
|
||||||
{
|
{
|
||||||
MainVehicle.Quaternion = Quaternion.Slerp(MainVehicle.ReadQuaternion(), Quaternion, 0.5f);
|
MainVehicle.Quaternion = Quaternion.Slerp(MainVehicle.ReadQuaternion(), Quaternion, 0.5f);
|
||||||
MainVehicle.RotationVelocity = RotationVelocity;
|
MainVehicle.LocalRotationVelocity = RotationVelocity;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MainVehicle.RotationVelocity = RotationVelocity + calirot * 0.2f;
|
MainVehicle.LocalRotationVelocity = RotationVelocity + calirot * 0.2f;
|
||||||
}
|
}
|
||||||
private Vector3 GetCalibrationRotation()
|
private Vector3 GetCalibrationRotation()
|
||||||
{
|
{
|
||||||
@ -307,6 +308,16 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
private bool CreateVehicle()
|
private bool CreateVehicle()
|
||||||
{
|
{
|
||||||
|
var existing = World.GetNearbyVehicles(Position, 2).ToList().FirstOrDefault();
|
||||||
|
if (existing != null && existing != MainVehicle)
|
||||||
|
{
|
||||||
|
if (EntityPool.VehiclesByHandle.ContainsKey(existing.Handle))
|
||||||
|
{
|
||||||
|
EntityPool.RemoveVehicle(ID);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
existing.Delete();
|
||||||
|
}
|
||||||
MainVehicle?.Delete();
|
MainVehicle?.Delete();
|
||||||
MainVehicle = Util.CreateVehicle(Model, Position);
|
MainVehicle = Util.CreateVehicle(Model, Position);
|
||||||
if (!Model.IsInCdImage)
|
if (!Model.IsInCdImage)
|
||||||
@ -337,41 +348,5 @@ namespace RageCoop.Client
|
|||||||
Model.MarkAsNoLongerNeeded();
|
Model.MarkAsNoLongerNeeded();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#region -- PEDALING --
|
|
||||||
/*
|
|
||||||
* Thanks to @oldnapalm.
|
|
||||||
*/
|
|
||||||
|
|
||||||
private string PedalingAnimDict()
|
|
||||||
{
|
|
||||||
switch ((VehicleHash)Model)
|
|
||||||
{
|
|
||||||
case VehicleHash.Bmx:
|
|
||||||
return "veh@bicycle@bmx@front@base";
|
|
||||||
case VehicleHash.Cruiser:
|
|
||||||
return "veh@bicycle@cruiserfront@base";
|
|
||||||
case VehicleHash.Scorcher:
|
|
||||||
return "veh@bicycle@mountainfront@base";
|
|
||||||
default:
|
|
||||||
return "veh@bicycle@roadfront@base";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private string PedalingAnimName(bool fast)
|
|
||||||
{
|
|
||||||
return fast ? "fast_pedal_char" : "cruise_pedal_char";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void StartPedalingAnim(bool fast)
|
|
||||||
{
|
|
||||||
MainVehicle.Driver?.Task.PlayAnimation(PedalingAnimDict(), PedalingAnimName(fast), 8.0f, -8.0f, -1, AnimationFlags.Loop | AnimationFlags.AllowRotation, 1.0f);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void StopPedalingAnim(bool fast)
|
|
||||||
{
|
|
||||||
MainVehicle.Driver.Task.ClearAnimation(PedalingAnimDict(), PedalingAnimName(fast));
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ namespace RageCoop.Client
|
|||||||
#endregion
|
#endregion
|
||||||
public static void Cleanup(bool keepPlayer = true, bool keepMine = true)
|
public static void Cleanup(bool keepPlayer = true, bool keepMine = true)
|
||||||
{
|
{
|
||||||
foreach (var ped in PedsByID.Values)
|
foreach (var ped in PedsByID.Values.ToArray())
|
||||||
{
|
{
|
||||||
if ((keepPlayer && (ped.ID == Main.LocalPlayerID)) || (keepMine && (ped.OwnerID == Main.LocalPlayerID))) { continue; }
|
if ((keepPlayer && (ped.ID == Main.LocalPlayerID)) || (keepMine && (ped.OwnerID == Main.LocalPlayerID))) { continue; }
|
||||||
RemovePed(ped.ID);
|
RemovePed(ped.ID);
|
||||||
@ -51,7 +51,7 @@ namespace RageCoop.Client
|
|||||||
PedsByID.Clear();
|
PedsByID.Clear();
|
||||||
PedsByHandle.Clear();
|
PedsByHandle.Clear();
|
||||||
|
|
||||||
foreach (int id in new List<int>(VehiclesByID.Keys))
|
foreach (int id in VehiclesByID.Keys.ToArray())
|
||||||
{
|
{
|
||||||
if (keepMine && (VehiclesByID[id].OwnerID == Main.LocalPlayerID)) { continue; }
|
if (keepMine && (VehiclesByID[id].OwnerID == Main.LocalPlayerID)) { continue; }
|
||||||
RemoveVehicle(id);
|
RemoveVehicle(id);
|
||||||
@ -277,8 +277,8 @@ namespace RageCoop.Client
|
|||||||
{
|
{
|
||||||
ProjectilesByHandle.Remove(p.Handle);
|
ProjectilesByHandle.Remove(p.Handle);
|
||||||
}
|
}
|
||||||
Main.Logger.Debug($"Removing projectile {sp.ID}. Reason:{reason}");
|
//Main.Logger.Debug($"Removing projectile {sp.ID}. Reason:{reason}");
|
||||||
p.Explode();
|
if (sp.Exploded) p.Explode();
|
||||||
}
|
}
|
||||||
ProjectilesByID.Remove(id);
|
ProjectilesByID.Remove(id);
|
||||||
}
|
}
|
||||||
@ -359,21 +359,24 @@ namespace RageCoop.Client
|
|||||||
lock (PedsLock)
|
lock (PedsLock)
|
||||||
{
|
{
|
||||||
AddPlayer();
|
AddPlayer();
|
||||||
|
var mainCharacters = new List<PedHash> { PedHash.Michael, PedHash.Franklin, PedHash.Franklin02, PedHash.Trevor };
|
||||||
|
|
||||||
foreach (Ped p in allPeds)
|
foreach (Ped p in allPeds)
|
||||||
{
|
{
|
||||||
SyncedPed c = GetPedByHandle(p.Handle);
|
if (!PedsByHandle.ContainsKey(p.Handle) && p != Game.Player.Character && !mainCharacters.Contains((PedHash)p.Model.Hash))
|
||||||
if (c == null && (p != Game.Player.Character))
|
|
||||||
{
|
{
|
||||||
if (allPeds.Length > Main.Settings.WorldPedSoftLimit && p.PopulationType == EntityPopulationType.RandomAmbient)
|
if (PedsByID.Count(x => x.Value.IsLocal) > Main.Settings.WorldPedSoftLimit)
|
||||||
{
|
{
|
||||||
p.Delete();
|
if (p.PopulationType == EntityPopulationType.RandomAmbient && !p.IsInVehicle())
|
||||||
continue;
|
{
|
||||||
|
p.Delete();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (p.PopulationType == EntityPopulationType.RandomScenario) continue;
|
||||||
}
|
}
|
||||||
// Main.Logger.Trace($"Creating SyncEntity for ped, handle:{p.Handle}");
|
// Main.Logger.Trace($"Creating SyncEntity for ped, handle:{p.Handle}");
|
||||||
c = new SyncedPed(p);
|
|
||||||
|
|
||||||
Add(c);
|
Add(new SyncedPed(p));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if BENCHMARK
|
#if BENCHMARK
|
||||||
@ -437,10 +440,9 @@ namespace RageCoop.Client
|
|||||||
{
|
{
|
||||||
if (!VehiclesByHandle.ContainsKey(veh.Handle))
|
if (!VehiclesByHandle.ContainsKey(veh.Handle))
|
||||||
{
|
{
|
||||||
if (allVehicles.Length > Main.Settings.WorldVehicleSoftLimit)
|
if (VehiclesByID.Count(x => x.Value.IsLocal) > Main.Settings.WorldVehicleSoftLimit)
|
||||||
{
|
{
|
||||||
var type = veh.PopulationType;
|
if (veh.PopulationType == EntityPopulationType.RandomAmbient || veh.PopulationType == EntityPopulationType.RandomParked)
|
||||||
if (type == EntityPopulationType.RandomAmbient || type == EntityPopulationType.RandomParked)
|
|
||||||
{
|
{
|
||||||
foreach (var p in veh.Occupants)
|
foreach (var p in veh.Occupants)
|
||||||
{
|
{
|
||||||
|
@ -126,7 +126,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
|
|
||||||
var p = EntityPool.GetPedByID(ownerID)?.MainPed;
|
var p = EntityPool.GetPedByID(ownerID)?.MainPed;
|
||||||
if (p == null) { p = Game.Player.Character; Main.Logger.Warning("Failed to find owner for bullet"); }
|
if (p == null) { return; /* p = Game.Player.Character; Main.Logger.Warning("Failed to find owner for bullet"); */ }
|
||||||
if (!CorePFXAsset.IsLoaded) { CorePFXAsset.Request(); }
|
if (!CorePFXAsset.IsLoaded) { CorePFXAsset.Request(); }
|
||||||
if (_lastWeaponHash != weaponHash)
|
if (_lastWeaponHash != weaponHash)
|
||||||
{
|
{
|
||||||
@ -135,7 +135,7 @@ namespace RageCoop.Client
|
|||||||
_lastWeaponHash = weaponHash;
|
_lastWeaponHash = weaponHash;
|
||||||
}
|
}
|
||||||
if (!_weaponAsset.IsLoaded) { _weaponAsset.Request(); }
|
if (!_weaponAsset.IsLoaded) { _weaponAsset.Request(); }
|
||||||
World.ShootBullet(start, end, p, _weaponAsset, (int)p.GetWeaponDamage(weaponHash));
|
World.ShootSingleBullet(start, end, (int)p.GetWeaponDamage(weaponHash), _weaponAsset, p);
|
||||||
Prop w;
|
Prop w;
|
||||||
if (((w = p.Weapons.CurrentWeaponObject) != null) && (p.VehicleWeapon == VehicleWeaponHash.Invalid))
|
if (((w = p.Weapons.CurrentWeaponObject) != null) && (p.VehicleWeapon == VehicleWeaponHash.Invalid))
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,7 @@ namespace RageCoop.Client
|
|||||||
{
|
{
|
||||||
// Weapon/radio wheel slow-mo patch
|
// Weapon/radio wheel slow-mo patch
|
||||||
// Thanks @CamxxCore, https://github.com/CamxxCore/GTAVWeaponWheelMod
|
// Thanks @CamxxCore, https://github.com/CamxxCore/GTAVWeaponWheelMod
|
||||||
var result = NativeMemory.FindPattern("\x38\x51\x64\x74\x19", "xxxxx");
|
var result = MemScanner.FindPatternBmh("\x38\x51\x64\x74\x19", "xxxxx");
|
||||||
if (result == null) { throw new NotSupportedException("Can't find memory pattern to patch weapon/radio slow-mo"); }
|
if (result == null) { throw new NotSupportedException("Can't find memory pattern to patch weapon/radio slow-mo"); }
|
||||||
var address = result + 26;
|
var address = result + 26;
|
||||||
address = address + *(int*)address + 4u;
|
address = address + *(int*)address + 4u;
|
||||||
@ -91,7 +91,7 @@ namespace RageCoop.Client
|
|||||||
var foundOffsets = new List<int>(100);
|
var foundOffsets = new List<int>(100);
|
||||||
for (int i = 0; i <= range; i++)
|
for (int i = 0; i <= range; i++)
|
||||||
{
|
{
|
||||||
var val = NativeMemory.ReadFloat(start + i);
|
var val = MemDataMarshal.ReadFloat(start + i);
|
||||||
if (Math.Abs(val - toSearch) < tolerance)
|
if (Math.Abs(val - toSearch) < tolerance)
|
||||||
{
|
{
|
||||||
foundOffsets.Add(i);
|
foundOffsets.Add(i);
|
||||||
|
@ -296,7 +296,7 @@ namespace RageCoop.Client
|
|||||||
{
|
{
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
else
|
else if (veh.GetPedOnSeat(seat) != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool isDead = veh.GetPedOnSeat(seat).IsDead;
|
bool isDead = veh.GetPedOnSeat(seat).IsDead;
|
||||||
|
@ -201,7 +201,7 @@ namespace RageCoop.Client
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ApplyForce(this Entity e, int boneIndex, Vector3 direction, Vector3 rotation = default(Vector3), ForceType forceType = ForceType.MaxForceRot2)
|
public static void ApplyForce(this Entity e, int boneIndex, Vector3 direction, Vector3 rotation = default(Vector3), ForceType forceType = ForceType.ExternalImpulse)
|
||||||
{
|
{
|
||||||
Function.Call(Hash.APPLY_FORCE_TO_ENTITY, e.Handle, forceType, direction.X, direction.Y, direction.Z, rotation.X, rotation.Y, rotation.Z, boneIndex, false, true, true, false, true);
|
Function.Call(Hash.APPLY_FORCE_TO_ENTITY, e.Handle, forceType, direction.X, direction.Y, direction.Z, rotation.X, rotation.Y, rotation.Z, boneIndex, false, true, true, false, true);
|
||||||
}
|
}
|
||||||
@ -244,7 +244,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
lineList.Add("ReloadKey=Insert");
|
lineList.Add("ReloadKey=Insert");
|
||||||
File.WriteAllLines("ScriptHookVDotNet.ini", lineList.ToArray());
|
File.WriteAllLines("ScriptHookVDotNet.ini", lineList.ToArray());
|
||||||
GTA.UI.Notification.Show("Reload cannot be performed automatically, please type \"Reload()\" manually in the SHVDN console.");
|
GTA.UI.Notification.PostTicker("Reload cannot be performed automatically, please type \"Reload()\" manually in the SHVDN console.", false);
|
||||||
}
|
}
|
||||||
Keys key = (Keys)Enum.Parse(typeof(Keys), reloadKey, true);
|
Keys key = (Keys)Enum.Parse(typeof(Keys), reloadKey, true);
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
GTA.UI.Notification.Show(ex.Message);
|
GTA.UI.Notification.PostTicker(ex.Message, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
PostMessage(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle, WM_KEYDOWN, (int)key, 0);
|
PostMessage(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle, WM_KEYDOWN, (int)key, 0);
|
||||||
|
@ -50,7 +50,7 @@ namespace RageCoop.Client
|
|||||||
flags |= VehicleDataFlags.IsHornActive;
|
flags |= VehicleDataFlags.IsHornActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v.IsSubmarineCar && Function.Call<bool>(Hash._GET_IS_SUBMARINE_VEHICLE_TRANSFORMED, veh.Handle))
|
if (v.IsSubmarineCar && Function.Call<bool>(Hash.IS_VEHICLE_IN_SUBMARINE_MODE, veh.Handle))
|
||||||
{
|
{
|
||||||
flags |= VehicleDataFlags.IsTransformed;
|
flags |= VehicleDataFlags.IsTransformed;
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
public static bool IsRocketBoostActive(this Vehicle veh)
|
public static bool IsRocketBoostActive(this Vehicle veh)
|
||||||
{
|
{
|
||||||
return Function.Call<bool>(Hash._IS_VEHICLE_ROCKET_BOOST_ACTIVE, veh);
|
return Function.Call<bool>(Hash.IS_ROCKET_BOOST_ACTIVE, veh);
|
||||||
}
|
}
|
||||||
public static bool IsParachuteActive(this Vehicle veh)
|
public static bool IsParachuteActive(this Vehicle veh)
|
||||||
{
|
{
|
||||||
@ -97,7 +97,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
public static void SetRocketBoostActive(this Vehicle veh, bool toggle)
|
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)
|
public static void SetParachuteActive(this Vehicle veh, bool toggle)
|
||||||
{
|
{
|
||||||
@ -174,12 +174,12 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (door.IsBroken)
|
/*else if (door.IsBroken) // causes break/repair loop in some situations
|
||||||
{
|
{
|
||||||
// The vehicle can only fix a door if the vehicle was completely fixed
|
// The vehicle can only fix a door if the vehicle was completely fixed
|
||||||
veh.Repair();
|
veh.Repair();
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
if ((model.OpenedDoors & (byte)(1 << i)) != 0)
|
if ((model.OpenedDoors & (byte)(1 << i)) != 0)
|
||||||
{
|
{
|
||||||
if ((!door.IsOpen) && (!door.IsBroken))
|
if ((!door.IsOpen) && (!door.IsBroken))
|
||||||
@ -196,10 +196,10 @@ namespace RageCoop.Client
|
|||||||
{
|
{
|
||||||
veh.Windows[(VehicleWindowIndex)i].Smash();
|
veh.Windows[(VehicleWindowIndex)i].Smash();
|
||||||
}
|
}
|
||||||
else if (!veh.Windows[(VehicleWindowIndex)i].IsIntact)
|
/*else if (!veh.Windows[(VehicleWindowIndex)i].IsIntact) // causes smash/repair loop in some situations
|
||||||
{
|
{
|
||||||
veh.Windows[(VehicleWindowIndex)i].Repair();
|
veh.Windows[(VehicleWindowIndex)i].Repair();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (VehicleWheel wheel in veh.Wheels)
|
foreach (VehicleWheel wheel in veh.Wheels)
|
||||||
@ -242,7 +242,7 @@ namespace RageCoop.Client
|
|||||||
|
|
||||||
public static void SetDeluxoHoverState(this Vehicle deluxo, bool hover)
|
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)
|
public static bool IsDeluxoHovering(this Vehicle deluxo)
|
||||||
{
|
{
|
||||||
@ -250,7 +250,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
public static void SetDeluxoWingRatio(this Vehicle v, float ratio)
|
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)
|
public static float GetDeluxoWingRatio(this Vehicle v)
|
||||||
{
|
{
|
||||||
@ -258,7 +258,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
public static float GetNozzleAngel(this Vehicle plane)
|
public static float GetNozzleAngel(this Vehicle plane)
|
||||||
{
|
{
|
||||||
return Function.Call<float>(Hash._GET_VEHICLE_FLIGHT_NOZZLE_POSITION, plane);
|
return Function.Call<float>(Hash.GET_VEHICLE_FLIGHT_NOZZLE_POSITION, plane);
|
||||||
}
|
}
|
||||||
public static bool HasNozzle(this Vehicle v)
|
public static bool HasNozzle(this Vehicle v)
|
||||||
{
|
{
|
||||||
|
@ -120,7 +120,7 @@ namespace RageCoop.Client
|
|||||||
if ((c == null) || (c.IsLocal && (ped.Handle != Game.Player.Character.Handle) && ped.PopulationType != EntityPopulationType.Mission))
|
if ((c == null) || (c.IsLocal && (ped.Handle != Game.Player.Character.Handle) && ped.PopulationType != EntityPopulationType.Mission))
|
||||||
{
|
{
|
||||||
|
|
||||||
Main.Logger.Trace($"Removing ped {ped.Handle}. Reason:RemoveTraffic");
|
// Main.Logger.Trace($"Removing ped {ped.Handle}. Reason:RemoveTraffic");
|
||||||
ped.CurrentVehicle?.Delete();
|
ped.CurrentVehicle?.Delete();
|
||||||
ped.Kill();
|
ped.Kill();
|
||||||
ped.Delete();
|
ped.Delete();
|
||||||
|
@ -81,7 +81,7 @@ namespace RageCoop.Server
|
|||||||
}
|
}
|
||||||
if (!CanAnnounce)
|
if (!CanAnnounce)
|
||||||
{
|
{
|
||||||
var existing = JsonConvert.DeserializeObject<List<ServerInfo>>(HttpHelper.DownloadString(Util.GetFinalRedirect(Settings.MasterServer))).Where(x => x.address == IpInfo.Address).FirstOrDefault();
|
var existing = JsonConvert.DeserializeObject<List<ServerInfo>>(HttpHelper.DownloadString(Util.GetFinalRedirect(Settings.MasterServer))).Where(x => x.address == IpInfo.Address && x.port == Settings.Port.ToString()).FirstOrDefault();
|
||||||
if(existing != null)
|
if(existing != null)
|
||||||
{
|
{
|
||||||
Logger.Warning("Server info already present in master server, waiting for 10 seconds...");
|
Logger.Warning("Server info already present in master server, waiting for 10 seconds...");
|
||||||
|
@ -15,7 +15,7 @@ using System.Resources;
|
|||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Version information
|
// Version information
|
||||||
[assembly: AssemblyVersion("1.5.4.2")]
|
[assembly: AssemblyVersion("1.5.4.5")]
|
||||||
[assembly: AssemblyFileVersion("1.5.4.2")]
|
[assembly: AssemblyFileVersion("1.5.4.5")]
|
||||||
[assembly: NeutralResourcesLanguageAttribute( "en-US" )]
|
[assembly: NeutralResourcesLanguageAttribute( "en-US" )]
|
||||||
|
|
||||||
|
@ -49,12 +49,12 @@
|
|||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Fody" Version="6.6.3">
|
<PackageReference Include="Fody" Version="6.8.0">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="6.0.8" />
|
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="7.0.9" />
|
||||||
<PackageReference Include="SharpZipLib" Version="1.3.3" />
|
<PackageReference Include="SharpZipLib" Version="1.4.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -38,7 +38,7 @@ namespace RageCoop.Server.Scripting
|
|||||||
});
|
});
|
||||||
API.RegisterCustomEventHandler(CustomEvents.OnPlayerDied, (e) =>
|
API.RegisterCustomEventHandler(CustomEvents.OnPlayerDied, (e) =>
|
||||||
{
|
{
|
||||||
API.SendCustomEventQueued(API.GetAllClients().Values.Where(x => x != e.Client).ToList(), CustomEvents.OnPlayerDied, e.Client.Username);
|
API.SendCustomEventQueued(API.GetAllClients().Values.Where(x => x != e.Client).ToList(), CustomEvents.OnPlayerDied, e.Args);
|
||||||
});
|
});
|
||||||
API.Events.OnChatMessage += (s, e) =>
|
API.Events.OnChatMessage += (s, e) =>
|
||||||
Server.Logger?.Info((e.Client?.Username ?? e.ClaimedSender ?? "Unknown") + ": " + e.Message);
|
Server.Logger?.Info((e.Client?.Username ?? e.ClaimedSender ?? "Unknown") + ": " + e.Message);
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The website address to be shown on master server
|
/// The website address to be shown on master server
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Website { get; set; } = "https://ragecoop.online/";
|
public string Website { get; set; } = "https://ragecoop.com/";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The description to be shown on master server
|
/// The description to be shown on master server
|
||||||
@ -58,7 +58,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Master server address, mostly doesn't need to be changed.
|
/// Master server address, mostly doesn't need to be changed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string MasterServer { get; set; } = "https://masterserver.ragecoop.online/";
|
public string MasterServer { get; set; } = "https://masterserver.ragecoop.com/";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// See <see cref="Core.Logger.LogLevel"/>.
|
/// See <see cref="Core.Logger.LogLevel"/>.
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user