ID:164256
 
How would I code it so that when two specific keys login from the same IP, they won't show up on the multikey login. Example : X and Y are from the same IP address and both login, the multikey doesn't show them from the same IP address.
How would I code that?
Basically.. I have this, a working multikey login code.
mob/characters/Login()
if(src.currentipaddress)
for(var/mob/characters/X in world)
if(X.key!=src.key)
if(X.client && src.client)
if(X.currentipaddress==src.currentipaddress)
world<<"<b>Multikey Info: [X]([X.key]) and [src]([src.key]) share the same IP address.</b>"
Make yourself an exceptions list with the keys to be ignored, and make sure it's not in the list before checking for multi-keys.

var/list/exceptions=list("Zaltron","Sonder")

client/New()
if(!(key in exceptions))
// Not an exception to the multi-keying rule, check for other keys.
.=..()
In response to YMIHere
So.. Where would I put that? And is there anything else that needs to be added?
In response to KalibreX
var/list/exceptions=list("Zaltron","Sonder")

mob/characters/Login()
if(src.currentipaddress)
if(!(key in exceptions))
for(var/mob/characters/X in world)
if(X.key!=src.key)
if(X.client && src.client)
if(X.currentipaddress==src.currentipaddress)
world<<"<b>Multikey Info: [X]([X.key]) and [src]([src.key]) share the same IP address.</b>"


or to make it take up less lines in your code you can add it in like this:

var/list/exceptions=list("Zaltron","Sonder")

mob/characters/Login()
if(src.currentipaddress && !(key in exceptions))for(var/mob/characters/X in world)
if(X.key!=src.key && X.client && src.client && X.currentipaddress==src.currentipaddress)
world<<"<b>Multikey Info: [X]([X.key]) and [src]([src.key]) share the same IP address.</b>"