gdcore

package
v0.0.0-...-7424bbb Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashMd5

func HashMd5(data string) string

HashMd5 HashMd5

func InvalidName

func InvalidName(in string) string

InvalidName InvalidName

func NewSkeleton

func NewSkeleton() *module.Skeleton

NewSkeleton NewSkeleton

func TryCatch

func TryCatch(f func()) (err error)

TryCatch TryCatch

Types

type Assembly

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

Assembly Assembly

func NewAssembly

func NewAssembly() *Assembly

NewAssembly NewAssembly

func (*Assembly) FindType

func (its *Assembly) FindType(name string) *TypeInfo

FindType FindType

func (*Assembly) GetAllType

func (its *Assembly) GetAllType() (result []*TypeInfo)

GetAllType GetAllType

func (*Assembly) New

func (its *Assembly) New(name string) interface{}

New New

func (*Assembly) RegistType

func (its *Assembly) RegistType(v interface{}, attrs ...interface{})

RegistType RegistType

type Delegator

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

Delegator Delegator

type EffectBase

type EffectBase struct {
	Value float64
	// contains filtered or unexported fields
}

EffectBase EffectBase

func (*EffectBase) Execute

func (its *EffectBase) Execute(args ...reflect.Value) (result []reflect.Value)

Execute Execute

func (*EffectBase) Init

func (its *EffectBase) Init(args ...interface{}) error

Init Init

type EffectCollector

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

EffectCollector EffectCollector

func NewEffectCollector

func NewEffectCollector() *EffectCollector

NewEffectCollector NewEffectCollector

func (*EffectCollector) Controller

func (its *EffectCollector) Controller(target, id interface{}, keys ...interface{}) func(source interface{}, args ...interface{}) *EffectResponse

Controller Controller

func (*EffectCollector) NewTarget

func (its *EffectCollector) NewTarget(assembly IAssembly, name string, args ...interface{}) error

NewTarget NewTarget

type EffectController

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

EffectController EffectController

func NewEffectController

func NewEffectController() *EffectController

NewEffectController NewEffectController

func (*EffectController) NewEffect

func (its *EffectController) NewEffect(assembly IAssembly, name string, args ...interface{}) error

NewEffect NewEffect

func (*EffectController) Source

func (its *EffectController) Source(source interface{}, keys ...interface{}) *EffectExecutor

Source Source

type EffectCtrlMgr

type EffectCtrlMgr map[interface{}]*EffectController

EffectCtrlMgr EffectCtrlMgr

func (EffectCtrlMgr) Controller

func (its EffectCtrlMgr) Controller(key interface{}) *EffectController

Controller Controller

type EffectExecutor

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

EffectExecutor EffectExecutor

func (*EffectExecutor) Do

func (its *EffectExecutor) Do(args ...interface{}) (resp *EffectResponse)

Do Do

type EffectResponse

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

EffectResponse EffectResponse

func (*EffectResponse) Result

func (its *EffectResponse) Result(fun interface{}) error

Result Result

type EventBase

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

EventBase EventBase

func NewEventBase

func NewEventBase(s ISession, sender interface{}) *EventBase

NewEventBase NewEventBase

func (*EventBase) Sender

func (its *EventBase) Sender() interface{}

Sender Sender

func (*EventBase) Session

func (its *EventBase) Session() ISession

Session Session

type EventCollector

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

EventCollector EventCollector

func NewEventCollector

func NewEventCollector(s ISession) *EventCollector

NewEventCollector NewEventCollector

func (*EventCollector) Bind

func (its *EventCollector) Bind(k, v, o interface{}) error

Bind Bind

func (*EventCollector) Call

func (its *EventCollector) Call(sender, event interface{}) error

Call Call

func (*EventCollector) Regist

func (its *EventCollector) Regist(k, v interface{}) error

Regist Regist

func (*EventCollector) UnBind

func (its *EventCollector) UnBind(k, o interface{}) error

