Jump to content
  • 0

Disallow Dual Login/IP/Account and allow Autotrade for this case


Question

Posted (edited)

Hi guys!
I use this code to prevent my events to run for "dual player's".
 

.@query_result = query_sql("SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id WHERE login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1", .@account_id);


if ( .@query_result > 1 && compare( $whiteList$,getcharid(3) +"" ) == 0 ) {
mes "[AVISO]";
mes "Você não poderá acessar as funções deste npc enquanto houverem mais de 1 conta conectada no mesmo IP. Foram encontrados "+ .@query_result +" registros.";
end;
}

Do you have know some way to check if the .@query_result gets a Autotrade user?

Some ways, my players are using dual account for Merchant and other for Player...can you help me?

Edited by Tales

8 answers to this question

Recommended Posts

Posted

try

query_sql( "SELECT `login`.`account_id` FROM `login` INNER JOIN `char` ON `char`.`account_id` = `login`.`account_id` WHERE `last_ip` = '"+escape_sql( getcharip() )+"' AND `char`.`online` = 1 AND `login`.`account_id` NOT IN ( SELECT `account_id` FROM `autotrade_merchants` )",.@count );
if ( .@count >= 2 ) {
	mes "You cant dual login from same IP.";
	sleep2 5000;
	atcommand "@kick "+strcharinfo(0);
}
end;

  • Upvote 1
  • 0
Posted

: DB error - Table 'ragnarok.autotrade_merchants' doesn't exist
[Debug]: at C:\Users\Mario Zicari\Desktop\rAthena\src\map\script.cpp:16996 - SELECT `login`.`account_id` FROM `login` INNER JOIN `char` ON `char`.`account_id` = `login`.`account_id` WHERE `last_ip` = '127.0.0.1' AND `char`.`online` = 1 AND `login`.`account_id` NOT IN ( SELECT `account_id` FROM `autotrade_merchants` )
[Debug]: Source (NPC): Only1perIP (invisible/not on a map)
  • 0
Posted

change 

query_sql( "SELECT `login`.`account_id` FROM `login` INNER JOIN `char` ON `char`.`account_id` = `login`.`account_id` WHERE `last_ip` = '"+escape_sql( getcharip() )+"' AND `char`.`online` = 1 AND `login`.`account_id` NOT IN ( SELECT `account_id` FROM `autotrade_merchants` )",.@count );

to

query_sql( "SELECT `login`.`account_id` FROM `login` INNER JOIN `char` ON `char`.`account_id` = `login`.`account_id` WHERE `last_ip` = '"+escape_sql( getcharip() )+"' AND `char`.`online` = 1 AND `login`.`account_id` NOT IN ( SELECT `account_id` FROM `vendings` )",.@count );

 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...