Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/simpleradio/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions pkg/simpleradio/types/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions pkg/simpleradio/types/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Loading