Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send identification to admins, when they are logged in #76

Open
trafilaw opened this issue Apr 23, 2020 · 1 comment
Open

Send identification to admins, when they are logged in #76

trafilaw opened this issue Apr 23, 2020 · 1 comment
Labels
good first issue Good for newcomers

Comments

@trafilaw
Copy link

No description provided.

@jxsl13 jxsl13 added the good first issue Good for newcomers label May 13, 2020
@jxsl13
Copy link
Owner

jxsl13 commented May 13, 2020

there is currently a special player flag that indicates a player being an admin.
I flag is a bit at a specific position of an integer, that indicated something being turned on(1) or turned off(0).

and int usually has 32 bits allowing for up to 32 true/false values being encoded into it.

setting a bit: int BitMask = (1<<0) || (1 << 2) || (1<<4);
setting a bit without changing the other values: BitMask |= (1<<1);
deleting/clearing a bit without changing the other bits BitMask &= ~(1<<1);

zCatch explicitly does not send this flag in order to allow admins to operate covertly(undercover).

trafilaw had the idea to allow for admins to see each other, which is a good addition to the current behavior.

The code that must be modified can be found here:

void CPlayer::Snap(int SnappingClient)

the passed parameter SnapingClient is the client that receives the current player's information, especially it is an admin.

The current player's ID is a member variable/class variable of the current Player object and can be accessed via m_ClientID.

Additionally the global Configuration that is retrieved via a server config file (autoexec.cfg) defines a configuration parameter that allows to toggle whether to hide or not to hide admins:

g_Config.m_SvHideAdmins

In order to test the behavior, you can use the sv_hide_admins 1 parameter in your server configuration file.

Due to rather hard to understand logic, this code should be reworked to hide admins from players that are not admins if g_Config.m_SvHideAdmins == 1.
And at the same time allow for admins (Server()->IsAuthed(m_ClientID) && Server()->IsAuthed(SnappingClient)) to receive the information that the current player is an admin/mod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants