Jump to content
  • 0

Bypass for Battleground Double Login IP Source Edit


iraciz

Question


  • Group:  Members
  • Topic Count:  140
  • Topics Per Day:  0.03
  • Content Count:  562
  • Reputation:   108
  • Joined:  10/05/12
  • Last Seen:  

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?

Edited by iraciz
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Not everyone does have that Easycore battleground mod. So you have to dig in more by yourself. Some insights like below

You could add a state in pc.hpp 

bool cashshop_open;
bool sale_open;
+ bool brothers;
unsigned int block_action : 10;

and access them in an if condition like

if (sd->state.brothers) { // bypass the duplicate

Of course you need to set the brothers (true/false) somewhere based on some criteria. Up to you where and how

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  140
  • Topics Per Day:  0.03
  • Content Count:  562
  • Reputation:   108
  • Joined:  10/05/12
  • Last Seen:  

What about this? Do you think this would make the trick?

40500,Partners Potion,Partners Potion,2,3000,,10,,,,,0xFFFFFFFF,7,2,,,1,,,{ set #brothers,1; },{},{}

+ bool brothers;
if (sd->state.brothers) { // bypass the duplicate
    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);
    return 1;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...