Documentation
¶
Index ¶
- Variables
- func RegisterFrameClientEntity(etyMgr *entity.EntityManager, impl FrameClientEntity)
- func RegisterFrameSeverEntity(etyMgr *entity.EntityManager, impl FrameSeverEntity)
- type Frame
- type FrameClient
- type FrameClientEntity
- type FrameData
- type FrameReq
- type FrameSever
- func (t *FrameSever) GameOver(c entity.Context, req *GameOverReq) error
- func (t *FrameSever) Heartbeat(c entity.Context, req *HeartbeatReq) (*HeartbeatRsp, error)
- func (t *FrameSever) Init(c entity.Context, req *InitReq) (*InitRsp, error)
- func (t *FrameSever) Input(c entity.Context, req *InputReq) error
- func (t *FrameSever) Join(c entity.Context, req *JoinReq) (*JoinRsp, error)
- func (t *FrameSever) Progress(c entity.Context, req *ProgressReq) error
- func (t *FrameSever) Ready(c entity.Context, req *ReadyReq) error
- type FrameSeverEntity
- type GameOverReq
- type HeartbeatReq
- type HeartbeatRsp
- type InitReq
- type InitRsp
- type InputData
- type InputReq
- type JoinReq
- type JoinRsp
- type OPID
- type Position
- func (*Position) Descriptor() ([]byte, []int)deprecated
- func (x *Position) GetX() int32
- func (x *Position) GetY() int32
- func (x *Position) GetZ() int32
- func (*Position) ProtoMessage()
- func (x *Position) ProtoReflect() protoreflect.Message
- func (x *Position) Reset()
- func (x *Position) String() string
- type ProgressReq
- func (*ProgressReq) Descriptor() ([]byte, []int)deprecated
- func (x *ProgressReq) GetId() uint64
- func (x *ProgressReq) GetLoadingProgress() int32
- func (*ProgressReq) ProtoMessage()
- func (x *ProgressReq) ProtoReflect() protoreflect.Message
- func (x *ProgressReq) Reset()
- func (x *ProgressReq) String() string
- type ReadyReq
- type StartReq
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) GetFrameID ¶
func (*Frame) ProtoMessage ¶
func (*Frame) ProtoMessage()
func (*Frame) ProtoReflect ¶
func (x *Frame) ProtoReflect() protoreflect.Message
type FrameClient ¶
func NewFrameClient ¶
func NewFrameClient(c entity.Context) (*FrameClient, error)
func NewFrameClientClient ¶
func NewFrameClientClient(eid entity.EntityID) *FrameClient
func NewFrameClientWithID ¶
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
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) ProtoMessage ¶
func (*FrameData) ProtoMessage()
func (*FrameData) ProtoReflect ¶
func (x *FrameData) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*FrameReq) ProtoMessage()
func (*FrameReq) ProtoReflect ¶
func (x *FrameReq) ProtoReflect() protoreflect.Message
type FrameSever ¶
func NewFrameSever ¶
func NewFrameSever(c entity.Context) (*FrameSever, error)
func NewFrameSeverClient ¶
func NewFrameSeverClient(eid entity.EntityID) *FrameSever
func NewFrameSeverWithID ¶
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) Progress ¶
func (t *FrameSever) Progress(c entity.Context, req *ProgressReq) 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) GetPlayerNum ¶
func (*InitReq) ProtoMessage ¶
func (*InitReq) ProtoMessage()
func (*InitReq) ProtoReflect ¶
func (x *InitReq) ProtoReflect() protoreflect.Message
type InitRsp ¶
type InitRsp struct {
// contains filtered or unexported fields
}
func (*InitRsp) Descriptor
deprecated
func (*InitRsp) ProtoMessage ¶
func (*InitRsp) ProtoMessage()
func (*InitRsp) ProtoReflect ¶
func (x *InitRsp) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*InputData) ProtoMessage()
func (*InputData) ProtoReflect ¶
func (x *InputData) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*InputReq) ProtoMessage()
func (*InputReq) ProtoReflect ¶
func (x *InputReq) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*JoinReq) ProtoMessage()
func (*JoinReq) ProtoReflect ¶
func (x *JoinReq) ProtoReflect() protoreflect.Message
type JoinRsp ¶
type JoinRsp struct {
// contains filtered or unexported fields
}
func (*JoinRsp) Descriptor
deprecated
func (*JoinRsp) ProtoMessage ¶
func (*JoinRsp) ProtoMessage()
func (*JoinRsp) ProtoReflect ¶
func (x *JoinRsp) ProtoReflect() protoreflect.Message
type OPID ¶
type OPID int32
func (OPID) Descriptor ¶
func (OPID) Descriptor() protoreflect.EnumDescriptor
func (OPID) EnumDescriptor
deprecated
func (OPID) Number ¶
func (x OPID) Number() protoreflect.EnumNumber
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) ProtoMessage ¶
func (*Position) ProtoMessage()
func (*Position) ProtoReflect ¶
func (x *Position) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*ReadyReq) ProtoMessage()
func (*ReadyReq) ProtoReflect ¶
func (x *ReadyReq) ProtoReflect() protoreflect.Message
type StartReq ¶
type StartReq struct {
// contains filtered or unexported fields
}
func (*StartReq) Descriptor
deprecated
func (*StartReq) ProtoMessage ¶
func (*StartReq) ProtoMessage()
func (*StartReq) ProtoReflect ¶
func (x *StartReq) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.