mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-19 15:51:58 +00:00
Fix kicking, Update Privacy Policy for EOS UserIdToken validation check
This commit is contained in:
1 parent
b2b575e946
commit
b8b537981c
8 files changed
+14
-15
No files matched your search
@@ -34,18 +34,17 @@ public static class LobbySharingAPI
|
||||
string hostName = Main.AllPlayerNames[PlayerControl.LocalPlayer.PlayerId].RemoveHtmlTags();
|
||||
string map = Options.RandomMapsMode.GetBool() ? "Random" : SubmergedCompatibility.Loaded && Main.NormalOptions.MapId == 6 ? "Submerged" : Main.CurrentMap.ToString();
|
||||
string gameMode = Options.EnableAutoGMRotation.GetBool() ? "Rotating" : Options.CurrentGameMode.ToString();
|
||||
string hostHashedPuid = Options.SendHashedPuidToUseLinkedAccount.GetBool() ? PlayerControl.LocalPlayer.GetClient().GetHashedPuid() : string.Empty;
|
||||
const string version = $"EHR v{Main.PluginDisplayVersion}";
|
||||
Main.Instance.StartCoroutine(SendLobbyCreatedRequest(roomCode, serverName, language, version, gameId, hostName, map, gameMode, hostHashedPuid));
|
||||
Main.Instance.StartCoroutine(SendLobbyCreatedRequest(roomCode, serverName, language, version, gameId, hostName, map, gameMode));
|
||||
}
|
||||
|
||||
private static IEnumerator SendLobbyCreatedRequest(string roomCode, string serverName, string language, string version, int gameId, string hostName, string map, string gameMode, string hostHashedPuid)
|
||||
private static IEnumerator SendLobbyCreatedRequest(string roomCode, string serverName, string language, string version, int gameId, string hostName, string map, string gameMode)
|
||||
{
|
||||
long timeSinceLastRequest = Utils.TimeStamp - LastRequestTimeStamp;
|
||||
if (timeSinceLastRequest < BufferTime) yield return new WaitForSecondsRealtime(BufferTime);
|
||||
LastRequestTimeStamp = Utils.TimeStamp;
|
||||
|
||||
var jsonData = $"{{\"roomCode\":\"{roomCode}\",\"serverName\":\"{serverName}\",\"language\":\"{language}\",\"version\":\"{version}\",\"gameId\":\"{gameId}\",\"hostName\":\"{hostName}\",\"map\":\"{map}\",\"gameMode\":\"{gameMode}\",\"hostHashedPuid\":\"{hostHashedPuid}\"}}";
|
||||
var jsonData = $"{{\"roomCode\":\"{roomCode}\",\"serverName\":\"{serverName}\",\"language\":\"{language}\",\"version\":\"{version}\",\"gameId\":\"{gameId}\",\"hostName\":\"{hostName}\",\"map\":\"{map}\",\"gameMode\":\"{gameMode}\"}}";
|
||||
byte[] jsonToSend = new UTF8Encoding().GetBytes(jsonData);
|
||||
|
||||
var request = new UnityWebRequest("https://app.gurge44.eu/lobby_created", "POST")
|
||||
@@ -56,6 +55,7 @@ public static class LobbySharingAPI
|
||||
|
||||
request.SetRequestHeader("Content-Type", "application/json");
|
||||
request.SetRequestHeader("User-Agent", $"{Main.ModName} v{Main.PluginVersion} - {Regex.Replace(hostName, @"[^\x20-\x7E]", "")}");
|
||||
request.SetRequestHeader("Authorization", "Bearer " + EOSManager.Instance.UserIDToken);
|
||||
yield return request.SendWebRequest();
|
||||
|
||||
LastRequestTimeStamp = Utils.TimeStamp;
|
||||
|
||||
@@ -737,7 +737,6 @@ public static class Options
|
||||
public static OptionItem PhantomCanGuess;
|
||||
|
||||
public static OptionItem PostLobbyCodeToEHRWebsite;
|
||||
public static OptionItem SendHashedPuidToUseLinkedAccount;
|
||||
public static OptionItem LobbyUpdateInterval;
|
||||
public static OptionItem StoreCompletedAchievementsOnEHRDatabase;
|
||||
public static OptionItem AllCrewRolesHaveVanillaColor;
|
||||
@@ -1764,9 +1763,6 @@ public static class Options
|
||||
|
||||
PostLobbyCodeToEHRWebsite = new BooleanOptionItem(19422, "PostLobbyCodeToEHRDiscordServer", true, TabGroup.SystemSettings)
|
||||
.SetHeader(true);
|
||||
|
||||
SendHashedPuidToUseLinkedAccount = new BooleanOptionItem(19501, "SendHashedPuidToUseLinkedAccount", true, TabGroup.SystemSettings)
|
||||
.SetParent(PostLobbyCodeToEHRWebsite);
|
||||
|
||||
LobbyUpdateInterval = new IntegerOptionItem(19502, "LobbyUpdateInterval", new(10, 30, 5), 30, TabGroup.SystemSettings)
|
||||
.SetParent(PostLobbyCodeToEHRWebsite)
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
using System.Linq;
|
||||
using AmongUs.GameOptions;
|
||||
using HarmonyLib;
|
||||
using Il2CppInterop.Runtime.Attributes;
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -97,7 +97,7 @@ internal static class Crowded
|
||||
playerButton.OnClick.AddListener((Action)(() =>
|
||||
{
|
||||
byte maxPlayers = byte.Parse(text.text);
|
||||
int maxImp = Mathf.Min(__instance.GetTargetOptions().NumImpostors, maxPlayers / 2);
|
||||
int maxImp = Math.Clamp(Mathf.Min(__instance.GetTargetOptions().NumImpostors, maxPlayers / 2), 1, 3);
|
||||
__instance.GetTargetOptions().SetInt(Int32OptionNames.NumImpostors, maxImp);
|
||||
__instance.ImpostorButtons[1].TextMesh.text = maxImp.ToString();
|
||||
__instance.SetMaxPlayersButtons(maxPlayers);
|
||||
|
||||
@@ -2,15 +2,15 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
using BepInEx.Unity.IL2CPP.Utils.Collections;
|
||||
using EHR.Gamemodes;
|
||||
using EHR.Modules;
|
||||
using EHR.Patches;
|
||||
using EHR.Roles;
|
||||
using HarmonyLib;
|
||||
using Il2CppSystem.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using EHR.Roles;
|
||||
using EHR.Gamemodes;
|
||||
|
||||
// ReSharper disable PossibleLossOfFraction
|
||||
|
||||
@@ -672,7 +672,7 @@ public static class NumberOptionPatch
|
||||
__instance.Increment = 0.05f;
|
||||
__instance.Value = (float)Math.Round(__instance.Value, 2);
|
||||
break;
|
||||
case StringNames.GameNumImpostors:
|
||||
case StringNames.GameNumImpostors when GameStates.CurrentServerType != GameStates.ServerType.Vanilla:
|
||||
__instance.ValidRange = new(0, Crowded.MaxImpostors);
|
||||
__instance.Value = (float)Math.Round(__instance.Value, 2);
|
||||
if (DebugModeManager.AmDebugger) __instance.ValidRange.min = 0;
|
||||
|
||||
@@ -613,6 +613,7 @@ internal static class UnrestrictedNumImpostorsPatch
|
||||
{
|
||||
public static bool Prefix(ref int __result)
|
||||
{
|
||||
if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) return true;
|
||||
__result = Main.NormalOptions.NumImpostors;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -287,6 +287,7 @@ internal static class ChangeRoleSettings
|
||||
{
|
||||
(OptionItem MinSetting, OptionItem MaxSetting) impLimits = Options.FactionMinMaxSettings[Team.Impostor];
|
||||
int optImpNum = IRandom.Instance.Next(impLimits.MinSetting.GetInt(), impLimits.MaxSetting.GetInt() + 1);
|
||||
if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) optImpNum = Math.Clamp(optImpNum, 1, 3);
|
||||
GameOptionsManager.Instance.currentNormalGameOptions.NumImpostors = optImpNum;
|
||||
GameOptionsManager.Instance.CurrentGameOptions.SetInt(Int32OptionNames.NumImpostors, optImpNum);
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ When using this integration, we collect the following non-personal information:
|
||||
- **Map Name:** The name of the map selected for the game (e.g., Skeld, Polus, Submerged).
|
||||
- **Game Mode:** The selected game mode (e.g., Standard, Room Rush, Free For All, Bed Wars).
|
||||
- **Lobby Status:** The current status of the lobby (e.g., In Lobby, In Game, Ended).
|
||||
- **Hashed PUID of the Host:** An encrypted version of the host's product user ID (see below), if `I have an EHR account linked to my discord account, send my hashed PUID to let discord users identify me` is enabled in System Settings, otherwise this field is left empty.
|
||||
- **EOS UserIdToken:** The user's EOS User ID Token.
|
||||
|
||||
Furthermore, the following information is collected to enhance the user experience:
|
||||
|
||||
@@ -666,7 +666,9 @@ Furthermore, the following information is collected to enhance the user experien
|
||||
The collected information is used solely for the following purposes:
|
||||
|
||||
- To notify players about available lobbies via the designated Discord server.
|
||||
- To make sure, that only genuine players can create lobbies on our server (prevent DDoS and fake data spam).
|
||||
- To update the status of the lobby in real time, enhancing coordination among players.
|
||||
- To provide lobby-management features for hosts, and track hosting statistics on Discord.
|
||||
- To ensure, that progress in custom achievements isn't lost when updating or reinstalling the mod.
|
||||
|
||||
**No personal data** or any other information beyond what is listed above is collected or processed.
|
||||
|
||||
@@ -11402,7 +11402,6 @@
|
||||
"SeeMedicAndTarget": "<color=#00ff97>Medic</color>+<color=#8cffff>Shielded</color>",
|
||||
"SeeNoone": "Nothing",
|
||||
"SeeTarget": "<color=#8cffff>Shielded</color>",
|
||||
"SendHashedPuidToUseLinkedAccount": "I have an EHR account linked to my discord account, send my hashed PUID to let discord users identify me",
|
||||
"SewedBySeamstress": "<#ffff44>You were sewed together with someone by the {0}!</color>",
|
||||
"Shapeshifter": "Shapeshifter",
|
||||
"ShareLobby": "Allow EHR-Chan Shares Lobby Code To Discord",
|
||||
|
||||
Reference in new issue
Block a user