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

Results 1 to 4 of 4
  1. #1
    Proficient Member Burak DatLife is offline
    MemberRank
    Jan 2015 Join Date
    inetpub/wwwrootLocation
    173Posts

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

    You Can Use This Code On All Sources Its Simple And Useful

    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);
        }


  2. #2
    ☆Dying Dawn☆ Bombillo is offline
    MemberRank
    Jan 2012 Join Date
    ValhallaLocation
    977Posts

    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
    12334.jpg
    Attached Thumbnails Attached Thumbnails 12334.jpg  

  3. #3
    Proficient Member Burak DatLife is offline
    MemberRank
    Jan 2015 Join Date
    inetpub/wwwrootLocation
    173Posts

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

    Quote Originally Posted by Bombillo View Post
    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
    12334.jpg
    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"

  4. #4
    Yuri-BR#1559 Yuri-BR is offline
    DeveloperRank
    Apr 2013 Join Date
    ☣️❤️Location
    1,040Posts

    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;
    }
    Last edited by Yuri-BR; 08-08-15 at 01:13 AM.



Advertisement