This commit is contained in:
meixiongfeng 2023-10-20 20:57:43 +08:00
commit c214107ff3
50 changed files with 1568 additions and 626 deletions

View File

@ -401,6 +401,7 @@ const ( //Rpc
Rpc_GatewayAgentUnBind core.Rpc_Key = "Rpc_GatewayAgentUnBind" //代理解绑 解绑用户Id Rpc_GatewayAgentUnBind core.Rpc_Key = "Rpc_GatewayAgentUnBind" //代理解绑 解绑用户Id
Rpc_GatewayAgentSendMsg core.Rpc_Key = "Rpc_GatewayAgentSendMsg" //代理发送消息 向用户发送消息 Rpc_GatewayAgentSendMsg core.Rpc_Key = "Rpc_GatewayAgentSendMsg" //代理发送消息 向用户发送消息
Rpc_GatewaySendBatchMsg core.Rpc_Key = "Rpc_GatewaySendBatchMsg" //向多个用户发送消息 Rpc_GatewaySendBatchMsg core.Rpc_Key = "Rpc_GatewaySendBatchMsg" //向多个用户发送消息
Rpc_GatewaySendBatchMsgByUid core.Rpc_Key = "Rpc_GatewaySendBatchMsgByUid" //向多个用户发送消息 查询uid
Rpc_GatewaySendRadioMsg core.Rpc_Key = "Rpc_GatewaySendRadioMsg" //广播消息 Rpc_GatewaySendRadioMsg core.Rpc_Key = "Rpc_GatewaySendRadioMsg" //广播消息
Rpc_GatewayAgentClose core.Rpc_Key = "Rpc_GatewayAgentClose" //代理关闭 关闭用户连接 Rpc_GatewayAgentClose core.Rpc_Key = "Rpc_GatewayAgentClose" //代理关闭 关闭用户连接
Rpc_GatewayNoticeUserLogin core.Rpc_Key = "Rpc_NoticeUserLogin" //通知用户登录 Rpc_GatewayNoticeUserLogin core.Rpc_Key = "Rpc_NoticeUserLogin" //通知用户登录

View File

@ -201,6 +201,7 @@ func UidToSTag(uid string) (stag string, err error) {
func GetUserBaseInfo(user *pb.DBUser) *pb.BaseUserInfo { func GetUserBaseInfo(user *pb.DBUser) *pb.BaseUserInfo {
info := &pb.BaseUserInfo{ info := &pb.BaseUserInfo{
Uid: user.Uid, Uid: user.Uid,
Sid: user.Sid,
Name: user.Name, Name: user.Name,
Gender: user.Gender, Gender: user.Gender,
Skin: user.CurSkin, Skin: user.CurSkin,

View File

@ -160,6 +160,8 @@ type (
IGetReddot IGetReddot
//获取本服用户数据 //获取本服用户数据
GetUser(uid string) (user *pb.DBUser, err error) GetUser(uid string) (user *pb.DBUser, err error)
//批量获取用户信息
GetCrossUsers(uid []string) (user []*pb.DBUser, err error)
//获取用户回话 //获取用户回话
GetUserSession(uid string) *pb.CacheUser GetUserSession(uid string) *pb.CacheUser
//批量查询用户会话数据 //批量查询用户会话数据

View File

@ -25,6 +25,6 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.DColorInfoReq) (err
return return
} }
session.SendMsg(string(this.module.GetType()), "singleover", &pb.DColorInfoResp{Info: info}) session.SendMsg(string(this.module.GetType()), "info", &pb.DColorInfoResp{Info: info})
return return
} }

View File

@ -14,7 +14,7 @@ func (this *apiComp) SingleCheck(session comm.IUserSession, req *pb.DColorSingle
func (this *apiComp) Single(session comm.IUserSession, req *pb.DColorSingleReq) (errdata *pb.ErrorData) { func (this *apiComp) Single(session comm.IUserSession, req *pb.DColorSingleReq) (errdata *pb.ErrorData) {
var ( var (
colors []pb.DBDColorColor colors []int32
) )
if errdata = this.SingleCheck(session, req); errdata != nil { if errdata = this.SingleCheck(session, req); errdata != nil {
return return

View File

@ -7,33 +7,24 @@ import (
) )
//随机颜色 //随机颜色
func RandomColor(difficulty pb.DBDColorDifficulty, Repeat bool) (temcolors []pb.DBDColorColor) { func RandomColor(difficulty pb.DBDColorDifficulty, Repeat bool) (temcolors []int32) {
var ( var (
colorNum int colorNum int
colors []pb.DBDColorColor = []pb.DBDColorColor{ colors []int32 = []int32{1, 2, 3, 4, 5, 6, 7, 8}
pb.DBDColorColor_Color_0,
pb.DBDColorColor_Color_1,
pb.DBDColorColor_Color_2,
pb.DBDColorColor_Color_3,
pb.DBDColorColor_Color_4,
pb.DBDColorColor_Color_5,
pb.DBDColorColor_Color_6,
pb.DBDColorColor_Color_7,
}
) )
switch difficulty { switch difficulty {
case pb.DBDColorDifficulty_Simple: case pb.DBDColorDifficulty_Simple:
colorNum = 4 colorNum = 4
temcolors = make([]pb.DBDColorColor, 4) temcolors = make([]int32, 4)
break break
case pb.DBDColorDifficulty_Difficulty: case pb.DBDColorDifficulty_Difficulty:
colorNum = 6 colorNum = 6
temcolors = make([]pb.DBDColorColor, 6) temcolors = make([]int32, 6)
break break
case pb.DBDColorDifficulty_Hell: case pb.DBDColorDifficulty_Hell:
colorNum = 8 colorNum = 8
temcolors = make([]pb.DBDColorColor, 7) temcolors = make([]int32, 7)
break break
} }
if Repeat { if Repeat {

View File

@ -6,6 +6,11 @@ import (
"go_dreamfactory/modules" "go_dreamfactory/modules"
) )
func NewModule() core.IModule {
m := new(DColor)
return m
}
/* /*
模块名称:猜颜色 模块名称:猜颜色
*/ */
@ -27,6 +32,13 @@ func (this *DColor) GetType() core.M_Modules {
// 模块初始化接口 注册用户创建角色事件 // 模块初始化接口 注册用户创建角色事件
func (this *DColor) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { func (this *DColor) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options) err = this.ModuleBase.Init(service, module, options)
service = this.service.(comm.IService) service = service.(comm.IService)
return return
} }
func (this *DColor) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.model = this.RegisterComp(new(modelComp)).(*modelComp)
this.modelQiecuo = this.RegisterComp(new(modelQiecuoComp)).(*modelQiecuoComp)
this.rooms = this.RegisterComp(new(roomsComp)).(*roomsComp)
}

View File

@ -82,10 +82,10 @@ func (this *Room) PlayerHandle(uid string, handle *pb.DColorHandleReq) (err erro
return return
} }
func (this *Room) comparison(results []pb.DBDColorColor) (allright, halfpair int32) { func (this *Room) comparison(results []int32) (allright, halfpair int32) {
var ( var (
resultscolor []pb.DBDColorColor resultscolor []int32
tempcolor []pb.DBDColorColor tempcolor []int32
) )
for i, v := range this.data.Results { for i, v := range this.data.Results {
if results[i] == v { if results[i] == v {

View File

@ -33,8 +33,8 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendAddBlackR
) )
uid := session.GetUserId() uid := session.GetUserId()
self = this.module.modelFriend.GetFriend(uid) self, err = this.module.modelFriend.GetFriend(uid)
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),
@ -42,8 +42,8 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendAddBlackR
return return
} }
target = this.module.modelFriend.GetFriend(req.FriendId) target, err = this.module.modelFriend.GetFriend(req.FriendId)
if target == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendTargetNoData, Code: pb.ErrorCode_FriendTargetNoData,
Title: pb.ErrorCode_FriendTargetNoData.ToString(), Title: pb.ErrorCode_FriendTargetNoData.ToString(),

View File

@ -33,8 +33,8 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (e
) )
uid := session.GetUserId() uid := session.GetUserId()
//获取玩家自己好友数据 //获取玩家自己好友数据
self = this.module.modelFriend.GetFriend(uid) self, err = this.module.modelFriend.GetFriend(uid)
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),
@ -104,8 +104,8 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (e
} }
//双向添加:将自己加入到申请人的好友列表中 //双向添加:将自己加入到申请人的好友列表中
target = this.module.modelFriend.GetFriend(userId) target, err = this.module.modelFriend.GetFriend(userId)
if target == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendTargetNoData, Code: pb.ErrorCode_FriendTargetNoData,
Title: pb.ErrorCode_FriendTargetNoData.ToString(), Title: pb.ErrorCode_FriendTargetNoData.ToString(),

View File

@ -43,8 +43,8 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (e
} }
//获取玩家自己好友数据 //获取玩家自己好友数据
self = this.module.modelFriend.GetFriend(uid) self, err = this.module.modelFriend.GetFriend(uid)
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),
@ -72,8 +72,8 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (e
} }
//获取好友数据 //获取好友数据
target = this.module.modelFriend.GetFriend(req.FriendId) target, err = this.module.modelFriend.GetFriend(req.FriendId)
if target == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendTargetNoData, Code: pb.ErrorCode_FriendTargetNoData,
Title: pb.ErrorCode_FriendTargetNoData.ToString(), Title: pb.ErrorCode_FriendTargetNoData.ToString(),

View File

@ -15,12 +15,13 @@ func (this *apiComp) ApplyList(session comm.IUserSession, req *pb.FriendApplyLis
var ( var (
self *pb.DBFriend self *pb.DBFriend
list []*pb.FriendBase list []*pb.FriendBase
err error
bChange bool bChange bool
bUpdate bool bUpdate bool
) )
self = this.module.modelFriend.GetFriend(session.GetUserId()) self, err = this.module.modelFriend.GetFriend(session.GetUserId())
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),

View File

@ -50,8 +50,8 @@ func (this *apiComp) Assisthero(session comm.IUserSession, req *pb.FriendAssisth
} }
//获取玩家自己好友数据 //获取玩家自己好友数据
self := this.module.modelFriend.GetFriend(uid) self, err := this.module.modelFriend.GetFriend(uid)
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),

View File

