Sign in to follow this  
yewbie

Directplay question :/

Recommended Posts

Yeah yeah, I know directplay sucks yadaa yadaa, but im using it and have a pretty decent client and server up and running, here is my question, how would I disconnect a client from a directplay server, or on the serverside disconnect the client?? there is literally no information on this? the only way I get get it to disconnect is to fully release all of the directplay stuff :/, there should be a easier way... any ideas would be greatly appreciated

Share this post


Link to post
Share on other sites
I tried that... the client still stays connected to the server for some reason...
i did find a way to do it though, from the DPServer->DestroyClient(SRemoteClient[i].NetworkInfo.DPid,NULL,NULL,NULL);

in case im not the only person in the world using directplay

Share this post


Link to post
Share on other sites
I used DirectPlay with my game earlier -- although I just finished converting to non-DirectPlay since it was unreliable and didn't have things I needed -- but anyway, the point is, no "message" is sent saying that a client or server has disconnected (because they're no longer connected :P). However, I believe it will throw an exception when it is not longer connected, which you can then catch and proceed however you like (ie. remove one from player count, etc).

That's how I did it. Also, C# has a simple OnDisconnect event which you can hook if you happen to be using it.

Share this post


Link to post
Share on other sites
well i dont know about client crashes but my server processes the DPN_MSGID_DESTROY_PLAYER message, it seems every time a client disconnects it sends that message, i wanted to know how to manually disconnect them, EX: bad login info -> disconnect

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this