Enabling Admin God Mode Restriction Limit Admin Commands To Specific Accounts - SWG-Source/swg-main GitHub Wiki

Controlling and Restricting Admin (God Mode) Access

Your localOptions.cfg file (located at swg-main/exe/linux/localOptions.cfg is the main configuration file for the server and contains several options related to who has admin permissions. By default in a fresh VM, you will see the following:

[GameServer]
#adminAccountDataTable=datatables/admin/stella_admin.iff
adminGodToAll=true
adminGodToAllGodLevel=50
  • adminAccountDataTable is the path to the compiled datatable (.iff) that contains the list of admin accounts.
  • adminGodToAll means that every account will have god permissions if this is set to true. If you comment this line out by prepending it with a # or set it to false, no accounts will have admin rights unless they are in the admin table and you uncomment that line.
  • adminGodToAllLevel is the level of permissions that god characters have if they get god permissions by adminGodToAll (this setting is irrelevant if adminGodToAll is disabled). Level 50 will have access to every admin command and permission. The god level and command permissions structure is outside the scope of this guide and it's messy so you probably don't want to bother with it anyways. Just use 50. As you can tell, by default on a fresly setup server, every account that is created will have admin permissions at god level 50.

Let's say you do not want every account to have admin rights and only certain accounts instead. To do this, we need to modify the admin datatable. The datatable when it has been compiled by the server (.iff file) is not editable, so we'll need to edit the pre-compiled file (.tab). To edit the admin table, go to: swg-main/dsrc/sku.0/sys.server/compiled/game/datatables/admin/ and find the file called stella_admin.tab. Double click to open this file in Mousepad or open it with Notepadqq, whichever you prefer.

The stella_admin.tab file is a tab-delimited file, meaning each tab between the text accounts for a new column. For the sake of this guide, all you should worry about is changing the username(s) in the file. By default, the file looks like this:

AdminAccounts	AdminLevel	AdminSkill	AdminComment	AdminComment2	AdminIpBlocks	AdminIpComment	AdminSuid	OldAdminSuid
s	i{0}	s	c	c	s	c	i{0}	i{0}
swg	50	admin		all account names must be lower case		main admin account	1	
swg2	50	admin				main admin account	2	
swg3	50	admin				main admin account	3	
swg4	50	admin				main admin account	4	
swg5	50	admin				main admin account	5	

DO NOT EDIT THE FIRST TWO ROWS

Where you see "swg" and "swg2", etc., replace those with the account username(s) you want to have god access and be sure to remove any additional rows so the pre-populated accounts don't have admin. Remember that usernames are case sensitive. You do not need to edit anything else.

So your new file should look something like:

AdminAccounts	AdminLevel	AdminSkill	AdminComment	AdminComment2	AdminIpBlocks	AdminIpComment	AdminSuid	OldAdminSuid
s	i{0}	s	c	c	s	c	i{0}	i{0}
aconite	50	admin		all account names must be lower case		main admin account	1	
irish	50	admin				main admin account	2	
seefo	50	admin				main admin account	3	

When you have finished making your edits, in your console, make sure you are in the swg-main directory, (If you don't know where you are, you can type cd then cd swg-main). And finally type the command ant compile_tab. You should see a message like this return:

[apply] SUCCESS creating data table: /home/swg/swg-main/data/sku.0/sys.server/compiled/game/datatables/admin/stella_admin.iff`

BUILD SUCCESSFUL

This means you have successfully compiled your modified tab into a datatable! Now all that is left is to change your configuration settings in localOptions.cfg.

  • First, comment out adminGodToAll and adminGodToAllLevel by adding a # in front of them, then uncomment the adminAccountDataTable line so it looks like this:
[GameServer]
adminAccountDataTable=datatables/admin/stella_admin.iff
#adminGodToAll=true
#adminGodToAllGodLevel=50

There are 2 other places you need to uncomment adminAccountDataTable under the [ConnectionServer] and [LoginServer] headers as well. Don't forget to do this part.

Finally, save your localOptions.cfg file, and restart (or start) your server, and you're all set.

To check that your changes have worked correctly, you can turn on god mode with /setGod once you have logged into a character on your account and type /setSpeed 10. If you can now move very quickly and you get a system message saying your speed has been modified, you have god mode. Then try creating another account and you should not be able to use those commands.