|
-
Nov 7th, 2001, 12:01 PM
#1
Thread Starter
Junior Member
DirectPlay and those annoying pop-up windows
I need to know how to get DirectPlay 7 to search for a session over a TCP/IP connection without getting that pop-up box where the user can just press enter. I am writing full-screen appplications and that pop-up box is unacceptable. I have tried creating a DPAddress using the CreateINetAddress method with an empty address and a universal broadcast (255.255.255.255) address. but they don't work. Any ideas?
-
Nov 8th, 2001, 04:05 AM
#2
Fanatic Member
I searched for that thing for a long time too, and I did find it eventually, allowing my fullscreen game to display a list of sessions manually...
I'm at work right now, but when I get home I'll search for it...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Dec 29th, 2001, 10:38 AM
#3
Lively Member
Please man, i need that too! Please post, if you find it!
-
Dec 29th, 2001, 01:11 PM
#4
Fanatic Member
*is happy*
yay! I just found it again! The biggest game I ever made, fullscreen DirectX with DirectPlay and textboxes and listboxes completely in DirectDraw and compressed bitmaps and a lot of more cool stuff which I've been creating in a period of two months, but I never got beyond the menu (selecting/creating sessions and chatting to other session members, completely with line-breaking and scrolling) 
*is still happy*
*thinks*.... nah, I will not give away the complete source, but let's see if I can find the DirectPlay part....
I guess I never found out how to enumerate the connections without the dialog, although I did however find what I needed: TCP/IP only connections without the dialog...
VB Code:
Public Sub InitDPTCPConnection(IP As String)
On Local Error GoTo Error:
If ErrSource <> "" Then Exit Sub
' Initialize DirectPlay TCP/IP connection
Set mDPAddress = mDPLobby.CreateINetAddress(IP, 0)
mDP.InitializeConnection mDPAddress
Exit Sub
Error:
ErrSource = "DX::InitDPTCPConnection"
ErrDesc = Err.Description
ErrNum = Err.Number
End Sub
Hope that helps a bit, if you need more code just let me know...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Dec 29th, 2001, 01:18 PM
#5
Fanatic Member
Ah, I see you already got that far 
Anyways, after some research I found it: the function is called with an empty string to host a session, and is either called with the IP to connect to or an empty string when DirectPlay should search when joining a session...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Dec 30th, 2001, 03:09 PM
#6
Lively Member
Um, äh.... It doesn´t want to take the IP. It want a DirectPlay8Adress Object... Thats bad...
What can I do?
-
Dec 30th, 2001, 03:13 PM
#7
Fanatic Member
How about the two lines directly under the comment line in the source I posted above? That converts an IP to a DirectPlayAddress (my sample uses DirectX 7, but I think it should work on DX8 too)
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Dec 30th, 2001, 03:26 PM
#8
Lively Member
Well, it isn´t really CreateConnection...
Look:
VB Code:
If Not (moDPP Is Nothing) Then
mlEnumAsync = moDPP.EnumHosts(Desc, Nothing, moDPA, INFINITE, 0, INFINITE, DPNENUMHOSTS_OKTOQUERYFORADDRESSING, ByVal 0&, 0)
ElseIf Not (moDPC Is Nothing) Then
mlEnumAsync = moDPC.EnumHosts(Desc, Nothing, moDPA, INFINITE, 0, INFINITE, DPNENUMHOSTS_OKTOQUERYFORADDRESSING, ByVal 0&, 0)
End If
DPNENUMHOSTS_OKTOQUERYFORADDRESSING creates the Box.
The NOTHING (after Desc) is the DirectPlay8AdressObject....
I need to Assign an IP to my DirectPlay8AdressObject
But how?
-
Dec 30th, 2001, 03:29 PM
#9
Lively Member
Besides, it has no CreateINetAddress() Function. Only a Build from URL, that takes no IP as Parameter, but a directplay string...
-
Dec 30th, 2001, 03:31 PM
#10
Fanatic Member
In that case: I don't have a clue.
I've never used DX8 (hated it actually), I haven't used DirectPlay that much (twice, only once without the dialog box) and it's been a year since I even started Visual Basic... 
Try http://www.vbexplorer.com/directx4vb/
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Dec 30th, 2001, 04:33 PM
#11
Lively Member
GREAT!
Well, no problem. I WILL find out.
My Game works, it worked without DirectPlay, now with it and that ugly DialogBox will get grilled.
BTW: If you make a game, NEVER start with the menu! Or the Graphics! (I did more than 10 times!)
This time I started the game on paper. How it should work and everything.
Now I have an engine, that actually is a game. It has no Graphics, but you can play it.And the Engine gives the correct Infos for DirectDraw / D3D.
I only need to make my Graphics Engine Ready (About 1/2 of it already works) and my game is completed. (Well, THEN i need to make the menus, they are only ugly msgboxes and text-fields at the moment)
Bye and thanks,
ALex
-
Dec 30th, 2001, 04:43 PM
#12
Fanatic Member
Well, basically, I already had a game. This was version 2. Version 1 had a settings dialog which was just a normal window, and the game would be fullscreen DirectX
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Dec 30th, 2001, 08:40 PM
#13
Thread Starter
Junior Member
Thanks, PsychoMark, but I already have that part. I can connect to a TCP/IP address that the user enters, but I need to be able to search the local subnet for an unknown address like the dialog box does if you just hit enter.
Also, I, too, hated DX8. Especially the way that Direct3D and DirectDraw became so integrated. Oh well, Microsoft does as it sees fit.
Thanks again for the help.
-
Dec 31st, 2001, 04:35 AM
#14
Fanatic Member
Well, in my case it would either search the specified IP for sessions, or (if no IP was entered) it would search our LAN.
Since I don't use VB anymore (thus I won't finish it anyways), I've decided I won't mind it becoming opensource, as I think it's a great learning source for fullscreen user input. If anyone's interested, leave a message and I'll upload it to my webserver...
[edit]
If you hate DX8, why do you use it? I still used DX7 after I had installed DX8 on my computer, no problem at all, still supported. I think DX7 is easier, especially with DirectDraw being seperated, so why do it the hard way? 
[/edit]
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Dec 31st, 2001, 05:33 PM
#15
Thread Starter
Junior Member
Actually, I do still use DX7. I tried DX8, but because of the problems outlined above, I went back to DX7. I do have DX8.1 installed, but I don't use it to develop, yet. Once I move into 3D, then I think it will probably be great.
Thanks for posting the code. I will check it out.
-
Jan 1st, 2002, 03:31 PM
#16
Lively Member
THX!!!!!!!!!!!!!!!!!!!
BTW: Happy new year!
-
Jan 3rd, 2002, 08:17 AM
#17
Lively Member
Dim Desc As DPN_APPLICATION_DESC
Desc.guidApplication = msGuid
moDPA.AddComponentString DPN_KEY_HOSTNAME, "IP OR HOSTNAME GOES HERE "
If Not (moDPP Is Nothing) Then
mlEnumAsync = moDPP.EnumHosts(Desc, moDPA, moDPA, INFINITE, 0, INFINITE, DPNENUMHOSTS_OKTOQUERYFORADDRESSING, ByVal 0&, 0)
ElseIf Not (moDPC Is Nothing) Then
mlEnumAsync = moDPC.EnumHosts(Desc, moDPA, moDPA, INFINITE, 0, INFINITE, DPNENUMHOSTS_OKTOQUERYFORADDRESSING, ByVal 0&, 0)
End If
This solves the Problem under DX 8.1
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
|