|
-
May 21st, 2004, 02:55 PM
#1
Thread Starter
Fanatic Member
Get IP Address using DPlay 7 (Or in any other way)
Subject says it all.
How do I get my IP address when I use DirectPlay 7?
I am building a multiplayer game, when hosting, I'll need to give
my IP to my friend that wants to connect. He needs my IP to connect, right? right.
So how do I get my IP address?
Thank you,
Arie.
Last edited by Arie; May 21st, 2004 at 11:34 PM.
Tip Of The Day: Fake it 'till you make it ! 
-
May 23rd, 2004, 09:01 AM
#2
Member
Well, you COULD add a winsock controler, connet it to www.myip.com/ by posing as a web client. And then parse the text it sends back =) that's what I would have done, anyways.
This would of course just give you the ip that connected to the myip.com server, so if your behind a proxy it would most likly not work...
-
May 23rd, 2004, 10:05 PM
#3
Fanatic Member
Add a winsock control to a form and put the following code:
sub form_load()
msgbox Winsock.LocalIP
'Name the winsock control "Winsock", duh
end sub
Don't pay attention to this signature, it's contradictory.
-
May 24th, 2004, 09:19 AM
#4
Member
That would only work if he's the ONLY computer sharing an internet connection. Most of the time you need the ip of your dsl modem or router. I guess
-
May 25th, 2004, 10:45 AM
#5
Thread Starter
Fanatic Member
Is that the only way? 'Cause I'm using it now.
I don't like to add controls to my projects.
Arie.
Tip Of The Day: Fake it 'till you make it ! 
-
May 25th, 2004, 12:29 PM
#6
Member
Yeah, that's the only way at least that I'm aware of...
If youre affraid that people havn't got the winsock controler installed (I don't think win2000 has it as default) you can just put the dll or ocx or whatever it was in your game dir and ship it along with your game. Thats what I allways do =)
-
May 25th, 2004, 12:54 PM
#7
Ex-Super Mod'rater
This might help: http://www.gamedev.net/community/for...opic_id=152760
I'm yet to use DPlay and barely used much C++ but this guy seemed to have your problem and it was solved at the end .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
May 26th, 2004, 09:37 AM
#8
Thread Starter
Fanatic Member
It's no use. I don't understand what he does there.
I searched for this problem in Google.
Found some pages that says that I can use the Registry to see my IP address. But how??
Tip Of The Day: Fake it 'till you make it ! 
-
May 28th, 2004, 08:50 AM
#9
Thread Starter
Fanatic Member
Please help!! Answer my last question...
Tip Of The Day: Fake it 'till you make it ! 
-
May 28th, 2004, 08:57 AM
#10
Ex-Super Mod'rater
Did they say where in the registry? Or is that a silly question.
I've searched google but it seems to disagree that the registry has the IP address in it .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
May 28th, 2004, 10:12 AM
#11
Thread Starter
Fanatic Member
This code does not work:
VB Code:
Public Function GetIPAddress() As String
Dim keyServiceName As String
Dim keyInterfaces As String
Dim strServiceName As String
Dim strIPAddress As String
keyServiceName = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\12"
keyInterfaces = "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces"
Set Reg = New Registry
Reg.GetKeyValue HKEY_LOCAL_MACHINE, keyServiceName, "ServiceName", strServiceName
keyInterfaces = keyInterfaces & "\" & strServiceName
R = Reg.GetKeyValue(HKEY_LOCAL_MACHINE, keyInterfaces, "IPAddress", strIPAddress)
GetIPAddress = strIPAddress
End Function
Now what?
Arie.
Tip Of The Day: Fake it 'till you make it ! 
-
May 28th, 2004, 10:16 AM
#12
Ex-Super Mod'rater
I'm more surprised DPlay does actually tell you the IP. Did you check the Dx SDK?
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
May 28th, 2004, 11:51 AM
#13
Thread Starter
Fanatic Member
I really don't know how. Can you or someone else check it for me?
Tip Of The Day: Fake it 'till you make it ! 
-
Jun 11th, 2004, 01:06 PM
#14
Thread Starter
Fanatic Member
Did someone check the DX SDK for me??
I need the answer for it... please..
There's gotta be some way to do this. If not, say it here.
Arie.
Tip Of The Day: Fake it 'till you make it ! 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|