$Quit
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

$Quit

Started by VidFamne, 06 July, 2004, 00:39:02

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

VidFamne

Is Ptokax really sending out a $Quit to everyone, when a user disconnect?
And can this be captured by the DataArrival?
Or is it in UserDisconnected?

Corayzon

VidFamne,

$Quit works like so, ...

When a user sends $Quit to the server, the server sends the same unedited msg to all the users and then disconnects the socket.

This is so the clients can remove the user from their list.

Also when a client disconnects by themselfs, then the server if also forced to send the $Quit message to the hub again.

This can be handled in dataarrival. And i think the userdisconnect is executed after the server sends the quit message out to the hub.
if strsub(sData, 1, 5) == "$Quit" then
	-- :: $Quit |
	local _,_, sUsername = strfind(sData, "%$Quit (.*)|")
	tUser:SendData("Quit -> sUsername: " .. sUsername)
end
more info bout handling hub commands can be found here and info about the p2p protocol can be found here

noza

Herodes

First Part :
--- Yes it does ... even if u have problems with it u can use this script NotRambitWombat has made,
 although since u don't describe any particular case I don't really know ... :)

Second Part :
--- Yes it can ... :D
function DataArrival(user, data)
if strsub(data, 1, 5) == "$Quit" then
--- TODO whatever code 
end
end

Third Part :
--- I suppose the PtokaX inbuilt UserDisconnected/OpDisconnected functions,
are triggered on receiving a $Quit ....

Smile everything is possible :D:D:D

Herodes

#3
Lolololololol I didn't know that browsing the forums with a 56K could have such an impact :D:D:D:D

Came second again .. :D

Corayzon

hehe Herodes, ...

good old cable bets the dialup once again

lolz

VidFamne

Thanks for the information :)
I just want to capture when a user disconnect for a counter I'm
working on.(Top 10)
I've tried with the UserDisconnect, but it seems it fails sometimes.
Btw, it looks like the client dont send any $Quit only the hub, according to the link you gave me. Dunno for sure.

Herodes

True that the Op/UserDisconnected and Op/NewUserConnected fail for some specific stuf ... I don't know why that is though ... .

Could someone give us a hint here ?

VidFamne

Hmm, it seems to be impossible to catch any $Quit through DataArrival.
Ive been logging it for some time now and havn't catch a single $Quit. :(

nErBoS

Hi,

Try to put this in the main...

function Main()
frmHub:EnableFullData(1)
end

frmHub:EnableFullData(n) ... enables/disables passing of ALL incomming data to current script

1- for enable, 0 - for disable

Best regards, nErBoS
--## nErBoS Spot ##--

HaArD

QuoteOriginally posted by Corayzon
VidFamne,

$Quit works like so, ...

When a user sends $Quit to the server, the server sends the same unedited msg to all the users and then disconnects the socket.

This is so the clients can remove the user from their list.

Also when a client disconnects by themselfs, then the server if also forced to send the $Quit message to the hub again.
....snip...
noza

For the record, DC Clients do not send $Quit to the Hub.

The $Quit message is created by the Hub to advise other clients that a user is no longer connected to the hub regardless of the reason (Closed client, lost net connection, got kicked, got redirected or whatever)

Corayzon

#10
VidFamne,
   
"Btw, it looks like the client dont send any $Quit only the hub, according to the link you gave me. Dunno for sure."
 
the client shouldnt send the $Quit string, it should just disconnect yes. But most hub soft will actually handle the $Quit string if it is directly sent by a user to disconnect to.

HaArD,

"For the record, DC Clients do not send $Quit to the Hub. "

i never said it does, i explained how the $Quit string is handled in multiple cases from the server.

And have u ever tried sending it to a ptokax server?

whahaha

noza

SMF spam blocked by CleanTalk