Welcome to the PtokaX Wiki!
This wiki is devoted to let users share information on the great hubsoft PtokaX. However, it is not limited to PtokaX, it is destined to share and discuss information on different parts of the LUA programming language, but the site is NOT intended to be a replacement for the primary LUA Board aka the PtokaX Portal, nor the secondary LUA Board or the PtokaX resources.
If you’re not familiar with wikis then in short: they are user-contributed sites: pages can be edited by (almost) anyone. As such, there is always kind of up-to-date and (hopefully) proper content. They are better than forums, since relevant pieces of information are on the same page. Do not hesitate to share your knowledge, and we all hope you can learn and teach a lot here! — bastya_elvtars
Trace: » Formatting Syntax » Rules page » PlayGround » ptokax » General settings » Deflood page » Advanced settings » Command Types (client to server) » s2s » Command Types (client to client)
Command Types (client to client)
Direct Connect uses TCP and UDP for client to client communication. Normaly the client listen at port 412 for client connections, but if the port already in use it uses 413,414 and so on.. The following section describes the format of the Commands, Each field is denoted with < >. The fields in the command are separated by a single space character (ASCII 32). And each Command ends with a | (pipe). All Commands are case sensitive.
$GetListLen
The downloading client sends the $GetListLen to request the filesize of the remote DCList in bytes.
$GetListLen
The uploading client responds to the $GetListLen command with $ListLen.
$ListLen <sizeinbyte>
<sizeinbyte>is the filesize of the remote DCList in bytes.
$MaxedOut
The $MaxedOut command is sent when there are no freeslots available from the uploading user.
$MaxedOut
$Error
The $Error command is sent when an error occurs, like file not found.
$Error <errormessage>
<errormessage>is the message sent to the download client containing the error description.
$Get
The $Get command is used to request a file from the uploading client.
$Get <filenameandpath>$<resumecount>
<filenameandpath>is the remote location of the file requested.<resumecount>is the byte offset to start at for resuming files.
$FileLength
The $FileLength is sent in response to the $Get command.
$FileLength <sizeinbytes>
<sizeinbytes>is the file size in bytes of the file requested with the $Get command.
$Canceled
The $Canceled command is sent by eather party signifying that the download has been canceled prematurly.
$Canceled
UDP Client To Client Commands
The following commands are the Client To Client UDP Commands.
$SR
The $SR command is sent in response to a client searching. This is sent UDP when the searching client is in Active Mode.
$SR <nick> <searchresponse> <hubip>:<hubport>
<nick>is the nick of the user with the file.<hubip>:<hubport>are the values sent in the $Search command.
<searchresponse> is made up of
<filenamewithpath><filesizeinbytes> <current openslots>/<allopenslots><hubname>
<filenamewithpath>is the location of the file on the remote client.<filesizeinbytes>is the size of the file found.<current openslots>is the number of free slots the remote client has available.<allopenslots>is the total number of slots the remote client has available.- “” is the ascii character 5.
Note: $SR is the only command that does not end in a “|”.
$Ping
I'm not sure what the purpose of this command.
$Ping <senderIp>:<senderPort>
<senderIp>is the Ip address of the client sending the command.<senderPort>is the UDP port the client is listening on (Usually the same as TCP port).
You are here: About the Wiki » misc » dcprotocol » Command Types (client to client)