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 Professional Discussion / How to prevent a player joining a multiplayer session?

Author
Message
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 24th Mar 2004 14:44
I am developing multiplayer game, which once a game is created and started, no players is allow to join in (just like most RTS.) The question is how do I prevent any new players from joining a NET GAME? The simplest way I can think is, when a new player is connected, the server will just send a message to the new player asking him to terminate his net game immediately (via FREE NET GAME). Is there any better way, like just disconnect the player immediately, or even better, prevent him from connected at the first place.

Thanks!

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 24th Mar 2004 16:44
Since you're writing the host and client code you have full control over that. On the client side you have it query the host and wait for a reply. On the host side you tell the client if the game is in progress or not.
--
TAZ

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 24th Mar 2004 19:50
Once the player has joined (in the DirectPlay part of the system) you get notified when you use the NET PLAYER CREATED() function. If you determine that you don't want that player to join then you can use the FREE NET PLAYER command to kick them out.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Bulleyes
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 25th Mar 2004 07:01
Can I simply call FREE NET PLAYER on any machine? Or only the session host?

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Mar 2004 14:11
You'll have to try it.

I've never had a need to use this command because I built the kick-out into the client application by sending an accepted/denied type message and getting that client to disconnect itself.

A combination of both is probably the best though in case someone is using a hacked client.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2025-05-28 04:21:17
Your offset time is: 2025-05-28 04:21:17