frameproto

package
v0.0.0-...-d853fe5 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OPID_name = map[int32]string{
		0: "None",
		1: "Move",
	}
	OPID_value = map[string]int32{
		"None": 0,
		"Move": 1,
	}
)

Enum value maps for OPID.

View Source
var File_frame_proto protoreflect.FileDescriptor
View Source
var FrameClientEntityDesc = entity.EntityDesc{
	TypeName:    "frameproto.FrameClientEntity",
	HandlerType: (*FrameClientEntity)(nil),
	Methods: map[string]entity.MethodDesc{

		"Progress": {
			MethodName:   "Progress",
			Handler:      _FrameClientEntity_Progress_Remote_Handler,
			LocalHandler: _FrameClientEntity_Progress_Local_Handler,
		},

		"Start": {
			MethodName:   "Start",
			Handler:      _FrameClientEntity_Start_Remote_Handler,
			LocalHandler: _FrameClientEntity_Start_Local_Handler,
		},

		"Frame": {
			MethodName:   "Frame",
			Handler:      _FrameClientEntity_Frame_Remote_Handler,
			LocalHandler: _FrameClientEntity_Frame_Local_Handler,
		},

		"GameOver": {
			MethodName:   "GameOver",
			Handler:      _FrameClientEntity_GameOver_Remote_Handler,
			LocalHandler: _FrameClientEntity_GameOver_Local_Handler,
		},
	},

	Metadata: "frame.proto",
}
View Source
var FrameSeverEntityDesc = entity.EntityDesc{
	TypeName:    "frameproto.FrameSeverEntity",
	HandlerType: (*FrameSeverEntity)(nil),
	Methods: map[string]entity.MethodDesc{

		"Heartbeat": {
			MethodName:   "Heartbeat",
			Handler:      _FrameSeverEntity_Heartbeat_Remote_Handler,
			LocalHandler: _FrameSeverEntity_Heartbeat_Local_Handler,
		},

		"Init": {
			MethodName:   "Init",
			Handler:      _FrameSeverEntity_Init_Remote_Handler,
			LocalHandler: _FrameSeverEntity_Init_Local_Handler,
		},

		"Join": {
			MethodName:   "Join",
			Handler:      _FrameSeverEntity_Join_Remote_Handler,
			LocalHandler: _FrameSeverEntity_Join_Local_Handler,
		},

		"Progress": {
			MethodName:   "Progress",
			Handler:      _FrameSeverEntity_Progress_Remote_Handler,
			LocalHandler: _FrameSeverEntity_Progress_Local_Handler,
		},

		"Ready": {
			MethodName:   "Ready",
			Handler:      _FrameSeverEntity_Ready_Remote_Handler,
			LocalHandler: _FrameSeverEntity_Ready_Local_Handler,
		},

		"Input": {
			MethodName:   "Input",
			Handler:      _FrameSeverEntity_Input_Remote_Handler,
			LocalHandler: _FrameSeverEntity_Input_Local_Handler,
		},

		"GameOver": {
			MethodName:   "GameOver",
			Handler:      _FrameSeverEntity_GameOver_Remote_Handler,
			LocalHandler: _FrameSeverEntity_GameOver_Local_Handler,
		},
	},

	Metadata: "frame.proto",
}

Functions

func RegisterFrameClientEntity

func RegisterFrameClientEntity(etyMgr *entity.EntityManager, impl FrameClientEntity)

func RegisterFrameSeverEntity

func RegisterFrameSeverEntity(etyMgr *entity.EntityManager, impl FrameSeverEntity)

Types

type Frame

type Frame struct {
	FrameID uint32       `protobuf:"varint,1,opt,name=FrameID,proto3" json:"FrameID,omitempty"` //帧ID
	Data    []*FrameData `protobuf:"bytes,2,rep,name=Data,proto3" json:"Data,omitempty"`
	// contains filtered or unexported fields
}

func (*Frame) Descriptor deprecated

func (*Frame) Descriptor() ([]byte, []int)

Deprecated: Use Frame.ProtoReflect.Descriptor instead.

func (*Frame) GetData

func (x *Frame) GetData() []*FrameData

