Small Fix __NO_TRADE

05/31/2015 13:19 raventh1984#1
Hi elitepvpers,

in some sources we have the __NO_TRADE this will stop the Staff members for trading and or receiving sending mail.

However an staff member cant read normal mail cause it is preventing by the __NO_TRADE system.

What i have done is made it so that Staff members can recieve and sending normal mail.

Staff members cant send items and or gold and also normal players cant send items and or gold to staff members. Except Admins.

this code will only go inside the function
void CDPSrvr::OnQueryPostMail( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )

Under
Code:
if( pItemElem->IsCharged() )
				{
					pUser->AddDiagText( prj.GetText( TID_GAME_CANNOT_POST ) );
					return;
				}
You place this
Code:
#ifdef __NO_TRADE
				if(g_eLocal.GetState(EVE_NO_TRADE))
				{
					if( idReceiver != AUTH_ADMINISTRATOR && idReceiver != AUTH_GENERAL )
					{
						pUser->AddText("You cannot send items to Staff Members.");
						return;
					}
					if(!pUser->IsAuthorization(AUTH_GENERAL) && !pUser->IsAuthorization(AUTH_ADMINISTRATOR) && !pUser->IsAuthorization(AUTH_OPERATOR))
					{		
						pUser->AddText("As an Staff member you cant send items to players.");
						return;
					}
				}
#endif
Under
Code:
{
				pUser->AddDiagText( prj.GetText( TID_GAME_LACKMONEY ) );
				return;
			}
You place this
Code:
#ifdef __NO_TRADE
				if(g_eLocal.GetState(EVE_NO_TRADE))
				{
					if( idReceiver != AUTH_ADMINISTRATOR && idReceiver != AUTH_GENERAL && nGold > 0 )
					{
						pUser->AddText("You cant send Gold to an Staff member.");
						return;
					}
					if(!pUser->IsAuthorization(AUTH_GENERAL) && !pUser->IsAuthorization(AUTH_ADMINISTRATOR) && !pUser->IsAuthorization(AUTH_OPERATOR) && nGold > 0)
					{		
						pUser->AddText("As an staff member you cant send gold to players.");
						return;
					}
					else
					{
						pUser->AddGold( (int)( (int)( nPostGold + nGold ) * (-1) ), TRUE );	// »ç¿ë·á Áö±Þ
					}
				}
#endif
Inside the source of Gentros

Remove these codes
Code:
#ifdef __NO_TRADE
		if(g_eLocal.GetState(EVE_NO_TRADE))
		{
			if(!pUser->IsAuthorization(AUTH_GENERAL) && !pUser->IsAuthorization(AUTH_ADMINISTRATOR) && !pUser->IsAuthorization(AUTH_OPERATOR))
			{		
				pUser->AddText("Unauthorized Action.");
				return;
			}
		}
#endif
From these functions
void CDPSrvr::OnQueryRemoveMail( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )

And
void CDPSrvr::OnQueryGetMailItem( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )

And
void CDPSrvr::OnQueryGetMailGold( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )

And
void CDPSrvr::OnQueryReadMail( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )

And
void CDPSrvr::OnQueryMailBox( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )

If you have done this rebuild the worldserver

@Credits goes to their respective creators

With kind regards,
05/31/2015 14:51 pakinglalat#2
Hi, I received this error when I compiled, where to declare the EVE_NO_TRADE and the others too?
05/31/2015 14:55 raventh1984#3
Sorry about that. Forgot something haha

inside FlyffEvent.h

Under EVE_RAINBOWRACE,

#ifdef __NO_TRADE
EVE_NO_TRADE,
#endif

Inside WorldServer.exe

Under
Code:
else if( s.Token == "RAINBOWRACE" )
		{
			g_eLocal.SetState( EVE_RAINBOWRACE, 1 );
		}
Code:
#ifdef __NO_TRADE
        else if ( s.Token == "NO_TRADE")
        {
            g_eLocal.SetState( EVE_NO_TRADE, 1 );
        }
#endif
Inside WorldServer.ini put NO_TRADE

Define __NO_TRADE in versionCommon.h WorldServer
05/31/2015 15:09 pakinglalat#4
Hi again, uhm how about this? [Only registered and activated users can see links. Click Here To Register...]
05/31/2015 15:11 raventh1984#5
Check your Authorization.h file
05/31/2015 15:17 pakinglalat#6
So looks like I don't have the OPERATOR, should I just change the one in your code to something else like the GAMEMASTER/2/3/4 or other high auth?

[Only registered and activated users can see links. Click Here To Register...]
05/31/2015 15:24 raventh1984#7
You can remove it or change it to something else

Keep in mind that if you do not want your staff with AUTH setting lower then Z can mail items etc then remove the AUTH_OPERATOR from the code.
05/31/2015 15:30 pakinglalat#8
Okay I get it already, thank you Raventh!