From 8de2264cdcd42eed33b4e14d8017d77348145b49 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Wed, 8 Sep 2021 08:43:48 -0400 Subject: [PATCH] Only let users modify their own characters --- Pages/Account.cshtml.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Pages/Account.cshtml.cs b/Pages/Account.cshtml.cs index 14cb121..80ce73e 100644 --- a/Pages/Account.cshtml.cs +++ b/Pages/Account.cshtml.cs @@ -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()