CollabVM 1.2 Protocol Reference: Difference between revisions

no edit summary
No edit summary
No edit summary
</table>
 
=== sizeScreen Size ===
Used to indicate the screen size of the VM. This will be sent after connecting and after any resolution change on the VM.
 
UsedSent to indicateannounce the screen size of the VM. This will be sent after connecting and after any resolution change on the VM.
==== Parameters ====
 
<table class="wikitable">
'''Layer''': This will always be zero (for the screen) on current server implementations. Some servers may implement other layers such as virtual mouse. Clients are not obligated to support these.
<tr><td>Opcode</td><td><code>size</code></td></tr>
<tr><td>Parameter 1</td><td><code>0</code></td></tr>
<tr><td>Parameter 2</td><td>Screen width</td></tr>
<tr><td>Parameter 3</td><td>Screen height</td></tr>
</table>
 
=== Framebuffer Update ===
'''Width''': The new width
 
UsedSent to update the VM screen. The server will send one initial PNG message containing the entire screen on connection, and after that will send a dirty rect for each update
'''Height''': The new height
 
<table class="wikitable">
=== png ===
<tr><td>Opcode</td><td><code>png</code></td></tr>
Used to update the VM screen. The server will send one initial PNG message containing the entire screen on connection, and after that will send a dirty rect for each update
<tr><td>Parameter 1</td><td><code>0</code></td></tr>
<tr><td>Parameter 2</td><td><code>0</code></td></tr>
<tr><td>Parameter 3</td><td>X-axis position of the rectangle</td></tr>
<tr><td>Parameter 4</td><td>Y-axis position of the rectangle</td></tr>
'''data''':<tr><td>Parameter 5</td><td>The base64-encoded rectrectangle. ThisDespite the name of the opcode, this may be either PNG or JPEG and can be determined through magic numbers or headers.</td></tr>
</table>
 
==== ParametersVote-for-reset notification ====
 
Sent when a Vote-tofor-reset on the VM updates
'''mask''': This will always be zero on current server implementations.
 
<table class="wikitable">
'''layer''': This will always be zero (for the screen) on current server implementations. Some servers may implement other layers such as virtual mouse. Clients are not obligated to support these.
<tr><td>Opcode</td><td><code>vote</code></td></tr>
<tr><td>Parameter 1</td><td>The status of the vote. See below for values</td></tr>
'''Time''':<tr><td>Parameter 2</td><td>Amount of time left on the vote in milliseconds. If the above status was 3 (cooldown), this is the amount of time before the client can start a vote.</td></tr>
'''Yes''':<tr><td>Parameter 3</td><td>The number of users who have voted in favor of resetting the VM</td></tr>
'''No''':<tr><td>Parameter 4</td><td>The number of users who have voted against resetting the VM</td></tr>
</table>
 
Possible vote statuses:
'''x''': X-axis position of the rect
 
'''y''': Y-axis position of the rect
 
'''data''': The base64-encoded rect. This may be either PNG or JPEG and can be determined through magic numbers or headers.
 
=== vote ===
 
Sent when a Vote-to-reset on the VM updates
 
==== Parameters ====
 
'''Status''': The status of the vote. Values:
<table class="wikitable">
<tr><th>Value</th><th>Status</th></tr>
<tr><td>0</td><td>The vote has started. The yes and no parameters may not be specified, and in such case should be assumed to be zero.</td></tr>
<tr><td>1</td><td>The vote count has updated.</td></tr>
<tr><td>2</td><td>The vote has ended. AllNo belowother parameters will be omitted. The server may send the result in the chatgiven.</td></tr>
<tr><td>3</td><td>Sent if the client tried to start a vote, however there is an active cooldown. Only the time parameter is given.</td></tr>
</table>
 
'''Time''': Amount of time left on the vote in milliseconds. If the above status was 3 (cooldown), this is the amount of time before the client can start a vote.
 
'''Yes''': The number of users who have voted in favor of resetting the VM
 
'''No''': The number of users who have voted against resetting the VM
 
=== turn ===