Seed initial group database with default and guest names from config

The `GroupManager` constructor ensures the structure of the `GroupList`
table, and if the table is newly-created, then some initial data is
seeded.

We previously used the names `default` to represent the group that
accounts are defaultly registered to, and `guest` to represent players
that have not logged in yet. We now instead refer to the group names
specified by the config (`DefaultRegistrationGroupName` and
`DefaultGuestGroupName` respectively)
This commit is contained in:
James Puleo 2022-12-14 21:41:37 -05:00
parent 6e589ffaee
commit 872b239b47
No known key found for this signature in database
GPG key ID: 3E16C7EFA34FB15D

View file

@ -57,7 +57,7 @@ namespace TShockAPI.DB
if (creator.EnsureTableStructure(table))
{
// Add default groups if they don't exist
AddDefaultGroup("guest", "",
AddDefaultGroup(TShock.Config.Settings.DefaultGuestGroupName, "",
string.Join(",",
Permissions.canbuild,
Permissions.canregister,
@ -68,7 +68,7 @@ namespace TShockAPI.DB
Permissions.synclocalarea,
Permissions.sendemoji));
AddDefaultGroup("default", "guest",
AddDefaultGroup(TShock.Config.Settings.DefaultRegistrationGroupName, TShock.Config.Settings.DefaultGuestGroupName,
string.Join(",",
Permissions.warp,
Permissions.canchangepassword,
@ -82,7 +82,7 @@ namespace TShockAPI.DB
Permissions.magicconch,
Permissions.demonconch));
AddDefaultGroup("vip", "default",
AddDefaultGroup("vip", TShock.Config.Settings.DefaultRegistrationGroupName,
string.Join(",",
Permissions.reservedslot,
Permissions.renamenpc,