func (*Frame) GetFrameID

func (x *Frame) GetFrameID() uint32

func (*Frame) ProtoMessage

func (*Frame) ProtoMessage()

func (*Frame) ProtoReflect

func (x *Frame) ProtoReflect() protoreflect.Message

func (*Frame) Reset

func (x *Frame) Reset()

func (*Frame) String

func (x *Frame) String() string

type FrameClient

type FrameClient struct {
	EntityID entity.EntityID
}

func NewFrameClient

func NewFrameClient(c entity.Context) (*FrameClient, error)

func NewFrameClientClient

func NewFrameClientClient(eid entity.EntityID) *FrameClient

func NewFrameClientWithID

func NewFrameClientWithID(c entity.Context, id entity.EntityID) (*FrameClient, error)

func (*FrameClient) Frame

func (t *FrameClient) Frame(c entity.Context, req *FrameReq) error

func (*FrameClient) GameOver

func (t *FrameClient) GameOver(c entity.Context, req *GameOverReq) error

func (*FrameClient) Progress

func (t *FrameClient) Progress(c entity.Context, req *ProgressReq) error

func (*FrameClient) Start

func (t *FrameClient) Start(c entity.Context, req *StartReq) error

type FrameClientEntity

type FrameClientEntity interface {
	entity.IEntity

	// Progress 通知客户端其他人加载进度
	Progress(c entity.Context, req *ProgressReq) error

	// Start 通知客户端开始
	Start(c entity.Context, req *StartReq) error

	// Frame 帧下发
	Frame(c entity.Context, req *FrameReq) error

	// GameOver 游戏结束
	GameOver(c entity.Context, req *GameOverReq) error
}

FrameClientEntity

type FrameData

type FrameData struct {
	Id    uint64     `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` // id可以是座位编号,uid,序号等,只要能区分就行
	Input *InputData `protobuf:"bytes,2,opt,name=Input,proto3" json:"Input,omitempty"`
	// contains filtered or unexported fields
}

func (*FrameData) Descriptor deprecated

func (*FrameData) Descriptor() ([]byte, []int)

Deprecated: Use FrameData.ProtoReflect.Descriptor instead.

func (*FrameData) GetId

func (x *FrameData) GetId() uint64

func (*FrameData) GetInput

func (x *FrameData) GetInput() *InputData

func (*FrameData) ProtoMessage

func (*FrameData) ProtoMessage()

func (*FrameData) ProtoReflect

func (x *FrameData) ProtoReflect() protoreflect.Message

func (*FrameData) Reset

func (x *FrameData) Reset()

func (*FrameData) String

func (x *FrameData) String() string

type FrameReq

type FrameReq struct {
	Frames []*Frame `protobuf:"bytes,1,rep,name=Frames,proto3" json:"Frames,omitempty"`
	// contains filtered or unexported fields
}

server to client frame

func (*FrameReq) Descriptor deprecated

func (*FrameReq) Descriptor() ([]byte, []int)

Deprecated: Use FrameReq.ProtoReflect.Descriptor instead.

func (*FrameReq) GetFrames

func (x *FrameReq) GetFrames() []*Frame

func (*FrameReq) ProtoMessage

func (*FrameReq) ProtoMessage()

func (*FrameReq) ProtoReflect

func (x *FrameReq) ProtoReflect() protoreflect.Message

func (*FrameReq) Reset

func (x *FrameReq) Reset()

func (*FrameReq) String

func (x *FrameReq) String() string

type FrameSever

type FrameSever struct {
	EntityID entity.EntityID
}

func NewFrameSever

func NewFrameSever(c entity.Context) (*FrameSever, error)

func NewFrameSeverClient

func NewFrameSeverClient(eid entity.EntityID) *FrameSever

func NewFrameSeverWithID

func NewFrameSeverWithID(c entity.Context, id entity.EntityID) (*FrameSever, error)

func (*FrameSever) GameOver

func (t *FrameSever) GameOver(c entity.Context, req *GameOverReq) error

func (*FrameSever) Heartbeat

func (t *FrameSever) Heartbeat(c entity.Context, req *HeartbeatReq) (*HeartbeatRsp, error)

