This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
NanoBob's profile picture

Identifying a server

Started by NanoBob, 08 November 2017 - 03:28 PM
NanoBob #1
Posted 08 November 2017 - 04:28 PM
Is it possible to get some sort of unique identifier for a server a program is running on? (Like an IP & port combination)

I guess I could use a php page which returns an IP, but multiple servers on the same IP would still be an issue in that case.
Edited on 08 November 2017 - 03:30 PM
KingofGamesYami #2
Posted 08 November 2017 - 04:45 PM
Not from within computercraft.
Luca_S #3
Posted 08 November 2017 - 07:30 PM
As KingofGames said it's not possible, you can only get the IP address.
But if you want to do that you don't need to write your own script there are already sites like this
NanoBob #4
Posted 08 November 2017 - 11:18 PM
As KingofGames said it's not possible, you can only get the IP address.
But if you want to do that you don't need to write your own script there are already sites like this
Yeah I am aware, but I'd prefer hosting it myself given the ide aI have in mind, but it would require being able to uniquely identify a server, this way virtual hosts hosting multiple servers on one IP would be an issue.
Lupus590 #5
Posted 09 November 2017 - 11:15 AM
Could you use something about the world on the server to disambiguate shared IPs??
NanoBob #6
Posted 09 November 2017 - 08:05 PM
Could you use something about the world on the server to disambiguate shared IPs??
If there was a way to identify a world with CC, yes. But I don't think there is.
Lupus590 #7
Posted 09 November 2017 - 09:33 PM
Could you use something about the world on the server to disambiguate shared IPs??
If there was a way to identify a world with CC, yes. But I don't think there is.
I was thinking of using the GPS position, it's unlikely that two computers would have the same location in two different worlds, the program will need players to know which world this is to tell the computer that.