Admin Gump - Owner Account.

Ce Jayce

Well-Known Member
Jan 24, 2014
140
14
23
Shard Name
Exordus. The Shire
Donate
Donate money to this user
So I've been trying to make a modified version of the AdminGump - got several versions floating about but at the moment I've rolled back to the base one to try and get this issue solved!
Currently I'm trying to make it so that the Owner account (Or any above your access level is hidden) from the Admin gump.
So I don't want Admins to be able to view my account name, characters, linked accounts, IP's and most importantly if i'm logged in or not!
I hate it when my Admins open up [Admin go to my account then teleport to me using to go to feature. I wan't to be able to log in and get a few things sorted on the sly every now and again without them asking me 100 and 1 questions the second I log in and I would like to be able to set up some players and just PLAY on my server without fear of my admins sending me pms on my player asking me this/that any bias in duels etc. etc.

The list of reasons goes on but, i'm truly stuck on this one so if anyone could help me out it would be greatly appreciated!

Thanks!
 

Ravenwolfe

Moderator
ServUO Developer
Sep 7, 2013
1,162
140
Texas
www.ultimaonlinephoenix.com
Shard Name
UO Phoenix
The problem is going to be one of rights. For example, its hard to have an Admin not able to see your player level account or your ip. Hiding your owner account from them will be easy.

I'm thinking the easiest solution would be to place a tag on the accounts that you want hidden and then add a check for the tags into the admin gump script. Two dangers I can think of, make sure that you code the tag check to only effect people below owner or you could hide accounts from yourself. Secondly, you want to be sure that no one else knows the name of the tag and could remove it or place it on one of their accounts.
 

Ce Jayce

Well-Known Member
Jan 24, 2014
140
14
23
Shard Name
Exordus. The Shire
Donate
Donate money to this user
Thanks for the quick response!
I don't mind admins seeing my player account just so long as they can't link it with my owner account in anyway what so ever, so if they go IP -> Shared accounts etc.
I guess I could do it with an account tag but I don't think that route is necessary for just hiding the owner account?

**EDIT**
Scratch that, I think i've found the appropriate sections to do the edits in now. I'll post back here if it's a success or epic failure :p
 
Last edited:

Ce Jayce

Well-Known Member
Jan 24, 2014
140
14
23
Shard Name
Exordus. The Shire
Donate
Donate money to this user
Ok got it finally, - Props to _Epila_ on RunUO for drawing my attention to the right areas!
For anyone else wanting to do the same look for
case AdminGumpPage.Clients:
case AdminGumpPage.Accounts_Shared:
case AdminGumpPage.Accounts:
Then in those sections at the top look for
Code:
                            if (this.m_List == null)
                            {
                                this.m_List = new ArrayList(NetState.Instances);
                                this.m_List.Sort(NetStateComparer.Instance);
                            }
Then edit that to be;
Code:
if (this.m_List == null)
{
    this.m_List = new ArrayList();
    foreach(NetState ns in NetState.Instances)
    {
        if (ns.Account.AccessLevel <= from.AccessLevel)
            m_List.Add(ns); //foreach does not allow you to modify the list during the loop, so we check every entry before adding it
                            //if you want more examples on how to remove invalid entries, check here: http://stackoverflow.com/questions/8791557/efficiently-deleting-item-from-within-foreach
    }
    this.m_List.Sort(NetStateComparer.Instance);
}
There are a few other areas you need to edit to make it completely proof, such as the bit where you can search for an IP and the bit where you can list all accounts but just hitting search.

I've attached my AdminGump.cs with all the necessary edits to achieve this for anyone wanting to do the same.
 

Attachments

Ce Jayce

Well-Known Member
Jan 24, 2014
140
14
23
Shard Name
Exordus. The Shire
Donate
Donate money to this user
Sorry to drag up a slightly old thread now but i'm a little baffled again. I pushed this to my live server and it just didn't work full stop. However using a fresh server with a new set of saves it does fine?

I've checked again and again to make sure that I have actually put the file into my server so it's not that. Any thoughts on what it could be? I've tried to test it with previous 'admin' level accounts and a new one that I created but I was still able to pull up the details of accounts with levels above me.

Any ideas?

Cheers
 

Ce Jayce

Well-Known Member
Jan 24, 2014
140
14
23
Shard Name
Exordus. The Shire
Donate
Donate money to this user
So after trying to figure this one out for a good hour, I find the answer right after posting up here!
If anyone else should run into the same issue. My account didn't have 'Owner' Access level in Accounts.xml just my character so obviously it was still showing up the account info as it was a 'player' account.