Author Topic: Multiple IPs for user in Lua API.  (Read 2639 times)

0 Members and 1 Guest are viewing this topic.

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 478
  • Karma: +209/-22
  • PtokaX developer
Multiple IPs for user in Lua API.
« on: 14 October, 2011, 00:19:43 »
 8)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

PtokaX forum

Multiple IPs for user in Lua API.
« on: 14 October, 2011, 00:19:43 »

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: Multiple IPs for user in Lua API.
« Reply #1 on: 22 October, 2011, 19:27:17 »
How about User.sIP6?
Everything could have been anything else and it would have just as much meaning.

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 478
  • Karma: +209/-22
  • PtokaX developer
Re: Multiple IPs for user in Lua API.
« Reply #2 on: 22 October, 2011, 19:52:08 »
That can cause compatibility problems to scripts expecting that tUser.sIP is not empty.. and with tUser.sIP6 it can be empty for IPv6 only users or when IPv4 check for IPv6 user fail  ::)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: Multiple IPs for user in Lua API.
« Reply #3 on: 22 October, 2011, 20:24:01 »
But if sIP becomes a table (it is a string now IIRC), then it also causes incompatibility problems.  Maybe sIP should fall back to v6 when v4 is b0rked.
Everything could have been anything else and it would have just as much meaning.

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 478
  • Karma: +209/-22
  • PtokaX developer
Re: Multiple IPs for user in Lua API.
« Reply #4 on: 22 October, 2011, 20:41:08 »
But then it will be confusing for scripters :( From my point of view when there will be tUser.sIP6 then i will expect that here will be IPv6 addres and in tUser.sIP will be IPv4 address not that it will change in some cases.
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 478
  • Karma: +209/-22
  • PtokaX developer
Re: Multiple IPs for user in Lua API.
« Reply #5 on: 02 May, 2012, 00:39:53 »
User.tIPs was added to build 386 :P
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

PtokaX forum

Re: Multiple IPs for user in Lua API.
« Reply #5 on: 02 May, 2012, 00:39:53 »