Only let users modify their own characters

This commit is contained in:
2021-09-08 08:43:48 -04:00
parent ed46b534ea
commit 8de2264cdc

View File

@ -37,23 +37,16 @@ namespace NightmareCoreWeb2.Pages
{
OnGet();
if (!IsAuthenticated)
Character c = new Character(guid);
if (!IsAuthenticated || c.Username != this.UserAccount.Username)
{
return;
}
Character c = new Character(guid);
foreach (Character test in this.UserAccount.Characters)
if ((c.AtLogin & Character.AtLoginOptions.AT_LOGIN_FIRST) == 0)
{
if (test.guid == c.guid)
{
if ((c.AtLogin & Character.AtLoginOptions.AT_LOGIN_FIRST) == 0)
{
c.AtLogin |= (Character.AtLoginOptions)action;
}
c.SetAtLogin();
}
c.AtLogin |= (Character.AtLoginOptions)action;
}
c.SetAtLogin();
}
public void OnGet()