CollabVM 1.2 Protocol Reference: Difference between revisions

no edit summary
No edit summary
No edit summary
== Server-to-Client Opcodes ==
 
These messages may be sent by the server at any time after completing the handshake and must be handled by the client.
=== adduser ===
 
=== adduserNew User(s) ===
Sent to indicate that one or more users have joined the VM. This will always be sent on connection.
 
Sent to indicate that one or more users have joined the VM. This willmay alwaysalso be sent onduring connectionthe handshake.
==== Parameters ====
 
TheParameters server1 willand send2 twoare parametersrepeated for each user: added.
 
<table class="wikitable">
'''Username''': The username of the new user
<tr><td>Opcode</td><td><code>adduser</code></td></tr>
<tr><td>Parameter 1</td><td>The username of the added user.</td></tr>
<tr><td>Parameter 2</td><td>The [[#Rank|Rank]] of the added user as an integer.</td></tr>
</table>
 
=== Removed User(s) ===
'''Rank''': The rank of the user as an integer (see the Staff section).
 
Sent when one or more users leavesdisconnect from the VM.
=== remuser ===
 
Parameter 2 is repeated for each user removed.
Sent when one or more users leaves the VM.
 
<table class="wikitable">
==== Parameters ====
<tr><td>Opcode</td><td><code>remuser</code></td></tr>
'''Number''':<tr><td>Parameter 1</td><td>The number of users whothat have left</td></tr>
<tr><td>Parameter 2</td><td>The username that has left the VM.</td></tr>
</table>
 
=== Client Renamed ===
'''Number''': The number of users who have left
 
Sent when the current client (you) is renamed, either by you or the server.
'''Username''': Username of the user who left. Repeated for each user if there are more than one
 
<table class="wikitable">
=== rename ===
<tr><td>Opcode</td><td><code>rename</code></td></tr>
 
<tr><td>Parameter 1</td><td><code>0</code></td></tr>
Sent when a user changes their username.
<tr><td>Parameter 2</td><td>The status of the rename. See below for available values.</td></tr>
 
<tr><td>Parameter 3</td><td>The client's new username. This may not necessarily be the username requested by the client, as the server can refuse this request for a variety of reasons and may instead assign a guest name.</td></tr>
==== Parameters ====
</table>
 
Parameters if the client's username is being changed, either by their use of the <code>rename</code> opcode or by staff:
 
'''0''': This parameter will always be <code>0</code> and is used to differentiate between the client being renamed and another user
 
Possible rename statuses:
'''Status''': This parameter is used for the status of the rename. It can have one of the below values:
 
<table class="wikitable">
</table>
 
=== User Renamed ===
'''Username''': The client's new username. This will either be the requested username, or one generated by the server if a new username was not specified or was rejected for one of the reasons above.
 
ParametersSent ifwhen another user isin beingthe list is renamed:.
 
<table class="wikitable">
'''1''': This parameter will always be 1 and is used to differentiate between the client being renamed and another user
<tr><td>Opcode</td><td><code>rename</code></td></tr>
<tr><td>Parameter 1</td><td><code>1</code></td></tr>
<tr><td>Parameter 2</td><td>The user's old username</td></tr>
<tr><td>Parameter 3</td><td>The user's new username</td></tr>
</table>
 
=== Chat message ===
'''Old Name''': The user's old username
 
Sent when one or more chat messages are received.
'''New Name''': The user's new username
 
Parameters 1 and 2 may be repeated for multiple chat messages, and this should be checked for. In current server implementations, this will only happen immediately after connection to send the chat history.
=== chat ===
 
<table class="wikitable">
Sent when another user sends a chat message.
<tr><td>Opcode</td><td><code>chat</code></td></tr>
 
<tr><td>Parameter 1</td><td>The user who sent the chat message. This may be an empty string to indicate a system message sent by the server, such as the Message of the Day, or a vote notification.</td></tr>
==== Parameters ====
<tr><td>Parameter 2</td><td>The chat message</td></tr>
 
</table>
This opcode will mostly have two parameters. However at the beginning of the connection, the server will send a chat history, containing the below parameters for each message.
 
'''Username''': The user who sent the chat message.
 
'''Message''': The chat message. The server '''MUST''' HTML-sanitize the message, otherwise this poses a severe vulnerability to users.
 
=== size ===
== Rank ==
 
CollabVM has threefour ranks:
 
<table class="wikitable">
'''0''': Unregistered. The default rank with no permissions that all users have prior to logging in.
<tr><th>ID</th><th>Name</th><th>Description</th></tr>
 
'''<tr><td>0''': </td><td>Unregistered. </td><td>The default rank with no permissions that all users have prior to logging in.</td></tr>
'''2''': Admin. Has all permissions on the VM.
<tr><td>1</td><td>Registered</td><td>A logged in user. This is only used by servers that use CollabVM Account Authentication.</td></tr>
 
'''<tr><td>2''': </td><td>Admin. </td><td>Has all permissions on the VM.</td></tr>
'''<tr><td>3''': </td><td>Moderator. </td><td>Permissions vary depending on server configuration. Even with all permissions granted moderators can still not use the QEMU monitor.</td></tr>
</table>