Page 1 of 1

Multiaccount from same ip

Posted: Mon Mar 06, 2006 12:21 pm
by `craig
On my server I would like to have multi account allowed, but I do not want someone making 10 accounts to mine with. I would like to add a check against someones IP address so that if they have been mining with another account in the last 5 minutes they cannot mine on that account. If this is effective then I would add it in for all crafting skills and reasource gathering skills ie Blacksmithy Tinker LJ, Has anyone an idea for the best approch at this problem?

Posted: Mon Mar 06, 2006 5:18 pm
by goldfish
Interesting way to not set an account limit actually :)

Few different way to go about it. Personally I would create a global property to store IP's that a performing a resource skill.

ie, at the start of the particular script something like this from an included file.

Code: Select all

function checkresourceskill( who )

var i := 1, gresource := GetGlobalProperty("ResourceSkill");
var backup := gresource;

if ( !gresource )
   gresource := {};
else
   foreach ip in gresource
      if ( ip[1] == who.ip )
         if ( ip[2] < ReadGameClock() )
            SendSysMessage(who, "Another account is currently using a resource skill.");
            return 0;
         else
            backup.erase(i);
         endif
      endif
   i := i + 1;
   endforeach
endif

backup.append( {who.ip, ReadGameClock()+360} );

SetGlobal("ResourceSkill", backup);

return 1;

endfunction
I don't script anymore, but its just 1 way of going about it.

I do like this idea though, but I'd probably let 2 characters from an ip do the same thing before disallowing it.

Hope this gives you an idea.

Edit: Forgot to add that you'd want to have a script running that clears every 15 mins or so any IP's from the global prop that are over 5 mins old.

Also it depends on how your resource scripts work. It wouldn't be any good if you can mine, lumber, fish for over 5 mins before starting again.

Posted: Tue Mar 07, 2006 8:58 am
by `craig
Thanks, thats definately a great start, we have a great scriptor here that will definately find that useful.

Posted: Sat Mar 25, 2006 7:45 am
by th3_l00ny
where is this file ?