diff --git a/F.ExperienceUI.csproj b/F.ExperienceUI.csproj new file mode 100644 index 0000000..d65b07f --- /dev/null +++ b/F.ExperienceUI.csproj @@ -0,0 +1,77 @@ + + + + + Debug + AnyCPU + {A26FD78B-48F8-45C3-8C4C-B407805D5850} + Library + Properties + F.ExperienceUI + F.ExperienceUI + v4.7.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + libs\Assembly-CSharp.dll + + + False + libs\Assembly-CSharp-firstpass.dll + + + False + libs\Rocket.API.dll + + + False + libs\Rocket.Core.dll + + + False + libs\Rocket.Unturned.dll + + + + + + + + + + + False + libs\UnityEngine.dll + + + False + libs\UnityEngine.CoreModule.dll + + + + + + + + + \ No newline at end of file diff --git a/F.ExperienceUI.sln b/F.ExperienceUI.sln new file mode 100644 index 0000000..aaccb96 --- /dev/null +++ b/F.ExperienceUI.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "F.ExperienceUI", "F.ExperienceUI.csproj", "{A26FD78B-48F8-45C3-8C4C-B407805D5850}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A26FD78B-48F8-45C3-8C4C-B407805D5850}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A26FD78B-48F8-45C3-8C4C-B407805D5850}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A26FD78B-48F8-45C3-8C4C-B407805D5850}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A26FD78B-48F8-45C3-8C4C-B407805D5850}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DDB59E8D-B4FF-40AE-ADD0-112EB7C3619F} + EndGlobalSection +EndGlobal diff --git a/Main.cs b/Main.cs new file mode 100644 index 0000000..3e2457b --- /dev/null +++ b/Main.cs @@ -0,0 +1,57 @@ +using Rocket.Core.Logging; +using Rocket.Core.Plugins; +using Rocket.Unturned; +using Rocket.Unturned.Events; +using Rocket.Unturned.Player; +using SDG.Unturned; +using System; + +namespace F.ExperienceUI +{ + public class Main : RocketPlugin + { + public static Main Instance; + + protected override void Load() + { + Main.Instance = this; + + + Logger.Log("####################################################", ConsoleColor.Red); + Logger.Log("# F.ExperienceUI Loaded #", ConsoleColor.Red); + Logger.Log("# Plugin By: Feli #", ConsoleColor.Red); + Logger.Log("# Discord Support:https://discord.gg/6zQVJ9p #", ConsoleColor.Red); + Logger.Log("# Plugin Ver: 2.0.0 #", ConsoleColor.Red); + Logger.Log("####################################################", ConsoleColor.Red); + + + U.Events.OnPlayerConnected += Events_OnPlayerConnected; + U.Events.OnPlayerDisconnected += Events_OnPlayerDisconnected; + UnturnedPlayerEvents.OnPlayerUpdateExperience += Events_OnPlayerUpdateExperience; + } + + private void Events_OnPlayerConnected(UnturnedPlayer player) + { + EffectManager.sendUIEffect(this.Configuration.Instance.ExperienceUI, (short)32401, player.CSteamID, true, this.Configuration.Instance.EconomySymbol + player.Experience.ToString()); + EffectManager.sendUIEffect(this.Configuration.Instance.ServerNameUI, (short)32403, player.CSteamID, true, this.Configuration.Instance.ServerName.ToString()); + } + + private void Events_OnPlayerUpdateExperience(UnturnedPlayer player, uint experience) + { + EffectManager.sendUIEffect(this.Configuration.Instance.ExperienceUI, (short)32401, player.CSteamID, true, this.Configuration.Instance.EconomySymbol + player.Experience.ToString()); + } + + private void Events_OnPlayerDisconnected(UnturnedPlayer player) + { + EffectManager.askEffectClearByID(this.Configuration.Instance.ExperienceUI, player.CSteamID); + EffectManager.askEffectClearByID(this.Configuration.Instance.ServerNameUI, player.CSteamID); + } + + protected override void Unload() + { + U.Events.OnPlayerConnected -= Events_OnPlayerConnected; + U.Events.OnPlayerDisconnected -= Events_OnPlayerDisconnected; + UnturnedPlayerEvents.OnPlayerUpdateExperience -= Events_OnPlayerUpdateExperience; + } + } +} diff --git a/libs/Assembly-CSharp-firstpass.dll b/libs/Assembly-CSharp-firstpass.dll new file mode 100644 index 0000000..45a8175 Binary files /dev/null and b/libs/Assembly-CSharp-firstpass.dll differ diff --git a/libs/Assembly-CSharp.dll b/libs/Assembly-CSharp.dll new file mode 100644 index 0000000..193b5af Binary files /dev/null and b/libs/Assembly-CSharp.dll differ diff --git a/libs/Rocket.API.dll b/libs/Rocket.API.dll new file mode 100644 index 0000000..c197c6f Binary files /dev/null and b/libs/Rocket.API.dll differ diff --git a/libs/Rocket.Core.dll b/libs/Rocket.Core.dll new file mode 100644 index 0000000..7197fcd Binary files /dev/null and b/libs/Rocket.Core.dll differ diff --git a/libs/Rocket.Unturned.dll b/libs/Rocket.Unturned.dll new file mode 100644 index 0000000..08ebe4c Binary files /dev/null and b/libs/Rocket.Unturned.dll differ diff --git a/libs/UnityEngine.CoreModule.dll b/libs/UnityEngine.CoreModule.dll new file mode 100644 index 0000000..72029ab Binary files /dev/null and b/libs/UnityEngine.CoreModule.dll differ diff --git a/libs/UnityEngine.dll b/libs/UnityEngine.dll new file mode 100644 index 0000000..1e7f6b8 Binary files /dev/null and b/libs/UnityEngine.dll differ diff --git a/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..5bc29aa Binary files /dev/null and b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