Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
SimTX Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
SimTX API/Framing
(section)
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Frames == After the preface, each direction is a sequence of frames: <syntaxhighlight lang="text"> varint length number of bytes that follow bytes message one ClientFrame (client to server) or ServerFrame (server to client) </syntaxhighlight> This is protobuf's standard ''length-delimited'' encoding of a message, as written by <code>writeDelimitedTo</code> and read by <code>parseDelimitedFrom</code>, or the equivalent helpers of other protobuf libraries. The varint is the usual base-128 encoding, least significant group first. <code>ClientFrame</code> and <code>ServerFrame</code> each consist of one <code>oneof msg</code>. Exactly one member is set in every frame. The member number says what the frame is, and the member's value is the message: <syntaxhighlight lang="protobuf"> message ClientFrame { oneof msg { ClientHello hello = 1; Ping ping = 2; ... ReceiverStart receiver_start = 10; ... } } </syntaxhighlight> So a frame body always starts with the tag of its member (field number Γ 8 + 2), then the member's length, then the member's message. The complete lists are on [[SimTX API/Packet list]]. === Member numbers === Member numbers are allocated in blocks, the same in both directions: {| class="wikitable" ! Numbers !! Area |- | 1 to 9 || Connection: hello, ping, errors, banners |- | 10 to 29 || Receiver and transmitter sessions |- | 30 to 59 || Control sessions |- | 60 to 79 || Moderation sessions |- | 80 to 99 || Reserved for the next area |} Numbers 1 to 15 encode the tag in one byte. <code>ServerFrame</code> numbers 15, 16 and 62 are reserved; do not use them.
Summary:
Please note that all contributions to SimTX Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
SimTX Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)