In response to Tiberath (#19)
I used the binary "or" on purpose, because its faster. I use the continue, because it's a personal preference.
In response to Chowder (#20)
Chowder wrote:
I used the binary "or" on purpose, because its faster.

And also doesn't work in this circumstance, as with your script I was able to login to the same server on two separate keys at the same time from the same computer.
In response to Tiberath (#21)
No, thats not why it's failing, I typed == instead of !=

It's correct now.

Well maybe not, I thought of a faster method

client
New()
for(var/client/C)
if((C.computer_id==computer_id)&&(src.key!=C.key)) return
..()
In response to Chowder (#22)
Chowder wrote:
No, thats not why it's failing, I typed == instead of !=

It's correct now.

Fair enough, I'll pay that.
In response to Tiberath (#23)
I edited that post. I want to hear your thoughts on it.
In response to Chowder (#20)
Keep in mind that the logical AND and OR operators (&& ||) support short-circuiting, which means they can be faster than their bitwise counterparts when the second argument is intensive to calculate (which in this case it obviously isn't).
In response to DarkCampainger (#25)
I thought the binary OR was also short circuiting. My bad, that means the logical OR might be faster.
In response to Chowder (#26)
Chowder wrote:
I thought the binary OR was also short circuiting. Was I wrong?

Short circuiting means only considering (and thus computing) the latter arguments when necessary. Since logical AND requires that both arguments be true to return true, if the first argument is false, it can short circuit and return false--the value of the second argument is irrelevant and cannot change the outcome. For logical OR, if the first value is true, the return value is necessarily true and no further computation needs to be done.

A bitwise/binary operator needs to calculate the value of both arguments before it can operate on them, because it's comparing each individual bit.

Although in this case, the second argument is so simple to calculate, the binary operator may be faster. But really, neither will affect the performance of the game for a process like this.
Page: 1 2