ID:265549
 
Ah yes. That address variable attached to the client. Wonderfull little thing that if I wing it right, should allow me to make a setup that will automatically detect and boot folks logging on multiple keys.

Two things to ask of you good folks here.

One, any better ideas on how to do this aside from comparing IP addresses of each new login to present connections in the world?

Two, any reason why I should go ahead and allow multikeyers to do their thing on the MUD anyhow?

If anyone would care to help me test this out, go ahead and join the Guilds of Merrior chat on multiple keys. I'm still tweaking the system and would love to see it in action.
Use IP, it is the best way. Here is some phocode:

login()
for(var/mob/M in world)
if(src.IP==M.IP)
Boot(src)


Simple as that, granted, IP is not a real variable, or at least is not a mob variable, but there is a client variable of that sort.
In response to Scoobert
The client variable for IP address is simply address. I'm comparing "src.client.address" to a list of all clients in the world ("var/client/connections.address") in a for loop right now.

Of course I also have a condition that if "src.client == connections" then the booting does NOT happen. Wouldn't want to ban someone from having the same connection as themselves afterall.

Maybe I have to use key names instead though... would two clients be equal even under two different keys, if they were started from the same computer?
In response to Lord Solemn
Lord Solemn wrote:
Maybe I have to use key names instead though... would two clients be equal even under two different keys, if they were started from the same computer?

Yep. They're two different objects.
In response to Lord Solemn
The way I read that, it seems you think boot == ban.
In response to Smoko
Nope, not ban. Boot. If someone logs on with two different keys, I just want to boot both connections - I use client.Del() - and then they can reconnect with whichever ONE they want.

Ban I think would be used mainly by moderators as a command on people who keep on trying, over and over, to log on more than one key.
In response to Lord Solemn
Exactly. The code Scoobert posted kicked the new connection, you could give them a message telling them to close their other connection before they start a new one. Not once has banning been called on any code examples in this thread. :P
In response to Smoko
Actualy, my code would boot everyone who trys to join I believe, you would need to add:

if(src!=M)

To make sure that it doesn't campair the same mob. Oh well, easy fix, it was late when I posted that.
In response to Scoobert
I thought:
    if(src.IP==M.IP)
Boot(src)


would of booted src if they had the same IP as M. Oh well, you know more than me. So, I'll shut up before I make my self look more stupid.
In response to Smoko
Smoko wrote:
would of booted src if they had the same IP as M.

It would, and that is part of what they are talking about. You always have the same address as yourself (indeed, it is your address after all), so you have to make sure the thing you are about to boot isn't itself.

If you are booting src because it has the same address as M when src actually is M itself, then that would kick everyone; and that is what they are talking about.
In response to Loduwijk
I see. Thanks for explaining that Loduwijk. <3
Lord Solemn wrote:
Two, any reason why I should go ahead and allow multikeyers to do their thing on the MUD anyhow?

Could multikeyers pose a problem? If not, let people connect as they want. There are "legit" uses for multikeying too, such as two or more people behind a NAT router wanting to play at once.
In response to Jon88
Tough luck for people on a network, who just happen to want to play the same game together, eh?