ahoj, vedel by mi niekto poradit? riesim prihlasenie na server prostrednictvom tcp a neviem ako poslat data na server, mam nejaky navod ale nechapem tomu, na 4bytov mam poslat velkost hesla + null, neviem ako zapisat na 4byty
# Post-authentication Client/Server communication is done via blocks of
# data. Each data block starts with the number of strings contained in
# the block, then each string, null terminated, with a 4-byte size sent
# before the string. Each 4-byte "length" is sent in unsigned long
# little-endian order.
#
# Bytes Meaning
# 1 2 3 4 Number of strings in this block
# 5 6 7 8 Size of string #1
# 9 ... String #1, with trailing NULL
# ... Size of string #2
# ... String #2, with trailing NULL
#
# Initial authentication is done via simple XOR'ing. The server sends 10
# bytes, and the client XORs the authentication information against those
# 10 bytes (and re-uses them again for each of the 10 bytes it sends to
# the server).
#
# Server->Client: 10 bytes: XOR pattern to use
# Client->Server: 4 bytes: length of user name (including the trailing NULL)
# Client->Server: X bytes: user (index-XOR'd, with trailing NULL)
# for example, if the user name was 15 "0x10" values,
# and the XOR pattern was the byte values from
# 0x00-0x09, the resulting "encrypted" user name
# would be in hex:
# 10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,0
# Client->Server: 4 bytes: length of password (including the trailing NULL)
# Client->Server: X bytes: password, XOR'd like the username, with final NULL
# Server->Client: 1 byte. (value of "1" means authenticated)
#
# To start console communication, the client seems to send something that
# almost matches the description of "Post-Authentication" communication,
# but the count of strings is wrong. Where "OFFSET" is the server instance
# to talk to (0 being first, 1 for the next server on the same IP, etc) it
# sends:
#
# 4 byte block length: 2
# NULL-terminated string: ConsoleRun OFFSET
# 4 byte block length: 2
# empty NULL-terminated string
# empty NULL-terminated string
#
# and then it reads back a regular block from the server, and then "normal"
# block-at-a-time communication starts up.