using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.ComponentModel; using System.Data; using System.Data.SqlTypes; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Dynamic; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Linq.Expressions; using System.Net; using System.Numerics; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using System.Xml; using System.Xml.Linq; using BepInEx; using BepInEx.Configuration; using Guilds; using HarmonyLib; using JetBrains.Annotations; using Jotunn.Managers; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Bson; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq.JsonPath; using Newtonsoft.Json.Schema; using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Utilities; using ServerSync; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] namespace RaidSystem { public class dWebHook { public string WebHookUrl { get; set; } public static void SendRaidMessage(string message) { string text = RaidSystemPlugin.WebhookUrl?.Value; if (string.IsNullOrWhiteSpace(text)) { text = ""; } dWebHook obj = new dWebHook(); obj.WebHookUrl = text; obj.SendMessage(message); } public void SendMessage(string message) { if (string.IsNullOrWhiteSpace(WebHookUrl) || string.IsNullOrWhiteSpace(message)) { return; } ThreadPool.QueueUserWorkItem(delegate { try { HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(WebHookUrl); httpWebRequest.ContentType = "application/json"; httpWebRequest.Method = "POST"; httpWebRequest.Timeout = 10000; string text = message.Replace("\\", "\\\\").Replace("\"", "\\\"").Replace("\n", "\\n") .Replace("\r", ""); byte[] bytes = Encoding.UTF8.GetBytes("{\"content\":\"" + text + "\"}"); httpWebRequest.ContentLength = bytes.Length; using (Stream stream = httpWebRequest.GetRequestStream()) { stream.Write(bytes, 0, bytes.Length); } using ((HttpWebResponse)httpWebRequest.GetResponse()) { } } catch (Exception ex) { Debug.LogWarning((object)("[RaidSystem] Webhook: " + ex.Message)); } }); } } internal class GUI { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__8_0; internal void b__8_0() { _scoreboard.SetActive(false); } } private static GameObject _menu; private static readonly Dictionary _menuItems = new Dictionary(); private static GameObject _scoreboard; public static void ToggleMenu() { if ((Object)(object)_menu == (Object)null || ((Object)(object)_menu != (Object)null && !_menu.activeSelf)) { if (GUIManager.Instance == null) { Debug.LogError((object)"[RaidSystem] GUIManager null"); return; } if (!Object.op_Implicit((Object)(object)GUIManager.CustomGUIFront)) { Debug.LogError((object)"[RaidSystem] CustomGUI null"); return; } if (string.IsNullOrEmpty(GuildsIntegration.GetOwnGuildName())) { Player localPlayer = Player.m_localPlayer; if (localPlayer != null) { ((Character)localPlayer).Message((MessageType)2, "Entre em uma guild para usar o RaidSystem.", 0, (Sprite)null); } return; } LoadMenu(); } if ((Object)(object)_menu != (Object)null) { _menu.SetActive(!_menu.activeSelf); } } public static void ToggleScoreboard() { if ((Object)(object)_scoreboard != (Object)null) { _scoreboard.SetActive(!_scoreboard.activeSelf); return; } LoadScoreboard(); if ((Object)(object)_scoreboard != (Object)null) { _scoreboard.SetActive(true); } } public static void DestroyMenu() { if ((Object)(object)_menu != (Object)null) { _menu.SetActive(false); } } public static void LoadMenu() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Expected O, but got Unknown //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: Expected O, but got Unknown if ((Object)(object)Player.m_localPlayer == (Object)null || GUIManager.Instance == null || !Object.op_Implicit((Object)(object)GUIManager.CustomGUIFront)) { return; } Object.Destroy((Object)(object)_menu); foreach (GameObject value in _menuItems.Values) { Object.Destroy((Object)(object)value); } _menuItems.Clear(); _menu = GUIManager.Instance.CreateWoodpanel(GUIManager.CustomGUIFront.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 0f), 500f, 700f, true); _menu.SetActive(false); PlayerInfo localPlayerInfo = RaidSystemPlugin.LocalPlayerInfo; string teamName = GuildsIntegration.GetOwnGuildName(); if (!string.IsNullOrEmpty(teamName)) { string text = localPlayerInfo?.Nick ?? ((Character)Player.m_localPlayer).m_nview.GetZDO().GetString("playerName", ""); GameObject val = GUIManager.Instance.CreateScrollView(_menu.transform, false, true, 8f, 50f, GUIManager.Instance.ValheimScrollbarHandleColorBlock, new Color(0.157f, 0.102f, 0.063f, 1f), 400f, 380f); ((RectTransform)val.transform).anchoredPosition = new Vector2(-20f, -50f); val.SetActive(true); _menuItems["scrollView"] = val; _menuItems["teamText"] = MakeText(teamName, _menu, new Vector2(200f, 650f), 30, 350f, 40f); _menuItems["playerNameText"] = MakeText(text, _menu, new Vector2(200f, 590f), 22, 350f, 50f); List territories = DataStore.Load().Territories; int num = territories.Count((TerritoryInfo t) => string.Equals(t.OwnerTeamId, teamName, StringComparison.OrdinalIgnoreCase)); _menuItems["territoriesText"] = MakeText($"Territories: {num}/{territories.Count}", _menu, new Vector2(370f, 617f), 18, 350f, 40f); GUIManager instance = GUIManager.Instance; string text2 = localPlayerInfo?.Description ?? ""; GameObject val2 = instance.CreateInputField(_menu.transform, new Vector2(0f, 0f), new Vector2(0f, 0f), new Vector2(160f, 555f), (ContentType)0, text2, 18, 270f, 33f); _menuItems["descInput"] = val2; GameObject val3 = GUIManager.Instance.CreateButton("Update", _menu.transform, new Vector2(0f, 0f), new Vector2(0f, 0f), new Vector2(360f, 555f), 90f, 35f); val3.SetActive(true); _menuItems["btnUpdate"] = val3; InputField inputComp = val2.GetComponent(); inputComp.text = localPlayerInfo?.Description ?? ""; ((UnityEvent)val3.GetComponent