Framework Base

Here you will find the documentation on the features in the base part of the framework.

Documentation may be incomplete and might need additions, we will update this when we can.

Usage:

            
        using Eco.EM.Framework;
        

Please note: This part is still under production, it requires some more work before its fully functional.

To use the browser link you need to make a new BrowserLink and assign it an address:

            
        BrowserLink Name => new BrowserLink("Display Name", "weblink.com");
        

Once we have created our new browser link we then pass it to the game using the localizer:

            
        Localizer.DoStr($"{Name.UILink()}");
        

This can be added to anything that shows text

For the Link to be clickable we need to add the .UILink()

It would then display in game the Display Name and when clicked it will open the default browser of that os and enter the weblink.

The BrowserLink currently only works for windows users until we can get a client os detection in place


String Sanitizer - Make reading command paramters easier, cleaner output and easier config file edits/generations

The string sanitizer convers all string input to lower then cleans up the whitespaces at the end and start of the string:

IE:

you have a command that accpets 2 paramaters: Input, Value

Each paramter comes back like this: Input, Value - With spaces inbetween the , and the second word ( Or at the start of the word if you like) With the sanitizer you can have the paramaters come back like this:

input,value - This helps prevent " value" returning null, wrong or incorrect when you really wanted "value"

            
        Usage: Base.Sanitize(string);
        value = Base.Sanitize(value);
            
    

This helps you to get the same value every time, especially when it converts it to lower so all the text is in lowercase and can be easily matched


Debug - Write to the console your errors or general code debugging

testing out something in your mod and want it to display to the console easier, the debug is a very simple string output into the console as yellow text, ie warning text. its very simple to use.


        Base.Debug(string);
            
    

Get Users - Easily find and match users to their Username, SLGID or SteamID

we have a few things here that you can use:

            
        Base.GetUserByName(string username)
        Base.GetPlayerByName(string playername)
        Base.GetUser(string filter) // Filter can be one of the following: UserName, SLGID or SteamID
            
    

We also have a few other features in this section:

            
            Base.OnlineUsers // This returns a list of all online users.
            Base.Users // This returns a list of all users on the server
            Base.Admins // This returns a list of all admins on the server
            Base.OnlineAdmins // This returns a list of all online admins on the server
            
    

These can be used easily for things like:

            
        foreach(var user in Base.OnlineUsers)
        {
        //your code here
        }
                
    

Extras - These are mostly used by us, but you can use them too.

Base.saveLocation - This is a string where all default configs are saved to using the file manager ( See Eco.EM.Framework.FileManger )

These are saved in the Configs/Mods/ Folder which is created on the server boot.

This is great for anyone who wishes to get their configs safe incase the mods folder is deleted.

Base.fileFormat - This is the basic format we save files to and is passed to the File Manager to make the files read easier - Save format is .json

Base.appName - This is what we use to identify our mods used when sending chat messages this is a string and reads as: [Elixr Mods]:

Base.appNameCon - This is what we use to identify our mods when sending messages to the Server Console and reads as: [Elixr Mods]: