Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

MB

DirectPlay / internet

This topic is 5539 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Beeing quite unexperienced in the field of network logics, this question might be stupid, but anyway. I succeeded in setting up a local network (setting all the IPs to 255.255.255.255) with migrating host, so this is fine - the DirectX samples and tutorials are transparent. What I missed was an explanation, how internet communication might work. a) Is the IP addressing as easy? b) How does the dial up work c) What's the difference of a DirectX URL and the respective internet URL d) How can an internet game be launched? e) Where and how can I store the IP of the migrating host? Lots of questions, sorry, but it is really hard to find clarifying information. I am using DirectX 8. [edited by - MB on April 19, 2003 4:06:29 AM]

Share this post


Link to post
Share on other sites
Advertisement
Maybe I should be more precise instead of asking all the things I don't understand. Ok, here's a definitely limited problem:

In WinSock you have a function which decodes the URL given by name (like http://www.gamedev.net) into an IP adress, like 127.92.55.55 (in Winsock the function is "gethostbyname").

I anylized the description of the DirectPlay8adress object - but it's puzzling. I don't understand what GetURLW and GetURLA actually do (I don't understand the adress object), and how this may be equivalent to gethostbyname.

Any clarification?

[edited by - MB on April 20, 2003 8:20:35 AM]

Share this post


Link to post
Share on other sites
> ... the DirectPlay8adress object -
> but it''s puzzling.

Indeed. It is used to describe connection points of various nature (modem, IP, IPX, ...); you fill in bits & pieces of the connection point specification by setting attributes such as port number, IP address, machine name, telephone number, baud rate, etc. in order to complete the address that defines the connection point. GetURLA() extracts this connection specification as a big attribute-based string. You can use this string to persist the connections for a later use, and reload it with BuildFromURLA().

The connection may contain an incomplete specification and DP will try to fill in the missing attributes by either 1) calling ''dpnsvr'' (the DP server) with the application GUID, or 2) by asking the user directly via a series of dialog boxes (see parameter dwFlags / DPNCONNECT_OKTOQUERYFORADDRESSING in IDirectPlay8Peer::Connect() ).

The GUIDs are used to separate games applications and instances from one another so that the DP server (''dpnsvr'') can assign and maintain the IP or COMx port assignations for the connecting clients to browse. This avoids port collisions.

With this rather complex addressing mechanism, you can have multiple instances of multiple games running on a single machine, each using its own connection specification. An outside client with the matching application GUID can browse your machine for the running game servers and get the connection point specification for that one specific game the client wants to join.

Thus, an incomplete connection specification allows multiple instances of a game to be running on a single machine, while a complete specification allow only one game instance per machine.

-cb

Share this post


Link to post
Share on other sites
> a) Is the IP addressing as easy?
> c) What''s the difference of a DirectX URL
> and the respective internet URL

As explained above, addressing in DP is more generalized. Where internet addressing can be simply be an IP and a port, DP addresses can contain more attributes.

> b) How does the dial up work

Never used it, but coding would be the same since you have to go through a DP address.

> d) How can an internet game be launched?

DP allows peer-to-peer and server-client modes. In a P2P setting, you setup your application in hosting mode using ''IDirectPlay8Peer::Host()'' and wait for clients to connect to your machine using ''IDirectPlay8Peer::Connect()''; you can also start in Connect() and browse the matching servers on other machines. In a server-client mode, the server waits for clients after the call ''IDirectPlay8Server::Host()'' and awaits clients that will use ''IDirectPlay8Client::Client()'' to connect.

> e) Where and how can I store the IP
> of the migrating host?

In a P2P mode only, you should recveive a notification message DPN_MSGID_HOST_MIGRATE which contains the DPNID of the new game host. You can get the IP by calling ''IDirectPlay8Peer::GetPeerAddress()''. This is just a notification message and there is nothing you have to do for the migration to happen; this is an under-the-hood feature of DP. There is thus nothing to store. You only need to be aware of the change if your machine becomes the game server host because your machine will then be responsible for running the entire game simulation; i.e. your process is dynamically switching from a client to both a client and a server. This impacts your game loop logic quite a bit!

-cb

Share this post


Link to post
Share on other sites
cbenoi, it is really nice that you''ve dedicated my question such an attention. I see a lot clearer now, getting a notion that Direct8adress itself follows component logics and serves as an overall tool.
I suceeded in migrating host, message sending etc (on a local basis) - but the internbet part is still somewhat obscure.
I conclude that I have to set up TCP/IP, have to define a port (any port?) and then establish communication the very same way as on a local machine.
Is there a way to start a game via a given internet adress?

Share this post


Link to post
Share on other sites
cbenoi, it is really nice that you''ve dedicated my question such an attention. I see a lot clearer now, getting a notion that Direct8adress itself follows component logics and serves as an overall tool.
I suceeded in migrating host, message sending etc (on a local basis) - but the internbet part is still somewhat obscure.
I conclude that I have to set up TCP/IP, have to define a port (any port?) and then establish communication the very same way as on a local machine.
Is there a way to start a game via a given internet adress?

Share this post


Link to post
Share on other sites
cbenoi, it is really nice that you''ve dedicated my question such an attention. I see a lot clearer now, getting a notion that Direct8adress itself follows component logics and serves as an overall tool.
I suceeded in migrating host, message sending etc (on a local basis) - but the internbet part is still somewhat obscure.
I conclude that I have to set up TCP/IP, have to define a port (any port?) and then establish communication the very same way as on a local machine.
Is there a way to start a game via a given internet adress?

Share this post


Link to post
Share on other sites
cbenoi, it is really nice that you''ve dedicated my question such an attention. I see a lot clearer now, getting a notion that Direct8adress itself follows component logics and serves as an overall tool.
I suceeded in migrating host, message sending etc (on a local basis) - but the internbet part is still somewhat obscure.
I conclude that I have to set up TCP/IP, have to define a port (any port?) and then establish communication the very same way as on a local machine.
Is there a way to start a game via a given internet adress?

Share this post


Link to post
Share on other sites
cbenoi, it is really nice that you''ve dedicated my question such an attention. I see a lot clearer now, getting a notion that Direct8adress itself follows component logics and serves as an overall tool.
I suceeded in migrating host, message sending etc (on a local basis) - but the internbet part is still somewhat obscure.
I conclude that I have to set up TCP/IP, have to define a port (any port?) and then establish communication the very same way as on a local machine.
Is there a way to start a game via a given internet adress?

Share this post


Link to post
Share on other sites
cbenoi, it is really nice that you''ve dedicated my question such an attention. I see a lot clearer now, getting a notion that Direct8adress itself follows component logics and serves as an overall tool.
I suceeded in migrating host, message sending etc (on a local basis) - but the internbet part is still somewhat obscure.
I conclude that I have to set up TCP/IP, have to define a port (any port?) and then establish communication the very same way as on a local machine.
Is there a way to start a game via a given internet adress?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!