Easy Admin Menu Project Integration
The included demo files show the asset fully integrated into a standard UE default project, but here are the steps needed to integrate with your own existing system.
1. Add the BPC_EasyAdmin component to your player character class. Set the component to be Replicated in the details tab of the component on your character.
2. Add the included Enhanced Input into your input handler or use your own existing input to call "ToggleActiveAdminWidget" on the BPC_EasyAdmin component to handle opening/closing of the admin menu.
Player Integration Screenshot (Interface logic covered below):
We're mostly done with the core integration now, the following steps are technically optional but are required for full functionality of the plugin.
Enable Heal/Kill player button: Add the EasyAdminInterface to your player pawn class. Implement the AdmAddPlayerHealth event. This event is called on Server from the admin tools so you can tie into your existing stat system here, whether it be your Damage interface or some sort of AddHealth functionality. By default Heal adds 100 health and Kill subtracts 100 health. For the return value of AdmGetPlayerHealth function that also comes with this interface, you can just plug in whatever variable you are using to store the player's health.
Enable Server Wide Settings, Ban/Allow list functionality: If you're not already using a custom game mode class, simply set your world settings to use GM_EasyAdmin and you're done. If you are using a custom game mode, you can reparent your's to GM_EasyAdmin or you simply need to add an interface and implement a few functions/variables in your existing GameMode class. Add EasyAdminGameModeInterface to your game mode class, and create two bool variables AllowPVP and RequireAllowList. On the two interface events GetAllowPVP and GetRequireAllowList simply double click these and feed your new booleans into the return values for each respectively. Then all you need to do is implement the following code in your GameMode graph:
GameMode Interface Implementation example:
Do the same setup as below for GetAllowPVP as well:
GameMode OnPostLogin Override:
God Mode and AllowPVP bools: As it stands with the default implementation, these are just states managed by the Admin tools with no actual damage system. To utilize their functionality with your game setup you just need to check these bools in your server damage function. They can be accessed via:
DamageTarget->GetComponentOfClass(BPC_EasyAdmin)->GetStateGodMode()
GetYourGameMode-> GetAllowPVP()
Enable Settings specific Item amounts: The Easy Admin Menu Spawner works fine without this piece, but offers functionality for setting specific item amounts when spawning if your system requires that (for example, a bandage item that has 3 of 4 uses). If you would like this you just need to add the EasyAdminSpawnerInterface to your item's class (or item manager depending on your setup) and implement the events. OnItemSpawned() is called after the item is spawned for any optionally needed initialization, and SetItemAmountSpawned() is called on server so you can plug your items quantity system into this.
That’s it, you should be good to go! There are a few settings you can customize in the class defaults from this point, such as your chosen authentication method and chosen game mode server settings. Aside from the Spawner menu, all of the lists are stored externally in json files generated at runtime and can be edited both externally or in game. The path to the json config files is YourProjectOrGameDirectory\Saved\EasyAdminFiles, please note the formats. Editing the files in game should handle formatting automatically but when editing these files manually be sure to back up your changes locally incase of accidental json syntax errors invalidating your config files. The Spawner Menu utilizes a composite data table, you can make your own data table of the struct SpawnerListEntry and add it to the composite data table used by the plugin. This way you can update the plugin without losing any of your configurations.
If you'd like to expand the Easy Admin menu with your own admin abilities and don't want to work in c++, a basic example is included of a Blueprint Only admin power integration at BPC_EasyAdmin>Event Graph>Blueprint Ability Example.
Add your SpawnerList Data table to this composite data table here:
Admin Authorization Methods:
LocalToken: Client password is stored locally in the UserKey file and then encrypted to send via RPC to the server to check against the server's local AdminList.json. This method encrypts the sensitive info before sending it from client to server and handles the check on server but is vulnerable if users don't keep their machines secure. Uses internal AES_KEY value for encryption which can be changed manually or replaced with a dynamic value for extra security
The hardcoded AES256 key value is in the EasyAdminMenu.Build.cs and can be changed there, if you use this method please use your own key value for added security (key must be valid AES256 value, google for more information if your new to this).
PlayerID: PlayerID is set by your OnlineSubsystem automatically on session login and is checked against the server's AdminList.json. This method doesn't require sending any sensitive information via RPC's so in theory may be a safer method, configured with something like Steam your admin list would consist of a list of SteamID's.
Ban/Allow List System Note:
This system operates under the assumption you are using an implemented Online Subsystem that provides persistent PlayerID's to players that join your game (such as Advanced Steam Sessions or most any options). Note that toggling the Servers global RequireAllowList setting during runtime will not actively boot all current players not on the AllowList, but this can be done manually from the ban menu.
Logging System:
To view the EasyAdmin Logs, navigate to your project or games \Saved\Logs and you can Ctrl-F "EasyAdminMenuAPI" to filter the results.
Update 1.1:
Ban Notifications: Integration is mostly the same but for the Ban Notification messages to be sent to players there’s just two small additional pieces you need. Simply inherit your GameInstance class off of the included example with the plugin (GI_EasyAdmin) or add the Easy Admin Game Instance Interface to your own and then implement the following functions and variables:
Implement CheckIfSessionKicked the same way dragging the PlayerWasKicked bool into the return node of the function. Lastly in your player controller if your not using the example class add the following: Add the EasyAdminController interface to your controller class, then Implement this function:
Then implement the following events and your done:
Buzz me in the support discord if you have any issues and hope you enjoy the plugin!