Skip to content
data-bomb edited this page Jul 4, 2023 · 28 revisions

Silica Logo

Adding Admins

In-Game

In-game is the preferred method of adding admins. Once the host is up and running and the Admin Mod is loaded, admins can be added via the game's in-game chat. Only the host can add/modify/remove admins. The host can issue the chat command: !addadmin <playerName> <Powers> <Level>

<playerName> is a unique part of the players name but it does not need to be the full name. For example, if there were 3 clients connected (Toaster, Toastee, Toasted) and we wanted to make sure Toasted was an admin then you could start with !addadmin ted or !addadmin Toasted.

<Powers> is the set of characters for each power that you want to grant. Use the Root power to grant all powers. See Powers for the mapping of powers to characters.

<Level> is a number between 0-255 the represents the heirarchy of the admin on the server and affects who they can target. See Levels for more information.

For example, to add Toasted as an admin with permission to kick, restart the round, and manage the commanders (demote/commander restrictions/etc), with a moderate level: !addadmin ted cik 80

Offline

It's also possible to add a new admin offline by modifying the Silica\UserData\admins.json file. Please do not update the admins.json file while the host server is running because the Admin Mod does not keep track if there were any modifications made before it overwrites the file. Admin entires will look like:

[
  {
    "Name": "Toasted",
    "SteamId": 76561197123456789,
    "Powers": 1284,
    "Level": 80,
    "CreatedOn": 1688371400,
    "LastModifiedOn": 1688371400
  }
]

The Powers field is a collection of all of the individual Powers logically ORd together. The Kick power is represented by 2^2, restarting the round is the End power and represented by 2^10, and the Commander power controls demotion/commander restriction permissions and is represented by 2^8. Each of these Powers represents a single bit and they can be added together: 4 + 1024 + 256 = 1284 to get the value that needs to go into the Powers field. The Root power, which includes all other powers, is represented by a value of 67108864.

The CreatedOn and LastModifiedOn fields are Unix timestamps. Websites like https://www.epochconverter.com/ are a good resource to gather this information on a Windows PC.

After making any direct modifications to a .json file, it's usually a good idea to validate that the file is still in the correct format for the next time the server starts up to read the information. (e.g., https://jsonlint.com/)

Architecture

graph LR;
    A[!kick Mod]-->B[Admin Extension];
    C[!ban Mod]-->B[Admin Extension];
    D[!mute Mod]-->B[Admin Extension];
    G[Other Mods]-->B[Admin Extension]
    B[Admin Extension]-->E[Admin Mod];
    E-- Extension Methods --> F[Silica Player Class]
Loading
Clone this wiki locally