fix: Adds server access with protected accounts (#915)
Adds a configuration file to specify protected accounts:
_Distribution/Configuration/server-access.json_
```json
{
"newPasswordOnReset": false,
"protectedAccounts": ["admin"]
}
```
Protected accounts are unbanned and reset to `AccessLevel.Owner` upon login.
The option `newPasswordOnReset` will create a new password for a protected account if it needs to be reset. The password is a random GUID and logged to the console.
_**Note:**_ If your player character was accidentally modified, simply make a new character to fix the old one.
This commit is contained in:
parent
51169ddbb0
commit
fc51b60cc1
4 changed files with 108 additions and 5 deletions
|
|
@ -241,13 +241,15 @@ namespace Server.Misc
|
|||
{
|
||||
res = DeleteResultType.CharBeingPlayed;
|
||||
}
|
||||
else if (RestrictDeletion && Core.Now < m.Created + DeleteDelay)
|
||||
else if (acct.AccessLevel == AccessLevel.Player && RestrictDeletion && Core.Now < m.Created + DeleteDelay)
|
||||
{
|
||||
res = DeleteResultType.CharTooYoung;
|
||||
}
|
||||
else if (m.AccessLevel == AccessLevel.Player &&
|
||||
// Don't need to check current location, if netstate is null, they're logged out
|
||||
else if (
|
||||
m.AccessLevel == AccessLevel.Player &&
|
||||
Region.Find(m.LogoutLocation, m.LogoutMap).IsPartOf<JailRegion>()
|
||||
) // Don't need to check current location, if netstate is null, they're logged out
|
||||
)
|
||||
{
|
||||
res = DeleteResultType.BadRequest;
|
||||
}
|
||||
|
|
@ -265,7 +267,6 @@ namespace Server.Misc
|
|||
|
||||
state.SendCharacterDeleteResult(res);
|
||||
state.SendCharacterListUpdate(acct);
|
||||
|
||||
}
|
||||
|
||||
public static bool CanCreate(IPAddress ip) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue