34 lines
1005 B
Go
34 lines
1005 B
Go
package modules
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/pb"
|
|
cfg "go_dreamfactory/sys/configure/structs"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
type (
|
|
//业务模块基类接口 定义所有业务模块都可以使用的接口
|
|
IModule interface {
|
|
core.IModule
|
|
//获取用户对象
|
|
GetUserSession(uid string) (session comm.IUserSession, ok bool)
|
|
//归还会话对象
|
|
PutUserSession(session comm.IUserSession)
|
|
//向指定用户发送消息
|
|
SendMsgToUser(mainType, subType string, msg proto.Message, uid string) (err error)
|
|
//向多个用户发送消息
|
|
SendMsgToUsers(mainType, subType string, msg proto.Message, uids ...string) (err error)
|
|
SendMsgToCUsers(mainType, subType string, msg proto.Message, users ...*pb.CacheUser) (err error)
|
|
//校验消耗资源
|
|
CheckConsumeRes(uid string, res []*cfg.Gameatn) (errdata *pb.ErrorData)
|
|
}
|
|
|
|
IMatchComp interface {
|
|
core.IModuleComp
|
|
MatchNotic(player map[string]interface{}) (err error)
|
|
}
|
|
)
|