52 lines
1.2 KiB
Go
52 lines
1.2 KiB
Go
package gameinvite
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/modules"
|
|
)
|
|
|
|
type GameInvite struct {
|
|
modules.ModuleBase
|
|
service comm.IService
|
|
api *apiComp
|
|
model *modelComp
|
|
dcolor comm.IDColor
|
|
}
|
|
|
|
func NewModule() core.IModule {
|
|
return &GameInvite{}
|
|
}
|
|
|
|
func (this *GameInvite) GetType() core.M_Modules {
|
|
return comm.ModuleGameInvite
|
|
}
|
|
|
|
func (this *GameInvite) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
|
if err = this.ModuleBase.Init(service, module, options); err != nil {
|
|
return
|
|
}
|
|
this.service = service.(comm.IService)
|
|
return
|
|
}
|
|
|
|
func (this *GameInvite) OnInstallComp() {
|
|
this.ModuleBase.OnInstallComp()
|
|
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
|
this.model = this.RegisterComp(new(modelComp)).(*modelComp)
|
|
}
|
|
func (this *GameInvite) Start() (err error) {
|
|
if err = this.ModuleBase.Start(); err != nil {
|
|
return
|
|
}
|
|
var module core.IModule
|
|
if module, err = this.service.GetModule(comm.ModuleDcolor); err != nil {
|
|
return
|
|
}
|
|
this.dcolor = module.(comm.IDColor)
|
|
return
|
|
}
|
|
func (this *GameInvite) GameInviteEnd(gtype int32, uid string) {
|
|
this.model.endQiecuo(gtype, uid)
|
|
}
|