diff --git a/freeroam-extended/client/html/index.de.html b/freeroam-extended/client/html/index.de.html new file mode 100644 index 0000000..cfdd3d1 --- /dev/null +++ b/freeroam-extended/client/html/index.de.html @@ -0,0 +1,66 @@ + + + + + + alt:V Chat + + + + +
+ Public Stress Test - v15. Powered by Avoro.eu +
+
+
+ Spieler online
xxxx
+
+
+ Deine ID
xxxx
+
+
+ Waffen
ON
+
+
+ Sprachchat
Connected
+
+
+ Streamed Spieler
0
+
+
+ Streamed Fahrzeuge
0
+
+
+
+
    +
  1. F2: HUD umschalten
  2. +
  3. T / Eingabe: Chat öffnen
  4. + +
  5. /tp <1 bis 22> (Teleport)
  6. +
  7. /model (wechselt zwischen männlichem und weiblichen Model)
  8. +
  9. /outfit [outfit_name] (Ändert Outfit zufällig oder auf gegebenen Wert)
  10. +
  11. /veh <modelName> (Erstellt ein Fahrzeug)
  12. +
  13. /clearvehicles (Löscht deine Fahrzeuge)
  14. +
  15. /tune <index> <value> (Fahrzeug Tuning)
  16. +
  17. /weapons (Gibt dir alle Waffen)
  18. +
  19. /addcomponent <name> (Waffen Komponenten hinzufügen)
  20. +
  21. /removecomponent <name> (Waffen Kompontent entfernen)
  22. +
  23. /dm ((De)Aktiviert den Respawn in der DM Zone)
  24. +
  25. /revive (Wiederbeleben des Spielers)
  26. +
