30 lines
745 B
Go
30 lines
745 B
Go
package entertainment
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) OperatorCheck(session comm.IUserSession, req *pb.EntertainOperatorReq) (errdata *pb.ErrorData) {
|
|
if req.Roomid == "" {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_ReqParameterError,
|
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) Operator(session comm.IUserSession, req *pb.EntertainOperatorReq) (errdata *pb.ErrorData) {
|
|
|
|
if errdata = this.module.gameMgr.RoomDistribute(req.Roomid, session, "operator", req); errdata == nil {
|
|
// 操作消息返回
|
|
session.SendMsg(string(this.module.GetType()), "operator", &pb.EntertainOperatorResp{
|
|
Success: true,
|
|
})
|
|
}
|
|
|
|
return
|
|
}
|