Author Topic: $Quit  (Read 2817 times)

0 Members and 1 Guest are viewing this topic.

Offline VidFamne

  • Triple Ace
  • **
  • Posts: 173
  • Karma: +2/-0
$Quit
« on: 06 July, 2004, 00:39:02 »
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?
« Last Edit: 06 July, 2004, 00:46:01 by VidFamne »

PtokaX forum

$Quit
« on: 06 July, 2004, 00:39:02 »

Offline Corayzon

  • Lord
  • ***
  • Posts: 464
  • Karma: +1/-0
(No subject)
« Reply #1 on: 06 July, 2004, 01:52:14 »
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.
Code: [Select]
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

  • Guest
(No subject)
« Reply #2 on: 06 July, 2004, 01:59:51 »
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
Code: [Select]
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

  • Guest
(No subject)
« Reply #3 on: 06 July, 2004, 02:01:07 »
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
« Last Edit: 06 July, 2004, 02:01:41 by Herodes »

Offline Corayzon

  • Lord
  • ***
  • Posts: 464
  • Karma: +1/-0
(No subject)
« Reply #4 on: 06 July, 2004, 02:17:08 »
hehe Herodes, ...

good old cable bets the dialup once again

lolz

Offline VidFamne

  • Triple Ace
  • **
  • Posts: 173
  • Karma: +2/-0
(No subject)
« Reply #5 on: 06 July, 2004, 02:37:36 »
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

  • Guest
(No subject)
« Reply #6 on: 06 July, 2004, 02:55:40 »
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 ?

Offline VidFamne

  • Triple Ace
  • **
  • Posts: 173
  • Karma: +2/-0
(No subject)
« Reply #7 on: 06 July, 2004, 06:01:55 »
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. :(

Offline nErBoS

  • Emperor
  • **
  • Posts: 1 149
  • Karma: +3/-1
(No subject)
« Reply #8 on: 06 July, 2004, 16:11:12 »
Hi,

Try to put this in the main...

Code: [Select]
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 ##--

Offline HaArD

  • Double Ace
  • *
  • Posts: 104
  • Karma: +2/-1
(No subject)
« Reply #9 on: 07 July, 2004, 07:17:55 »
Quote
Originally 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)

Offline Corayzon

  • Lord
  • ***
  • Posts: 464
  • Karma: +1/-0
(No subject)
« Reply #10 on: 07 July, 2004, 07:31:24 »
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
« Last Edit: 07 July, 2004, 10:20:23 by Corayzon »

PtokaX forum

(No subject)
« Reply #10 on: 07 July, 2004, 07:31:24 »