Communication Protocol - UserXXX/vCom GitHub Wiki

This page gives an overview of the packets vCom uses for communication. Each packet consists of an identifier (32 bit signed integer) followed by the packets data. Currently the security packages are missing, they are coming soon.

ConnectionRequest

Usage Initial package that requests to open a connection. Send after a secure connection has been established.
Direction C -> S
Identifier 256
Packet data
Name Type Notes
Length of the User Identifier 32 bit signed integer -
User Identifier array of 8 bit signed integers (Java style bytes) The length is given by the previous field.
Device Identifier 32 bit signed integer -1 if connected for the first time, signals the server to generate a new device identifier.
Length of server password 32 bit signed integer 0 if none is present.
Server password array of 8 bit signed integers (Java style bytes) -

ConnectionAccept

Usage Notifies the client that the connection attempt made using ConnectionRequest has been accepted.
Direction S -> C
Identifier 257
Packet data
Name Type Notes
Device Identifier 32 bit signed integer If the client connects for the first time using this device: The (per server) unique device identifier to use in future.
If not: The same value as send with ConnectionRequest.

ConnectionDeny

Usage Denies a connection request made using ConnectionRequest. The socket is closed after this package is sent.
Direction S -> C
Identifier 258
Packet data
Name Type Notes
Error code 8 bit signed integer (Java style byte) See below for a list of error codes.

Error codes

Error code Meaning
0 The send User Identifier is blacklisted on this server.
1 The used IP is blacklisted on this server.
2 The User Identifier / IP is not whitelisted on this server.

RequestUserListsSync

Usage Requests the synchronisation of the user lists (friendlist, blocklist).
Note: This packet requests the client to compare the timestamps of its own lists to the ones send by the server and if there are differences to either download the servers list(s) or upload its own list(s).
Direction S -> C
Identifier 259
Packet data
Name Type Notes
Friendlist timestamp 64 bit signed integer (Java style long) The value represents the milliseconds since January 1, 1970, 00:00:00 GMT.
Blocklist timestamp 64 bit signed integer (Java style long) The value represents the milliseconds since January 1, 1970, 00:00:00 GMT.

UserListsSync

Usage Either: Response to a RequestUserListsSync package. Or: Initiative send when the friend-/blocklist changed.
Direction C -> S
Identifier 260
Packet data
Name Type Notes
Synchronize friendlist flag 8 bit signed integer (Java style byte) The possible values are listed in the table below.
Friendlist length 32 bit signed integer (Java style int) Only present if the sync flag indicates that the clients version is newer.
Friendlist entries Each consists of a 32 bit signed integer for the length, followed by a 8 bit signed integer array that encodes an UTF-8 string representation of the identifier. Only present if the sync flag indicates that the clients version is newer.
Synchronize blocklist flag 8 bit signed integer (Java style byte) The possible values are listed in the table below.
Blocklist length 32 bit signed integer (Java style int) Only present if the sync flag indicates that the clients version is newer.
Blocklist entries Each consists of a 32 bit signed integer for the length, followed by a 8 bit signed integer array that encodes an UTF-8 string representation of the identifier. Only present if the sync flag indicates that the clients version is newer.

Synchronization flag values

Flag value Meaning
0 The lists are synchronized, no data is send.
1 The servers list is newer and the client wants to receive it, no data is send.
2 The clients list is newer and this flag is followed by the clients list data.

FriendlistSync

Usage Transferes the identifiers of the users friends from server to client.
Direction S -> C
Identifier 261
Packet data
Name Type Notes
Number of friendlist entries 32 bit signed integer (Java style int) -
UserIdentifier entries Each consists of a 32 bit signed integer for the length, followed by a 8 bit signed integer array that encodes an UTF-8 string representation of the identifier. -

BlocklistSync

Usage Transferes the identifiers of the users blocked users from server to client.
Direction S -> C
Identifier 262
Packet data
Name Type Notes
Number of blocklist entries 32 bit signed integer (Java style int) -
UserIdentifier entries Each consists of a 32 bit signed integer for the length, followed by a 8 bit signed integer array that encodes an UTF-8 string representation of the identifier. -