func (*FrameSever) Init

func (t *FrameSever) Init(c entity.Context, req *InitReq) (*InitRsp, error)

func (*FrameSever) Input

func (t *FrameSever) Input(c entity.Context, req *InputReq) error

func (*FrameSever) Join

func (t *FrameSever) Join(c entity.Context, req *JoinReq) (*JoinRsp, error)

func (*FrameSever) Progress

func (t *FrameSever) Progress(c entity.Context, req *ProgressReq) error

func (*FrameSever) Ready

func (t *FrameSever) Ready(c entity.Context, req *ReadyReq) error

type FrameSeverEntity

type FrameSeverEntity interface {
	entity.IEntity

	// Heartbeat
	Heartbeat(c entity.Context, req *HeartbeatReq) (*HeartbeatRsp, error)

	// Init
	Init(c entity.Context, req *InitReq) (*InitRsp, error)

	// Join 客户端加入
	Join(c entity.Context, req *JoinReq) (*JoinRsp, error)

	// Progress 客户端上报加载进度
	Progress(c entity.Context, req *ProgressReq) error

	// Ready 客户端准备好
	Ready(c entity.Context, req *ReadyReq) error

	// Input 客户端的操作
	Input(c entity.Context, req *InputReq) error

	// GameOver 上报结束
	GameOver(c entity.Context, req *GameOverReq) error
}

FrameSeverEntity

type GameOverReq

type GameOverReq struct {
	Id     uint64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
	Result int32  `protobuf:"varint,2,opt,name=Result,proto3" json:"Result,omitempty"`
	// contains filtered or unexported fields
}

func (*GameOverReq) Descriptor deprecated

func (*GameOverReq) Descriptor() ([]byte, []int)

Deprecated: Use GameOverReq.ProtoReflect.Descriptor instead.

func (*GameOverReq) GetId

func (x *GameOverReq) GetId() uint64

func (*GameOverReq) GetResult

func (x *GameOverReq) GetResult() int32

func (*GameOverReq) ProtoMessage

func (*GameOverReq) ProtoMessage()

func (*GameOverReq) ProtoReflect

func (x *GameOverReq) ProtoReflect() protoreflect.Message

func (*GameOverReq) Reset

func (x *GameOverReq) Reset()

func (*GameOverReq) String

func (x *GameOverReq) String() string

type HeartbeatReq

type HeartbeatReq struct {
	Id uint64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
	// contains filtered or unexported fields
}

func (*HeartbeatReq) Descriptor deprecated

func (*HeartbeatReq) Descriptor() ([]byte, []int)

Deprecated: Use HeartbeatReq.ProtoReflect.Descriptor instead.

func (*HeartbeatReq) GetId

func (x *HeartbeatReq) GetId() uint64

func (*HeartbeatReq) ProtoMessage

func (*HeartbeatReq) ProtoMessage()

func (*HeartbeatReq) ProtoReflect

func (x *HeartbeatReq) ProtoReflect() protoreflect.Message

func (*HeartbeatReq) Reset

func (x *HeartbeatReq) Reset()

func (*HeartbeatReq) String

func (x *HeartbeatReq) String() string

type HeartbeatRsp

type HeartbeatRsp struct {
	// contains filtered or unexported fields
}

func (*HeartbeatRsp) Descriptor deprecated

func (*HeartbeatRsp) Descriptor() ([]byte, []int)

Deprecated: Use HeartbeatRsp.ProtoReflect.Descriptor instead.

func (*HeartbeatRsp) ProtoMessage

func (*HeartbeatRsp) ProtoMessage()

func (*HeartbeatRsp) ProtoReflect

func (x *HeartbeatRsp) ProtoReflect() protoreflect.Message

func (*HeartbeatRsp) Reset

func (x *HeartbeatRsp) Reset()

func (*HeartbeatRsp) String

func (x *HeartbeatRsp) String() string

type InitReq

type InitReq struct {
	PlayerNum int32 `protobuf:"varint,1,opt,name=PlayerNum,proto3" json:"PlayerNum,omitempty"`
	// contains filtered or unexported fields
}

func (*InitReq) Descriptor deprecated

func (*InitReq) Descriptor() ([]byte, []int)

Deprecated: Use InitReq.ProtoReflect.Descriptor instead.

func (*InitReq) GetPlayerNum

func (x *InitReq) GetPlayerNum() int32

func (*InitReq) ProtoMessage

func (*InitReq) ProtoMessage()

func (*InitReq) ProtoReflect

func (x *InitReq) ProtoReflect() protoreflect.Message

func (*InitReq) Reset

func (x *InitReq) Reset()

func (*InitReq) String

func (x *InitReq) String() string

type InitRsp

type InitRsp struct {
	// contains filtered or unexported fields
}

func (*InitRsp) Descriptor deprecated

func (*InitRsp) Descriptor() ([]byte, []int)

Deprecated: Use InitRsp.ProtoReflect.Descriptor instead.

func (*InitRsp) ProtoMessage

func (*InitRsp) ProtoMessage()

func (*InitRsp) ProtoReflect

func (x *InitRsp) ProtoReflect() protoreflect.Message

func (*InitRsp) Reset

func (x *InitRsp) Reset()

func (*InitRsp) String

func (x *InitRsp) String() string

type InputData

type InputData struct {
	OPID OPID      `protobuf:"varint,1,opt,name=OPID,proto3,enum=frameproto.OPID" json:"OPID,omitempty"` //操作id
	Pos  *Position `protobuf:"bytes,2,opt,name=Pos,proto3" json:"Pos,omitempty"`                         //操作位置
	// contains filtered or unexported fields
}

func (*InputData) Descriptor deprecated

func (*InputData) Descriptor() ([]byte, []int)

Deprecated: Use InputData.ProtoReflect.Descriptor instead.

func (*InputData) GetOPID

func (x *InputData) GetOPID() OPID

func (*InputData) GetPos

func (x *InputData) GetPos() *Position

func (*InputData) ProtoMessage

func (*InputData) ProtoMessage()

func (*InputData) ProtoReflect

func (x *InputData) ProtoReflect() protoreflect.Message

func (*InputData) Reset

func (x *InputData) Reset()

func (*InputData) String

func (x *InputData) String() string

type InputReq

type InputReq struct {
	Id    uint64     `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
	Input *InputData `protobuf:"bytes,2,opt,name=Input,proto3" json:"Input,omitempty"`
	// contains filtered or unexported fields
}

client input

func (*InputReq) Descriptor deprecated

func (*InputReq) Descriptor() ([]byte, []int)

Deprecated: Use InputReq.ProtoReflect.Descriptor instead.

func (*InputReq) GetId

func (x *InputReq) GetId() uint64

func (*InputReq) GetInput

func (x *InputReq) GetInput() *InputData

func (*InputReq) ProtoMessage

func (*InputReq) ProtoMessage()

func (*InputReq) ProtoReflect

func (x *InputReq) ProtoReflect() protoreflect.Message

func (*InputReq) Reset

func (x *InputReq) Reset()

func (*InputReq) String

func (x *InputReq) String() string

type JoinReq

type JoinReq struct {
	Id uint64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
	// contains filtered or unexported fields
}

func (*JoinReq) Descriptor deprecated

func (*JoinReq) Descriptor() ([]byte, []int)

Deprecated: Use JoinReq.ProtoReflect.Descriptor instead.

func (*JoinReq) GetId

func (x *JoinReq) GetId() uint64

func (*JoinReq) ProtoMessage

func (*JoinReq) ProtoMessage()

func (*JoinReq) ProtoReflect

func (x *JoinReq) ProtoReflect() protoreflect.Message

func (*JoinReq) Reset

func (x *JoinReq) Reset()

func (*JoinReq) String

func (x *JoinReq) String() string

type JoinRsp

type JoinRsp struct {
	// contains filtered or unexported fields
}

func (*JoinRsp) Descriptor deprecated

func (*JoinRsp) Descriptor() ([]byte, []int)

Deprecated: Use JoinRsp.ProtoReflect.Descriptor instead.

func (*JoinRsp) ProtoMessage

func (*JoinRsp) ProtoMessage()

func (*JoinRsp) ProtoReflect

func (x *JoinRsp) ProtoReflect() protoreflect.Message

func (*JoinRsp) Reset

func (x *JoinRsp) Reset()

func (*JoinRsp) String

func (x *JoinRsp) String() string

type OPID

type OPID int32
const (
	OPID_None OPID = 0
	OPID_Move OPID = 1
)

func (OPID) Descriptor

func (OPID) Descriptor() protoreflect.EnumDescriptor

func (OPID) Enum

func (x OPID) Enum() *OPID

func (OPID) EnumDescriptor deprecated

func (OPID) EnumDescriptor() ([]byte, []int)

Deprecated: Use OPID.Descriptor instead.

func (OPID) Number

func (x OPID) Number() protoreflect.EnumNumber

func (OPID) String

func (x OPID) String() string

func (OPID) Type

func (OPID) Type() protoreflect.EnumType

type Position

type Position struct {
	X int32 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"`
	Y int32 `protobuf:"varint,2,opt,name=y,proto3" json:"y,omitempty"`
	Z int32 `protobuf:"varint,3,opt,name=z,proto3" json:"z,omitempty"`
	// contains filtered or unexported fields
}

func (*Position) Descriptor deprecated

func (*Position) Descriptor() ([]byte, []int)

Deprecated: Use Position.ProtoReflect.Descriptor instead.

func (*Position) GetX

func (x *Position) GetX() int32

func (*Position) GetY

func (x *Position) GetY() int32

func (*Position) GetZ

func (x *Position) GetZ() int32

func (*Position) ProtoMessage

func (*Position) ProtoMessage()

func (*Position) ProtoReflect

func (x *Position) ProtoReflect() protoreflect.Message

func (*Position) Reset

func (x *Position) Reset()

func (*Position) String

func (x *Position) String() string

type ProgressReq

type ProgressReq struct {
	Id              uint64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
	LoadingProgress int32  `protobuf:"varint,2,opt,name=LoadingProgress,proto3" json:"LoadingProgress,omitempty"`
	// contains filtered or unexported fields
}

func (*ProgressReq) Descriptor deprecated

func (*ProgressReq) Descriptor() ([]byte, []int)

Deprecated: Use ProgressReq.ProtoReflect.Descriptor instead.

func (*ProgressReq) GetId

func (x *ProgressReq) GetId() uint64

func (*ProgressReq) GetLoadingProgress

func (x *ProgressReq) GetLoadingProgress() int32

func (*ProgressReq) ProtoMessage

func (*ProgressReq) ProtoMessage()

func (*ProgressReq) ProtoReflect

func (x *ProgressReq) ProtoReflect() protoreflect.Message

func (*ProgressReq) Reset

func (x *ProgressReq) Reset()

func (*ProgressReq) String

func (x *ProgressReq) String() string

type ReadyReq

type ReadyReq struct {
	Id uint64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadyReq) Descriptor deprecated

func (*ReadyReq) Descriptor() ([]byte, []int)

Deprecated: Use ReadyReq.ProtoReflect.Descriptor instead.

func (*ReadyReq) GetId

func (x *ReadyReq) GetId() uint64

func (*ReadyReq) ProtoMessage

func (*ReadyReq) ProtoMessage()

func (*ReadyReq) ProtoReflect

func (x *ReadyReq) ProtoReflect() protoreflect.Message

func (*ReadyReq) Reset

func (x *ReadyReq) Reset()

func (*ReadyReq) String

func (x *ReadyReq) String() string

type StartReq

type StartReq struct {
	// contains filtered or unexported fields
}

func (*StartReq) Descriptor deprecated

func (*StartReq) Descriptor() ([]byte, []int)

Deprecated: Use StartReq.ProtoReflect.Descriptor instead.

func (*StartReq) ProtoMessage

func (*StartReq) ProtoMessage()

func (*StartReq) ProtoReflect

func (x *StartReq) ProtoReflect() protoreflect.Message

func (*StartReq) Reset

func (x *StartReq) Reset()

func (*StartReq) String

func (x *StartReq) String() string

Jump to

Keyboard shortcuts

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