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.

AppGameKit Classic Chat / The unused client Id's doesent get removed from the server

Author
Message
Brny
9
Years of Service
User Offline
Joined: 12th Oct 2015
Location:
Posted: 17th Jan 2016 18:41 Edited at: 17th Jan 2016 20:06
Hi, so finally after some work and research i achieved to be able to play 1 vs 1 by internet with the game, now i am adding more players, i would like to make up to 6 or 10,

so i am using the client numbers to distiguish between the clients, and i can/want to have only a limited number of clients . So when the client connects to the server, generates a client name, (2), ok,

but then when i disconnect the client, i use getclientdisconnected(2) from the reserver to remove the sprite and it works. The sprite of the client gets removed from the server screen.

The problem, is when i try to connect again with the client, then it generates a new number (3) and so on every time that i reconnect.


I would like that, when a client is disconected, that client slot gets available again and the next client that connects re-uses that client number.


How could that be done?

There's any example of a multiplayer with more than 2 players...?

Thanks
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 18th Jan 2016 09:42
Can you post up some demo code of what you have already come up with? Forum Knights are more likely to help fix your code, than write new code for you.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 18th Jan 2016 12:58
I think that it probably works like sprites, sounds, images etc. It will use the next number, instead of trying to find a number that might have been used and released. From a performance point of view, this is a much better approach.

I always use arrays to store my game assets (which includes network connections). One of the fields in my type is ID, where I store the AppGameKit id value..
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Brny
9
Years of Service
User Offline
Joined: 12th Oct 2015
Location:
Posted: 18th Jan 2016 17:20 Edited at: 19th Jan 2016 16:06
Hi CJB and BatVink! good to see you




I'll try then....

Login to post a reply

Server time is: 2024-11-17 02:59:05
Your offset time is: 2024-11-17 02:59:05