GLBasic forum

Main forum => Bug Reports => Topic started by: Wampus on 2012-Dec-03

Title: NETQUITPPLAYER() is broken - returns wrong IDs and sometimes doesn't complete
Post by: Wampus on 2012-Dec-03
OK, so when a client connected to a NET game quits with NETDESTROYPLAYER [their client ID number] the server command NETQUITPLAYER() pretty much consistently returns the wrong ID number.

NETQUITPLAYER should also keep returning the numbers of client IDs that have quit until reaching 0 but instead it sometimes misses them when more than one player have quit <- note, this is not a lag problem, unless lags of over 5 secs on a ethernet are to be expected.

In addition to the NETQUITPLAYER id being wrong, when a client uses NETDESTROYPLAYER they are not removed from the list of players found on the server with NETNUMPLAYERS() and NETGETPLAYERID, NETPLAYERNAME$.

The above behaviour is consistent on and between Windows and Android, i.e. its always the same, whether the host is an Android device or a Windows computer.

I have only tested this on LAN. I tested on IDE 11.171 and 10.283

On a tangent, does anyone know of a way to kick a client off the server? Doesn't seem to be a command for it.
Title: Re: NETQUITPPLAYER() is broken - sends wrong IDs and sometimes doesn't complete
Post by: matchy on 2012-Dec-03
Got some sample code and have you use Kanonet lib?
Title: Re: NETQUITPPLAYER() is broken - sends wrong IDs and sometimes doesn't complete
Post by: Wampus on 2012-Dec-04
Kanonet lib? Where can I find it? I'm using my own code, written and explored from the ground up. I'm not going to share that as a sample but I could write a little proggy just to demonstrate what is happening.

Is anyone else seeing this with their own code using the NET commands?
Title: Re: NETQUITPPLAYER() is broken - returns wrong IDs and sometimes doesn't complete
Post by: kanonet on 2012-Dec-04
I did just play around with NET commands for a short time. They had to much limitations for me so I switched to SOCK commands. I think SOCK commands are really useful and easy to use, dont see a real advantage in using NET commands.
I did write my own little network lib, i think that is what matchy did talk about. You can find it on my website (http://www.kanonet.de/downloads/libnet), but keep in mind that its in an early stage and under active development (atm im adding automatically syncing variables etc.).
Title: Re: NETQUITPPLAYER() is broken - returns wrong IDs and sometimes doesn't complete
Post by: matchy on 2012-Dec-05
Quote from: Wampus on 2012-Dec-04
I'm not going to share that..

:zzz:  :'(  >:D  :D


I recommend learning kanonet lib as I did and did write some stuff from ground up just to learn because server/client designs can differ and stability is the aim.
How information is passed around seems to be another matter, even if the general functions were perfect. For example, a collision can be locally processed for animation but process on the server for position.  :P
Title: Re: NETQUITPPLAYER() is broken - returns wrong IDs and sometimes doesn't complete
Post by: Wampus on 2012-Dec-05
Hmmm. Ok, I'll use pure SOCK commands instead. I thought NET would save some time but from what you and Kanonet I'd do better writing my own game session library.
Title: Re: NETQUITPPLAYER() is broken - returns wrong IDs and sometimes doesn't complete
Post by: erico on 2012-Dec-05
Quote from: kanonet on 2012-Dec-04
(atm im adding automatically syncing variables etc.).

This sounds interesting, not that I know anything about net, but I thought the original commands kind of did that :sick:
Gonna be a while before I ever try a "hello" through net anyways.