[Tutorial] Premium Only Servers (All Sources) (Simple Code)
You Can Use This Code On All Sources Its Simple And Useful :thumbup1:
Open WarZ.sln HUDDisplay.cpp
Search For :
Code:
int HUDDisplay::Update()
You Can See This Code :
Code:
const ClientGameLogic& CGL = gClientLogic();
Add Below :
Code:
if(CGL.m_gameInfo.mapId==GBGameInfo::MAPID_WZ_PremiumMap && gUserProfile.ProfileData.AccountType == 2 ) // Premium Server Burak DatLife
{
MessageBox(GetActiveWindow(), "You Are Not Allowed To Join This Server !", "Error", MB_OK);
ExitProcess(0);
}
1 Attachment(s)
Re: [Tutorial] Premium Only Servers (All Sources) (Simple Code)
nice tut, but it would be better to put this windows inside the game and click "Ok" to close it instead of closing the game
https://forum.ragezone.com/attachmen...d=152953&stc=1
Re: [Tutorial] Premium Only Servers (All Sources) (Simple Code)
Quote:
Originally Posted by
Bombillo
You Can Use This Code :P
Code:
if(CGL.m_gameInfo.mapId==GBGameInfo::MAPID_WZ_PremiumMap && gUserProfile.ProfileData.AccountType == 2 )
{
ShellExecute(NULL, "open", "http://www.thelastsoulmmo.com/buypremiumpage.php", "", NULL, SW_SHOW);
ExitProcess(0);
}
And Dont Miss This :P
Code:
#include "shellapi.h"
Re: [Tutorial] Premium Only Servers (All Sources) (Simple Code)
Well this is not very subtle and it is very easy to bypass with reverse engineer, more has another way simpler and better to make with check by server side :P
Try this basic example I did to new source code
Add code in red
WarZ.sln
Code:
// search in active games
const GBPKT_M2C_GameData_s* gdata = gMasterServerLogic.FindGameById(m_joinGameServerId);
if(gdata)
{
foundGameInMaster = true;
if(gdata->info.flags & GBGameInfo::SFLAGS_Passworded)
needPassword = true;
if(gdata->info.mapId == GBGameInfo::MAPID_ServerTest && gUserProfile.ProfileData.PremiumAcc == 0) // By Yuri-BR
{
Scaleform::GFx::Value var[3];
var[0].SetString("You are not allowed to join this server");
var[1].SetBoolean(true);
var[2].SetString("");
gfxMovie.Invoke("_root.api.showInfoMsg", var, 3);
return;
}
WarZ_Server.sln
Code:
if((ginfo_.channel==4 && peer.temp_profile.ProfileData.PremiumAcc == 0) || (ginfo_.mapId == GBGameInfo::MAPID_ServerTest && peer.temp_profile.ProfileData.PremiumAcc == 0))
{
PKT_S2C_StartGameAns_s n;
n.result = PKT_S2C_StartGameAns_s::RES_Failed;
p2pSendRawToPeer(peerId, &n, sizeof(n));
DisconnectPeer(peerId, true, "Premium required");
return;
}