UnBind UnBind

func (*EventCollector) UnRegist

func (its *EventCollector) UnRegist(k, v interface{}) error

UnRegist UnRegist

type IActivity

type IActivity interface {
	GetStatus() int32
	MemberStatus(uint64) int32
	SetMemberStatus(uint64, int32)
}

IActivity IActivity

type IAgent

type IAgent interface {
	SendBytes(bytes [][]byte)
	Send(int32, interface{})
	UserData() interface{}
	SetUserData(interface{})
	Close()
}

IAgent IAgent

type IAssembly

type IAssembly interface {
	New(string) interface{}
	FindType(string) *TypeInfo
	GetAllType() []*TypeInfo
	RegistType(interface{}, ...interface{})
}

IAssembly IAssembly

type ICommand

type ICommand interface {
	Name() string
	Help() string
	Run(in *Value, roleID uint64) string
}

ICommand ICommand

type ICondition

type ICondition interface {
	Init(s ISession, args ...interface{}) []uint64
	Load(s ISession, ids []uint64, args ...interface{})
	Check(s ISession) bool
	OnRemove(s ISession)
	Step(s ISession) float64
}

ICondition ICondition

type IEffect

type IEffect interface {
	Init(args ...interface{}) error
	Execute(args ...reflect.Value) []reflect.Value
	Work() interface{}
}

IEffect IEffect

type IEvent

type IEvent interface {
	Session() ISession
	Sender() interface{}
}

IEvent IEvent

type IFMP

type IFMP interface {
	Parse() []interface{}
}

IFMP IFMP

type IFilter

type IFilter interface {
	Check(*NoArg, *NoReturn) error
}

IFilter IFilter

type IModule

type IModule interface {
	AfterFunc(time.Duration, func()) *timer.Timer
	CronFunc(*timer.CronExpr, func()) *timer.Cron
	Go(func(), func())
	RegisterChanRPC(interface{}, interface{})
	ChanCall(interface{}, ...interface{})
}

IModule IModule

type IService

type IService interface {
	OnLoad()
	OnClose()
	OnUpdate(time.Duration)
}

IService IService

type ISession

type ISession interface {
	Add(interface{})
	GetService(interface{}) interface{}
	ForeachService(func(IUserService))
	RoleID() uint64
	Agent() IAgent
	Bind(IAgent)
	UnBind(IAgent)
	Ping()
	IsPingTimeout() bool
	IsTimeout() bool
	Close()
	Dispatch(sender, event interface{})
	Off(k, v interface{}) error
	On(k, v interface{}) error
	BindOff(k, o interface{}) error
	BindOn(k, v, o interface{}) error
	KeepAlive()
	Effect() *EffectCollector
	Enable() bool
	Active()
	MakeCondition(id uint64, ptr interface{}, args ...interface{}) []uint64
	LoadCondition(id uint64, ptr interface{}, ids []uint64, args ...interface{})
	RemoveCondition(id uint64)
	FindCondition(id uint64) interface{}
}

ISession ISession

type IStep

type IStep interface {
	ZOrder() int
	Update(dt time.Duration)
	IsDone() bool
	Award(roleID uint64, pageID int, awardList, extraData string) error
}

IStep IStep

type ITarget

type ITarget interface {
	AddEffect(mgr EffectCtrlMgr, args ...interface{})
}

ITarget ITarget

type IUserService

type IUserService interface {
	OnLoad(ISession)
	OnLogin(ISession)
	OnLogout(ISession)
	OnUpdate(ISession)
}

IUserService IUserService

type Mask

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

Mask Mask

func NewMask

func NewMask() *Mask

NewMask NewMask

func (*Mask) Clone

func (its *Mask) Clone() *Mask

Clone Clone

func (*Mask) Data

func (its *Mask) Data() []uint32

Data Data

func (*Mask) ForeachMask

func (its *Mask) ForeachMask(fun func(int) bool)

