game

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func RegisterAllComponents

func RegisterAllComponents(s *gogs.App, srv Component)

Types

type BaseWorld

type BaseWorld struct {

	// 绑定玩家
	BindUser *BindUser `protobuf:"bytes,1,opt,name=BindUser,proto3" json:"BindUser,omitempty"`
	// 玩家加入世界
	JoinWorld *JoinWorld `protobuf:"bytes,2,opt,name=JoinWorld,proto3" json:"JoinWorld,omitempty"`
	// 通知其他玩家用户加入世界
	JoinWorldNotify *JoinWorldNotify `protobuf:"bytes,3,opt,name=JoinWorldNotify,proto3" json:"JoinWorldNotify,omitempty"`
	// 玩家更新位置
	UpdateUserInWorld *UpdateUserInWorld `protobuf:"bytes,4,opt,name=UpdateUserInWorld,proto3" json:"UpdateUserInWorld,omitempty"`
	// 返回绑定成功熊希
	BindSuccess *BindSuccess `protobuf:"bytes,5,opt,name=BindSuccess,proto3" json:"BindSuccess,omitempty"`
	// 加入世界成功
	JoinWorldSuccess *JoinWorldSuccess `protobuf:"bytes,6,opt,name=JoinWorldSuccess,proto3" json:"JoinWorldSuccess,omitempty"`
	// contains filtered or unexported fields
}

func (*BaseWorld) Descriptor deprecated

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

Deprecated: Use BaseWorld.ProtoReflect.Descriptor instead.

func (*BaseWorld) GetBindSuccess

func (x *BaseWorld) GetBindSuccess() *BindSuccess

func (*BaseWorld) GetBindUser

func (x *BaseWorld) GetBindUser() *BindUser

func (*BaseWorld) GetJoinWorld

func (x *BaseWorld) GetJoinWorld() *JoinWorld

func (*BaseWorld) GetJoinWorldNotify

func (x *BaseWorld) GetJoinWorldNotify() *JoinWorldNotify

func (*BaseWorld) GetJoinWorldSuccess

func (x *BaseWorld) GetJoinWorldSuccess() *JoinWorldSuccess

func (*BaseWorld) GetUpdateUserInWorld

func (x *BaseWorld) GetUpdateUserInWorld() *UpdateUserInWorld

func (*BaseWorld) ProtoMessage

func (*BaseWorld) ProtoMessage()

func (*BaseWorld) ProtoReflect

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

func (*BaseWorld) Reset

func (x *BaseWorld) Reset()

func (*BaseWorld) String

func (x *BaseWorld) String() string

type BindSuccess

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

@gogs:ServerMessage

func (*BindSuccess) Descriptor deprecated

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

Deprecated: Use BindSuccess.ProtoReflect.Descriptor instead.

func (*BindSuccess) ProtoMessage

func (*BindSuccess) ProtoMessage()

func (*BindSuccess) ProtoReflect

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

func (*BindSuccess) Reset

func (x *BindSuccess) Reset()

func (*BindSuccess) String

func (x *BindSuccess) String() string

type BindUser

type BindUser struct {
	Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	// contains filtered or unexported fields
}

绑定所有session到同一个Player上

func (*BindUser) Descriptor deprecated

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

Deprecated: Use BindUser.ProtoReflect.Descriptor instead.

func (*BindUser) GetUid

func (x *BindUser) GetUid() string

func (*BindUser) ProtoMessage

func (*BindUser) ProtoMessage()

func (*BindUser) ProtoReflect

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

func (*BindUser) Reset

func (x *BindUser) Reset()

func (*BindUser) String

func (x *BindUser) String() string

type Component

type Component interface {
	BindUser(ctx context.Context, s *session.Session, in *BindUser)

	JoinWorld(ctx context.Context, s *session.Session, in *JoinWorld)

	UpdateUserInWorld(ctx context.Context, s *session.Session, in *UpdateUserInWorld)
}

type Components

type Components struct {
	BaseWorld *BaseWorld `protobuf:"bytes,1,opt,name=BaseWorld,proto3" json:"BaseWorld,omitempty"`
	// contains filtered or unexported fields
}

@gogs:Components

func (*Components) Descriptor deprecated

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

Deprecated: Use Components.ProtoReflect.Descriptor instead.

func (*Components) GetBaseWorld

