Disable GM Private Shop

06/03/2020 12:46 Peww.#1
How to disable GMs from opening private shop?
06/03/2020 14:08 QuietSmoke#2
Quote:
Originally Posted by Peww. View Post
How to disable GMs from opening private shop?
If you're talking about vendors, then:

WndVendor.cpp, in function CWndVendor::OnChildNotify

Below:
Code:
			if(prj.IsInvalidName(strVendor)
#ifdef __RULE_0615
			   || prj.IsAllowedLetter(strVendor, TRUE) == FALSE
#endif
			   )
			{
				g_WndMng.OpenMessageBox(_T(prj.GetText(TID_DIAG_0020)));
				return TRUE;
			}
Add:
Code:
			if(!g_pPlayer->IsAuthorization(AUTH_GENERAL))
			{
				g_WndMng.OpenMessageBox("The administrator is forbidden to open a private shop.");
				return TRUE;
			}
06/03/2020 15:11 ZeroTwo02#3
lol no. Don't make a CLIENT side verification for that...

In the function "CDPSrvr::OnPVendorOpen"

after

Code:
	CUser* pUser	= g_UserMng.GetUser( dpidCache, dpidUser );
	if( IsValidObj( pUser ) )
	{
add

Code:
if ( pUser->m_dwAuthorization > AUTH_HELPER )
	return;
06/03/2020 15:19 Drabur#4
Quote:
Originally Posted by QuietSmoke View Post
If you're talking about vendors, then:

WndVendor.cpp, in function CWndVendor::OnChildNotify

Below:
Code:
			if(prj.IsInvalidName(strVendor)
#ifdef __RULE_0615
			   || prj.IsAllowedLetter(strVendor, TRUE) == FALSE
#endif
			   )
			{
				g_WndMng.OpenMessageBox(_T(prj.GetText(TID_DIAG_0020)));
				return TRUE;
			}
Add:
Code:
			if(!g_pPlayer->IsAuthorization(AUTH_GENERAL))
			{
				g_WndMng.OpenMessageBox("The administrator is forbidden to open a private shop.");
				return TRUE;
			}
wow you talk about quality of code in another thread and then something?
06/03/2020 15:22 QuietSmoke#5
Quote:
Originally Posted by Drabur View Post
wow you talk about quality of code in another thread and then something?
What do u mean?

If you mean checking on the client side, this will not give any advantages to ordinary players, and if you fix the change of rights through CE, then there will be no problems
06/03/2020 15:24 Drabur#6
Quote:
Originally Posted by QuietSmoke View Post
What do u mean?

If you mean checking on the client side, this will not give any advantages to ordinary players, and if you correct the change of rights through CE, then there will be no problems
ordinary players? this is a prevention for pushing gms
it is very possible that they will try bypass it
06/03/2020 15:26 QuietSmoke#7
Quote:
Originally Posted by Drabur View Post
ordinary players? this is a prevention for pushing gms
it is very possible that they will try bypass it
If you could put 1 cycle to check the player’s credentials, then this is impossible to get around;)
06/03/2020 22:08 cookie69#8
@[Only registered and activated users can see links. Click Here To Register...] they are right, never trust the client xd
Always do the check in client side and in server side otherwise it is easy to bypass that client side check.
06/03/2020 22:12 QuietSmoke#9
Quote:
Originally Posted by cookie69 View Post
@[Only registered and activated users can see links. Click Here To Register...] they are right, never trust the client xd
Always do the check in client side and in server side otherwise it is easy to bypass that client side check.
I know that they are right and do not deny it
I understand that I was mistaken
But in any case, for example, it will work for me in the client, because the protection is good:D
06/03/2020 22:14 Avalion#10
Quote:
Originally Posted by QuietSmoke View Post
If you could put 1 cycle to check the player’s credentials, then this is impossible to get around;)
Eh, still can be bypassed? :thinking:
06/03/2020 22:16 QuietSmoke#11
Quote:
Originally Posted by Avalion View Post
Eh, still can be bypassed? :thinking:
The cycle is yes.
But not full protection for prohibiting changes to the Auth variable:p
06/03/2020 22:51 cookie69#12
Quote:
Originally Posted by QuietSmoke View Post
The cycle is yes.
But not full protection for prohibiting changes to the Auth variable:p
No, never trust the client! Don't even try to find arguments.
06/03/2020 22:54 QuietSmoke#13
Quote:
Originally Posted by cookie69 View Post
No, never trust the client! Don't even try to find arguments.
I know about that, but thanks for the reminder:D