How Bypass Battleground Double Login IP? Source Edit

iraciz

New member
Messages
11
Points
0
I came here, and this site is my last hope! 

I want to create a variable, example: #trusted  in order  to  allow accounts with the #variable bypass the double login check filter for battlegrounds.  (intented for couples or brothers that share same connection) 

This is the Whole code of the bg Join structure, it is source coded, and there is no way possible via script, to ignore or bypass the ip check.  I don't want disable the check in battle.conf

int bg_queue_join(struct map_session_data *sd, int q_id)
{
char output[128];
struct queue_data *qd;
int i;

if (battle_config.bg_queue_onlytowns && !map_getmapflag(sd->bl.m, MF_TOWN))
{
clif_displaymessage(sd->fd, "You only can join BG queues from Towns or BG Waiting Room.");
return 0;
}

if (sd->bg_id)
{
clif_displaymessage(sd->fd, "You cannot join queues when already playing Battlegrounds.");
return 0;
}

if (sd->sc.data[SC_JAILED])
{
clif_displaymessage(sd->fd, "You cannot join queues when jailed.");
return 0;
}

if ((qd = sd->qd) != NULL)
{ // You cannot join a Queue if you are already on one.
i = bg_queue_member_search(qd, sd->bl.id);
sprintf(output, "You are already on %s queue at position %d.", qd->queue_name, i);
clif_displaymessage(sd->fd, output);
return 0;
}

if ((qd = bg_queue_search(q_id)) == NULL)
return 0; // Current Queue don't exists

if (qd->min_level && sd->status.base_level < qd->min_level)
{
sprintf(output, "You cannot join %s queue. Required min level is %d.", qd->queue_name, qd->min_level);
clif_displaymessage(sd->fd, output);
return 0;
}
if( bg_countlogin(sd,false) > 0 && battle_config.bg_double_login)
{
sprintf(output,"You cannot join %s queue. Double Login detected.", qd->queue_name);
clif_displaymessage(sd->fd,output);
return 0;
}
i = bg_queue_member_add(qd, sd);
sprintf(output, "You have joined %s queue at position %d.", qd->queue_name, i);
clif_displaymessage(sd->fd, output);

if (qd->join_event[0]) npc_event_do(qd->join_event);
return 1;
}




This is the part that give me the most headache

    if( bg_countlogin(sd,false) > 0 && battle_config.bg_double_login)
    {
        sprintf(output,"You cannot join %s queue. Double Login detected.", qd->queue_name);
        clif_displaymessage(sd->fd,output);
        return 0;
    }




This is the atcommand structure for @joinbg

   // Player Commands
    bindatcmd "joinbg","BG_Queue_Join::OnDoJoin",0,99;
    bindatcmd "leavebg","BG_Queue_Join::OnDoLeave",0,99;
    end;

OnDoJoin: // @joinbg
    if (getbattleflag("bg_eAmod_mode") == 0) {
        message strcharinfo(0),"Battlegrounds are currently disabled.";
        end;
    } else if (agitcheck() || agitcheck2()) {
        dispbottom "[Battleground is currently disabled for this moment due to War of Emperium.]";
        end;
    } else if (checkquest(8600,PLAYTIME) == 2) {
        erasequest 8600;
    } else if (checkquest(8600,PLAYTIME) == 0) {
        dispbottom "[You are a Deserter. You can't participate until the indicator goes off]";
        end;
    }

    bg_queue_join .BG_Queue;
    end;




Please I beg you!

What do I have to edit! In order to make acocunts with a #var ignore the ip check and join the bg?

 
Hi, I am a C++ programmer and I am still learning Hercules scripting so my answer will probably be wrong, but I would try something like this.

  if( bg_countlogin(sd,false) > 0 && battle_config.bg_double_login && #trusted == 0)   

 {         

sprintf(output,"You cannot join %s queue. Double Login detected.", qd->queue_name);       

 clif_displaymessage(sd->fd,output);         

return 0;   

 }

 
Back
Top