@ -14,8 +14,8 @@ func (this *apiComp) AssistHeroListCheck(session comm.IUserSession, req *pb.Frie
func (this *apiComp) AssistHeroList(session comm.IUserSession, req *pb.FriendAssistHeroListReq) (errdata *pb.ErrorData) { func (this *apiComp) AssistHeroList(session comm.IUserSession, req *pb.FriendAssistHeroListReq) (errdata *pb.ErrorData) {
//获取玩家自己好友数据 //获取玩家自己好友数据
self := this.module.modelFriend.GetFriend(session.GetUserId()) self, err := this.module.modelFriend.GetFriend(session.GetUserId())
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),
@ -25,7 +25,7 @@ func (this *apiComp) AssistHeroList(session comm.IUserSession, req *pb.FriendAss
rsp := &pb.FriendAssistHeroListResp{} rsp := &pb.FriendAssistHeroListResp{}
for _, v := range self.FriendIds { for _, v := range self.FriendIds {
f := this.module.modelFriend.GetFriend(v) f, _ := this.module.modelFriend.GetFriend(v)
rsp.Friends = append(rsp.Friends, &pb.FriendBase{ rsp.Friends = append(rsp.Friends, &pb.FriendBase{
UserId: v, UserId: v,

View File

@ -16,8 +16,8 @@ func (this *apiComp) AssistlistCheck(session comm.IUserSession, req *pb.FriendAs
func (this *apiComp) Assistlist(session comm.IUserSession, req *pb.FriendAssistlistReq) (errdata *pb.ErrorData) { func (this *apiComp) Assistlist(session comm.IUserSession, req *pb.FriendAssistlistReq) (errdata *pb.ErrorData) {
var list []*pb.FriendBase var list []*pb.FriendBase
//获取玩家自己好友数据 //获取玩家自己好友数据
self := this.module.modelFriend.GetFriend(session.GetUserId()) self, err := this.module.modelFriend.GetFriend(session.GetUserId())
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),
@ -29,8 +29,8 @@ func (this *apiComp) Assistlist(session comm.IUserSession, req *pb.FriendAssistl
base := this.setDefaultFriendUserBaseInfo(uid) base := this.setDefaultFriendUserBaseInfo(uid)
if base != nil { if base != nil {
// 获取好友信息 // 获取好友信息
target := this.module.modelFriend.GetFriend(uid) target, err := this.module.modelFriend.GetFriend(uid)
if target == nil { if err != nil {
continue continue
} }
if target.AssistHeroId != "" { if target.AssistHeroId != "" {

View File

@ -14,10 +14,11 @@ func (this *apiComp) Blacklist(session comm.IUserSession, req *pb.FriendBlackLis
var ( var (
self *pb.DBFriend self *pb.DBFriend
list []*pb.FriendBase list []*pb.FriendBase
err error
) )
self = this.module.modelFriend.GetFriend(session.GetUserId()) self, err = this.module.modelFriend.GetFriend(session.GetUserId())
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),

View File

@ -25,8 +25,8 @@ func (this *apiComp) Del(session comm.IUserSession, req *pb.FriendDelReq) (errda
} }
uid := session.GetUserId() uid := session.GetUserId()
self := this.module.modelFriend.GetFriend(uid) self, err := this.module.modelFriend.GetFriend(uid)
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),
@ -52,8 +52,8 @@ func (this *apiComp) Del(session comm.IUserSession, req *pb.FriendDelReq) (errda
return return
} }
target := this.module.modelFriend.GetFriend(req.FriendId) target, err := this.module.modelFriend.GetFriend(req.FriendId)
if target == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendNotSelf, Code: pb.ErrorCode_FriendNotSelf,
Title: pb.ErrorCode_FriendNotSelf.ToString(), Title: pb.ErrorCode_FriendNotSelf.ToString(),

View File

@ -28,8 +28,8 @@ func (this *apiComp) Delblack(session comm.IUserSession, req *pb.FriendDelBlackR
self *pb.DBFriend self *pb.DBFriend
) )
uid := session.GetUserId() uid := session.GetUserId()
self = this.module.modelFriend.GetFriend(session.GetUserId()) self, err = this.module.modelFriend.GetFriend(session.GetUserId())
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),

View File

@ -24,8 +24,8 @@ func (this *apiComp) GetRelation(session comm.IUserSession, req *pb.FriendGetRel
return return
} }
self := this.module.modelFriend.GetFriend(session.GetUserId()) self, err := this.module.modelFriend.GetFriend(session.GetUserId())
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),
@ -33,8 +33,8 @@ func (this *apiComp) GetRelation(session comm.IUserSession, req *pb.FriendGetRel
return return
} }
target := this.module.modelFriend.GetFriend(req.TargetUid) target, err := this.module.modelFriend.GetFriend(req.TargetUid)
if target == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendTargetNoData, Code: pb.ErrorCode_FriendTargetNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),

View File

@ -14,8 +14,8 @@ func (this *apiComp) GetrewardCheck(session comm.IUserSession, req *pb.FriendGet
func (this *apiComp) Getreward(session comm.IUserSession, req *pb.FriendGetrewardReq) (errdata *pb.ErrorData) { func (this *apiComp) Getreward(session comm.IUserSession, req *pb.FriendGetrewardReq) (errdata *pb.ErrorData) {
uid := session.GetUserId() uid := session.GetUserId()
//获取玩家自己好友数据 //获取玩家自己好友数据
self := this.module.modelFriend.GetFriend(uid) self, err := this.module.modelFriend.GetFriend(uid)
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),

View File

@ -16,10 +16,11 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.FriendListReq) (err
var ( var (
self *pb.DBFriend self *pb.DBFriend
list []*pb.FriendBase list []*pb.FriendBase
err error
) )
self = this.module.modelFriend.GetFriend(session.GetUserId()) self, err = this.module.modelFriend.GetFriend(session.GetUserId())
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),
@ -41,8 +42,8 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.FriendListReq) (err
} }
// 判断是否已点赞 // 判断是否已点赞
target := this.module.modelFriend.GetFriend(userId) target, err := this.module.modelFriend.GetFriend(userId)
if target == nil { if err != nil {
continue continue
} }

View File

@ -16,8 +16,8 @@ func (this *apiComp) RandlistCheck(session comm.IUserSession, req *pb.FriendRand
func (this *apiComp) Randlist(session comm.IUserSession, req *pb.FriendRandlistReq) (errdata *pb.ErrorData) { func (this *apiComp) Randlist(session comm.IUserSession, req *pb.FriendRandlistReq) (errdata *pb.ErrorData) {
// 当前玩家好友数据 // 当前玩家好友数据
self := this.module.modelFriend.GetFriend(session.GetUserId()) self, err := this.module.modelFriend.GetFriend(session.GetUserId())
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),
@ -50,8 +50,8 @@ func (this *apiComp) Randlist(session comm.IUserSession, req *pb.FriendRandlistR
} }
//检查目标v中的申请列表中是否有自己 //检查目标v中的申请列表中是否有自己
target := this.module.modelFriend.GetFriend(v.Uid) target, err := this.module.modelFriend.GetFriend(v.Uid)
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),
@ -86,8 +86,8 @@ func (this *apiComp) Randlist(session comm.IUserSession, req *pb.FriendRandlistR
var userList []*pb.FriendBase var userList []*pb.FriendBase
for _, uid := range randOnlineUsers { for _, uid := range randOnlineUsers {
target := this.module.modelFriend.GetFriend(uid) target, err := this.module.modelFriend.GetFriend(uid)
if target == nil { if err != nil {
this.module.Debug("未找到好友", this.module.Debug("未找到好友",
log.Field{Key: "uid", Value: uid}) log.Field{Key: "uid", Value: uid})
continue continue

View File

@ -30,11 +30,12 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.FriendRefuseReq)
var ( var (
self *pb.DBFriend self *pb.DBFriend
optNum int32 optNum int32
err error
) )
//获取玩家自己好友数据 //获取玩家自己好友数据
self = this.module.modelFriend.GetFriend(uid) self, err = this.module.modelFriend.GetFriend(uid)
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),
@ -80,6 +81,5 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.FriendRefuseReq)
session.SendMsg(string(this.module.GetType()), FriendSubTypeRefuse, resp) session.SendMsg(string(this.module.GetType()), FriendSubTypeRefuse, resp)
return return
} }

View File

@ -55,8 +55,8 @@ func (this *apiComp) Search(session comm.IUserSession, req *pb.FriendSearchReq)
ServerId: u.Sid, ServerId: u.Sid,
} }
target := this.module.modelFriend.GetFriend(u.Uid) target, err := this.module.modelFriend.GetFriend(u.Uid)
if target == nil { if err != nil {
continue continue
} }

View File

@ -50,8 +50,8 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (errda
) )
// 是否已给好友点赞 // 是否已给好友点赞
for _, v := range req.FriendIds { for _, v := range req.FriendIds {
target = this.module.modelFriend.GetFriend(v) target, err = this.module.modelFriend.GetFriend(v)
if target == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),

View File

@ -19,10 +19,11 @@ func (this *apiComp) Zanlist(session comm.IUserSession, req *pb.FriendZanlistReq
var ( var (
self *pb.DBFriend self *pb.DBFriend
list []*pb.FriendBase list []*pb.FriendBase
err error
) )
self = this.module.modelFriend.GetFriend(session.GetUserId()) self, err = this.module.modelFriend.GetFriend(session.GetUserId())
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),

View File

@ -30,8 +30,8 @@ func (this *apiComp) Zanreceive(session comm.IUserSession, req *pb.FriendZanrece
err error err error
) )
self = this.module.modelFriend.GetFriend(session.GetUserId()) self, err = this.module.modelFriend.GetFriend(session.GetUserId())
if self == nil { if err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_FriendSelfNoData, Code: pb.ErrorCode_FriendSelfNoData,
Title: pb.ErrorCode_FriendSelfNoData.ToString(), Title: pb.ErrorCode_FriendSelfNoData.ToString(),

View File

@ -1,12 +1,12 @@
package friend package friend
import ( import (
"context"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/redis" "go_dreamfactory/lego/sys/redis"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/db"
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/x/bsonx" "go.mongodb.org/mongo-driver/x/bsonx"
@ -14,13 +14,13 @@ import (
type ModelFriend struct { type ModelFriend struct {
modules.MCompModel modules.MCompModel
moduleFriend *Friend moduole *Friend
} }
func (this *ModelFriend) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { func (this *ModelFriend) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.TableName = comm.TableFriend this.TableName = comm.TableFriend
err = this.MCompModel.Init(service, module, comp, options) err = this.MCompModel.Init(service, module, comp, options)
this.moduleFriend = module.(*Friend) this.moduole = module.(*Friend)
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
}) })
@ -29,30 +29,33 @@ func (this *ModelFriend) Init(service core.IService, module core.IModule, comp c
} }
// 查询好友 // 查询好友
func (this *ModelFriend) GetFriend(uid string) *pb.DBFriend { func (this *ModelFriend) GetFriend(uid string) (friend *pb.DBFriend, err error) {
friend := &pb.DBFriend{Uid: uid} friend = &pb.DBFriend{Uid: uid}
if this.moduleFriend.IsCross() { if this.moduole.IsCross() {
err := this.Get(uid, friend) err = this.Get(uid, friend)
if err != nil { if err != nil {
if err == redis.RedisNil || err == mongo.ErrNoDocuments { if err == redis.RedisNil || err == mongo.ErrNoDocuments {
if err := this.Add(uid, friend); err != nil { if err = this.Add(uid, friend); err != nil {
return nil return
} }
} }
// log.Error("未获得好友数据", log.Fields{"uid": uid}) // log.Error("未获得好友数据", log.Fields{"uid": uid})
} }
} else { } else {
friend := &pb.DBFriend{} var (
if err := this.moduleFriend.service.AcrossClusterRpcCall( model *db.DBModel
context.Background(), )
this.moduleFriend.GetCrossTag(), if model, err = this.moduole.GetCrossDBModel(this.TableName); err != nil {
comm.Service_Worker, return
string(comm.Rpc_ModuleFriendDB), }
pb.RPCGeneralReqA1{Param1: uid}, model.Get(uid, friend)
friend); err != nil { if err != nil {
this.moduleFriend.Errorln(err) if err == redis.RedisNil || err == mongo.ErrNoDocuments {
if err = model.Add(uid, friend); err != nil {
return
} }
} }
}
return friend }
return
} }

View File

@ -97,14 +97,14 @@ func (this *Friend) ResetFriend(uid string) {
} }
func (this *Friend) GetFriendCount(uid string) (count int32) { func (this *Friend) GetFriendCount(uid string) (count int32) {
if friend := this.modelFriend.GetFriend(uid); friend != nil { if friend, err := this.modelFriend.GetFriend(uid); err == nil {
count = cast.ToInt32(len(friend.FriendIds)) count = cast.ToInt32(len(friend.FriendIds))
} }
return return
} }
func (this *Friend) GetFriendList(uid string) (uids []string) { func (this *Friend) GetFriendList(uid string) (uids []string) {
if friend := this.modelFriend.GetFriend(uid); friend != nil { if friend, err := this.modelFriend.GetFriend(uid); err == nil {
uids = friend.FriendIds uids = friend.FriendIds
} }
return return
@ -141,7 +141,7 @@ func (this *Friend) RpcFriendDB(ctx context.Context, req *pb.RPCGeneralReqA1, re
// friendId 好友Id // friendId 好友Id
func (this *Friend) UseAssistHero(uid, friendId string) (*pb.DBHero, error) { func (this *Friend) UseAssistHero(uid, friendId string) (*pb.DBHero, error) {
//指定好友 //指定好友
friend := this.modelFriend.GetFriend(friendId) friend, _ := this.modelFriend.GetFriend(friendId)
for _, fId := range friend.FriendIds { for _, fId := range friend.FriendIds {
// 判断uid是否在指定玩家的好友列表中 // 判断uid是否在指定玩家的好友列表中
@ -207,7 +207,7 @@ func (this *Friend) QiecuoFinishNotify(redUid, matchId string) error {
func (this *Friend) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) { func (this *Friend) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem) reddot = make(map[comm.ReddotType]*pb.ReddotItem)
friend := this.modelFriend.GetFriend(session.GetUserId()) friend, _ := this.modelFriend.GetFriend(session.GetUserId())
if friend == nil { if friend == nil {
for _, v := range rid { for _, v := range rid {
reddot[v] = &pb.ReddotItem{ reddot[v] = &pb.ReddotItem{

View File

@ -51,6 +51,7 @@ type Agent struct {
sessionId string sessionId string
uId string uId string
wId string wId string
cwid string
writeChan chan [][]byte writeChan chan [][]byte
closeSignal chan bool closeSignal chan bool
state int32 //状态 0 关闭 1 运行 2 关闭中 state int32 //状态 0 关闭 1 运行 2 关闭中
@ -321,7 +322,12 @@ func (this *Agent) Bind(uId string, wId string) {
func (this *Agent) UnBind() { func (this *Agent) UnBind() {
this.uId = "" this.uId = ""
} }
func (this *Agent) SetCrosssId(wId string) {
this.cwid = wId
}
func (this *Agent) CrosssWorkerId() string {
return this.cwid
}
func (this *Agent) WriteMsg(msg *pb.UserMessage) (err error) { func (this *Agent) WriteMsg(msg *pb.UserMessage) (err error) {
if atomic.LoadInt32(&this.state) != 1 { if atomic.LoadInt32(&this.state) != 1 {
return return
@ -432,7 +438,11 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) (err error) {
} else if len(paths) == 2 { } else if len(paths) == 2 {
if paths[0] == "~" { if paths[0] == "~" {
serviceTag = db.CrossTag() serviceTag = db.CrossTag()
if len(this.cwid) > 0 { //已经绑定 跨服服务器
servicePath = fmt.Sprintf("%s/%s", paths[1], this.cwid)
} else {
servicePath = paths[1] servicePath = paths[1]
}
} else { } else {
servicePath = rule servicePath = rule
} }

View File

@ -26,6 +26,7 @@ type AgentMgrComp struct {
service base.IRPCXService service base.IRPCXService
module *Gateway module *Gateway
agents *sync.Map agents *sync.Map
users *sync.Map
} }
func (this *AgentMgrComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { func (this *AgentMgrComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
@ -34,6 +35,7 @@ func (this *AgentMgrComp) Init(service core.IService, module core.IModule, comp
this.service = service.(base.IRPCXService) this.service = service.(base.IRPCXService)
this.module = module.(*Gateway) this.module = module.(*Gateway)
this.agents = new(sync.Map) this.agents = new(sync.Map)
this.users = new(sync.Map)
return return
} }
@ -61,6 +63,10 @@ func (this *AgentMgrComp) Connect(a IAgent) {
// DisConnect 移除断开的用户 // DisConnect 移除断开的用户
func (this *AgentMgrComp) DisConnect(a IAgent) { func (this *AgentMgrComp) DisConnect(a IAgent) {
if a.(IAgent).UserId() != "" {
this.users.Delete(a.(IAgent).UserId())
}
this.agents.Delete(a.SessionId()) this.agents.Delete(a.SessionId())
if a.UserId() != "" { //登录用户 通知业务服务处理玩家离线相关 if a.UserId() != "" { //登录用户 通知业务服务处理玩家离线相关
if _, err := this.service.RpcGo(context.Background(), fmt.Sprintf("%s/%s", comm.Service_Worker, a.WorkerId()), string(comm.Rpc_GatewayNoticeUserClose), &pb.NoticeUserCloseReq{ if _, err := this.service.RpcGo(context.Background(), fmt.Sprintf("%s/%s", comm.Service_Worker, a.WorkerId()), string(comm.Rpc_GatewayNoticeUserClose), &pb.NoticeUserCloseReq{
@ -85,7 +91,7 @@ func (this *AgentMgrComp) DisConnect(a IAgent) {
} }
// if this.options.SpanServiceTag != "" { // if this.options.SpanServiceTag != "" {
//推送跨服集群处理 //推送跨服集群处理
if _, err := this.service.AcrossClusterRpcGo(context.Background(), db.CrossTag(), comm.Service_Worker, string(comm.Rpc_GatewayNoticeUserClose), &pb.NoticeUserCloseReq{ if _, err := this.service.AcrossClusterRpcGo(context.Background(), db.CrossTag(), fmt.Sprintf("%s/%s", comm.Service_Worker, a.CrosssWorkerId()), string(comm.Rpc_GatewayNoticeUserClose), &pb.NoticeUserCloseReq{
Ip: a.IP(), Ip: a.IP(),
ServiceTag: this.service.GetTag(), ServiceTag: this.service.GetTag(),
GatewayServiceId: this.service.GetId(), GatewayServiceId: this.service.GetId(),
@ -108,36 +114,14 @@ func (this *AgentMgrComp) DisConnect(a IAgent) {
} }
} }
// Bind 用户绑定Id func (this *AgentMgrComp) Logined(a IAgent) {
// func (this *AgentMgrComp) Bind(ctx context.Context, args *pb.AgentBuildReq, reply *pb.RPCMessageReply) error { this.users.Store(a.UserId(), a)
// if a, ok := this.agents.Load(args.UserSessionId); ok { }
// agent := a.(IAgent)
// agent.Bind(args.UserId, args.WorkerId)
// // if this.options.SpanServiceTag != "" { //跨服集群配置存在 推送通知过去
// //推送跨服集群处理
// if _, err := this.service.AcrossClusterRpcGo(context.Background(), db.CrossTag(), comm.Service_Worker, string(comm.Rpc_GatewayNoticeUserLogin), &pb.NoticeUserLoginReq{
// Ip: agent.IP(),
// ServiceTag: this.service.GetTag(),
// GatewayServiceId: this.service.GetId(),
// UserSessionId: agent.SessionId(),
// UserId: agent.UserId(),
// }, nil); err != nil {
// log.Errorf("uId:%s clusterTag:%s Rpc_NoticeUserLogin err:%v", agent.UserId(), db.CrossTag(), err)
// }
// // }
// } else {
// reply.ErrorData = &pb.ErrorData{
// Code: pb.ErrorCode_UserSessionNobeing,
// Title: pb.ErrorCode_UserSessionNobeing.ToString(),
// Message: fmt.Sprintf("绑定uid:%s失败!", args.WorkerId),
// }
// }
// return nil
// }
// UnBind 用户解绑Id // UnBind 用户解绑Id
func (this *AgentMgrComp) UnBind(ctx context.Context, args *pb.AgentUnBuildReq, reply *pb.RPCMessageReply) error { func (this *AgentMgrComp) UnBind(ctx context.Context, args *pb.AgentUnBuildReq, reply *pb.RPCMessageReply) error {
if a, ok := this.agents.Load(args.UserSessionId); ok { if a, ok := this.agents.Load(args.UserSessionId); ok {
this.users.Delete(a.(IAgent).UserId())
a.(IAgent).UnBind() a.(IAgent).UnBind()
} else { } else {
reply.ErrorData = &pb.ErrorData{ reply.ErrorData = &pb.ErrorData{
@ -217,9 +201,37 @@ func (this *AgentMgrComp) SendMsgToAllAgent(ctx context.Context, args *pb.BroadC
return return
} }
// SendMsgToAllAgent 向所有户发送消息
func (this *AgentMgrComp) SendMsgToUsers(ctx context.Context, args *pb.BatchUsersMessageReq, reply *pb.RPCMessageReply) (err error) {
var (
data []byte
)
msg := &pb.UserMessage{
MainType: args.MainType,
SubType: args.SubType,
Data: args.Data,
}
this.module.Debugf("SendMsgToAgents: agents:%v msg:%v", args.Uids, msg)
if data, err = proto.Marshal(msg); err != nil {
return
}
for _, v := range args.Uids {
if a, ok := this.users.Load(v); ok {
agent := a.(IAgent)
if err = agent.WriteBytes(data); err != nil {
this.module.Errorln(err)
}
}
}
return nil
}
// CloseAgent 关闭某个用户 // CloseAgent 关闭某个用户
func (this *AgentMgrComp) CloseAgent(ctx context.Context, args *pb.AgentCloseeReq, reply *pb.RPCMessageReply) error { func (this *AgentMgrComp) CloseAgent(ctx context.Context, args *pb.AgentCloseeReq, reply *pb.RPCMessageReply) error {
if a, ok := this.agents.Load(args.UserSessionId); ok { if a, ok := this.agents.Load(args.UserSessionId); ok {
if a.(IAgent).UserId() != "" {
this.users.Delete(a.(IAgent).UserId())
}
a.(IAgent).Close() a.(IAgent).Close()
this.agents.Delete(args.UserSessionId) this.agents.Delete(args.UserSessionId)
} else { } else {

View File

@ -17,6 +17,8 @@ type (
UserId() string UserId() string
WorkerId() string WorkerId() string
Bind(uId string, wId string) Bind(uId string, wId string)
SetCrosssId(wId string)
CrosssWorkerId() string
UnBind() UnBind()
WriteMsg(msg *pb.UserMessage) (err error) WriteMsg(msg *pb.UserMessage) (err error)
WriteBytes(data []byte) (err error) WriteBytes(data []byte) (err error)

View File

@ -74,6 +74,8 @@ func (this *Gateway) Start() (err error) {
string(comm.Rpc_GatewaySendBatchMsg): this.agentMgr.SendMsgToAgents, string(comm.Rpc_GatewaySendBatchMsg): this.agentMgr.SendMsgToAgents,
// 向所有用户发送消息接口 // 向所有用户发送消息接口
string(comm.Rpc_GatewaySendRadioMsg): this.agentMgr.SendMsgToAllAgent, string(comm.Rpc_GatewaySendRadioMsg): this.agentMgr.SendMsgToAllAgent,
string(comm.Rpc_GatewaySendBatchMsgByUid): this.agentMgr.SendMsgToUsers,
// 关闭用户socket连接接口 // 关闭用户socket连接接口
string(comm.Rpc_GatewayAgentClose): this.agentMgr.CloseAgent, string(comm.Rpc_GatewayAgentClose): this.agentMgr.CloseAgent,
} }
@ -115,15 +117,19 @@ func (this *Gateway) DisConnect(a IAgent) {
} }
func (this *Gateway) LoginNotice(a IAgent) { func (this *Gateway) LoginNotice(a IAgent) {
if _, err := this.service.AcrossClusterRpcGo(context.Background(), db.CrossTag(), comm.Service_Worker, string(comm.Rpc_GatewayNoticeUserLogin), &pb.NoticeUserLoginReq{ this.agentMgr.Logined(a)
resp := &pb.NoticeUserLoginResp{}
if err := this.service.AcrossClusterRpcCall(context.Background(), db.CrossTag(), comm.Service_Worker, string(comm.Rpc_GatewayNoticeUserLogin), &pb.NoticeUserLoginReq{
Ip: a.IP(), Ip: a.IP(),
ServiceTag: this.service.GetTag(), ServiceTag: this.service.GetTag(),
GatewayServiceId: this.service.GetId(), GatewayServiceId: this.service.GetId(),
UserSessionId: a.SessionId(), UserSessionId: a.SessionId(),
UserId: a.UserId(), UserId: a.UserId(),
}, nil); err != nil { }, resp); err != nil {
log.Errorf("uId:%s clusterTag:%s Rpc_NoticeUserLogin err:%v", a.UserId(), db.CrossTag(), err) log.Errorf("uId:%s clusterTag:%s Rpc_NoticeUserLogin err:%v", a.UserId(), db.CrossTag(), err)
return
} }
a.SetCrosssId(resp.WorkerSId)
} }
// GetMsgDistribute 读取消息分发规则 // GetMsgDistribute 读取消息分发规则

20
modules/maincity/api.go Normal file
View File

@ -0,0 +1,20 @@
package maincity
import (
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
type apiComp struct {
modules.MCompGate
service base.IRPCXService
module *MainCity
}
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
_ = this.MCompGate.Init(service, module, comp, options)
this.service = service.(base.IRPCXService)
this.module = module.(*MainCity)
return
}

View File

@ -0,0 +1,31 @@
package maincity
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
func (this *apiComp) SynchPosCheck(session comm.IUserSession, req *pb.MainCitySynchPosPeek) (errdata *pb.ErrorData) {
return
}
// 查看某一封邮件
func (this *apiComp) SynchPos(session comm.IUserSession, req *pb.MainCitySynchPosPeek) (errdata *pb.ErrorData) {
var (
friends []*pb.BaseUserInfo
groupUser map[string][]*pb.BaseUserInfo = make(map[string][]*pb.BaseUserInfo)
ok bool
)
friends = this.module.model.getplayerPos(session.GetUserId())
for _, v := range friends {
if _, ok = groupUser[v.Sid]; !ok {
groupUser[v.Sid] = make([]*pb.BaseUserInfo, 0)
}
groupUser[v.Sid] = append(groupUser[v.Sid], v)
}
this.module.SendMsgToSession(string(this.module.GetType()), "synchpos", &pb.MainCitySynchPosPush{
Pos: req.Pos,
}, groupUser)
return
}

48
modules/maincity/model.go Normal file
View File

@ -0,0 +1,48 @@
package maincity
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"sync"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/x/bsonx"
)
type modelComp struct {
modules.MCompModel
module *MainCity
lock sync.RWMutex
onlines map[string][]*pb.BaseUserInfo //关联用户信息
}
func (this *modelComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.MCompModel.Init(service, module, comp, options)
this.TableName = comm.Tablekftask
this.module = module.(*MainCity)
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
})
return
}
func (this *modelComp) setplayerPos(uid string, friends []*pb.BaseUserInfo) {
this.lock.Lock()
this.onlines[uid] = friends
this.lock.Unlock()
}
func (this *modelComp) getplayerPos(uid string) (friends []*pb.BaseUserInfo) {
this.lock.RLock()
friends = this.onlines[uid]
this.lock.RUnlock()
return
}
func (this *modelComp) removelayerPos(uid string) {
this.lock.Lock()
delete(this.onlines, uid)
this.lock.Unlock()
}

118
modules/maincity/module.go Normal file
View File

@ -0,0 +1,118 @@
package maincity
import (
"context"
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/event"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"time"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/anypb"
)
type MainCity struct {
modules.ModuleBase
service comm.IService
api *apiComp
model *modelComp
friend comm.IFriend
sociaty comm.ISociaty
}
func NewModule() core.IModule {
return &MainCity{}
}
func (this *MainCity) GetType() core.M_Modules {
return comm.ModuleKFTask
}
func (this *MainCity) 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 *MainCity) Start() (err error) {
if err = this.ModuleBase.Start(); err != nil {
return
}
var module core.IModule
if module, err = this.service.GetModule(comm.ModuleFriend); err != nil {
return
}
this.friend = module.(comm.IFriend)
if module, err = this.service.GetModule(comm.ModuleSociaty); err != nil {
return
}
this.sociaty = module.(comm.ISociaty)
event.Register(comm.EventUserLogin, this.EventUserLogin)
event.Register(comm.EventUserOffline, this.EventUserOffline)
return
}
func (this *MainCity) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.model = this.RegisterComp(new(modelComp)).(*modelComp)
}
// 用户登录
func (this *MainCity) EventUserLogin(session comm.IUserSession) {
var (
uids []string
sociaty *pb.DBSociaty
users []*pb.DBUser
busers []*pb.BaseUserInfo
err error
)
uids = this.friend.GetFriendList(session.GetUserId())
if sociaty = this.sociaty.GetSociaty(session.GetUserId()); sociaty != nil {
for _, v := range sociaty.Members {
if v.Uid != session.GetUserId() {
uids = append(uids, v.Uid)
}
}
}
if users, err = this.ModuleUser.GetCrossUsers(uids); err != nil {
this.Errorln(err)
return
}
busers = make([]*pb.BaseUserInfo, len(users))
for i, v := range users {
busers[i] = comm.GetUserBaseInfo(v)
}
this.model.setplayerPos(session.GetUserId(), busers)
}
// 用户登录
func (this *MainCity) EventUserOffline(session comm.IUserSession) {
this.model.removelayerPos(session.GetUserId())
}
// 向多个用户发送消息
func (this *MainCity) SendMsgToSession(mainType, subType string, msg proto.Message, users map[string][]*pb.BaseUserInfo) (err error) {
data, _ := anypb.New(msg)
for k, users := range users {
uids := []string{}
for _, v := range users {
uids = append(uids, v.Uid)
}
ctx, _ := context.WithTimeout(context.Background(), time.Second*5)
if _, err = this.service.AcrossClusterRpcGo(ctx, k, comm.Service_Gateway, string(comm.Rpc_GatewaySendBatchMsgByUid), &pb.BatchUsersMessageReq{
Uids: uids,
MainType: mainType,
SubType: subType,
Data: data,
}, nil); err != nil {
log.Errorf("SendMsgToUsers:%s->%s.%s err:%v", k, mainType, subType, err)
}
}
return
}

View File

@ -67,7 +67,7 @@ func (this *aiComp) createAi(battleid string, btype pb.RaceType, users []*pb.DBR
} }
ais = make([]*AI, len(users)) ais = make([]*AI, len(users))
for i, v := range users { for i, v := range users {
if conf, err = this.module.configure.getgameBukashiAiDataByDan(int32(btype), v.Dan); err != nil { if conf, err = this.module.configure.getgameBukashiAiDataByDan(int32(btype)+1, v.Dan+1); err != nil {
return return
} }
ais[i] = NewAI(battleid, v.Uid, conf) ais[i] = NewAI(battleid, v.Uid, conf)

View File

@ -239,12 +239,14 @@ func (this *Parkour) qte(id string, uid string, time float32, conf *cfg.GameBuzk
battle, ok = this.battles[id] battle, ok = this.battles[id]
this.lock.RUnlock() this.lock.RUnlock()
if ok { if ok {
ok = false
for _, v := range battle.RedMember { for _, v := range battle.RedMember {
if v.Uid == uid { if v.Uid == uid {
ok = true ok = true
v.Scores += conf.Value v.Scores += conf.Value
side = 1 side = 1
member = v member = v
break
} }
} }
if !ok { if !ok {
@ -254,9 +256,14 @@ func (this *Parkour) qte(id string, uid string, time float32, conf *cfg.GameBuzk
v.Scores += conf.Value v.Scores += conf.Value
side = 2 side = 2
member = v member = v
break
} }
} }
} }
if !ok {
this.Error("qte on found Member !", log.Field{Key: "uid", Value: uid})
return
}
if side == 1 { if side == 1 {
battle.RedScore += conf.Value battle.RedScore += conf.Value
teamScores = battle.RedScore teamScores = battle.RedScore
@ -295,6 +302,7 @@ func (this *Parkour) shot(id string, uid string) {
battle, ok = this.battles[id] battle, ok = this.battles[id]
this.lock.RUnlock() this.lock.RUnlock()
if ok { if ok {
ok = false
for _, v := range battle.RedMember { for _, v := range battle.RedMember {
if v.Uid == uid { if v.Uid == uid {
v.Scores += this.ModuleTools.GetGlobalConf().BuzkashiGoalscore v.Scores += this.ModuleTools.GetGlobalConf().BuzkashiGoalscore
@ -313,6 +321,10 @@ func (this *Parkour) shot(id string, uid string) {
} }
} }
} }
if !ok {
this.Error("shot on found Member !", log.Field{Key: "uid", Value: uid})
return
}
if side == 1 { if side == 1 {
battle.RedScore += this.ModuleTools.GetGlobalConf().BuzkashiGoalteamscore battle.RedScore += this.ModuleTools.GetGlobalConf().BuzkashiGoalteamscore
teamScores = battle.RedScore teamScores = battle.RedScore
@ -370,7 +382,7 @@ func (this *Parkour) avoid(id string, uid string, distance float32, conf *cfg.Ga
} }
} }
if !ok { if !ok {
this.Error("躲避障碍物逻辑异常 未找到玩家!", log.Field{Key: "battleid", Value: id}, log.Field{Key: "uid", Value: uid}) this.Error("avoid on found Member !", log.Field{Key: "uid", Value: uid})
return return
} }
@ -421,6 +433,7 @@ func (this *Parkour) recoverhp(id string, uid string, hp int32) {
battle, ok = this.battles[id] battle, ok = this.battles[id]
this.lock.RUnlock() this.lock.RUnlock()
if ok { if ok {
ok = false
for _, v := range battle.RedMember { for _, v := range battle.RedMember {
if v.Uid == uid { if v.Uid == uid {
player = v player = v
@ -443,6 +456,10 @@ func (this *Parkour) recoverhp(id string, uid string, hp int32) {
break break
} }
} }
if !ok {
this.Error("recoverhp on found Member !", log.Field{Key: "uid", Value: uid})
return
}
for _, v := range battle.Session { for _, v := range battle.Session {
sessions = append(sessions, v) sessions = append(sessions, v)

View File

@ -309,9 +309,9 @@ func (this *ParkourComp) match() {
} }
this.tlock.RUnlock() this.tlock.RUnlock()
if len(users)+rednum+bulenum < 6 { // if len(users)+rednum+bulenum < 6 {
return // return
} // }
n := len(reduser) n := len(reduser)
//补充人员 //补充人员
if len(reduser) < 3 { if len(reduser) < 3 {

View File

@ -113,6 +113,36 @@ func (this *ModelUser) GetUser(uid string) (user *pb.DBUser, err error) {
return return
} }
// 获取用户
func (this *ModelUser) GetCrossUsers(uids []string) (users []*pb.DBUser, err error) {
var (
stage string
usergroup map[string][]string = make(map[string][]string)
conn *db.DBConn
model *db.DBModel
usersSlice []*pb.DBUser
)
for _, v := range uids {
if stage, err = comm.UidToSTag(v); err != nil {
return
}
usergroup[stage] = append(usergroup[stage], v)
}
for k, v := range usergroup {
if conn, err = db.ServerDBConn(k); err != nil {
return
}
model = db.NewDBModel(this.TableName, conn)
usersSlice = make([]*pb.DBUser, 0)
if _, err = model.Gets(v, &usersSlice); err != nil {
return
}
users = append(users, usersSlice...)
}
return
}
// 设置属性 // 设置属性
func (this *ModelUser) updateUserAttr(uid string, data map[string]interface{}) error { func (this *ModelUser) updateUserAttr(uid string, data map[string]interface{}) error {
if this.module.IsCross() { if this.module.IsCross() {

View File

@ -126,6 +126,15 @@ func (this *User) GetUser(uid string) (user *pb.DBUser, err error) {
return return
} }
// 获取用户数据
func (this *User) GetCrossUsers(uid []string) (user []*pb.DBUser, err error) {
if !this.IsCross() {
return
}
user, err = this.modelUser.GetCrossUsers(uid)
return
}
// 获取跨服用户数据 // 获取跨服用户数据
func (this *User) GetCrossUser(uid string) (*pb.DBUser, error) { func (this *User) GetCrossUser(uid string) (*pb.DBUser, error) {
reply := &pb.DBUser{} reply := &pb.DBUser{}

File diff suppressed because it is too large Load Diff

View File

@ -70,70 +70,6 @@ func (DBDColorDifficulty) EnumDescriptor() ([]byte, []int) {
return file_dcolor_dcolor_db_proto_rawDescGZIP(), []int{0} return file_dcolor_dcolor_db_proto_rawDescGZIP(), []int{0}
} }
type DBDColorColor int32
const (
DBDColorColor_Color_0 DBDColorColor = 0
DBDColorColor_Color_1 DBDColorColor = 1
DBDColorColor_Color_2 DBDColorColor = 2
DBDColorColor_Color_3 DBDColorColor = 3
DBDColorColor_Color_4 DBDColorColor = 4
DBDColorColor_Color_5 DBDColorColor = 5
DBDColorColor_Color_6 DBDColorColor = 6
DBDColorColor_Color_7 DBDColorColor = 7
)
// Enum value maps for DBDColorColor.
var (
DBDColorColor_name = map[int32]string{
0: "Color_0",
1: "Color_1",
2: "Color_2",
3: "Color_3",
4: "Color_4",
5: "Color_5",
6: "Color_6",
7: "Color_7",
}
DBDColorColor_value = map[string]int32{
"Color_0": 0,
"Color_1": 1,
"Color_2": 2,
"Color_3": 3,
"Color_4": 4,
"Color_5": 5,
"Color_6": 6,
"Color_7": 7,
}
)
func (x DBDColorColor) Enum() *DBDColorColor {
p := new(DBDColorColor)
*p = x
return p
}
func (x DBDColorColor) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (DBDColorColor) Descriptor() protoreflect.EnumDescriptor {
return file_dcolor_dcolor_db_proto_enumTypes[1].Descriptor()
}
func (DBDColorColor) Type() protoreflect.EnumType {
return &file_dcolor_dcolor_db_proto_enumTypes[1]
}
func (x DBDColorColor) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use DBDColorColor.Descriptor instead.
func (DBDColorColor) EnumDescriptor() ([]byte, []int) {
return file_dcolor_dcolor_db_proto_rawDescGZIP(), []int{1}
}
//切磋请求记录 //切磋请求记录
type DBDColor struct { type DBDColor struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -451,7 +387,7 @@ type DBDColorResult struct {
Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index"` Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index"`
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"`
Results []DBDColorColor `protobuf:"varint,3,rep,packed,name=results,proto3,enum=DBDColorColor" json:"results"` Results []int32 `protobuf:"varint,3,rep,packed,name=results,proto3" json:"results"`
Allright int32 `protobuf:"varint,4,opt,name=allright,proto3" json:"allright"` Allright int32 `protobuf:"varint,4,opt,name=allright,proto3" json:"allright"`
Halfpair int32 `protobuf:"varint,5,opt,name=halfpair,proto3" json:"halfpair"` Halfpair int32 `protobuf:"varint,5,opt,name=halfpair,proto3" json:"halfpair"`
} }
@ -502,7 +438,7 @@ func (x *DBDColorResult) GetUid() string {
return "" return ""
} }
func (x *DBDColorResult) GetResults() []DBDColorColor { func (x *DBDColorResult) GetResults() []int32 {
if x != nil { if x != nil {
return x.Results return x.Results
} }
@ -530,7 +466,7 @@ type DBDColorRoom struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Rid string `protobuf:"bytes,1,opt,name=rid,proto3" json:"rid"` Rid string `protobuf:"bytes,1,opt,name=rid,proto3" json:"rid"`
Results []DBDColorColor `protobuf:"varint,2,rep,packed,name=results,proto3,enum=DBDColorColor" json:"results"` Results []int32 `protobuf:"varint,2,rep,packed,name=results,proto3" json:"results"`
Red *DBDColorRoomPlayer `protobuf:"bytes,3,opt,name=red,proto3" json:"red"` Red *DBDColorRoomPlayer `protobuf:"bytes,3,opt,name=red,proto3" json:"red"`
Blue *DBDColorRoomPlayer `protobuf:"bytes,4,opt,name=blue,proto3" json:"blue"` Blue *DBDColorRoomPlayer `protobuf:"bytes,4,opt,name=blue,proto3" json:"blue"`
Handles []*DBDColorResult `protobuf:"bytes,5,rep,name=handles,proto3" json:"handles"` Handles []*DBDColorResult `protobuf:"bytes,5,rep,name=handles,proto3" json:"handles"`
@ -575,7 +511,7 @@ func (x *DBDColorRoom) GetRid() string {
return "" return ""
} }
func (x *DBDColorRoom) GetResults() []DBDColorColor { func (x *DBDColorRoom) GetResults() []int32 {
if x != nil { if x != nil {
return x.Results return x.Results
} }
@ -645,20 +581,18 @@ var file_dcolor_dcolor_db_proto_rawDesc = []byte{
0x73, 0x61, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x73, 0x61, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01,
0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f,
0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22,
0x9a, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x75, 0x8a, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x07, 0x72, 0x65, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x73,
0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x07, 0x72, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6c, 0x6c, 0x72, 0x69, 0x67, 0x68, 0x74, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6c, 0x6c, 0x72, 0x69, 0x67, 0x68, 0x74,
0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x6c, 0x6c, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x6c, 0x6c, 0x72, 0x69, 0x67, 0x68, 0x74,
0x12, 0x1a, 0x0a, 0x08, 0x68, 0x61, 0x6c, 0x66, 0x70, 0x61, 0x69, 0x72, 0x18, 0x05, 0x20, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x61, 0x6c, 0x66, 0x70, 0x61, 0x69, 0x72, 0x18, 0x05, 0x20, 0x01,
0x28, 0x05, 0x52, 0x08, 0x68, 0x61, 0x6c, 0x66, 0x70, 0x61, 0x69, 0x72, 0x22, 0xc5, 0x01, 0x0a, 0x28, 0x05, 0x52, 0x08, 0x68, 0x61, 0x6c, 0x66, 0x70, 0x61, 0x69, 0x72, 0x22, 0xb5, 0x01, 0x0a,
0x0c, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x10, 0x0a,
0x03, 0x72, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x69, 0x64, 0x12, 0x03, 0x72, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x69, 0x64, 0x12,
0x28, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05,
0x32, 0x0e, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x03, 0x72, 0x65, 0x64,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f,
0x72, 0x52, 0x6f, 0x6f, 0x6d, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x03, 0x72, 0x65, 0x64, 0x72, 0x52, 0x6f, 0x6f, 0x6d, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x03, 0x72, 0x65, 0x64,
@ -671,15 +605,7 @@ var file_dcolor_dcolor_db_proto_rawDesc = []byte{
0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x69, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x69,
0x6d, 0x70, 0x6c, 0x65, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x6d, 0x70, 0x6c, 0x65, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63,
0x75, 0x6c, 0x74, 0x79, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x65, 0x6c, 0x6c, 0x10, 0x02, 0x75, 0x6c, 0x74, 0x79, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x65, 0x6c, 0x6c, 0x10, 0x02,
0x2a, 0x77, 0x0a, 0x0d, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x6f, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x72, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30, 0x10, 0x00, 0x12, 0x0b,
0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43,
0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f,
0x72, 0x5f, 0x33, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34,
0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x35, 0x10, 0x05, 0x12,
0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07,
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x37, 0x10, 0x07, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -694,33 +620,30 @@ func file_dcolor_dcolor_db_proto_rawDescGZIP() []byte {
return file_dcolor_dcolor_db_proto_rawDescData return file_dcolor_dcolor_db_proto_rawDescData
} }
var file_dcolor_dcolor_db_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_dcolor_dcolor_db_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_dcolor_dcolor_db_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_dcolor_dcolor_db_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_dcolor_dcolor_db_proto_goTypes = []interface{}{ var file_dcolor_dcolor_db_proto_goTypes = []interface{}{
(DBDColorDifficulty)(0), // 0: DBDColorDifficulty (DBDColorDifficulty)(0), // 0: DBDColorDifficulty
(DBDColorColor)(0), // 1: DBDColorColor (*DBDColor)(nil), // 1: DBDColor
(*DBDColor)(nil), // 2: DBDColor (*DBDColorQiecuoInvite)(nil), // 2: DBDColorQiecuoInvite
(*DBDColorQiecuoInvite)(nil), // 3: DBDColorQiecuoInvite (*DBDColorQiecuoRecord)(nil), // 3: DBDColorQiecuoRecord
(*DBDColorQiecuoRecord)(nil), // 4: DBDColorQiecuoRecord (*DBDColorRoomPlayer)(nil), // 4: DBDColorRoomPlayer
(*DBDColorRoomPlayer)(nil), // 5: DBDColorRoomPlayer (*DBDColorResult)(nil), // 5: DBDColorResult
(*DBDColorResult)(nil), // 6: DBDColorResult (*DBDColorRoom)(nil), // 6: DBDColorRoom
(*DBDColorRoom)(nil), // 7: DBDColorRoom (*BaseUserInfo)(nil), // 7: BaseUserInfo
(*BaseUserInfo)(nil), // 8: BaseUserInfo
} }
var file_dcolor_dcolor_db_proto_depIdxs = []int32{ var file_dcolor_dcolor_db_proto_depIdxs = []int32{
3, // 0: DBDColorQiecuoRecord.targets:type_name -> DBDColorQiecuoInvite 2, // 0: DBDColorQiecuoRecord.targets:type_name -> DBDColorQiecuoInvite
0, // 1: DBDColorQiecuoRecord.difficulty:type_name -> DBDColorDifficulty 0, // 1: DBDColorQiecuoRecord.difficulty:type_name -> DBDColorDifficulty
8, // 2: DBDColorRoomPlayer.info:type_name -> BaseUserInfo 7, // 2: DBDColorRoomPlayer.info:type_name -> BaseUserInfo
1, // 3: DBDColorResult.results:type_name -> DBDColorColor 4, // 3: DBDColorRoom.red:type_name -> DBDColorRoomPlayer
1, // 4: DBDColorRoom.results:type_name -> DBDColorColor 4, // 4: DBDColorRoom.blue:type_name -> DBDColorRoomPlayer
5, // 5: DBDColorRoom.red:type_name -> DBDColorRoomPlayer 5, // 5: DBDColorRoom.handles:type_name -> DBDColorResult
5, // 6: DBDColorRoom.blue:type_name -> DBDColorRoomPlayer 6, // [6:6] is the sub-list for method output_type
6, // 7: DBDColorRoom.handles:type_name -> DBDColorResult 6, // [6:6] is the sub-list for method input_type
8, // [8:8] is the sub-list for method output_type 6, // [6:6] is the sub-list for extension type_name
8, // [8:8] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension extendee
8, // [8:8] is the sub-list for extension type_name 0, // [0:6] is the sub-list for field type_name
8, // [8:8] is the sub-list for extension extendee
0, // [0:8] is the sub-list for field type_name
} }
func init() { file_dcolor_dcolor_db_proto_init() } func init() { file_dcolor_dcolor_db_proto_init() }
@ -808,7 +731,7 @@ func file_dcolor_dcolor_db_proto_init() {
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_dcolor_dcolor_db_proto_rawDesc, RawDescriptor: file_dcolor_dcolor_db_proto_rawDesc,
NumEnums: 2, NumEnums: 1,
NumMessages: 6, NumMessages: 6,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,

View File

@ -168,7 +168,7 @@ type DColorSingleResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Results []DBDColorColor `protobuf:"varint,2,rep,packed,name=results,proto3,enum=DBDColorColor" json:"results"` Results []int32 `protobuf:"varint,2,rep,packed,name=results,proto3" json:"results"`
} }
func (x *DColorSingleResp) Reset() { func (x *DColorSingleResp) Reset() {
@ -203,7 +203,7 @@ func (*DColorSingleResp) Descriptor() ([]byte, []int) {
return file_dcolor_dcolor_msg_proto_rawDescGZIP(), []int{3} return file_dcolor_dcolor_msg_proto_rawDescGZIP(), []int{3}
} }
func (x *DColorSingleResp) GetResults() []DBDColorColor { func (x *DColorSingleResp) GetResults() []int32 {
if x != nil { if x != nil {
return x.Results return x.Results
} }
@ -218,7 +218,7 @@ type DColorSingleOverReq struct {
Difficulty DBDColorDifficulty `protobuf:"varint,1,opt,name=difficulty,proto3,enum=DBDColorDifficulty" json:"difficulty"` Difficulty DBDColorDifficulty `protobuf:"varint,1,opt,name=difficulty,proto3,enum=DBDColorDifficulty" json:"difficulty"`
Repeat bool `protobuf:"varint,2,opt,name=Repeat,proto3" json:"Repeat"` Repeat bool `protobuf:"varint,2,opt,name=Repeat,proto3" json:"Repeat"`
Results []DBDColorColor `protobuf:"varint,3,rep,packed,name=results,proto3,enum=DBDColorColor" json:"results"` Results []int32 `protobuf:"varint,3,rep,packed,name=results,proto3" json:"results"`
Handles []*DBDColorResult `protobuf:"bytes,4,rep,name=handles,proto3" json:"handles"` Handles []*DBDColorResult `protobuf:"bytes,4,rep,name=handles,proto3" json:"handles"`
Time float32 `protobuf:"fixed32,5,opt,name=time,proto3" json:"time"` Time float32 `protobuf:"fixed32,5,opt,name=time,proto3" json:"time"`
} }
@ -269,7 +269,7 @@ func (x *DColorSingleOverReq) GetRepeat() bool {
return false return false
} }
func (x *DColorSingleOverReq) GetResults() []DBDColorColor { func (x *DColorSingleOverReq) GetResults() []int32 {
if x != nil { if x != nil {
return x.Results return x.Results
} }
@ -949,7 +949,7 @@ type DColorHandleReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index"` Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index"`
Results []DBDColorColor `protobuf:"varint,2,rep,packed,name=results,proto3,enum=DBDColorColor" json:"results"` Results []int32 `protobuf:"varint,2,rep,packed,name=results,proto3" json:"results"`
} }
func (x *DColorHandleReq) Reset() { func (x *DColorHandleReq) Reset() {
@ -991,7 +991,7 @@ func (x *DColorHandleReq) GetIndex() int32 {
return 0 return 0
} }
func (x *DColorHandleReq) GetResults() []DBDColorColor { func (x *DColorHandleReq) GetResults() []int32 {
if x != nil { if x != nil {
return x.Results return x.Results
} }
@ -1174,19 +1174,17 @@ var file_dcolor_dcolor_msg_proto_rawDesc = []byte{
0x72, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x72, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x0a, 0x64, 0x69, 0x66,
0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x65, 0x70, 0x65, 0x61, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x65, 0x70, 0x65, 0x61,
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x22, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x22,
0x3c, 0x0a, 0x10, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x52, 0x2c, 0x0a, 0x10, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x52,
0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02,
0x20, 0x03, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x43, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xbb, 0x01,
0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xcb, 0x01,
0x0a, 0x13, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4f, 0x76, 0x0a, 0x13, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x4f, 0x76,
0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75,
0x6c, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6c, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x44, 0x42, 0x44, 0x43,
0x6f, 0x6c, 0x6f, 0x72, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x0a, 0x6f, 0x6c, 0x6f, 0x72, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x0a,
0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x65, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x65,
0x70, 0x65, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x52, 0x65, 0x70, 0x65, 0x70, 0x65, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x52, 0x65, 0x70, 0x65,
0x61, 0x74, 0x12, 0x28, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x61, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20,
0x03, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x43, 0x6f, 0x03, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x29, 0x0a, 0x07,
0x6c, 0x6f, 0x72, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x29, 0x0a, 0x07,
0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e,
0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07,
0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18,
@ -1245,12 +1243,11 @@ var file_dcolor_dcolor_msg_proto_rawDesc = []byte{
0x61, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x50, 0x75, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x50, 0x75, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06,
0x72, 0x6f, 0x6f, 0x6d, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x72, 0x6f, 0x6f, 0x6d, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f,
0x6f, 0x6d, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x6f, 0x6d, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x05, 0x52, 0x04, 0x73, 0x69, 0x64, 0x65, 0x22, 0x51, 0x0a, 0x0f, 0x44, 0x43, 0x6f, 0x6c, 0x28, 0x05, 0x52, 0x04, 0x73, 0x69, 0x64, 0x65, 0x22, 0x41, 0x0a, 0x0f, 0x44, 0x43, 0x6f, 0x6c,
0x6f, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6f, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x69,
0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65,
0x78, 0x12, 0x28, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03,
0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x12, 0x0a, 0x10, 0x44,
0x6f, 0x72, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x12, 0x0a, 0x10, 0x44,
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22,
0x51, 0x0a, 0x14, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x51, 0x0a, 0x14, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e,
0x64, 0x6c, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x64, 0x6c, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01,
@ -1305,29 +1302,25 @@ var file_dcolor_dcolor_msg_proto_goTypes = []interface{}{
(*DColorGameOverPush)(nil), // 20: DColorGameOverPush (*DColorGameOverPush)(nil), // 20: DColorGameOverPush
(*DBDColor)(nil), // 21: DBDColor (*DBDColor)(nil), // 21: DBDColor
(DBDColorDifficulty)(0), // 22: DBDColorDifficulty (DBDColorDifficulty)(0), // 22: DBDColorDifficulty
(DBDColorColor)(0), // 23: DBDColorColor (*DBDColorResult)(nil), // 23: DBDColorResult
(*DBDColorResult)(nil), // 24: DBDColorResult (*BaseUserInfo)(nil), // 24: BaseUserInfo
(*BaseUserInfo)(nil), // 25: BaseUserInfo (*DBDColorRoom)(nil), // 25: DBDColorRoom
(*DBDColorRoom)(nil), // 26: DBDColorRoom
} }
var file_dcolor_dcolor_msg_proto_depIdxs = []int32{ var file_dcolor_dcolor_msg_proto_depIdxs = []int32{
21, // 0: DColorInfoResp.info:type_name -> DBDColor 21, // 0: DColorInfoResp.info:type_name -> DBDColor
22, // 1: DColorSingleReq.difficulty:type_name -> DBDColorDifficulty 22, // 1: DColorSingleReq.difficulty:type_name -> DBDColorDifficulty
23, // 2: DColorSingleResp.results:type_name -> DBDColorColor 22, // 2: DColorSingleOverReq.difficulty:type_name -> DBDColorDifficulty
22, // 3: DColorSingleOverReq.difficulty:type_name -> DBDColorDifficulty 23, // 3: DColorSingleOverReq.handles:type_name -> DBDColorResult
23, // 4: DColorSingleOverReq.results:type_name -> DBDColorColor 22, // 4: DColorQiecuoReq.difficulty:type_name -> DBDColorDifficulty
24, // 5: DColorSingleOverReq.handles:type_name -> DBDColorResult 24, // 5: DColorQiecuonotifyPush.user:type_name -> BaseUserInfo
22, // 6: DColorQiecuoReq.difficulty:type_name -> DBDColorDifficulty 22, // 6: DColorQiecuonotifyPush.difficulty:type_name -> DBDColorDifficulty
25, // 7: DColorQiecuonotifyPush.user:type_name -> BaseUserInfo 25, // 7: DColorGameReadyPush.room:type_name -> DBDColorRoom
22, // 8: DColorQiecuonotifyPush.difficulty:type_name -> DBDColorDifficulty 23, // 8: DColorGameHandlePush.handle:type_name -> DBDColorResult
26, // 9: DColorGameReadyPush.room:type_name -> DBDColorRoom 9, // [9:9] is the sub-list for method output_type
23, // 10: DColorHandleReq.results:type_name -> DBDColorColor 9, // [9:9] is the sub-list for method input_type
24, // 11: DColorGameHandlePush.handle:type_name -> DBDColorResult 9, // [9:9] is the sub-list for extension type_name
12, // [12:12] is the sub-list for method output_type 9, // [9:9] is the sub-list for extension extendee
12, // [12:12] is the sub-list for method input_type 0, // [0:9] is the sub-list for field type_name
12, // [12:12] is the sub-list for extension type_name
12, // [12:12] is the sub-list for extension extendee
0, // [0:12] is the sub-list for field type_name
} }
func init() { file_dcolor_dcolor_msg_proto_init() } func init() { file_dcolor_dcolor_msg_proto_init() }

311
pb/maincity_db.pb.go Normal file
View File

@ -0,0 +1,311 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.0
// source: maincity/maincity_db.proto
package pb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type MainCityScene int32
const (
MainCityScene_MainCity MainCityScene = 0 //主城
MainCityScene_WUGUAN MainCityScene = 1 //武馆
)
// Enum value maps for MainCityScene.
var (
MainCityScene_name = map[int32]string{
0: "MainCity",
1: "WUGUAN",
}
MainCityScene_value = map[string]int32{
"MainCity": 0,
"WUGUAN": 1,
}
)
func (x MainCityScene) Enum() *MainCityScene {
p := new(MainCityScene)
*p = x
return p
}
func (x MainCityScene) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (MainCityScene) Descriptor() protoreflect.EnumDescriptor {
return file_maincity_maincity_db_proto_enumTypes[0].Descriptor()
}
func (MainCityScene) Type() protoreflect.EnumType {
return &file_maincity_maincity_db_proto_enumTypes[0]
}
func (x MainCityScene) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use MainCityScene.Descriptor instead.
func (MainCityScene) EnumDescriptor() ([]byte, []int) {
return file_maincity_maincity_db_proto_rawDescGZIP(), []int{0}
}
type DBVector3 struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
X float32 `protobuf:"fixed32,1,opt,name=x,proto3" json:"x"`
Y float32 `protobuf:"fixed32,2,opt,name=y,proto3" json:"y"`
Z float32 `protobuf:"fixed32,3,opt,name=z,proto3" json:"z"`
}
func (x *DBVector3) Reset() {
*x = DBVector3{}
if protoimpl.UnsafeEnabled {
mi := &file_maincity_maincity_db_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBVector3) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBVector3) ProtoMessage() {}
func (x *DBVector3) ProtoReflect() protoreflect.Message {
mi := &file_maincity_maincity_db_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DBVector3.ProtoReflect.Descriptor instead.
func (*DBVector3) Descriptor() ([]byte, []int) {
return file_maincity_maincity_db_proto_rawDescGZIP(), []int{0}
}
func (x *DBVector3) GetX() float32 {
if x != nil {
return x.X
}
return 0
}
func (x *DBVector3) GetY() float32 {
if x != nil {
return x.Y
}
return 0
}
func (x *DBVector3) GetZ() float32 {
if x != nil {
return x.Z
}
return 0
}
type DBMainCityPos struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Player *BaseUserInfo `protobuf:"bytes,1,opt,name=player,proto3" json:"player"`
Pos *DBVector3 `protobuf:"bytes,2,opt,name=pos,proto3" json:"pos"`
Target *DBVector3 `protobuf:"bytes,3,opt,name=target,proto3" json:"target"`
Scene MainCityScene `protobuf:"varint,4,opt,name=scene,proto3,enum=MainCityScene" json:"scene"`
}
func (x *DBMainCityPos) Reset() {
*x = DBMainCityPos{}
if protoimpl.UnsafeEnabled {
mi := &file_maincity_maincity_db_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBMainCityPos) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBMainCityPos) ProtoMessage() {}
func (x *DBMainCityPos) ProtoReflect() protoreflect.Message {
mi := &file_maincity_maincity_db_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DBMainCityPos.ProtoReflect.Descriptor instead.
func (*DBMainCityPos) Descriptor() ([]byte, []int) {
return file_maincity_maincity_db_proto_rawDescGZIP(), []int{1}
}
func (x *DBMainCityPos) GetPlayer() *BaseUserInfo {
if x != nil {
return x.Player
}
return nil
}
func (x *DBMainCityPos) GetPos() *DBVector3 {
if x != nil {
return x.Pos
}
return nil
}
func (x *DBMainCityPos) GetTarget() *DBVector3 {
if x != nil {
return x.Target
}
return nil
}
func (x *DBMainCityPos) GetScene() MainCityScene {
if x != nil {
return x.Scene
}
return MainCityScene_MainCity
}
var File_maincity_maincity_db_proto protoreflect.FileDescriptor
var file_maincity_maincity_db_proto_rawDesc = []byte{
0x0a, 0x1a, 0x6d, 0x61, 0x69, 0x6e, 0x63, 0x69, 0x74, 0x79, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x63,
0x69, 0x74, 0x79, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f,
0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x35, 0x0a, 0x09, 0x44, 0x42, 0x56, 0x65,
0x63, 0x74, 0x6f, 0x72, 0x33, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02,
0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x01,
0x79, 0x12, 0x0c, 0x0a, 0x01, 0x7a, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x01, 0x7a, 0x22,
0x9e, 0x01, 0x0a, 0x0d, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6e, 0x43, 0x69, 0x74, 0x79, 0x50, 0x6f,
0x73, 0x12, 0x25, 0x0a, 0x06, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f,
0x52, 0x06, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72,
0x33, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x12, 0x22, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x56, 0x65, 0x63, 0x74, 0x6f,
0x72, 0x33, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x73, 0x63,
0x65, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x4d, 0x61, 0x69, 0x6e,
0x43, 0x69, 0x74, 0x79, 0x53, 0x63, 0x65, 0x6e, 0x65, 0x52, 0x05, 0x73, 0x63, 0x65, 0x6e, 0x65,
0x2a, 0x29, 0x0a, 0x0d, 0x4d, 0x61, 0x69, 0x6e, 0x43, 0x69, 0x74, 0x79, 0x53, 0x63, 0x65, 0x6e,
0x65, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x61, 0x69, 0x6e, 0x43, 0x69, 0x74, 0x79, 0x10, 0x00, 0x12,
0x0a, 0x0a, 0x06, 0x57, 0x55, 0x47, 0x55, 0x41, 0x4e, 0x10, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_maincity_maincity_db_proto_rawDescOnce sync.Once
file_maincity_maincity_db_proto_rawDescData = file_maincity_maincity_db_proto_rawDesc
)
func file_maincity_maincity_db_proto_rawDescGZIP() []byte {
file_maincity_maincity_db_proto_rawDescOnce.Do(func() {
file_maincity_maincity_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_maincity_maincity_db_proto_rawDescData)
})
return file_maincity_maincity_db_proto_rawDescData
}
var file_maincity_maincity_db_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_maincity_maincity_db_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_maincity_maincity_db_proto_goTypes = []interface{}{
(MainCityScene)(0), // 0: MainCityScene
(*DBVector3)(nil), // 1: DBVector3
(*DBMainCityPos)(nil), // 2: DBMainCityPos
(*BaseUserInfo)(nil), // 3: BaseUserInfo
}
var file_maincity_maincity_db_proto_depIdxs = []int32{
3, // 0: DBMainCityPos.player:type_name -> BaseUserInfo
1, // 1: DBMainCityPos.pos:type_name -> DBVector3
1, // 2: DBMainCityPos.target:type_name -> DBVector3
0, // 3: DBMainCityPos.scene:type_name -> MainCityScene
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_maincity_maincity_db_proto_init() }
func file_maincity_maincity_db_proto_init() {
if File_maincity_maincity_db_proto != nil {
return
}
file_comm_proto_init()
if !protoimpl.UnsafeEnabled {
file_maincity_maincity_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBVector3); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_maincity_maincity_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBMainCityPos); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_maincity_maincity_db_proto_rawDesc,
NumEnums: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_maincity_maincity_db_proto_goTypes,
DependencyIndexes: file_maincity_maincity_db_proto_depIdxs,
EnumInfos: file_maincity_maincity_db_proto_enumTypes,
MessageInfos: file_maincity_maincity_db_proto_msgTypes,
}.Build()
File_maincity_maincity_db_proto = out.File
file_maincity_maincity_db_proto_rawDesc = nil
file_maincity_maincity_db_proto_goTypes = nil
file_maincity_maincity_db_proto_depIdxs = nil
}

214
pb/maincity_msg.pb.go Normal file
View File

@ -0,0 +1,214 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.0
// source: maincity/maincity_msg.proto
package pb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
//同步 无回应
type MainCitySynchPosPeek struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Pos *DBMainCityPos `protobuf:"bytes,1,opt,name=pos,proto3" json:"pos"`
}
func (x *MainCitySynchPosPeek) Reset() {
*x = MainCitySynchPosPeek{}
if protoimpl.UnsafeEnabled {
mi := &file_maincity_maincity_msg_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MainCitySynchPosPeek) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MainCitySynchPosPeek) ProtoMessage() {}
func (x *MainCitySynchPosPeek) ProtoReflect() protoreflect.Message {
mi := &file_maincity_maincity_msg_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MainCitySynchPosPeek.ProtoReflect.Descriptor instead.
func (*MainCitySynchPosPeek) Descriptor() ([]byte, []int) {
return file_maincity_maincity_msg_proto_rawDescGZIP(), []int{0}
}
func (x *MainCitySynchPosPeek) GetPos() *DBMainCityPos {
if x != nil {
return x.Pos
}
return nil
}
//坐标同步
type MainCitySynchPosPush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Pos *DBMainCityPos `protobuf:"bytes,1,opt,name=pos,proto3" json:"pos"`
}
func (x *MainCitySynchPosPush) Reset() {
*x = MainCitySynchPosPush{}
if protoimpl.UnsafeEnabled {
mi := &file_maincity_maincity_msg_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MainCitySynchPosPush) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MainCitySynchPosPush) ProtoMessage() {}
func (x *MainCitySynchPosPush) ProtoReflect() protoreflect.Message {
mi := &file_maincity_maincity_msg_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MainCitySynchPosPush.ProtoReflect.Descriptor instead.
func (*MainCitySynchPosPush) Descriptor() ([]byte, []int) {
return file_maincity_maincity_msg_proto_rawDescGZIP(), []int{1}
}
func (x *MainCitySynchPosPush) GetPos() *DBMainCityPos {
if x != nil {
return x.Pos
}
return nil
}
var File_maincity_maincity_msg_proto protoreflect.FileDescriptor
var file_maincity_maincity_msg_proto_rawDesc = []byte{
0x0a, 0x1b, 0x6d, 0x61, 0x69, 0x6e, 0x63, 0x69, 0x74, 0x79, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x63,
0x69, 0x74, 0x79, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x6d,
0x61, 0x69, 0x6e, 0x63, 0x69, 0x74, 0x79, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x63, 0x69, 0x74, 0x79,
0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x38, 0x0a, 0x14, 0x4d, 0x61, 0x69,
0x6e, 0x43, 0x69, 0x74, 0x79, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x50, 0x6f, 0x73, 0x50, 0x65, 0x65,
0x6b, 0x12, 0x20, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e,
0x2e, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6e, 0x43, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x73, 0x52, 0x03,
0x70, 0x6f, 0x73, 0x22, 0x38, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e, 0x43, 0x69, 0x74, 0x79, 0x53,
0x79, 0x6e, 0x63, 0x68, 0x50, 0x6f, 0x73, 0x50, 0x75, 0x73, 0x68, 0x12, 0x20, 0x0a, 0x03, 0x70,
0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x69,
0x6e, 0x43, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x73, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_maincity_maincity_msg_proto_rawDescOnce sync.Once
file_maincity_maincity_msg_proto_rawDescData = file_maincity_maincity_msg_proto_rawDesc
)
func file_maincity_maincity_msg_proto_rawDescGZIP() []byte {
file_maincity_maincity_msg_proto_rawDescOnce.Do(func() {
file_maincity_maincity_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_maincity_maincity_msg_proto_rawDescData)
})
return file_maincity_maincity_msg_proto_rawDescData
}
var file_maincity_maincity_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_maincity_maincity_msg_proto_goTypes = []interface{}{
(*MainCitySynchPosPeek)(nil), // 0: MainCitySynchPosPeek
(*MainCitySynchPosPush)(nil), // 1: MainCitySynchPosPush
(*DBMainCityPos)(nil), // 2: DBMainCityPos
}
var file_maincity_maincity_msg_proto_depIdxs = []int32{
2, // 0: MainCitySynchPosPeek.pos:type_name -> DBMainCityPos
2, // 1: MainCitySynchPosPush.pos:type_name -> DBMainCityPos
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_maincity_maincity_msg_proto_init() }
func file_maincity_maincity_msg_proto_init() {
if File_maincity_maincity_msg_proto != nil {
return
}
file_maincity_maincity_db_proto_init()
if !protoimpl.UnsafeEnabled {
file_maincity_maincity_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MainCitySynchPosPeek); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_maincity_maincity_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MainCitySynchPosPush); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_maincity_maincity_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_maincity_maincity_msg_proto_goTypes,
DependencyIndexes: file_maincity_maincity_msg_proto_depIdxs,
MessageInfos: file_maincity_maincity_msg_proto_msgTypes,
}.Build()
File_maincity_maincity_msg_proto = out.File
file_maincity_maincity_msg_proto_rawDesc = nil
file_maincity_maincity_msg_proto_goTypes = nil
file_maincity_maincity_msg_proto_depIdxs = nil
}

View File

@ -1516,7 +1516,8 @@ type ParkourRaceOverPush struct {
Winside int32 `protobuf:"varint,1,opt,name=winside,proto3" json:"winside"` //0平局 1 红方胜利 2 蓝方胜利 Winside int32 `protobuf:"varint,1,opt,name=winside,proto3" json:"winside"` //0平局 1 红方胜利 2 蓝方胜利
Race *DBRace `protobuf:"bytes,2,opt,name=race,proto3" json:"race"` //比赛信息 Race *DBRace `protobuf:"bytes,2,opt,name=race,proto3" json:"race"` //比赛信息
Award []*UserAtno `protobuf:"bytes,3,rep,name=award,proto3" json:"award"` //奖励 Weekintegral int32 `protobuf:"varint,3,opt,name=weekintegral,proto3" json:"weekintegral"` //周长积分
Award []*UserAtno `protobuf:"bytes,4,rep,name=award,proto3" json:"award"` //奖励
} }
func (x *ParkourRaceOverPush) Reset() { func (x *ParkourRaceOverPush) Reset() {
@ -1565,6 +1566,13 @@ func (x *ParkourRaceOverPush) GetRace() *DBRace {
return nil return nil
} }
func (x *ParkourRaceOverPush) GetWeekintegral() int32 {
if x != nil {
return x.Weekintegral
}
return 0
}
func (x *ParkourRaceOverPush) GetAward() []*UserAtno { func (x *ParkourRaceOverPush) GetAward() []*UserAtno {
if x != nil { if x != nil {
return x.Award return x.Award
@ -2163,50 +2171,52 @@ var file_parkour_parkour_msg_proto_rawDesc = []byte{
0x52, 0x65, 0x76, 0x69, 0x76, 0x61, 0x6c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x50, 0x75, 0x73, 0x52, 0x65, 0x76, 0x69, 0x76, 0x61, 0x6c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x50, 0x75, 0x73,
0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x75, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x75, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x02, 0x68, 0x70, 0x22, 0x6d, 0x0a, 0x13, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x52, 0x61, 0x02, 0x68, 0x70, 0x22, 0x91, 0x01, 0x0a, 0x13, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x52,
0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x61, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x77,
0x6e, 0x73, 0x69, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69,
0x73, 0x69, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x72, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x72, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20,
0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, 0x52, 0x04, 0x72, 0x61, 0x63, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, 0x52, 0x04, 0x72, 0x61,
0x65, 0x12, 0x1f, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x77, 0x65, 0x65, 0x6b, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72,
0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x77, 0x65, 0x65, 0x6b, 0x69, 0x6e,
0x72, 0x64, 0x22, 0x27, 0x0a, 0x13, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x47, 0x65, 0x74, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x1f, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18,
0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x69, 0x64, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x72, 0x69, 0x64, 0x22, 0x36, 0x0a, 0x14, 0x50, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x22, 0x27, 0x0a, 0x13, 0x50, 0x61, 0x72, 0x6b, 0x6f,
0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x75, 0x72, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x10,
0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0a, 0x03, 0x72, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x72, 0x69, 0x64,
0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x52, 0x04, 0x69, 0x22, 0x36, 0x0a, 0x14, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x47, 0x65, 0x74, 0x52, 0x65,
0x6e, 0x66, 0x6f, 0x22, 0x7e, 0x0a, 0x16, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f,
0x72, 0x4a, 0x6f, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x72, 0x6b, 0x6f,
0x09, 0x63, 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x75, 0x72, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x7e, 0x0a, 0x16, 0x52, 0x50, 0x43, 0x50,
0x52, 0x09, 0x63, 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x6d, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x4a, 0x6f, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52,
0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x18,
0x52, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x64,
0x65, 0x72, 0x12, 0x1f, 0x0a, 0x03, 0x61, 0x69, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x25, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b,
0x0d, 0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x03, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52,
0x61, 0x69, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x03, 0x61, 0x69, 0x73, 0x18, 0x03,
0x72, 0x4a, 0x6f, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x38, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d,
0x0a, 0x18, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x43, 0x61, 0x6e, 0x63, 0x62, 0x65, 0x72, 0x52, 0x03, 0x61, 0x69, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x52, 0x50, 0x43, 0x50,
0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x4a, 0x6f, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52,
0x70, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x65, 0x73, 0x70, 0x22, 0x38, 0x0a, 0x18, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75,
0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x22, 0x1b, 0x0a, 0x19, 0x52, 0x50, 0x43, 0x50, 0x72, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x12,
0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x5c, 0x0a, 0x16, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x22, 0x1b, 0x0a,
0x6f, 0x75, 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x53, 0x75, 0x63, 0x63, 0x52, 0x65, 0x71, 0x12, 0x19, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x43, 0x61, 0x6e, 0x63, 0x65,
0x1f, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x5c, 0x0a, 0x16, 0x52, 0x50,
0x42, 0x52, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x03, 0x72, 0x65, 0x64, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x53, 0x75, 0x63,
0x12, 0x21, 0x0a, 0x04, 0x62, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x63, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28,
0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x04, 0x62, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72,
0x75, 0x6c, 0x65, 0x22, 0x19, 0x0a, 0x17, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x04, 0x62, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20,
0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x53, 0x75, 0x63, 0x63, 0x52, 0x65, 0x73, 0x70, 0x22, 0x49, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62,
0x0a, 0x19, 0x52, 0x50, 0x43, 0x5f, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x54, 0x72, 0x75, 0x65, 0x72, 0x52, 0x04, 0x62, 0x75, 0x6c, 0x65, 0x22, 0x19, 0x0a, 0x17, 0x52, 0x50, 0x43, 0x50,
0x73, 0x74, 0x65, 0x65, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x53, 0x75, 0x63, 0x63, 0x52,
0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x65, 0x73, 0x70, 0x22, 0x49, 0x0a, 0x19, 0x52, 0x50, 0x43, 0x5f, 0x50, 0x61, 0x72, 0x6b, 0x6f,
0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x75, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x65, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x71,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x52, 0x50, 0x43, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x5f, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x65, 0x73, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03,
0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x1c,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x0a, 0x1a, 0x52, 0x50, 0x43, 0x5f, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x54, 0x72, 0x75,
0x73, 0x74, 0x65, 0x65, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

View File

@ -181,7 +181,7 @@ func (this *SCompGateRoute) ReceiveMsg(ctx context.Context, args *pb.AgentMessag
} }
// RPC_NoticeUserClose 接收用户登录通知 // RPC_NoticeUserClose 接收用户登录通知
func (this *SCompGateRoute) NoticeUserLogin(ctx context.Context, args *pb.NoticeUserLoginReq, reply *pb.RPCMessageReply) error { func (this *SCompGateRoute) NoticeUserLogin(ctx context.Context, args *pb.NoticeUserLoginReq, reply *pb.NoticeUserLoginResp) error {
log.Debug("RPC_NoticeUserLogin", log.Field{Key: "args", Value: args}) log.Debug("RPC_NoticeUserLogin", log.Field{Key: "args", Value: args})
conn, err := db.Local() conn, err := db.Local()
if err != nil { if err != nil {
@ -198,7 +198,10 @@ func (this *SCompGateRoute) NoticeUserLogin(ctx context.Context, args *pb.Notice
} }
model.AddList(comm.RDS_EMPTY, args.UserId, user, db.SetDBMgoLog(false)) model.AddList(comm.RDS_EMPTY, args.UserId, user, db.SetDBMgoLog(false))
session := this.GetUserSession(user) session := this.GetUserSession(user)
defer this.PutUserSession(session)
event.TriggerEvent(comm.EventUserLogin, session) event.TriggerEvent(comm.EventUserLogin, session)
session.Push()
reply.WorkerSId = this.service.GetId()
return nil return nil
} }

View File

@ -17,6 +17,7 @@ import (
"go_dreamfactory/modules/chat" "go_dreamfactory/modules/chat"
"go_dreamfactory/modules/combat" "go_dreamfactory/modules/combat"
"go_dreamfactory/modules/dailytask" "go_dreamfactory/modules/dailytask"
"go_dreamfactory/modules/dcolor"
"go_dreamfactory/modules/dispatch" "go_dreamfactory/modules/dispatch"
"go_dreamfactory/modules/dragon" "go_dreamfactory/modules/dragon"
"go_dreamfactory/modules/enchant" "go_dreamfactory/modules/enchant"
@ -39,6 +40,7 @@ import (
"go_dreamfactory/modules/library" "go_dreamfactory/modules/library"
"go_dreamfactory/modules/linestory" "go_dreamfactory/modules/linestory"
"go_dreamfactory/modules/mail" "go_dreamfactory/modules/mail"
"go_dreamfactory/modules/maincity"
"go_dreamfactory/modules/mainline" "go_dreamfactory/modules/mainline"
"go_dreamfactory/modules/moonfantasy" "go_dreamfactory/modules/moonfantasy"
"go_dreamfactory/modules/notify" "go_dreamfactory/modules/notify"
@ -168,6 +170,8 @@ func main() {
achieve.NewModule(), achieve.NewModule(),
jielong.NewModule(), jielong.NewModule(),
entertainment.NewModule(), entertainment.NewModule(),
dcolor.NewModule(),
maincity.NewModule(),
) )
} }