BroadcastMessage

Usage Broadcasts an unencrypted message to all online clients.
Direction S -> C
Identifier 263
Packet data
Name Type Notes
Number of message bytes 32 bit signed integer (Java style int) -
Message data 8 bit signed integer array Encodes an UTF-8 string representation of the message.

UnicastMessageSC

Usage Sends a message for one user from the server to the client.
Direction S -> C
Identifier 264
Packet data
Name Type Notes
Length of the senders user identifier 32 bit signed integer (Java style int) -
Senders user identifier data 8 bit signed integer array Encodes an UTF-8 string representation of the user identifier.
Read 8 bit signed integer 0 means false, everything else means true (boolean value).
Mailing date 64 bit signed integer (Java style long) The value represents the milliseconds since January 1, 1970, 00:00:00 GMT.
Is text message 8 bit signed integer 0 means false, everything else means true (boolean value). Specifies whether the transferred data is text or image data.
Length of the data 32 bit signed integer (Java style int) -
Data Array of 8 bit signed integers (Java style bytes) -

MulticastMessageSC

Usage: Sends a message for a group of users from the server to one of the adressed clients.

Direction: S -> C

Identifier: 265

Package Data:

  • sender identifier
  • recipient (group) identifier (32 bit signed integer)
  • sender identifier
  • read (boolean)
  • send timestamp (timestamp)
  • is text message (boolean)
  • data length (32bit signed integer)
  • data (byte array)

UnicastMessageCS

Usage: Sends a message for one user from the client to the server.

Direction: C -> S

Identifier: 266

Package Data:

  • recipient identifier
  • send timestamp (timestamp)
  • is text message (boolean)
  • data length (32bit signed integer)
  • data (byte array)

MulticastMessageCS

Usage: Sends a message for a group of users from the client to the server for redistribution.

Direction: C -> S

Identifier: 267

Package Data:

  • recipient (group) identifier (32 bit signed integer)
  • send timestamp (timestamp)
  • is text message (boolean)
  • data length (32bit signed integer)
  • data (byte array)

RequestFileTransfer

Usage: Requests to transfer a file from one client to another. A user may not make a second request before the server answered his first request.

Direction: C -> S

Identifier: 268

Package Data:

  • recipient identifier
  • file size in bytes (32bit signed integer)
  • file name (string)

FileTransferID

Usage: Sets the ID for a requested file transfer.

Direction: S -> C

Identifier: 269

Package Data:

  • file transfer identifier (32bit signed integer)

AbortFileTransfer

Usage:

S -> C: Aborts a file transfer if the file transfer violates the server settings or one of the users connection was dropped.

C -> S: Notifies the server that the user doesn't want to receive the offered file.

Direction: S -> C / C -> S

Identifier: 270

Package Data:

  • file transfer identifier (32bit signed integer)
  • reason (32bit signed integer)

AskForFileTransfer

Usage: Questions a user if he/she wants to begin a file transfer for the given file.

Direction: S -> C

Identifier: 271

Package Data:

  • sender identifier
  • file size in bytes (32bit signed integer)
  • file name (string)
  • file transfer identifier (32bit signed integer)

AcceptFileTransfer

Usage:

C -> S: Notifies the server that the client wants to receive the offered file.

S -> C: Notifies the client that it may begin transferring the file now.

Direction: C -> S / S -> C

Identifier: 272

Package Data:

  • file transfer identifier (32bit signed integer)

FilePart

Usage: Transferes a piece of a file.

Direction: C -> S / S -> C

Identifier: 273

Package Data:

  • file transfer identifier (32bit signed integer)
  • data length (32bit signed integer, <= 1024)
  • data (byte array)

FileTransferFinished

Usage: Notifies the receiver, that the file has been successfully transferred.

Direction: S -> C / C -> S

Identifier: 274

Package Data:

  • file transfer identifier (32bit signed integer)
⚠️ **GitHub.com Fallback** ⚠️