[Help] How Dose The Server Know The Client Disconnected?

Newbie Spellweaver
Joined
Oct 13, 2008
Messages
81
Reaction score
9
Eh.. Its Kinda A Stupid Question But I Was Wondering If It Like Sends A Packet To Check If Its Still Connected And If So What Dose This Packet Look Like.. Because In Caalie Files ( Yes I Know There Banned ) It Says Such And Such Has Disconnected Reason : Recv = -1 =X Hope You Guys Can Help

Thanks In Advance!

- John
 
Re: How Dose The Server Know The Client Disconnected?

What? What I got out of it was that you wanted to know how your login/world server knows if your online or not. It sends packets back and forth. To know what all the packets mean, would take some real looking up. Recv ID-1 is your server displaying a logout packet.(-1 people have logged on)
 
Re: How Dose The Server Know The Client Disconnected?

What? What I got out of it was that you wanted to know how your login/world server knows if your online or not. It sends packets back and forth. To know what all the packets mean, would take some real looking up. Recv ID-1 is your server displaying a logout packet.(-1 people have logged on)
i figured it out.. the login server keeps track of whos online, whos offline ( or disconnected ) then it sends it to all the other servers via ISC =p and i got my anti-caali crasher program working with ip banning system and auto ip ban when a crash packet is recv'd so no more caali crashes for hero 8D
 
Re: How Dose The Server Know The Client Disconnected?

Since I'm Board I'm Going To Explain How My Anti-Caali Crasher Works

Well First Off Its Like This :
Client -> Server ( Theres No Filtering )

My Anti-Caali Crasher Dose This :
Client -> Filter -> Server..
Now If The Filter Detects A Caali Crash Packet It Then Black-Lists The IP Via MySQL, Disconnects The "Crasher" And Dose Not Allow The Packet To Be Sent :)

How The IP Banning System Works :
Client Connects... Filter System Checks IP If IP Is Blacklisted It Then Disconnects Them

Functional Part :
The Normal Char Server Starts On A Diff Port ( Even Diff IP ) And The "Filter" Is On The Normal IP And Normal Port Of 28000 So Packets "Loop" From Filter To Normal Server

Also The "Filter" Can Limit Pending Connections So You Don't Have 50 People Connecting At Once And Causing Lag
 
Re: How Dose The Server Know The Client Disconnected?

A server knows when the client disconnects when a packet containing either FIN (close connection) or RST (reset connection/close connection by force) flag arrives.
 
Re: How Dose The Server Know The Client Disconnected?

Since I'm Board I'm Going To Explain How My Anti-Caali Crasher Works

Well First Off Its Like This :
Client -> Server ( Theres No Filtering )

My Anti-Caali Crasher Dose This :
Client -> Filter -> Server..
Now If The Filter Detects A Caali Crash Packet It Then Black-Lists The IP Via MySQL, Disconnects The "Crasher" And Dose Not Allow The Packet To Be Sent :)

How The IP Banning System Works :
Client Connects... Filter System Checks IP If IP Is Blacklisted It Then Disconnects Them

Functional Part :
The Normal Char Server Starts On A Diff Port ( Even Diff IP ) And The "Filter" Is On The Normal IP And Normal Port Of 28000 So Packets "Loop" From Filter To Normal Server

Also The "Filter" Can Limit Pending Connections So You Don't Have 50 People Connecting At Once And Causing Lag
Whats the data of the packet that crashes the server anyway?
 
Heres what happens when the "Caali Crash Packet" is sent...
[ Server -2- Client ] Packet : 0x5E080000000000000029000000

(Crash Packet)
[ Client -2- Server ] Packet : 0x5E806E4E71930000003EE9ECF2FFFFFFFFF500000029000000726A61747964696D6F667567636C717572636C716563647268767173757762766E746D72796B74646C29000000726A61747964696D6F667567636C717572636C716563647268767173757762766E746D72796B74646C29000000726A61747964696D6F667567636C717572636C716563647268767173757762766E746D72796B74646C5A7A0000

[ Server -2- Client ] Packet : 0x5E08000000FE000000270500005E1D000000F300000000000000000000000300000000000000000300000000000000

The "Crash" packet dose change... but a few things that always stay the same are :
There are always a total of 322 characters
The first four characters are always " 0x5E " ( ^ )
There is always a "4E7193000000" near the front...
There is always a "ECF2FFFFFFFFF500000029000000726A61747964696D6F667567636C717572636C716563647268767173757762766E746D72796B74646C29000000726A61747964696D6F667567636C717572636C716563647268767173757762766E746D72796B74646C29000000726A61747964696D6F667567636C717572636C716563647268767173757762766E746D72796B74646C5A7A0000" about 24 characters from the start...

Heres a little function i use in autoit to determine if a packet is a "Crash Packet"

Code:
Func _IsCrashPacket ($Packet)
$String = StringSplit ($Packet, '')
If $String['0'] == '322' Then 
If $String['1'] & $String['2'] & $String['3'] & $String['4'] == '0x5E' Then 
If StringInStr ($Packet, '4E7193000000') == '9' Then 
If StringInStr ($Packet, 'ECF2FFFFFFFFF500000029000000726A61747964696D6F667567636C717572636C716563647268767173757762766E746D72796B74646C29000000726A61747964696D6F667567636C717572636C716563647268767173757762766E746D72796B74646C29000000726A61747964696D6F667567636C717572636C716563647268767173757762766E746D72796B74646C5A7A0000') == '25' Then Return '1'
EndIf 
EndIf 
EndIf 
EndFunc

If the packet is a crash packet it returns 1, if not it returns 0
 
Also heres the script i used to get the crash packet.. its kinda like a "Packet Sniffer"

Code:
TcpStartUp ()
$Server = TcpListen ('127.0.0.1','28000')
Do 
$Socket = TcpAccept ($Server)
Sleep ('10')
Until $Socket <> '-1'
$Char_Server = TcpConnect ('127.0.0.1','28001')

$Timer = TimerInit ()
Do 
; Server -> Client
$Server_Says = TcpRecv ($Char_Server, '1000000')
If $Server_Says <> '' Then 
TcpSend ($Socket, $Server_Says)
; Some Sort Of Logging System To Log "$Server_Says" To A File...
EndIf 
; Client -> Server
$Client_Says = TcpRecv ($Socket, '1000000')
If $Client_Says <> '' Then 
TcpSend ($Char_Server, $Client_Says)
; Some Sort Of Logging System To Log "$Client_Says" To A File...
EndIf 
$Timer_Diff = TimerDiff ($Timer)
Until $Timer_Diff >= '10000'
 
Back