[Tutorial] Premium Only Servers (All Sources) (Simple Code)

Junior Spellweaver
Joined
Jan 5, 2015
Messages
173
Reaction score
195
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);
    }
 
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
Burak DatLife - [Tutorial] Premium Only Servers (All Sources) (Simple Code) - RaGEZONE Forums
 

Attachments

  • 12334 - [Tutorial] Premium Only Servers (All Sources) (Simple Code) - RaGEZONE Forums
    12334.webp
    185.4 KB · Views: 664
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
Burak DatLife - [Tutorial] Premium Only Servers (All Sources) (Simple Code) - RaGEZONE Forums

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"
 
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;
            
    [COLOR=#ff0000]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;
    }[/COLOR]

WarZ_Server.sln

Code:
if([COLOR=#ff0000]([/COLOR]ginfo_.channel==4 && peer.temp_profile.ProfileData.PremiumAcc == 0[COLOR=#ff0000]) || (ginfo_.mapId == GBGameInfo::MAPID_ServerTest && peer.temp_profile.ProfileData.PremiumAcc == 0)[/COLOR])
{
    PKT_S2C_StartGameAns_s n;
    n.result = PKT_S2C_StartGameAns_s::RES_Failed;
    p2pSendRawToPeer(peerId, &n, sizeof(n));


    DisconnectPeer(peerId, true, "Premium required");
    return;
}
 
Last edited:
Back