Worlds Inc

VRML+



BNF of Packet Formats for VRML+

This is in pseudo-BNF (does anyone write real BNF) where the following conventions are used
MixedCase
Non terminal, i.e. look in this document for the definition
UPPERCASE
Constant, defined in the Constants section
X*
0 or more occurances of X (terminated by end of packet)

Basic structure of all packets

Packet::= CommandCode CommandParamaters
CommandCode::= UInt8
CommandParamaters::= Any*

Individual Packets

Packet::= GetIDPacket | SetIDPacket | GetXPacket | SetXPacket
	  | AckXPacket
	  | NeighbourUpdatePacket
	  | ClientUpdatePacket | RedirectPacket | UseAuthorisationPacket 
  	  | CommandFailedPacket | MapNamePacket | RequestNamePacket
	  | TextSendPacket | TextNotifyPacket |
	  | SRDPPacket | SRDPAckPacket

Identity

GetIDPacket::= GETIDCODE
SetIDPacket::= SETIDCODE Id
Id::= SInt32
GetXPacket::= GETXCODE Id DataType
DataType::= VRMLTYPE | NAMETYPE | ADDRESSTYPE
SetXPacket::= SETXCODE Id SetData
SetData::= VRMLData | NameData | AddressData
VRMLData::= VRMLTYPE Any*
NameData::= NAMETYPE Any*
AddressData::= ADDRESSTYPE Ip Port
AckXPacket::= ACKSETXCODE DataType
Ip::= UInt32
Port::= SInt16

Motion

NeighbourUpdatePacket::= NEIGHBOURUPDATECODE Location Disappears ShortUpdates
Location::= Float32 Float32 Float32
Disappears::= UInt8 UInt8 Id*
ShortUpdates::= UInt8 UInt8 ShortUpdate*
ShortUpdate::= Id ShortLocation Orientation
ShortLocation::= SInt16 SInt16 SInt16
Orientation::= SInt8 SInt8 SInt8 UInt8
ClientUpdatePacket::= CLIENTUPDATECODE Id Location Orientation Horizon MaxGhosts MaxNeighborUpdates
Horizon::= Float32
MaxGhosts::= UInt8
MaxNeighorUpdates::= UInt8

Error and Redirection

RedirectPacket::= REDIRECTCODE CommandCode Ip Port
CommandCode::= GETIDCODE | SETIDCODE | GETXCODE | SETXCODE | ACKSETXCODE | CLIENTUPDATECODE | NEIGHBOURUPDATECODE | USEAUTHORISATIONCODE | COMMANDFAILEDCODE | REDIRECTCODE | TEXTSENDCODE | TEXTNOTIFYCODE | SRDPDATACODE | SRDPACKCODE | RESERVEDCODE
UseAuthorisationPacket::= USEAUTHORISATIONCODE Url
CommandFailedPacket::= COMMANDFAILEDCODE Reason Packet
Reason::= COMMANDUNKNOWN | OUTOFRESOURCES | DUPLICATEID | INVALIDID | BADDATA | AUTHORISATIONFAILURE

Text

TextSendPacket::= TEXTSENDCODE Id Ascii*
TextNotifyPacket::= TEXTNOTIFYCODE Id

SRDP

SRDPPacket::= SRDPDATACODE SRDPPacketID SRDPFlags SRDPBytes
SRDPAckPacket ::= SRDPACKCODE SRDPPacketID
SRDPPacketID::= UInt16
SRDPFlags::= UInt8
SRDPBytes::= Packet
Note the extra constraint on SRDPBytes, which only applies within this application in order that the SRDPBytes can be passed back to the parser.

Types used in more than one section

Url::= Ascii*
Id::= UInt32
Ip::= UInt32
Port::= SInt16

Generic types used

UInt32::= a 32 bit integer, sent higher bytes first
UInt16::= a 16 bit integer, sent high bytes first
UInt8::= a 8 bit integer
Float32::= a 32 bit floating point number
Ascii::= Any printable Ascii character
Any::= any byte

Constants

DataType

ADDRESSTYPE::= 1
VRMLTYPE::= 2
NAMETYPE::= 3

CommandCode

GETIDCODE::= 1
SETIDCODE::= 2
GETXCODE::= 3
SETXCODE::= 4
ACKSETXCODE::= 5
CLIENTUPDATECODE::= 6
NEIGHBOURUPDATECODE::= 7
USEAUTHORISATIONCODE::= 8
COMMANDFAILEDCODE::= 9
REDIRECTCODE::= 10
TEXTSENDCODE::= 11
TEXTNOTIFYCODE::= 12
SRDPDATACODE::= 13
SRDPACK::= 14
RESERVEDCODE::= 128..255

Reason

COMMANDUNKNOWN::= 1
OUTOFRESOURCES::= 2
DUPLICATEID::= 3
INVALIDID::= 4
BADDATA::= 5
AUTHORISATIONFAILURE::= 6


Worlds Inc VRML+ Team
Alan Steremberg <alans@core.worlds.net>
Jeff Close <close@halcyon.com>
Kyle Hayes <kyle@core.worlds.net>
Mitra <mitra@mitra.biz>

All contents Copyright © 1995 Worlds Inc. Reproduction for personal use is permitted. All other uses are prohibited without the formal authorization of Worlds Inc., Worlds, Worlds Chat, AlphaWorld, VRML+, Internet Worlds Fair, LifeForms, Worlds Class Builder and It's Your World are all trademarks of Worlds Inc.
Web Problems?