diff options
Diffstat (limited to 'messages.go')
| -rw-r--r-- | messages.go | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/messages.go b/messages.go new file mode 100644 index 0000000..805334d --- /dev/null +++ b/messages.go @@ -0,0 +1,46 @@ +// messages.go +package main + +type IncomingMessage struct { + Type string `json:"type"` // "auth", "chat", "location", "nick" + Token string `json:"token,omitempty"` + Nick string `json:"nick,omitempty"` + ServerID string `json:"serverId,omitempty"` + PlayerUUID string `json:"playerUuid,omitempty"` + + Message string `json:"message,omitempty"` + X float64 `json:"x,omitempty"` + Y float64 `json:"y,omitempty"` + Z float64 `json:"z,omitempty"` + Dimension string `json:"dimension,omitempty"` +} + +type AuthOK struct { + Type string `json:"type"` // "auth_ok" + InternalName string `json:"internalName"` +} + +type AuthError struct { + Type string `json:"type"` // "auth_error" + Error string `json:"error"` +} + +type OutChat struct { + Type string `json:"type"` // "chat" + FromNick string `json:"fromNick"` + FromInternal string `json:"fromInternal"` + Message string `json:"message"` + Timestamp int64 `json:"timestamp"` +} + +type OutLocation struct { + Type string `json:"type"` // "location" + Nick string `json:"nick"` + Internal string `json:"internal"` + ServerID string `json:"serverId"` + X float64 `json:"x"` + Y float64 `json:"y"` + Z float64 `json:"z"` + Dimension string `json:"dimension"` + Timestamp int64 `json:"timestamp"` +}
\ No newline at end of file |
