Jump to content
  • 0

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


Tales

Question


  • Group:  Members
  • Topic Count:  163
  • Topics Per Day:  0.04
  • Content Count:  319
  • Reputation:   8
  • Joined:  02/05/12
  • Last Seen:  

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
Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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
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:  

: 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)
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  78
  • Reputation:   0
  • Joined:  08/21/12
  • Last Seen:  

I tried this one but I'm using proxy they have all same last login ip how to fix this one even you have ip proxy ? 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

On 5/23/2023 at 2:14 AM, jimboy092032 said:

I tried this one but I'm using proxy they have all same last login ip how to fix this one even you have ip proxy ? 

use gepard Unique_id if you used gepard

try this method

https://rathena.org/board/topic/117327-utility-mapusers-count-functions-ipgepard/

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  78
  • Reputation:   0
  • Joined:  08/21/12
  • Last Seen:  

On 5/25/2023 at 9:44 PM, LearningRO said:

use gepard Unique_id if you used gepard

try this method

https://rathena.org/board/topic/117327-utility-mapusers-count-functions-ipgepard/

Sorry I'm not using gepard

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

On 5/27/2023 at 10:11 AM, jimboy092032 said:

Sorry I'm not using gepard

so use other function base on IP already include on that link

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  78
  • Reputation:   0
  • Joined:  08/21/12
  • Last Seen:  

On 5/28/2023 at 8:37 PM, LearningRO said:

so use other function base on IP already include on that link

But I'm using proxy how am I able to do that? my ip are all same using proxy

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...