ForeachMask ForeachMask

func (*Mask) ForeachUnmask

func (its *Mask) ForeachUnmask(fun func(int) bool)

ForeachUnmask ForeachUnmask

func (*Mask) FromData

func (its *Mask) FromData(v []uint32) *Mask

FromData FromData

func (*Mask) IsMask

func (its *Mask) IsMask(i uint) bool

IsMask IsMask

func (*Mask) SetMask

func (its *Mask) SetMask(i uint) *Mask

SetMask SetMask

func (*Mask) SetSize

func (its *Mask) SetSize(n int) *Mask

SetSize SetSize

func (*Mask) UnsetMask

func (its *Mask) UnsetMask(i uint) *Mask

UnsetMask UnsetMask

type NoArg

type NoArg struct {
}

NoArg NoArg

type NoReturn

type NoReturn struct {
}

NoReturn NoReturn

type SerialID

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

SerialID SerialID

func (*SerialID) Gen

func (its *SerialID) Gen() uint64

Gen Gen

func (*SerialID) Init

func (its *SerialID) Init(seed uint64)

Init Init

type ServiceBase

type ServiceBase struct {
}

ServiceBase ServiceBase

func (*ServiceBase) OnClose

func (its *ServiceBase) OnClose()

OnClose OnClose

func (*ServiceBase) OnLoad

func (its *ServiceBase) OnLoad()

OnLoad OnLoad

func (*ServiceBase) OnUpdate

func (its *ServiceBase) OnUpdate(_ time.Duration)

OnUpdate OnUpdate

type ServiceCollector

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

ServiceCollector ServiceCollector

func NewServiceCollector

func NewServiceCollector() *ServiceCollector

NewServiceCollector NewServiceCollector

func (*ServiceCollector) Add

func (its *ServiceCollector) Add(v interface{})

Add Add

func (*ServiceCollector) FindService

func (its *ServiceCollector) FindService(in interface{}) (interface{}, error)

FindService FindService

func (*ServiceCollector) GetAllService

func (its *ServiceCollector) GetAllService() []IService

GetAllService GetAllService

func (*ServiceCollector) GetAllUserService

func (its *ServiceCollector) GetAllUserService() []IUserService

GetAllUserService GetAllUserService

type Session

type Session struct {
	*ServiceCollector
	// contains filtered or unexported fields
}

Session Session

func NewSession

func NewSession(assembly IAssembly, roleID uint64) (result *Session)

NewSession NewSession

func (*Session) Active

func (its *Session) Active()

Active Active

func (*Session) Agent

func (its *Session) Agent() IAgent

Agent Agent

func (*Session) Bind

func (its *Session) Bind(a IAgent)

Bind Bind

func (*Session) BindOff

func (its *Session) BindOff(k, o interface{}) error

BindOff BindOff

func (*Session) BindOn

func (its *Session) BindOn(k, v, o interface{}) error

BindOn BindOn

func (*Session) Close

func (its *Session) Close()

Close Close

func (*Session) Dispatch

func (its *Session) Dispatch(sender, event interface{})

Dispatch Dispatch

func (*Session) Effect

func (its *Session) Effect() *EffectCollector

Effect Effect

func (*Session) Enable

func (its *Session) Enable() bool

Enable Enable

func (*Session) FindCondition

func (its *Session) FindCondition(id uint64) interface{}

FindCondition FindCondition

func (*Session) ForeachService

func (its *Session) ForeachService(fun func(IUserService))

ForeachService ForeachService

func (*Session) GetService

func (its *Session) GetService(in interface{}) interface{}

GetService GetService

func (*Session) IsPingTimeout

func (its *Session) IsPingTimeout() bool

IsPingTimeout IsPingTimeout

func (*Session) IsTimeout

func (its *Session) IsTimeout() bool

IsTimeout IsTimeout

func (*Session) KeepAlive

func (its *Session) KeepAlive()

KeepAlive KeepAlive

func (*Session) LoadCondition

func (its *Session) LoadCondition(id uint64, ptr interface{}, ids []uint64, args ...interface{})

LoadCondition LoadCondition

func (*Session) MakeCondition

func (its *Session) MakeCondition(id uint64, ptr interface{}, args ...interface{}) (result []uint64)

MakeCondition MakeCondition

func (*Session) Off

func (its *Session) Off(k, v interface{}) error

Off Off

func (*Session) On

func (its *Session) On(k, v interface{}) error

On On

func (*Session) Ping

func (its *Session) Ping()

Ping Ping

func (*Session) RemoveCondition

func (its *Session) RemoveCondition(id uint64)

RemoveCondition RemoveCondition

func (*Session) RoleID

func (its *Session) RoleID() uint64

RoleID RoleID

func (*Session) UnBind

func (its *Session) UnBind(a IAgent)

UnBind UnBind

type StepBase

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

StepBase StepBase

func (*StepBase) Activity

func (its *StepBase) Activity() IActivity

Activity Activity

func (*StepBase) Award

func (its *StepBase) Award(_ uint64, _ int, _ string) error

Award Award

func (*StepBase) IsDone

func (its *StepBase) IsDone() bool

IsDone IsDone

func (*StepBase) Update

func (its *StepBase) Update(_ time.Duration)

Update Update

func (*StepBase) ZOrder

func (its *StepBase) ZOrder() int

ZOrder ZOrder

type StepCollector

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

StepCollector StepCollector

func NewStepCollector

func NewStepCollector(activity IActivity) *StepCollector

NewStepCollector NewStepCollector

func (*StepCollector) CurStep

func (its *StepCollector) CurStep() IStep

CurStep CurStep

func (*StepCollector) Init

func (its *StepCollector) Init(assembly IAssembly, mp IFMP) *StepCollector

Init Init

func (*StepCollector) Update

func (its *StepCollector) Update(dt time.Duration)

Update Update

type TypeInfo

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

TypeInfo TypeInfo

func (*TypeInfo) GetAttributes

func (its *TypeInfo) GetAttributes() (result []interface{})

GetAttributes GetAttributes

func (*TypeInfo) GetProperties

func (its *TypeInfo) GetProperties() (result []*TypeMember)

GetProperties GetProperties

func (*TypeInfo) Name

func (its *TypeInfo) Name() string

Name Name

func (*TypeInfo) Type

func (its *TypeInfo) Type() reflect.Type

Type Type

type TypeMember

type TypeMember struct {
	Name string
	// contains filtered or unexported fields
}

TypeMember TypeMember

func (*TypeMember) Type

func (its *TypeMember) Type() reflect.Type

Type Type

type UUID

type UUID [16]byte

UUID UUID

func NewUUID

func NewUUID() UUID

NewUUID NewUUID

func (UUID) Hex

func (obj UUID) Hex() string

Hex Hex

type UserService

type UserService struct {
}

UserService UserService

func (*UserService) OnLoad

func (its *UserService) OnLoad(_ ISession)

OnLoad OnLoad

func (*UserService) OnLogin

func (its *UserService) OnLogin(_ ISession)

OnLogin OnLogin

func (*UserService) OnLogout

func (its *UserService) OnLogout(_ ISession)

OnLogout OnLogout

func (*UserService) OnUpdate

func (its *UserService) OnUpdate(_ ISession)

OnUpdate OnUpdate

type Value

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

Value Value

func NewValue

func NewValue(in map[string]string) *Value

NewValue NewValue

func (*Value) HelpText

func (its *Value) HelpText() string

HelpText HelpText

func (*Value) Int

func (its *Value) Int(name string, dfv ...int) int

Int Int

func (*Value) Set

func (its *Value) Set(name, value string)

Set Set

func (*Value) String

func (its *Value) String(name string, dfv ...string) string

String String

Jump to

Keyboard shortcuts

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