func (x *Components) GetBaseWorld() *BaseWorld

func (*Components) ProtoMessage

func (*Components) ProtoMessage()

func (*Components) ProtoReflect

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

func (*Components) Reset

func (x *Components) Reset()

func (*Components) String

func (x *Components) String() string

type JoinWorld

type JoinWorld struct {
	Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	// contains filtered or unexported fields
}

func (*JoinWorld) Descriptor deprecated

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

Deprecated: Use JoinWorld.ProtoReflect.Descriptor instead.

func (*JoinWorld) GetUid

func (x *JoinWorld) GetUid() string

func (*JoinWorld) ProtoMessage

func (*JoinWorld) ProtoMessage()

func (*JoinWorld) ProtoReflect

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

func (*JoinWorld) Reset

func (x *JoinWorld) Reset()

func (*JoinWorld) String

func (x *JoinWorld) String() string

type JoinWorldNotify

type JoinWorldNotify struct {
	Uid  string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

@gogs:ServerMessage

func (*JoinWorldNotify) Descriptor deprecated

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

Deprecated: Use JoinWorldNotify.ProtoReflect.Descriptor instead.

func (*JoinWorldNotify) GetName

func (x *JoinWorldNotify) GetName() string

func (*JoinWorldNotify) GetUid

func (x *JoinWorldNotify) GetUid() string

func (*JoinWorldNotify) ProtoMessage

func (*JoinWorldNotify) ProtoMessage()

func (*JoinWorldNotify) ProtoReflect

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

func (*JoinWorldNotify) Reset

func (x *JoinWorldNotify) Reset()

func (*JoinWorldNotify) String

func (x *JoinWorldNotify) String() string

type JoinWorldSuccess

type JoinWorldSuccess struct {
	Uids []string `protobuf:"bytes,1,rep,name=uids,proto3" json:"uids,omitempty"`
	// contains filtered or unexported fields
}

@gogs:ServerMessage

func (*JoinWorldSuccess) Descriptor deprecated

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

Deprecated: Use JoinWorldSuccess.ProtoReflect.Descriptor instead.

func (*JoinWorldSuccess) GetUids

func (x *JoinWorldSuccess) GetUids() []string

func (*JoinWorldSuccess) ProtoMessage

func (*JoinWorldSuccess) ProtoMessage()

func (*JoinWorldSuccess) ProtoReflect

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

func (*JoinWorldSuccess) Reset

func (x *JoinWorldSuccess) Reset()

func (*JoinWorldSuccess) String

func (x *JoinWorldSuccess) String() string

type UpdateUserInWorld

type UpdateUserInWorld struct {
	Uid      string   `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	Position *Vecotr3 `protobuf:"bytes,2,opt,name=position,proto3" json:"position,omitempty"`
	// contains filtered or unexported fields
}

更新用户在世界中的位置

func (*UpdateUserInWorld) Descriptor deprecated

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

Deprecated: Use UpdateUserInWorld.ProtoReflect.Descriptor instead.

func (*UpdateUserInWorld) GetPosition

func (x *UpdateUserInWorld) GetPosition() *Vecotr3

func (*UpdateUserInWorld) GetUid

func (x *UpdateUserInWorld) GetUid() string

func (*UpdateUserInWorld) ProtoMessage

func (*UpdateUserInWorld) ProtoMessage()

func (*UpdateUserInWorld) ProtoReflect

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

func (*UpdateUserInWorld) Reset

func (x *UpdateUserInWorld) Reset()

func (*UpdateUserInWorld) String

func (x *UpdateUserInWorld) String() string

type Vecotr3

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

func (*Vecotr3) Descriptor deprecated

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

Deprecated: Use Vecotr3.ProtoReflect.Descriptor instead.

func (*Vecotr3) GetX

func (x *Vecotr3) GetX() float32

func (*Vecotr3) GetY

func (x *Vecotr3) GetY() float32

func (*Vecotr3) GetZ

func (x *Vecotr3) GetZ() float32

func (*Vecotr3) ProtoMessage

func (*Vecotr3) ProtoMessage()

func (*Vecotr3) ProtoReflect

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

func (*Vecotr3) Reset

func (x *Vecotr3) Reset()

func (*Vecotr3) String

func (x *Vecotr3) String() string

Jump to

Keyboard shortcuts

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