CollabVM 1.2 Protocol Reference: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
These opcodes may be sent by the client at any time after the handshake to perform various actions
 
=== Account Login ===
TODO
 
Used to log in with a CollabVM account. This should only be sent if the server announced authentication using the <code>auth</code> opcode during the handshake phase. Sending this opcode otherwise is undefined behavior.
 
==== Request ====
 
<table class="wikitable">
<tr><td>Opcode</td><td><code>login</code></td></tr>
<tr><td>Parameter 1</td><td>A session token OR bot token obtained from the authentication server announced during handshake.</td></tr>
</table>
 
==== Response ====
 
<table class="wikitable">
<tr><td>Opcode</td><td><code>login</code></td></tr>
<tr><td>Parameter 1</td><td>Login status. <code>0</code> for error, <code>1</code> for success.</td></tr>
<tr><td>Parameter 2</td><td>Human-readable error. Only sent if status was <code>0</code></td></tr>
</table>
 
After a successful login, the client should expect to be renamed and have their rank updated by the server.
 
=== Rename ===
 
Used to change the client's username. This opcode is not available on servers that use account authentication, and the server will respond with an error.
 
==== Request ====
 
<table class="wikitable">
<tr><td>Opcode</td><td><code>rename</code></td></tr>
<tr><td>Parameter 1</td><td>The username requested by the client. If omitted, the server will reassign a guest username.</td></tr>
</table>
 
==== Response ====
 
The server will respond with a [[#Client Renamed|Client Renamed]] event.
 
=== Send Chat ===
 
Send a public chat message to the server.
 
==== Request ====
 
<table class="wikitable">
<tr><td>Opcode</td><td><code>chat</code></td></tr>
<tr><td>Parameter 1</td><td>Chat message to send</td></tr>
</table>
 
==== Response ====
 
This opcode has no specific response, although the server will send a [[#Chat message|Chat message]] event for the message, provided it was not blocked or ratelimited.
 
=== Take turn ===
 
Request a turn on the VM.
 
==== Request ====
 
<table class="wikitable">
<tr><td>Opcode</td><td><code>turn</code></td></tr>
<tr><td>Parameter 1</td><td><code>1</code> to take a turn, <code>0</code> to cancel your turn. If not specified, the server will infer <code>1</code>.</td></tr>
</table>
 
==== Response ====
 
The server will send a [[#Turn queue update|Turn queue update]] assuming the request was not blocked or ratelimited.
 
== Admin Opcodes ==