+
+
+
+
+
+
+
+
+ +
+
+
+
+ + + diff --git a/freeroam-extended/client/html/index.html b/freeroam-extended/client/html/index.html index 055ed53..f820820 100644 --- a/freeroam-extended/client/html/index.html +++ b/freeroam-extended/client/html/index.html @@ -9,7 +9,7 @@
- Public Stress Test - v15 + Public Stress Test - v15. Powered by Avoro.eu
diff --git a/freeroam-extended/client/src/view.ts b/freeroam-extended/client/src/view.ts index f5cec3d..0f6181d 100644 --- a/freeroam-extended/client/src/view.ts +++ b/freeroam-extended/client/src/view.ts @@ -18,4 +18,10 @@ class View extends alt.WebView { } } -export const view = new View("http://resource/html/index.html") +const locale = alt.getLocale(); + +let viewUrl = "http://resource/html/index.html" +if (locale === "de") { + viewUrl = "http://resource/html/index.de.html" +} +export const view = new View(viewUrl) diff --git a/freeroam-extended/server/freeroam-extended/Commands.cs b/freeroam-extended/server/freeroam-extended/Commands.cs index bf828a2..1fd3dd7 100644 --- a/freeroam-extended/server/freeroam-extended/Commands.cs +++ b/freeroam-extended/server/freeroam-extended/Commands.cs @@ -17,7 +17,7 @@ public class Commands : IScript [Command("veh")] public void SpawnVeh(IAltPlayer player, string vehicleName) { - if (Misc.BlacklistedVehicle.Contains(Alt.Hash(vehicleName)) && !player.IsAdmin) + if (!Misc.WhitelistedVehicles.Contains(Alt.Hash(vehicleName))) { player.SendChatMessage("{FF0000} Vehicle is blacklisted."); return; @@ -105,24 +105,24 @@ public void GetWeapons(IAltPlayer player) } } - [Command("model")] - public void ChangeModel(IAltPlayer player) - { - if (player.Model == Alt.Hash("mp_m_freemode_01")) - { - player.Model = Alt.Hash("mp_f_freemode_01"); - } - else - { - player.Model = Alt.Hash("mp_m_freemode_01"); - } - - player.RefreshFace(); - - player.RefreshClothes(); - player.SendChatMessage( - $"{{00FF00}}Your model changed"); - } + //[Command("model")] + //public void ChangeModel(IAltPlayer player) + //{ + // if (player.Model == Alt.Hash("mp_m_freemode_01")) + // { + // player.Model = Alt.Hash("mp_f_freemode_01"); + // } + // else + // { + // player.Model = Alt.Hash("mp_m_freemode_01"); + // } + + // player.RefreshFace(); + + // player.RefreshClothes(); + // player.SendChatMessage( + // $"{{00FF00}}Your model changed"); + //} [Command("outfit")] public void Outfit(IAltPlayer player, string outfitUniqueName = "") @@ -205,6 +205,9 @@ public void Unban(IAltPlayer player, string rsid) // remove banned player from list Misc.BannedPlayers.Remove(rsid); + string json = JsonSerializer.Serialize(Misc.BannedPlayers); + File.WriteAllText(@"BannedPlayers.json", json); + player.SendChatMessage($"{{00FF00}}Player with hwid {rsid} unbanned!"); } @@ -287,6 +290,18 @@ public void Dimension(IAltPlayer player, int dimension = 0) player.Dimension = dimension; } + [Command("streamplayers")] + public void StreamPlayers(IAltPlayer player, int count = 128) + { + if (!player.IsAdmin) + { + player.SendChatMessage("{FF0000} No permission!"); + return; + } + + + } + [Command("clearvehicles")] public void ClearVehicles(IAltPlayer player) { diff --git a/freeroam-extended/server/freeroam-extended/EventHandler.cs b/freeroam-extended/server/freeroam-extended/EventHandler.cs index 2fe415e..0d01d2e 100644 --- a/freeroam-extended/server/freeroam-extended/EventHandler.cs +++ b/freeroam-extended/server/freeroam-extended/EventHandler.cs @@ -38,16 +38,27 @@ public EventHandler() [AsyncScriptEvent(ScriptEventType.PlayerConnect)] public async Task OnPlayerConnect(IAltPlayer player, string reason) { - string cloudId = await player.RequestCloudId(); - if (cloudId == "invalid") + try { - player.Kick("Authorization error"); - AltAsync.Log( - $"HWID: {player.HardwareIdHash}, RS ID: {cloudId}. Tried to join the server with invalid RS ID."); - return; + string cloudId = await player.RequestCloudId(); + if (cloudId == "NO_LICENSE") + { + player.Kick("Authorization error"); + AltAsync.Log( + $"HWID: {player.HardwareIdHash}, RS ID: {cloudId}. Tried to join the server with invalid RS ID."); + return; + } + + player.CloudID = cloudId; } + catch (Exception ex) + { + if (ex.Message != "SERVICE_UNAVAILABLE") + { - player.CloudID = cloudId; + } + } + if (Misc.BannedPlayers.Contains(player.CloudID)) { @@ -57,7 +68,7 @@ public async Task OnPlayerConnect(IAltPlayer player, string reason) return; } - if (Misc.Operators.Contains(cloudId)) + if (Misc.Operators.Contains(player.CloudID)) player.IsAdmin = true; // select random entry from SpawnPoints @@ -89,6 +100,13 @@ public async Task OnPlayerConnect(IAltPlayer player, string reason) Misc.UniquePlayers.Add(player.CloudID); File.WriteAllText(@"UniquePlayers.json", JsonSerializer.Serialize(Misc.UniquePlayers)); } + + string oldData = $"old auth data: {player.SocialClubId}, {player.SocialClubName}"; + if (!Misc.UniquePlayers.Contains(oldData)) + { + Misc.UniquePlayers.Add(oldData); + File.WriteAllText(@"UniquePlayers.json", JsonSerializer.Serialize(Misc.UniquePlayers)); + } } Voice.AddPlayer(player); @@ -256,25 +274,25 @@ public bool OnProjectileStart(IAltPlayer player, Position startPosition, Positio return false; } - [ClientEvent("chat:message")] - public void OnChatMessage(IAltPlayer player, params string[] args) - { - var message = string.Join("", args); - if (args.Length == 0 || message.Length == 0) return; - - if (args[0].StartsWith("/")) return; - if (!Misc.ChatState && !player.IsAdmin) - { - player.SendChatMessage("{FF0000}Chat is disabled!"); - return; - } - - foreach (var p in Alt.GetAllPlayers()) - { - p.SendChatMessage( - $"{(player.IsAdmin ? "{008736}" : "{FFFFFF}")} {player.Name}({player.Id}): {{FFFFFF}}{message}"); - } - } + //[ClientEvent("chat:message")] + //public void OnChatMessage(IAltPlayer player, params string[] args) + //{ + // var message = string.Join("", args); + // if (args.Length == 0 || message.Length == 0) return; + + // if (args[0].StartsWith("/")) return; + // if (!Misc.ChatState && !player.IsAdmin) + // { + // player.SendChatMessage("{FF0000}Chat is disabled!"); + // return; + // } + + // foreach (var p in Alt.GetAllPlayers()) + // { + // p.SendChatMessage( + // $"{(player.IsAdmin ? "{008736}" : "{FFFFFF}")} {player.Name}({player.Id}): {{FFFFFF}}{message}"); + // } + //} [ClientEvent("tp_to_waypoint")] public void TeleportToWaypoint(IAltPlayer player, int x, int y, int z) diff --git a/freeroam-extended/server/freeroam-extended/Freeroam-Extended.csproj b/freeroam-extended/server/freeroam-extended/Freeroam-Extended.csproj index 0c68f16..a895b20 100644 --- a/freeroam-extended/server/freeroam-extended/Freeroam-Extended.csproj +++ b/freeroam-extended/server/freeroam-extended/Freeroam-Extended.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -9,8 +9,8 @@ - - + + diff --git a/freeroam-extended/server/freeroam-extended/Misc.cs b/freeroam-extended/server/freeroam-extended/Misc.cs index 89abe19..d25460a 100644 --- a/freeroam-extended/server/freeroam-extended/Misc.cs +++ b/freeroam-extended/server/freeroam-extended/Misc.cs @@ -246,6 +246,14 @@ public static class Misc 3987008919, }; + public static HashSet WhitelistedVehicles = new () + { + 0xB779A091, + 0xAE2BFE94, + 0x6322B39A, + 0x92EF6E04 + }; + public static readonly Position[] SpawnPositions = { new (-1734.69885f,-1108.47033f, 14.05346f ), // Pier new (-2162.94067f, -398.45275f,14.373657f), // Parking Lot at the beach-highway