protocol

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2023 License: MIT Imports: 0 Imported by: 11

Documentation

Index

Constants

View Source
const (
	LoginStatusSucc = 1
	LoginStatusFail = 2
)

Login status

Variables

View Source
var EmptyMessage = None{}

EmptyMessage was a shared empty message

Functions

This section is empty.

Types

type EnterWorldResponse

type EnterWorldResponse struct {
	ID int64 `json:"id"`
}

EnterWorldResponse indicates a new tadpole enter current scene

type JoyLoginRequest

type JoyLoginRequest struct {
	Username  string `json:"username"`
	Cipher    string `json:"cipher"`
	Timestamp int    `json:"timestamp"`
}

JoyLoginRequest represent a login request

type LeaveWorldResponse

type LeaveWorldResponse struct {
	ID int64 `json:"id"`
}

LeaveWorldResponse indicates tadpole leave current scene

type LoginResponse

type LoginResponse struct {
	Status int    `json:"status"`
	ID     int64  `json:"id"`
	Error  string `json:"error"`
}

LoginResponse represent a login response

type None

type None struct{}

None represents a message with nothing

type UpdateMessage

type UpdateMessage struct {
	ID       int     `json:"id"`
	X        float32 `json:"x"`
	Y        float32 `json:"y"`
	Name     string  `json:"name"`
	Momentum float32 `json:"momentum"`
	Angle    float32 `json:"angle"`
}

UpdateMessage contains latest position information of tadpole

type WorldMessage

type WorldMessage struct {
	ID      int64  `json:"id"`
	Message string `json:"message"`
}

WorldMessage represent a guest message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL