48 lines
986 B
Go
48 lines
986 B
Go
package entertainment
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) MatchCheck(session comm.IUserSession, req *pb.EntertainMatchReq) (errdata *pb.ErrorData) {
|
|
if req.Idcard == "" {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_ReqParameterError,
|
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
|
}
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) Match(session comm.IUserSession, req *pb.EntertainMatchReq) (errdata *pb.ErrorData) {
|
|
var (
|
|
user *pb.DBUser
|
|
err error
|
|
)
|
|
user, err = this.module.ModuleUser.GetUser(session.GetUserId())
|
|
if err != nil {
|
|
|
|
}
|
|
this.module.match.MatchReq(&pb.DBXXLMatch{
|
|
Userinfo: &pb.BaseUserInfo{
|
|
Uid: user.Uid,
|
|
Sid: user.Sid,
|
|
Name: user.Name,
|
|
Gender: 0,
|
|
Skin: user.CurSkin,
|
|
Aframe: "",
|
|
Title: user.Curtitle,
|
|
Lv: user.Lv,
|
|
},
|
|
Cardid: req.Idcard,
|
|
})
|
|
|
|
session.SendMsg(string(this.module.GetType()), "match", &pb.EntertainMatchResp{
|
|
Maych: true,
|
|
})
|
|
return
|
|
}
|