diff --git a/pkg/simpleradio/message.go b/pkg/simpleradio/message.go index b5c7bd6b..b209a45e 100644 --- a/pkg/simpleradio/message.go +++ b/pkg/simpleradio/message.go @@ -31,7 +31,7 @@ func (c *Client) Send(message types.Message) error { // newMessage creates a new message with the client's version, the given message type, and the client's info. func (c *Client) newMessage(t types.MessageType) types.Message { message := types.Message{ - Version: "2.1.0.2", // stubbing fake SRS version, TODO add flag + Version: "2.3.2.1", // stubbing fake SRS version, TODO add flag Type: t, } message.Client = c.clientInfo diff --git a/pkg/simpleradio/types/info.go b/pkg/simpleradio/types/info.go index 0f1771b2..89c9990c 100644 --- a/pkg/simpleradio/types/info.go +++ b/pkg/simpleradio/types/info.go @@ -9,19 +9,19 @@ import ( // ClientInfo is information about the client included in messages. type ClientInfo struct { // GUID a unique client ID. - GUID GUID `json:"ClientGuid"` + GUID GUID `json:"clientGuid"` // Name is the name that will appear in the client list and in in-game transmissions - Name string `json:"Name"` + Name string `json:"name"` // Seat is the seat number for multicrew aircraft. For bots, set this to 0. - Seat int `json:"Seat"` + Seat int `json:"seat"` // Coalition is the side that the client will act on - Coalition coalitions.Coalition `json:"Coalition"` + Coalition coalitions.Coalition `json:"coalition"` // AllowRecording indicates consent to record audio server-side. For bots, this should usually be set to True. - AllowRecording bool `json:"AllowRecord"` + AllowRecording bool `json:"allowRecord"` // RadioInfo contains the client's unit, radios, transponder and ambient audio settings. - RadioInfo RadioInfo `json:"RadioInfo"` + RadioInfo RadioInfo `json:"radioInfo"` // Position is the unit's in-game location. This is omitted for external clients not bound to a unit. - Position *Position `json:"LatLngPosition,omitempty"` + Position *Position `json:"latLngPosition,omitempty"` } // RadioInfo is information about a client's radios. diff --git a/pkg/simpleradio/types/message.go b/pkg/simpleradio/types/message.go index 94457b51..b228d36d 100644 --- a/pkg/simpleradio/types/message.go +++ b/pkg/simpleradio/types/message.go @@ -19,15 +19,15 @@ const ( // The order of fields in this type matches the order of fields in the official SRS client, just in case a different order were to trigger some obscure bug. type Message struct { // Version is the SRS client version. - Version string `json:"Version"` + Version string `json:"version"` // Client is used in messages that reference a single client. - Client ClientInfo `json:"Client"` // TODO v2: Change type to *ClientInfo and set omitempty + Client ClientInfo `json:"client"` // TODO v2: Change type to *ClientInfo and set omitempty // Clients is used in messages that reference multiple clients. - Clients []ClientInfo `json:"Clients,omitempty"` + Clients []ClientInfo `json:"clients,omitempty"` // ServerSettings is a map of server settings and their values. It sometimes appears in Sync messages. - ServerSettings map[string]string `json:"ServerSettings,omitempty"` + ServerSettings map[string]string `json:"serverSettings,omitempty"` // ExternalAWACSModePassword is the External AWACS Mode password, used in ExternalAWACSModePassword messages to authenticate a client as an AWACS. - ExternalAWACSModePassword string `json:"ExternalAWACSModePassword,omitempty"` + ExternalAWACSModePassword string `json:"externalAWACSModePassword,omitempty"` // Type is the type of the message. - Type MessageType `json:"MsgType"` + Type MessageType `json:"msgType"` }