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 Discussion / Retrieving IP Address? help

Author
Message
General Sephiro
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location:
Posted: 16th Apr 2006 17:25 Edited at: 16th Apr 2006 17:49
I'm touching up on my multiplayer game programming skills, wondering how i'd get the current IP Address of the computer the program is running on.

Any simple commands in DBC for it? Any Ideas?

EDIT}- No, i do not want to know my own IP, i'd like to automatically get the IP Address without having to type it in.

Random idea, set up a web page to grab the IP, then save that webpage as a file with his ip in it... read in file grab the IP..., it's a REALLY long round a bout way of doing it... but just an idea.

Dark Eternity
20
Years of Service
User Offline
Joined: 10th Jul 2004
Location: Vana Diel
Posted: 16th Apr 2006 17:54
i think that is why people moved to professional... MUCH easier to do multiplayer... I think you might need a DLL for that

I am DarkEternity (DE for short) OWNER OF ANIRE!!!
We are looking for a coder, modelers etc
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 16th Apr 2006 18:00
You could create a separate executable with another language, or a vbs file might work (might), and have that executable retrieve the data from something like the command-line or if there is a routine for obtaining the IP with vb perhaps that would work, and then have your main DB file execute the IP Exe and obtain the data through some sort of data return (perhaps having the IP Exe save the IP to a data file, and have DBC read the data file and then delete it).

Im pretty sure if you searched around on google for methods of obtaining an IP through another language like VB you'd find something fairly easy.

General Sephiro
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location:
Posted: 16th Apr 2006 18:04 Edited at: 16th Apr 2006 18:50
ok i'll try VB 6.0 have it installed somewhere on this computer

if it fails though i'll just go for the
http://www.hybridwolves.co.uk/EOD/test3.php my second attempt at php =P

Thanks folks for the help I shall not give up til i have this finished and working

{EDIT}
Ok, i got it working with VB 6.0, thanks to some dll files =D. Wohoo, back to work with DBC and its multiplayer commands. Thanks again folks

Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 16th Apr 2006 20:11
Getting your address from the internet isn't always what you want as you may be behind a router and thus it wouldn't be the address you want. There is a way to get a list of useable IP addresses using Winsock, and it can be done in DBP using dll calls.

Now, this code is from a file that I have on my computer. I didn't write it, but uh, credit goes to whoever did.

Functions:


This is how you use the functions to get your IP address:



I advise however that you do give the user an option to enter their own IP, as in some cases the user might have multiple IP addresses, and this method will not necessarily find the correct one.

Tempest - P2P UDP Multiplayer Plugin (DBP/DBCe) - 71%
Download the free version
General Sephiro
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location:
Posted: 16th Apr 2006 21:00 Edited at: 16th Apr 2006 21:07
i think i said this in the above post , but I got it working ^-^, created a IP retriever in Visual Basic 6.0. Have it all working now, even have an online lobby up for connecting games together. I'm amazed at the progress in this little test app i'm making.

Some Side info: Making a small online bomber man style game, except you work little fat headed dragons ^-^ Nearlly all the material done for the project just getting it online and working is the tricky part. *my first attempt at an online game* aside from chat programs... might need some more help later on with this... thanks for help peeps ^-^



Eray
20
Years of Service
User Offline
Joined: 26th Apr 2005
Location: United Kingdom
Posted: 16th Apr 2006 22:46
Hey,

I hate to be nosey and all but can you tell us a little more about this game of yours ? and maybe even show us some more pics of gameplay and maybe even a demo

im intreged you see

www.kinggamers.co.uk
General Sephiro
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location:
Posted: 16th Apr 2006 23:31 Edited at: 16th Apr 2006 23:38
well obviously i don't want to give too much away, so here is one last screen shot of the game.. for this month



It shall be an online bomber man game, i've got the lobby working, still need to create the gameplay. Soooo much to do, and i can only test the server etc..., once my m8 gets online.. which means once every 30 days heh. If any1 is interested in helping out feel free to add me to msn. Hmm chances r that's y i've already got almost all the media completed =P curse that friend... *waits once more*

Pumpkin dude inspired by zzz's game, pirate dude inspired by all this pirate talk a while ago, clown inspired by IT(the clown), and finally the swat guy was inspired by the game "S.W.A.T."

Before any of u ask, the reason it aint in WIP thread, as from now on i'm only putting projects 99% complete into it. That way there usually shall only be one days work left to do on the game.

Login to post a reply

Server time is: 2025-05-23 21:36:23
Your offset time is: 2025-05-23 21:36:23