Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / multiplayer server ip-adress

Author
Message
Not only Games
18
Years of Service
User Offline
Joined: 17th Jul 2007
Location:
Posted: 19th Feb 2012 13:23
Hi everyone,

i have a little problem with programming my server for an lan-game. For different tasks i want to run different programms parallel on one (server-)computer, each of which is connected to one central serverprogramm. To do that, i want them to connect automatic to the central programm without having to insert the ip-adress manually.

How can i get the ip-adress of the computer, a programm is actually running on? i can't find a command like "get ip adress" or something like that...
Or is there a way to do it much easier?


Thanks for your ideas and your help!
(DBPro version 1.071)
Millenium7
21
Years of Service
User Offline
Joined: 13th Dec 2004
Location:
Posted: 19th Feb 2012 16:45 Edited at: 19th Feb 2012 17:00
If you use matrix1util's you can



alternatively if you have the enhancement pack you can use get ip address$() otherwise you'll need to use a 3rd party program/plugin.
Buuuuuuut with matrix1, enhancement pack or most plugins you'll only get the interface IP address (i.e. 192.168.1.2) rather than external/internet IP address

to get the external IP you can the built in HTTP commands to return a string telling you your IP

IanM wrote this piece of code, i've converted it into a function for easier access

Not only Games
18
Years of Service
User Offline
Joined: 17th Jul 2007
Location:
Posted: 19th Feb 2012 17:04
Thanks for your reply! Which enhancement pack for "get ip adress$()"?
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 19th Feb 2012 17:52
127.0.0.1?
Hmm

Login to post a reply

Server time is: 2026-07-10 08:48:28
Your offset time is: 2026-07-10 08:48:28