28 lines
697 B
Go
28 lines
697 B
Go
package entertainment
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) ReadyCheck(session comm.IUserSession, req *pb.EntertainReadyReq) (errdata *pb.ErrorData) {
|
|
if req.Roomid == "" {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_ReqParameterError,
|
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) Ready(session comm.IUserSession, req *pb.EntertainReadyReq) (errdata *pb.ErrorData) {
|
|
|
|
if errdata = this.module.gameMgr.RoomDistribute(req.Roomid, session, "ready", req); errdata == nil {
|
|
session.SendMsg(string(this.module.GetType()), "ready", &pb.EntertainReadyResp{
|
|
Ready: true,
|
|
})
|
|
}
|
|
return
|
|
}
|