Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
8e5c18f2a7
@ -8,73 +8,73 @@ import (
|
||||
|
||||
var (
|
||||
//friend
|
||||
friend_builders = []*builder{
|
||||
friendBuilders = []*builder{
|
||||
{
|
||||
//list
|
||||
mainType: string(comm.SM_FriendModule),
|
||||
subType: friend.Friend_SubType_List,
|
||||
req: &pb.Friend_List_Req{},
|
||||
rsp: &pb.Friend_List_Rsp{},
|
||||
mainType: string(comm.ModuleFriend),
|
||||
subType: friend.FriendSubTypeList,
|
||||
req: &pb.FriendListReq{},
|
||||
rsp: &pb.FriendListRsp{},
|
||||
enabled: true,
|
||||
}, {
|
||||
//blacklist
|
||||
mainType: string(comm.SM_FriendModule),
|
||||
subType: friend.Friend_SubType_Blacklist,
|
||||
req: &pb.Friend_BlackList_Req{},
|
||||
rsp: &pb.Friend_BlackList_Rsp{},
|
||||
mainType: string(comm.ModuleFriend),
|
||||
subType: friend.FriendSubTypeBlacklist,
|
||||
req: &pb.FriendBlackListReq{},
|
||||
rsp: &pb.FriendBlackListRsp{},
|
||||
}, {
|
||||
//search
|
||||
mainType: string(comm.SM_FriendModule),
|
||||
subType: friend.Friend_SubType_Search,
|
||||
req: &pb.Friend_Search_Req{
|
||||
mainType: string(comm.ModuleFriend),
|
||||
subType: friend.FriendSubTypeSearch,
|
||||
req: &pb.FriendSearchReq{
|
||||
NickName: "", //设置测试参数
|
||||
},
|
||||
rsp: &pb.Friend_Search_Rsp{},
|
||||
rsp: &pb.FriendSearchRsp{},
|
||||
}, {
|
||||
//apply
|
||||
mainType: string(comm.SM_FriendModule),
|
||||
subType: friend.Friend_SubType_Apply,
|
||||
req: &pb.Friend_Apply_Req{},
|
||||
rsp: &pb.Friend_Apply_Rsp{},
|
||||
mainType: string(comm.ModuleFriend),
|
||||
subType: friend.FriendSubTypeApply,
|
||||
req: &pb.FriendApplyReq{},
|
||||
rsp: &pb.FriendApplyRsp{},
|
||||
enabled: true,
|
||||
}, {
|
||||
//applylist
|
||||
mainType: string(comm.SM_FriendModule),
|
||||
subType: friend.Friend_SubType_ApplyList,
|
||||
req: &pb.Friend_ApplyList_Req{},
|
||||
rsp: &pb.Friend_ApplyList_Rsp{},
|
||||
mainType: string(comm.ModuleFriend),
|
||||
subType: friend.FriendSubTypeApplyList,
|
||||
req: &pb.FriendApplyListReq{},
|
||||
rsp: &pb.FriendApplyListRsp{},
|
||||
}, {
|
||||
//agree
|
||||
mainType: string(comm.SM_FriendModule),
|
||||
subType: friend.Friend_SubType_Agree,
|
||||
req: &pb.Friend_Agree_Req{},
|
||||
rsp: &pb.Friend_Agree_Rsp{},
|
||||
mainType: string(comm.ModuleFriend),
|
||||
subType: friend.FriendSubTypeAgree,
|
||||
req: &pb.FriendAgreeReq{},
|
||||
rsp: &pb.FriendAgreeRsp{},
|
||||
}, {
|
||||
//refuse
|
||||
mainType: string(comm.SM_FriendModule),
|
||||
subType: friend.Friend_SubType_Refuse,
|
||||
req: &pb.Friend_Agree_Req{},
|
||||
rsp: &pb.Friend_Agree_Rsp{},
|
||||
mainType: string(comm.ModuleFriend),
|
||||
subType: friend.FriendSubTypeRefuse,
|
||||
req: &pb.FriendAgreeReq{},
|
||||
rsp: &pb.FriendAgreeRsp{},
|
||||
}, {
|
||||
//addblack
|
||||
mainType: string(comm.SM_FriendModule),
|
||||
subType: friend.Friend_SubType_AddBlack,
|
||||
req: &pb.Friend_BlackAdd_Req{
|
||||
mainType: string(comm.ModuleFriend),
|
||||
subType: friend.FriendSubTypeAddBlack,
|
||||
req: &pb.FriendBlackAddReq{
|
||||
FriendId: "",
|
||||
},
|
||||
rsp: &pb.Friend_BlackAdd_Rsp{},
|
||||
rsp: &pb.FriendBlackAddRsp{},
|
||||
}, {
|
||||
//delblack
|
||||
mainType: string(comm.SM_FriendModule),
|
||||
subType: friend.Friend_SubType_DelBlack,
|
||||
req: &pb.Friend_DelBlack_Req{},
|
||||
rsp: &pb.Friend_DelBlack_Rsp{},
|
||||
mainType: string(comm.ModuleFriend),
|
||||
subType: friend.FriendSubTypeDelBlack,
|
||||
req: &pb.FriendDelBlackReq{},
|
||||
rsp: &pb.FriendDelBlackRsp{},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
//声明加入到构建器并发起请求
|
||||
func (r *Robot) RunFriend() {
|
||||
r.addBuilders(friend_builders)
|
||||
r.addBuilders(friendBuilders)
|
||||
r.handleReq()
|
||||
}
|
||||
|
@ -8,19 +8,23 @@ import (
|
||||
|
||||
var (
|
||||
//hero
|
||||
hero_builders = []*builder{
|
||||
heroBuilders = []*builder{
|
||||
{
|
||||
mainType: string(comm.SM_HeroModule),
|
||||
subType: hero.Hero_SubType_List,
|
||||
req: &pb.Hero_List_Req{},
|
||||
rsp: &pb.Hero_List_Rsp{},
|
||||
mainType: string(comm.ModuleHero),
|
||||
subType: hero.HeroSubTypeList,
|
||||
req: &pb.HeroListReq{},
|
||||
rsp: &pb.HeroListRsp{},
|
||||
enabled: true,
|
||||
}, {
|
||||
mainType: string(comm.ModuleHero),
|
||||
subType: hero.HeroSubTypeList,
|
||||
req: &pb.HeroInfoReq{},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
//声明加入到构建器并发起请求
|
||||
func (r *Robot) RunHero() {
|
||||
r.addBuilders(hero_builders)
|
||||
r.addBuilders(heroBuilders)
|
||||
r.handleReq()
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ func (r *Robot) AccountLogin() {
|
||||
log.Printf("区服:[%d] 账号:[%s] login...", r.opts.ServerId, r.opts.Account)
|
||||
builders := []*builder{
|
||||
{
|
||||
mainType: string(comm.SM_UserModule),
|
||||
mainType: string(comm.ModuleUser),
|
||||
subType: user.UserSubTypeLogin,
|
||||
req: &pb.UserLoginReq{
|
||||
Account: r.opts.Account,
|
||||
|
@ -8,8 +8,8 @@ import (
|
||||
var notify_builders = []*builder{
|
||||
{
|
||||
//create
|
||||
mainType: comm.MainType_Notify,
|
||||
subType: comm.SubType_ErrorNotify,
|
||||
mainType: comm.MainTypeNotify,
|
||||
subType: comm.SubTypeErrorNotify,
|
||||
rsp: &pb.ErrorNotify{},
|
||||
enabled: true,
|
||||
},
|
||||
|
@ -9,11 +9,11 @@ import (
|
||||
var pack_builders = []*builder{
|
||||
{
|
||||
//create
|
||||
mainType: string(comm.SM_PackModule),
|
||||
mainType: string(comm.ModulePack),
|
||||
subType: "queryuserpackreq",
|
||||
// req: &pb.Pack_Getlist_Req{IType: 1},
|
||||
rsp: &pb.UserCreateRsp{},
|
||||
enabled: true,
|
||||
rsp: &pb.UserCreateRsp{},
|
||||
enabled: true,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,6 @@ func (r *Robot) handleReq() {
|
||||
|
||||
//执行响应
|
||||
func (r *Robot) handleRsp(msg *pb.UserMessage) {
|
||||
|
||||
for i, b := range r.builders {
|
||||
if b.enabled && (msg.MainType == b.mainType &&
|
||||
msg.SubType == b.subType) {
|
||||
|
@ -10,13 +10,13 @@ import (
|
||||
var user_builders = []*builder{
|
||||
{
|
||||
//create
|
||||
mainType: string(comm.SM_UserModule),
|
||||
mainType: string(comm.ModuleUser),
|
||||
subType: user.UserSubTypeCreate,
|
||||
req: &pb.UserCreateReq{ //设置请求参数
|
||||
NickName: "乐谷6281",
|
||||
},
|
||||
rsp: &pb.UserCreateRsp{},
|
||||
enabled: true,
|
||||
rsp: &pb.UserCreateRsp{},
|
||||
// enabled: true,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -22,23 +22,23 @@ const (
|
||||
|
||||
//ERR
|
||||
const (
|
||||
MainType_Notify = "notify" //通知
|
||||
SubType_ErrorNotify = "errornotify" //错误通知
|
||||
MainTypeNotify = "notify" //通知
|
||||
SubTypeErrorNotify = "errornotify" //错误通知
|
||||
)
|
||||
|
||||
//模块名定义处
|
||||
const (
|
||||
SM_GateModule core.M_Modules = "gateway" //gate模块 网关服务模块
|
||||
SM_WebModule core.M_Modules = "web" //web模块
|
||||
SM_UserModule core.M_Modules = "user" //用户模块
|
||||
SM_PackModule core.M_Modules = "pack" //背包模块
|
||||
SM_MailModule core.M_Modules = "mail" //邮件模块
|
||||
SM_FriendModule core.M_Modules = "friend" //好友模块
|
||||
SM_LogModelModule core.M_Modules = "model" //日志模块
|
||||
SM_EquipmentModule core.M_Modules = "equipment" //装备模块
|
||||
SM_HeroModule core.M_Modules = "hero" //英雄模块
|
||||
SM_ForumModule core.M_Modules = "forum" //论坛模块
|
||||
SM_ItemsModule core.M_Modules = "item"
|
||||
ModuleGate core.M_Modules = "gateway" //gate模块 网关服务模块
|
||||
ModuleWeb core.M_Modules = "web" //web模块
|
||||
ModuleUser core.M_Modules = "user" //用户模块
|
||||
ModulePack core.M_Modules = "pack" //背包模块
|
||||
ModuleMail core.M_Modules = "mail" //邮件模块
|
||||
ModuleFriend core.M_Modules = "friend" //好友模块
|
||||
ModuleLogModel core.M_Modules = "model" //日志模块
|
||||
ModuleEquipment core.M_Modules = "equipment" //装备模块
|
||||
ModuleHero core.M_Modules = "hero" //英雄模块
|
||||
ModuleForum core.M_Modules = "forum" //论坛模块
|
||||
ModuleItems core.M_Modules = "item"
|
||||
)
|
||||
|
||||
//RPC服务接口定义处
|
||||
@ -55,13 +55,13 @@ const ( //Rpc
|
||||
|
||||
//事件类型定义处
|
||||
const (
|
||||
Event_UserLogin core.Event_Key = "Event_UserLogin" //登录事件
|
||||
Event_CreateUser core.Event_Key = "Event_CreateUser" //创建角色事件
|
||||
Event_UserOffline core.Event_Key = "Event_UserOffline" //用户离线事件
|
||||
EventUserLogin core.Event_Key = "Event_UserLogin" //登录事件
|
||||
EventCreateUser core.Event_Key = "Event_CreateUser" //创建角色事件
|
||||
EventUserOffline core.Event_Key = "Event_UserOffline" //用户离线事件
|
||||
)
|
||||
|
||||
const (
|
||||
DBService_Status string = "DBService_status"
|
||||
DBServiceStatus string = "DBService_status"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -42,11 +42,11 @@ type (
|
||||
|
||||
// 获取英雄
|
||||
// heroId 英雄ID
|
||||
GetHero(uid, heroId string) (*pb.DB_HeroData, pb.ErrorCode)
|
||||
GetHero(uid, heroId string) (*pb.DBHero, pb.ErrorCode)
|
||||
// 佩戴装备
|
||||
UpdateEquipment(hero *pb.DB_HeroData, equip []*pb.DB_Equipment) (code pb.ErrorCode)
|
||||
UpdateEquipment(hero *pb.DBHero, equip []*pb.DB_Equipment) (code pb.ErrorCode)
|
||||
//获取玩家英雄列表
|
||||
GetHeroList(uid string) []*pb.DB_HeroData
|
||||
GetHeroList(uid string) []*pb.DBHero
|
||||
}
|
||||
|
||||
//玩家
|
||||
|
@ -66,24 +66,28 @@ func (this *UserSession) IsLogin() bool {
|
||||
///wokerId 用户绑定worker服务id
|
||||
func (this *UserSession) Bind(uid string, wokerId string) (err error) {
|
||||
reply := &pb.RPCMessageReply{}
|
||||
if err := this.service.RpcCall(context.Background(), fmt.Sprintf("%s/%s", Service_Gateway, this.GatewayServiceId), string(Rpc_GatewayAgentBind), &pb.AgentBuildReq{
|
||||
if err = this.service.RpcCall(context.Background(), fmt.Sprintf("%s/%s", Service_Gateway, this.GatewayServiceId), string(Rpc_GatewayAgentBind), &pb.AgentBuildReq{
|
||||
UserSessionId: this.SessionId,
|
||||
UserId: uid,
|
||||
WorkerId: wokerId,
|
||||
}, reply); err != nil {
|
||||
log.Errorf("Bind UserSession:%s UserId:%s err:%v", this.SessionId, this.UserId, err)
|
||||
return
|
||||
}
|
||||
this.UserId = uid
|
||||
return
|
||||
}
|
||||
|
||||
//解绑uid 注销和切换账号是处理
|
||||
func (this *UserSession) UnBind() (err error) {
|
||||
reply := &pb.RPCMessageReply{}
|
||||
if err := this.service.RpcCall(context.Background(), fmt.Sprintf("%s/%s", Service_Gateway, this.GatewayServiceId), string(Rpc_GatewayAgentUnBind), &pb.AgentUnBuildReq{
|
||||
if err = this.service.RpcCall(context.Background(), fmt.Sprintf("%s/%s", Service_Gateway, this.GatewayServiceId), string(Rpc_GatewayAgentUnBind), &pb.AgentUnBuildReq{
|
||||
UserSessionId: this.SessionId,
|
||||
}, reply); err != nil {
|
||||
log.Errorf("UnBuild UserSession:%s UserId:%s err:%v", this.SessionId, this.UserId, err)
|
||||
return
|
||||
}
|
||||
this.UserId = ""
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ func (this *DB_Comp) Start() (err error) {
|
||||
err = this.MCompModel.Start()
|
||||
model_count := this.Model_TotalCount()
|
||||
if model_count > 0 { //1000
|
||||
this.Redis.Set(comm.DBService_Status, true, -1)
|
||||
this.Redis.Set(comm.DBServiceStatus, true, -1)
|
||||
this.isInit = false
|
||||
} else {
|
||||
this.isInit = true
|
||||
@ -48,7 +48,7 @@ func (this *DB_Comp) run() {
|
||||
this.Model_UpdateDBByLog("")
|
||||
}
|
||||
if !this.isInit && this.Model_TotalCount() <= 0 {
|
||||
this.Redis.Delete(comm.DBService_Status)
|
||||
this.Redis.Delete(comm.DBServiceStatus)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ func (this *DBService) Init(service core.IService, module core.IModule, options
|
||||
}
|
||||
|
||||
func (this *DBService) GetType() core.M_Modules {
|
||||
return comm.SM_LogModelModule
|
||||
return comm.ModuleLogModel
|
||||
}
|
||||
|
||||
func (this *DBService) OnInstallComp() {
|
||||
|
@ -14,7 +14,7 @@ func (this *apiComp) EquipCheck(session comm.IUserSession, req *pb.Equipment_Equ
|
||||
errorCode pb.ErrorCode
|
||||
confs []*cfg.Game_equipData
|
||||
equipments []*pb.DB_Equipment
|
||||
hero *pb.DB_HeroData
|
||||
hero *pb.DBHero
|
||||
)
|
||||
confs = make([]*cfg.Game_equipData, len(req.EquipmentId))
|
||||
equipments = make([]*pb.DB_Equipment, len(req.EquipmentId))
|
||||
@ -53,13 +53,13 @@ func (this *apiComp) Equip(session comm.IUserSession, agrs map[string]interface{
|
||||
equipment *pb.DB_Equipment
|
||||
equipments []*pb.DB_Equipment
|
||||
updatequipment []*pb.DB_Equipment
|
||||
hero *pb.DB_HeroData
|
||||
hero *pb.DBHero
|
||||
)
|
||||
|
||||
confs = agrs["conf"].([]*cfg.Game_equipData)
|
||||
equipments = agrs["equipment"].([]*pb.DB_Equipment)
|
||||
updatequipment = make([]*pb.DB_Equipment, 0)
|
||||
hero = agrs["hero"].(*pb.DB_HeroData)
|
||||
hero = agrs["hero"].(*pb.DBHero)
|
||||
|
||||
for i, v := range hero.EquipID {
|
||||
if v != "" {
|
||||
|
@ -55,7 +55,7 @@ func (this *apiComp) Upgrade(session comm.IUserSession, agrs map[string]interfac
|
||||
conf *cfg.Game_equipData
|
||||
intensify *cfg.Game_equipIntensifyData
|
||||
equipment *pb.DB_Equipment
|
||||
hero *pb.DB_HeroData
|
||||
hero *pb.DBHero
|
||||
equipments []*pb.DB_Equipment
|
||||
issucc bool
|
||||
)
|
||||
|
@ -31,7 +31,7 @@ type Equipment struct {
|
||||
|
||||
//模块名
|
||||
func (this *Equipment) GetType() core.M_Modules {
|
||||
return comm.SM_EquipmentModule
|
||||
return comm.ModuleEquipment
|
||||
}
|
||||
|
||||
//模块初始化接口 注册用户创建角色事件
|
||||
@ -45,7 +45,7 @@ func (this *Equipment) Init(service core.IService, module core.IModule, options
|
||||
func (this *Equipment) Start() (err error) {
|
||||
err = this.ModuleBase.Start()
|
||||
var module interface{}
|
||||
if module, err = this.service.GetModule(comm.SM_HeroModule); err != nil {
|
||||
if module, err = this.service.GetModule(comm.ModuleHero); err != nil {
|
||||
log.Errorf("Equipment Start err:%v", err)
|
||||
return
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ type Forum struct {
|
||||
|
||||
//模块名
|
||||
func (this *Forum) GetType() core.M_Modules {
|
||||
return comm.SM_EquipmentModule
|
||||
return comm.ModuleEquipment
|
||||
}
|
||||
|
||||
//模块初始化接口 注册用户创建角色事件
|
||||
|
@ -6,15 +6,15 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
Friend_SubType_List = "list"
|
||||
Friend_SubType_Apply = "apply"
|
||||
Friend_SubType_ApplyList = "applylist"
|
||||
Friend_SubType_AddBlack = "addblack"
|
||||
Friend_SubType_DelBlack = "delblack"
|
||||
Friend_SubType_Blacklist = "blacklist"
|
||||
Friend_SubType_Agree = "agree"
|
||||
Friend_SubType_Refuse = "refuse"
|
||||
Friend_SubType_Search = "search"
|
||||
FriendSubTypeList = "list"
|
||||
FriendSubTypeApply = "apply"
|
||||
FriendSubTypeApplyList = "applylist"
|
||||
FriendSubTypeAddBlack = "addblack"
|
||||
FriendSubTypeDelBlack = "delblack"
|
||||
FriendSubTypeBlacklist = "blacklist"
|
||||
FriendSubTypeAgree = "agree"
|
||||
FriendSubTypeRefuse = "refuse"
|
||||
FriendSubTypeSearch = "search"
|
||||
)
|
||||
|
||||
type apiComp struct {
|
||||
|
@ -6,14 +6,14 @@ import (
|
||||
"go_dreamfactory/utils"
|
||||
)
|
||||
|
||||
func (this *apiComp) AddblackCheck(session comm.IUserSession, req *pb.Friend_BlackAdd_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) AddblackCheck(session comm.IUserSession, req *pb.FriendBlackAddReq) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
chk = make(map[string]interface{})
|
||||
var (
|
||||
err error
|
||||
blackNumMax = 50 //TODO 从配置中读取
|
||||
)
|
||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||
target := &pb.DB_FriendData{UId: req.FriendId}
|
||||
self := &pb.DBFriend{UId: session.GetUserId()}
|
||||
target := &pb.DBFriend{UId: req.FriendId}
|
||||
|
||||
err = this.module.modelFriend.Get(session.GetUserId(), self)
|
||||
if self == nil || err != nil {
|
||||
@ -58,22 +58,22 @@ func (this *apiComp) AddblackCheck(session comm.IUserSession, req *pb.Friend_Bla
|
||||
}
|
||||
|
||||
//加入黑名单
|
||||
func (this *apiComp) Addblack(session comm.IUserSession, chk map[string]interface{}, req *pb.Friend_BlackAdd_Req) (code pb.ErrorCode) {
|
||||
func (this *apiComp) Addblack(session comm.IUserSession, chk map[string]interface{}, req *pb.FriendBlackAddReq) (code pb.ErrorCode) {
|
||||
var (
|
||||
self *pb.DB_FriendData
|
||||
rsp *pb.Friend_BlackAdd_Rsp
|
||||
self *pb.DBFriend
|
||||
rsp *pb.FriendBlackAddRsp
|
||||
)
|
||||
|
||||
defer func() {
|
||||
rsp = &pb.Friend_BlackAdd_Rsp{
|
||||
rsp = &pb.FriendBlackAddRsp{
|
||||
FriendId: req.FriendId,
|
||||
UserId: session.GetUserId(),
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), Friend_SubType_AddBlack, rsp)
|
||||
session.SendMsg(string(this.module.GetType()), FriendSubTypeAddBlack, rsp)
|
||||
}()
|
||||
|
||||
if v, ok := chk["self"]; ok {
|
||||
self = v.(*pb.DB_FriendData)
|
||||
self = v.(*pb.DBFriend)
|
||||
//将目标加入黑名单
|
||||
self.BlackIds = append(self.BlackIds, req.FriendId)
|
||||
|
||||
|
@ -6,10 +6,10 @@ import (
|
||||
"go_dreamfactory/utils"
|
||||
)
|
||||
|
||||
func (this *apiComp) AgreeCheck(session comm.IUserSession, req *pb.Friend_Agree_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) AgreeCheck(session comm.IUserSession, req *pb.FriendAgreeReq) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
chk = make(map[string]interface{})
|
||||
var err error
|
||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||
self := &pb.DBFriend{UId: session.GetUserId()}
|
||||
|
||||
//获取玩家自己好友数据
|
||||
err = this.module.modelFriend.Get(session.GetUserId(), self)
|
||||
@ -34,18 +34,18 @@ func (this *apiComp) AgreeCheck(session comm.IUserSession, req *pb.Friend_Agree_
|
||||
}
|
||||
|
||||
//单个/批量同意
|
||||
func (this *apiComp) Agree(session comm.IUserSession, chk map[string]interface{}, req *pb.Friend_Agree_Req) (code pb.ErrorCode) {
|
||||
func (this *apiComp) Agree(session comm.IUserSession, chk map[string]interface{}, req *pb.FriendAgreeReq) (code pb.ErrorCode) {
|
||||
var (
|
||||
self *pb.DB_FriendData
|
||||
rsp *pb.Friend_Agree_Rsp
|
||||
self *pb.DBFriend
|
||||
rsp *pb.FriendAgreeRsp
|
||||
optNum int32
|
||||
)
|
||||
|
||||
defer func() {
|
||||
rsp = &pb.Friend_Agree_Rsp{
|
||||
rsp = &pb.FriendAgreeRsp{
|
||||
Num: optNum,
|
||||
}
|
||||
err := session.SendMsg(string(this.module.GetType()), Friend_SubType_Agree, rsp)
|
||||
err := session.SendMsg(string(this.module.GetType()), FriendSubTypeAgree, rsp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
@ -56,7 +56,7 @@ func (this *apiComp) Agree(session comm.IUserSession, chk map[string]interface{}
|
||||
code = pb.ErrorCode_FriendTargetNoData
|
||||
return
|
||||
} else {
|
||||
self = v.(*pb.DB_FriendData)
|
||||
self = v.(*pb.DBFriend)
|
||||
}
|
||||
|
||||
if agreeIds, ok := chk["agreeIds"]; ok {
|
||||
@ -70,7 +70,7 @@ func (this *apiComp) Agree(session comm.IUserSession, chk map[string]interface{}
|
||||
}
|
||||
|
||||
//双向添加:将自己加入到申请人的好友列表中
|
||||
target := &pb.DB_FriendData{}
|
||||
target := &pb.DBFriend{}
|
||||
err := this.module.modelFriend.Get(userId, target)
|
||||
if target == nil || err != nil {
|
||||
code = pb.ErrorCode_FriendTargetNoData
|
||||
|
@ -7,11 +7,11 @@ import (
|
||||
"go_dreamfactory/utils"
|
||||
)
|
||||
|
||||
func (this *apiComp) ApplyCheck(session comm.IUserSession, req *pb.Friend_Apply_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) ApplyCheck(session comm.IUserSession, req *pb.FriendApplyReq) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
chk = make(map[string]interface{})
|
||||
var err error
|
||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||
target := &pb.DB_FriendData{UId: req.FriendId}
|
||||
self := &pb.DBFriend{UId: session.GetUserId()}
|
||||
target := &pb.DBFriend{UId: req.FriendId}
|
||||
|
||||
//获取玩家自己好友数据
|
||||
err = this.module.modelFriend.Get(session.GetUserId(), self)
|
||||
@ -79,24 +79,24 @@ func (this *apiComp) ApplyCheck(session comm.IUserSession, req *pb.Friend_Apply_
|
||||
}
|
||||
|
||||
//好友申请
|
||||
func (this *apiComp) Apply(session comm.IUserSession, chk map[string]interface{}, req *pb.Friend_Apply_Req) (code pb.ErrorCode) {
|
||||
func (this *apiComp) Apply(session comm.IUserSession, chk map[string]interface{}, req *pb.FriendApplyReq) (code pb.ErrorCode) {
|
||||
var (
|
||||
target *pb.DB_FriendData
|
||||
rsp *pb.Friend_Apply_Rsp
|
||||
target *pb.DBFriend
|
||||
rsp *pb.FriendApplyRsp
|
||||
)
|
||||
|
||||
defer func() {
|
||||
utils.TraceFunc(session.GetUserId(), string(this.module.GetType()), Friend_SubType_Apply, req, rsp)
|
||||
utils.TraceFunc(session.GetUserId(), string(this.module.GetType()), FriendSubTypeApply, req, rsp)
|
||||
}()
|
||||
|
||||
defer func() {
|
||||
if code == pb.ErrorCode_Success {
|
||||
rsp = &pb.Friend_Apply_Rsp{
|
||||
rsp = &pb.FriendApplyRsp{
|
||||
UserId: session.GetUserId(),
|
||||
FriendId: req.FriendId,
|
||||
}
|
||||
}
|
||||
err := session.SendMsg(string(this.module.GetType()), Friend_SubType_Apply, rsp)
|
||||
err := session.SendMsg(string(this.module.GetType()), FriendSubTypeApply, rsp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
@ -107,7 +107,7 @@ func (this *apiComp) Apply(session comm.IUserSession, chk map[string]interface{}
|
||||
code = pb.ErrorCode_FriendTargetNoData
|
||||
return
|
||||
} else {
|
||||
target = v.(*pb.DB_FriendData)
|
||||
target = v.(*pb.DBFriend)
|
||||
}
|
||||
|
||||
//将自己加入到目标用户的申请列表中
|
||||
|
@ -5,9 +5,9 @@ import (
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
func (this *apiComp) ApplyListCheck(session comm.IUserSession, req *pb.Friend_ApplyList_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) ApplyListCheck(session comm.IUserSession, req *pb.FriendApplyListReq) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
chk = make(map[string]interface{})
|
||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||
self := &pb.DBFriend{UId: session.GetUserId()}
|
||||
err := this.module.modelFriend.Get(session.GetUserId(), self)
|
||||
if self == nil || err != nil {
|
||||
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
|
||||
@ -18,24 +18,24 @@ func (this *apiComp) ApplyListCheck(session comm.IUserSession, req *pb.Friend_Ap
|
||||
}
|
||||
|
||||
//申请列表
|
||||
func (this *apiComp) ApplyList(session comm.IUserSession, chk map[string]interface{}, req *pb.Friend_ApplyList_Req) (code pb.ErrorCode) {
|
||||
func (this *apiComp) ApplyList(session comm.IUserSession, chk map[string]interface{}, req *pb.FriendApplyListReq) (code pb.ErrorCode) {
|
||||
var (
|
||||
self *pb.DB_FriendData
|
||||
rsp *pb.Friend_ApplyList_Rsp
|
||||
self *pb.DBFriend
|
||||
rsp *pb.FriendApplyListRsp
|
||||
list []*pb.FriendBase
|
||||
)
|
||||
|
||||
defer func() {
|
||||
if code == pb.ErrorCode_Success {
|
||||
rsp = &pb.Friend_ApplyList_Rsp{
|
||||
rsp = &pb.FriendApplyListRsp{
|
||||
List: list,
|
||||
}
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), Friend_SubType_ApplyList, rsp)
|
||||
session.SendMsg(string(this.module.GetType()), FriendSubTypeApplyList, rsp)
|
||||
}()
|
||||
|
||||
if v, ok := chk["self"]; ok {
|
||||
self = v.(*pb.DB_FriendData)
|
||||
self = v.(*pb.DBFriend)
|
||||
for _, userId := range self.ApplyIds {
|
||||
//TODO 组装FriendBase明细数据
|
||||
list = append(list, &pb.FriendBase{
|
||||
|
@ -5,9 +5,9 @@ import (
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
func (this *apiComp) BlacklistCheck(session comm.IUserSession, req *pb.Friend_BlackList_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) BlacklistCheck(session comm.IUserSession, req *pb.FriendBlackListReq) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
chk = make(map[string]interface{})
|
||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||
self := &pb.DBFriend{UId: session.GetUserId()}
|
||||
err := this.module.modelFriend.Get(session.GetUserId(), self)
|
||||
if self == nil || err != nil {
|
||||
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
|
||||
@ -18,19 +18,19 @@ func (this *apiComp) BlacklistCheck(session comm.IUserSession, req *pb.Friend_Bl
|
||||
}
|
||||
|
||||
//黑名单
|
||||
func (this *apiComp) Blacklist(session comm.IUserSession, chk map[string]interface{}, req *pb.Friend_BlackList_Req) (code pb.ErrorCode) {
|
||||
func (this *apiComp) Blacklist(session comm.IUserSession, chk map[string]interface{}, req *pb.FriendBlackListReq) (code pb.ErrorCode) {
|
||||
var (
|
||||
self *pb.DB_FriendData
|
||||
rsp *pb.Friend_BlackList_Rsp
|
||||
self *pb.DBFriend
|
||||
rsp *pb.FriendBlackListRsp
|
||||
list []*pb.FriendBase
|
||||
)
|
||||
|
||||
defer func() {
|
||||
rsp = &pb.Friend_BlackList_Rsp{
|
||||
rsp = &pb.FriendBlackListRsp{
|
||||
Friends: list,
|
||||
}
|
||||
|
||||
err := session.SendMsg(string(this.module.GetType()), Friend_SubType_Blacklist, rsp)
|
||||
err := session.SendMsg(string(this.module.GetType()), FriendSubTypeBlacklist, rsp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
@ -38,7 +38,7 @@ func (this *apiComp) Blacklist(session comm.IUserSession, chk map[string]interfa
|
||||
}()
|
||||
|
||||
if v, ok := chk["self"]; ok {
|
||||
self = v.(*pb.DB_FriendData)
|
||||
self = v.(*pb.DBFriend)
|
||||
for _, userId := range self.BlackIds {
|
||||
//TODO 完善FriendBase信息
|
||||
list = append(list, &pb.FriendBase{
|
||||
|
@ -5,11 +5,11 @@ import (
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
func (this *apiComp) DelCheck(session comm.IUserSession, req *pb.Friend_Del_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) DelCheck(session comm.IUserSession, req *pb.FriendDelReq) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
return
|
||||
}
|
||||
|
||||
//删除好友
|
||||
func (this *apiComp) Del(session comm.IUserSession, chk map[string]interface{}, req *pb.Friend_Del_Req) error {
|
||||
func (this *apiComp) Del(session comm.IUserSession, chk map[string]interface{}, req *pb.FriendDelReq) error {
|
||||
return nil
|
||||
}
|
||||
|
@ -6,9 +6,9 @@ import (
|
||||
"go_dreamfactory/utils"
|
||||
)
|
||||
|
||||
func (this *apiComp) DelblackCheck(session comm.IUserSession, req *pb.Friend_DelBlack_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) DelblackCheck(session comm.IUserSession, req *pb.FriendDelBlackReq) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
chk = make(map[string]interface{})
|
||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||
self := &pb.DBFriend{UId: session.GetUserId()}
|
||||
err := this.module.modelFriend.Get(session.GetUserId(), self)
|
||||
if self == nil || err != nil {
|
||||
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
|
||||
@ -19,19 +19,19 @@ func (this *apiComp) DelblackCheck(session comm.IUserSession, req *pb.Friend_Del
|
||||
}
|
||||
|
||||
//删除黑名单
|
||||
func (this *apiComp) Delblack(session comm.IUserSession, chk map[string]interface{}, req *pb.Friend_DelBlack_Req) (code pb.ErrorCode) {
|
||||
func (this *apiComp) Delblack(session comm.IUserSession, chk map[string]interface{}, req *pb.FriendDelBlackReq) (code pb.ErrorCode) {
|
||||
var (
|
||||
self *pb.DB_FriendData
|
||||
rsp *pb.Friend_DelBlack_Rsp
|
||||
self *pb.DBFriend
|
||||
rsp *pb.FriendDelBlackRsp
|
||||
)
|
||||
defer func() {
|
||||
if code == pb.ErrorCode_Success {
|
||||
rsp = &pb.Friend_DelBlack_Rsp{
|
||||
rsp = &pb.FriendDelBlackRsp{
|
||||
FriendId: req.FriendId,
|
||||
UserId: session.GetUserId(),
|
||||
}
|
||||
}
|
||||
err := session.SendMsg(string(this.module.GetType()), Friend_SubType_DelBlack, rsp)
|
||||
err := session.SendMsg(string(this.module.GetType()), FriendSubTypeDelBlack, rsp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
@ -39,7 +39,7 @@ func (this *apiComp) Delblack(session comm.IUserSession, chk map[string]interfac
|
||||
}()
|
||||
|
||||
if v, ok := chk["self"]; ok {
|
||||
self = v.(*pb.DB_FriendData)
|
||||
self = v.(*pb.DBFriend)
|
||||
//从黑名单列表中删除目标
|
||||
self.BlackIds = utils.DeleteString(self.BlackIds, req.FriendId)
|
||||
//更新黑名单
|
||||
|
@ -5,9 +5,9 @@ import (
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.Friend_List_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.FriendListReq) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
chk = make(map[string]interface{})
|
||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||
self := &pb.DBFriend{UId: session.GetUserId()}
|
||||
err := this.module.modelFriend.Get(session.GetUserId(), self)
|
||||
if self == nil || err != nil {
|
||||
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
|
||||
@ -18,18 +18,18 @@ func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.Friend_List_Re
|
||||
}
|
||||
|
||||
//好友列表
|
||||
func (this *apiComp) List(session comm.IUserSession, chk map[string]interface{}, req *pb.Friend_List_Req) (code pb.ErrorCode) {
|
||||
func (this *apiComp) List(session comm.IUserSession, chk map[string]interface{}, req *pb.FriendListReq) (code pb.ErrorCode) {
|
||||
var (
|
||||
self *pb.DB_FriendData
|
||||
rsp *pb.Friend_List_Rsp
|
||||
self *pb.DBFriend
|
||||
rsp *pb.FriendListRsp
|
||||
list []*pb.FriendBase
|
||||
)
|
||||
|
||||
defer func() {
|
||||
rsp = &pb.Friend_List_Rsp{
|
||||
rsp = &pb.FriendListRsp{
|
||||
List: list,
|
||||
}
|
||||
err := session.SendMsg(string(this.module.GetType()), Friend_SubType_List, rsp)
|
||||
err := session.SendMsg(string(this.module.GetType()), FriendSubTypeList, rsp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
@ -37,7 +37,7 @@ func (this *apiComp) List(session comm.IUserSession, chk map[string]interface{},
|
||||
}()
|
||||
|
||||
if v, ok := chk["self"]; ok {
|
||||
self = v.(*pb.DB_FriendData)
|
||||
self = v.(*pb.DBFriend)
|
||||
for _, userId := range self.FriendIds {
|
||||
list = append(list, &pb.FriendBase{
|
||||
UserId: userId,
|
||||
|
@ -6,10 +6,10 @@ import (
|
||||
"go_dreamfactory/utils"
|
||||
)
|
||||
|
||||
func (this *apiComp) RefuseCheck(session comm.IUserSession, req *pb.Friend_Refuse_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) RefuseCheck(session comm.IUserSession, req *pb.FriendRefuseReq) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
chk = make(map[string]interface{})
|
||||
var err error
|
||||
self := &pb.DB_FriendData{UId: session.GetUserId()}
|
||||
self := &pb.DBFriend{UId: session.GetUserId()}
|
||||
|
||||
//获取玩家自己好友数据
|
||||
err = this.module.modelFriend.Get(session.GetUserId(), self)
|
||||
@ -33,19 +33,19 @@ func (this *apiComp) RefuseCheck(session comm.IUserSession, req *pb.Friend_Refus
|
||||
}
|
||||
|
||||
//单个/批量拒绝
|
||||
func (this *apiComp) Refuse(session comm.IUserSession, chk map[string]interface{}, req *pb.Friend_Refuse_Req) (code pb.ErrorCode) {
|
||||
func (this *apiComp) Refuse(session comm.IUserSession, chk map[string]interface{}, req *pb.FriendRefuseReq) (code pb.ErrorCode) {
|
||||
//将申请人从申请列表中删除
|
||||
var (
|
||||
self *pb.DB_FriendData
|
||||
rsp *pb.Friend_Refuse_Rsp
|
||||
self *pb.DBFriend
|
||||
rsp *pb.FriendRefuseRsp
|
||||
optNum int32
|
||||
)
|
||||
defer func() {
|
||||
rsp = &pb.Friend_Refuse_Rsp{
|
||||
rsp = &pb.FriendRefuseRsp{
|
||||
Num: optNum,
|
||||
}
|
||||
|
||||
err := session.SendMsg(string(this.module.GetType()), Friend_SubType_Refuse, rsp)
|
||||
err := session.SendMsg(string(this.module.GetType()), FriendSubTypeRefuse, rsp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
@ -56,7 +56,7 @@ func (this *apiComp) Refuse(session comm.IUserSession, chk map[string]interface{
|
||||
code = pb.ErrorCode_FriendTargetNoData
|
||||
return
|
||||
} else {
|
||||
self = v.(*pb.DB_FriendData)
|
||||
self = v.(*pb.DBFriend)
|
||||
|
||||
if v, ok := chk["refuseIds"]; ok {
|
||||
//将申请人从申请列表中删除
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
func (this *apiComp) SearchCheck(session comm.IUserSession, req *pb.Friend_Search_Req) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) SearchCheck(session comm.IUserSession, req *pb.FriendSearchReq) (chk map[string]interface{}, code comm.ErrorCode) {
|
||||
if req.NickName == "" {
|
||||
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSearchNameEmpty}
|
||||
return
|
||||
@ -14,18 +14,18 @@ func (this *apiComp) SearchCheck(session comm.IUserSession, req *pb.Friend_Searc
|
||||
}
|
||||
|
||||
//搜索
|
||||
func (this *apiComp) Search(session comm.IUserSession, chk map[string]interface{}, req *pb.Friend_Search_Req) (code pb.ErrorCode) {
|
||||
func (this *apiComp) Search(session comm.IUserSession, chk map[string]interface{}, req *pb.FriendSearchReq) (code pb.ErrorCode) {
|
||||
var (
|
||||
rsp *pb.Friend_Search_Rsp
|
||||
rsp *pb.FriendSearchRsp
|
||||
friend *pb.FriendBase
|
||||
)
|
||||
defer func() {
|
||||
if code == pb.ErrorCode_Success {
|
||||
rsp = &pb.Friend_Search_Rsp{
|
||||
rsp = &pb.FriendSearchRsp{
|
||||
Friend: friend,
|
||||
}
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), Friend_SubType_Search, rsp)
|
||||
session.SendMsg(string(this.module.GetType()), FriendSubTypeSearch, rsp)
|
||||
}()
|
||||
|
||||
user := this.module.modelFriend.Frined_FindCond(req.NickName)
|
||||
|
@ -19,7 +19,7 @@ type Friend struct {
|
||||
}
|
||||
|
||||
func (this *Friend) GetType() core.M_Modules {
|
||||
return comm.SM_FriendModule
|
||||
return comm.ModuleFriend
|
||||
}
|
||||
|
||||
func (this *Friend) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
|
@ -24,7 +24,7 @@ type Game struct {
|
||||
|
||||
//模块名
|
||||
func (this *Game) GetType() core.M_Modules {
|
||||
return comm.SM_EquipmentModule
|
||||
return comm.ModuleEquipment
|
||||
}
|
||||
|
||||
//模块初始化接口 注册用户创建角色事件
|
||||
|
@ -83,8 +83,8 @@ locp:
|
||||
} else {
|
||||
data, _ := anypb.New(&pb.ErrorNotify{ReqMainType: msg.MainType, ReqSubType: msg.SubType, Code: pb.ErrorCode_SecKeyInvalid})
|
||||
if err = this.WriteMsg(&pb.UserMessage{
|
||||
MainType: comm.MainType_Notify,
|
||||
SubType: comm.SubType_ErrorNotify,
|
||||
MainType: comm.MainTypeNotify,
|
||||
SubType: comm.SubTypeErrorNotify,
|
||||
Data: data,
|
||||
}); err != nil {
|
||||
go this.Close()
|
||||
@ -234,8 +234,8 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) (err error) {
|
||||
if reply.Code != pb.ErrorCode_Success {
|
||||
data, _ := anypb.New(&pb.ErrorNotify{ReqMainType: msg.MainType, ReqSubType: msg.SubType, Code: pb.ErrorCode(reply.Code.Number())})
|
||||
err = this.WriteMsg(&pb.UserMessage{
|
||||
MainType: comm.MainType_Notify,
|
||||
SubType: comm.SubType_ErrorNotify,
|
||||
MainType: comm.MainTypeNotify,
|
||||
SubType: comm.SubTypeErrorNotify,
|
||||
Data: data,
|
||||
})
|
||||
return
|
||||
|
@ -40,7 +40,8 @@ func (this *AgentMgrComp) DisConnect(a IAgent) {
|
||||
if a.UserId() != "" { //登录用户 通知业务服务处理玩家离线相关
|
||||
reply := &pb.RPCMessageReply{}
|
||||
if _, err := this.service.RpcGo(context.Background(), fmt.Sprintf("%s/%s", comm.Service_Worker, a.WorkerId()), string(comm.Rpc_NoticeUserClose), &pb.NoticeUserCloseReq{
|
||||
UserId: a.UserId(),
|
||||
UserSessionId: a.SessionId(),
|
||||
UserId: a.UserId(),
|
||||
}, reply); err != nil {
|
||||
log.Errorf(" uId:%s Rpc_NoticeUserClose err:%v", a.UserId(), err)
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ type Gateway struct {
|
||||
|
||||
//模块名
|
||||
func (this *Gateway) GetType() core.M_Modules {
|
||||
return comm.SM_GateModule
|
||||
return comm.ModuleGate
|
||||
}
|
||||
|
||||
//模块自定义参数
|
||||
|
@ -14,14 +14,14 @@ type apiComp struct {
|
||||
}
|
||||
|
||||
const ( //消息回复的头名称
|
||||
StrengthenUplv = "strengthenherolv"
|
||||
Hero_SubType_Info = "info" //英雄卡片信息
|
||||
Hero_SubType_List = "list" //英雄列表
|
||||
StrengthenUplv = "strengthenherolv"
|
||||
HeroSubTypeInfo = "info" //英雄卡片信息
|
||||
HeroSubTypeList = "list" //英雄列表
|
||||
)
|
||||
|
||||
//组件初始化接口
|
||||
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)
|
||||
err = this.MCompGate.Init(service, module, comp, options)
|
||||
this.moduleHero = module.(*Hero)
|
||||
this.service = service
|
||||
return
|
||||
@ -32,7 +32,7 @@ func (this *apiComp) Start() (err error) {
|
||||
|
||||
var module core.IModule
|
||||
|
||||
if module, err = this.service.GetModule(comm.SM_UserModule); err != nil {
|
||||
if module, err = this.service.GetModule(comm.ModuleUser); err != nil {
|
||||
return
|
||||
}
|
||||
this.user = module.(comm.IUser)
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) StrengthenUpStarCheck(session comm.IUserSession, req *pb.Hero_StrengthenUpStar_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) StrengthenUpStarCheck(session comm.IUserSession, req *pb.HeroStrengthenUpStarReq) (result map[string]interface{}, code comm.ErrorCode) {
|
||||
if req.HeroObjID == "" {
|
||||
code.Code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
@ -16,7 +16,7 @@ func (this *apiComp) StrengthenUpStarCheck(session comm.IUserSession, req *pb.He
|
||||
var (
|
||||
curLv int32
|
||||
target *cfg.Game_heroStarupData // 配置表目标升星英雄信息
|
||||
raceHero *pb.DB_HeroData // 消耗的阵容英雄
|
||||
raceHero *pb.DBHeroData // 消耗的阵容英雄
|
||||
costRaceCount int32
|
||||
curGold int32
|
||||
)
|
||||
@ -101,13 +101,13 @@ func (this *apiComp) StrengthenUpStarCheck(session comm.IUserSession, req *pb.He
|
||||
}
|
||||
|
||||
/// 英雄升星
|
||||
func (this *apiComp) StrengthenUpStar(session comm.IUserSession, agrs map[string]interface{}, req *pb.Hero_StrengthenUpStar_Req) (code pb.ErrorCode) {
|
||||
func (this *apiComp) StrengthenUpStar(session comm.IUserSession, agrs map[string]interface{}, req *pb.HeroStrengthenUpStarReq) (code pb.ErrorCode) {
|
||||
var (
|
||||
costGold int32 // 当前需要消耗金币的数量
|
||||
)
|
||||
defer func() {
|
||||
if code == pb.ErrorCode_Success {
|
||||
session.SendMsg(string(this.moduleHero.GetType()), StrengthenUplv, &pb.Hero_StrengthenUpStar_Resp{})
|
||||
session.SendMsg(string(this.moduleHero.GetType()), StrengthenUplv, &pb.HeroStrengthenUpStarResp{})
|
||||
}
|
||||
}()
|
||||
costGold = agrs["costGold"].(int32)
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) StrengthenUplvCheck(session comm.IUserSession, req *pb.Hero_StrengthenUplv_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) StrengthenUplvCheck(session comm.IUserSession, req *pb.HeroStrengthenUplvReq) (result map[string]interface{}, code comm.ErrorCode) {
|
||||
if req.HeroObjID == "" {
|
||||
code.Code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
@ -107,7 +107,7 @@ func (this *apiComp) StrengthenUplvCheck(session comm.IUserSession, req *pb.Hero
|
||||
}
|
||||
|
||||
/// 英雄升级
|
||||
func (this *apiComp) StrengthenUplv(session comm.IUserSession, agrs map[string]interface{}, req *pb.Hero_StrengthenUplv_Req) (code pb.ErrorCode) {
|
||||
func (this *apiComp) StrengthenUplv(session comm.IUserSession, agrs map[string]interface{}, req *pb.HeroStrengthenUplvReq) (code pb.ErrorCode) {
|
||||
var (
|
||||
curLv int32
|
||||
curExp int32 // 当前英雄的经验
|
||||
@ -117,7 +117,7 @@ func (this *apiComp) StrengthenUplv(session comm.IUserSession, agrs map[string]i
|
||||
)
|
||||
defer func() {
|
||||
if code == pb.ErrorCode_Success {
|
||||
session.SendMsg(string(this.moduleHero.GetType()), StrengthenUplv, &pb.Hero_StrengthenUplv_Resp{})
|
||||
session.SendMsg(string(this.moduleHero.GetType()), StrengthenUplv, &pb.HeroStrengthenUplvResp{})
|
||||
}
|
||||
}()
|
||||
costGold = agrs["costGold"].(int32)
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.Hero_Info_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.HeroInfoReq) (result map[string]interface{}, code comm.ErrorCode) {
|
||||
result = map[string]interface{}{}
|
||||
hero := this.moduleHero.modelHero.getOneHero(session.GetUserId(), req.HeroId)
|
||||
if hero == nil {
|
||||
@ -16,10 +16,10 @@ func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.Hero_Info_Req)
|
||||
return
|
||||
}
|
||||
|
||||
func (this *apiComp) Info(session comm.IUserSession, result map[string]interface{}, req *pb.Hero_Info_Req) (code pb.ErrorCode) {
|
||||
rsp := &pb.Hero_Info_Rsp{}
|
||||
func (this *apiComp) Info(session comm.IUserSession, result map[string]interface{}, req *pb.HeroInfoReq) (code pb.ErrorCode) {
|
||||
rsp := &pb.HeroInfoRsp{}
|
||||
defer func() {
|
||||
err := session.SendMsg(string(this.moduleHero.GetType()), Hero_SubType_Info, rsp)
|
||||
err := session.SendMsg(string(this.moduleHero.GetType()), HeroSubTypeInfo, rsp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
@ -27,7 +27,7 @@ func (this *apiComp) Info(session comm.IUserSession, result map[string]interface
|
||||
}()
|
||||
|
||||
if v, ok := result["hero"]; ok {
|
||||
rsp.Base = v.(*pb.DB_HeroData)
|
||||
rsp.Base = v.(*pb.DBHero)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -6,15 +6,15 @@ import (
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.Hero_List_Req) (result map[string]interface{}, code comm.ErrorCode) {
|
||||
func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.HeroListReq) (result map[string]interface{}, code comm.ErrorCode) {
|
||||
return
|
||||
}
|
||||
|
||||
func (this *apiComp) List(session comm.IUserSession, result map[string]interface{}, req *pb.Hero_List_Req) (code pb.ErrorCode) {
|
||||
rsp := &pb.Hero_List_Rsp{}
|
||||
func (this *apiComp) List(session comm.IUserSession, result map[string]interface{}, req *pb.HeroListReq) (code pb.ErrorCode) {
|
||||
rsp := &pb.HeroListRsp{}
|
||||
|
||||
defer func() {
|
||||
err := session.SendMsg(this.moduleHero.api.service.GetType(), Hero_SubType_List, rsp)
|
||||
err := session.SendMsg(string(this.moduleHero.GetType()), HeroSubTypeList, rsp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/lego/sys/redis"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
"math"
|
||||
@ -27,14 +26,14 @@ func (this *ModelHero) Init(service core.IService, module core.IModule, comp cor
|
||||
}
|
||||
|
||||
//初始化英雄
|
||||
func (this *ModelHero) initHero(uid string, heroCfgId int32) *pb.DB_HeroData {
|
||||
func (this *ModelHero) initHero(uid string, heroCfgId int32) *pb.DBHero {
|
||||
heroCfg := this.moduleHero.configure.GetHero(heroCfgId)
|
||||
if heroCfg == nil {
|
||||
log.Errorf("%v hero not found from config %v", heroCfgId)
|
||||
return nil
|
||||
}
|
||||
objId := primitive.NewObjectID().Hex()
|
||||
newHero := &pb.DB_HeroData{
|
||||
newHero := &pb.DBHero{
|
||||
Id: objId,
|
||||
Uid: uid,
|
||||
HeroID: heroCfg.Hid,
|
||||
@ -78,8 +77,8 @@ func (this *ModelHero) createMultiHero(uid string, heroCfgIds ...int32) error {
|
||||
}
|
||||
|
||||
//获取一个英雄
|
||||
func (this *ModelHero) getOneHero(uid, heroId string) *pb.DB_HeroData {
|
||||
hero := &pb.DB_HeroData{}
|
||||
func (this *ModelHero) getOneHero(uid, heroId string) *pb.DBHero {
|
||||
hero := &pb.DBHero{}
|
||||
err := this.moduleHero.modelHero.GetListObj(uid, heroId, hero)
|
||||
if err != nil {
|
||||
return nil
|
||||
@ -92,24 +91,15 @@ func (this *ModelHero) consumeOneHeroCard(uid, heroId string) error {
|
||||
return this.moduleHero.modelHero.DelListlds(uid, heroId)
|
||||
}
|
||||
|
||||
func (this *Hero) ModifyHero(heroId *pb.DB_HeroData) (*pb.DB_HeroData, pb.ErrorCode) {
|
||||
func (this *Hero) ModifyHero(heroId *pb.DBHero) (*pb.DBHero, pb.ErrorCode) {
|
||||
|
||||
return nil, pb.ErrorCode_HeroNoExist
|
||||
}
|
||||
|
||||
//获取玩家的英雄列表
|
||||
func (this *ModelHero) getHeroList(uid string) ([]*pb.DB_HeroData, error) {
|
||||
herokeys := make(map[string]string)
|
||||
err := this.Get(uid, herokeys)
|
||||
if err != nil {
|
||||
if err == redis.RedisNil {
|
||||
return make([]*pb.DB_HeroData, 0), nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
heroes := make([]*pb.DB_HeroData, 0)
|
||||
err = this.GetList(uid, &heroes)
|
||||
func (this *ModelHero) getHeroList(uid string) ([]*pb.DBHero, error) {
|
||||
heroes := make([]*pb.DBHero, 0)
|
||||
err := this.GetList(uid, &heroes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -130,7 +120,7 @@ func (this *ModelHero) setEquipment(uid, heroId string, equipIds []string) pb.Er
|
||||
|
||||
//指定英雄升级
|
||||
func (this *ModelHero) levelUp(uid string, heroId int32) error {
|
||||
var heroes []*pb.DB_HeroData
|
||||
var heroes []*pb.DBHero
|
||||
err := this.moduleHero.modelHero.GetList(uid, heroes)
|
||||
if err != nil {
|
||||
log.Errorf("levelUp err:%v", err)
|
||||
|
@ -22,7 +22,7 @@ type Hero struct {
|
||||
|
||||
//模块名
|
||||
func (this *Hero) GetType() core.M_Modules {
|
||||
return comm.SM_HeroModule
|
||||
return comm.ModuleHero
|
||||
}
|
||||
|
||||
//模块初始化接口 注册用户创建角色事件
|
||||
@ -47,7 +47,7 @@ func (this *Hero) CreateHero(uid string, heroCfgId ...int32) error {
|
||||
//消耗英雄卡
|
||||
func (this *Hero) ChangeCard(uId string, heroCfgId int32, count int32) (code pb.ErrorCode) {
|
||||
heroes := this.GetHeroList(uId)
|
||||
var curList []*pb.DB_HeroData
|
||||
var curList []*pb.DBHero
|
||||
for _, v := range heroes {
|
||||
if heroCfgId == v.HeroID {
|
||||
curList = append(curList, v)
|
||||
@ -68,7 +68,7 @@ func (this *Hero) ChangeCard(uId string, heroCfgId int32, count int32) (code pb.
|
||||
}
|
||||
|
||||
//获取英雄
|
||||
func (this *Hero) GetHero(uid, heroId string) (*pb.DB_HeroData, pb.ErrorCode) {
|
||||
func (this *Hero) GetHero(uid, heroId string) (*pb.DBHero, pb.ErrorCode) {
|
||||
hero := this.modelHero.getOneHero(uid, heroId)
|
||||
if hero == nil {
|
||||
return nil, pb.ErrorCode_HeroNoExist
|
||||
@ -77,7 +77,7 @@ func (this *Hero) GetHero(uid, heroId string) (*pb.DB_HeroData, pb.ErrorCode) {
|
||||
}
|
||||
|
||||
//佩戴装备
|
||||
func (this *Hero) UpdateEquipment(hero *pb.DB_HeroData, equip []*pb.DB_Equipment) (code pb.ErrorCode) {
|
||||
func (this *Hero) UpdateEquipment(hero *pb.DBHero, equip []*pb.DB_Equipment) (code pb.ErrorCode) {
|
||||
equipIds := make([]string, 4)
|
||||
for _, v := range equip {
|
||||
equipIds = append(equipIds, v.Id)
|
||||
@ -86,7 +86,7 @@ func (this *Hero) UpdateEquipment(hero *pb.DB_HeroData, equip []*pb.DB_Equipment
|
||||
}
|
||||
|
||||
//英雄列表
|
||||
func (this *Hero) GetHeroList(uid string) []*pb.DB_HeroData {
|
||||
func (this *Hero) GetHeroList(uid string) []*pb.DBHero {
|
||||
list, err := this.modelHero.getHeroList(uid)
|
||||
if err != nil {
|
||||
return nil
|
||||
|
@ -28,7 +28,7 @@ type Items struct {
|
||||
|
||||
//模块名称
|
||||
func (this *Items) GetType() core.M_Modules {
|
||||
return comm.SM_ItemsModule
|
||||
return comm.ModuleItems
|
||||
}
|
||||
|
||||
//模块初始化接口 注册用户创建角色事件
|
||||
|
@ -34,7 +34,7 @@ func (this *apiComp) Start() (err error) {
|
||||
err = this.MCompGate.Start()
|
||||
var module core.IModule
|
||||
|
||||
if module, err = this.service.GetModule(comm.SM_ItemsModule); err != nil {
|
||||
if module, err = this.service.GetModule(comm.ModuleItems); err != nil {
|
||||
return
|
||||
}
|
||||
this.items = module.(comm.IItems)
|
||||
|
@ -30,7 +30,7 @@ type Mail struct {
|
||||
}
|
||||
|
||||
func (this *Mail) GetType() core.M_Modules {
|
||||
return comm.SM_MailModule
|
||||
return comm.ModuleMail
|
||||
}
|
||||
|
||||
func (this *Mail) OnInstallComp() {
|
||||
|
@ -89,15 +89,15 @@ func (this *ModuleBase) CheckConsumeRes(uid string, res []*cfg.Game_atn) (code p
|
||||
hero comm.IHero //英雄模块
|
||||
// equipment comm.IEquipment //装备模块
|
||||
)
|
||||
if module, err = this.service.GetModule(comm.SM_UserModule); err == nil {
|
||||
if module, err = this.service.GetModule(comm.ModuleUser); err == nil {
|
||||
return
|
||||
}
|
||||
user = module.(comm.IUser)
|
||||
if module, err = this.service.GetModule(comm.SM_ItemsModule); err == nil {
|
||||
if module, err = this.service.GetModule(comm.ModuleItems); err == nil {
|
||||
return
|
||||
}
|
||||
items = module.(comm.IItems)
|
||||
if module, err = this.service.GetModule(comm.SM_HeroModule); err == nil {
|
||||
if module, err = this.service.GetModule(comm.ModuleHero); err == nil {
|
||||
return
|
||||
}
|
||||
hero = module.(comm.IHero)
|
||||
|
@ -33,7 +33,7 @@ func (this *apiComp) Start() (err error) {
|
||||
var module core.IModule
|
||||
|
||||
//get module hero
|
||||
if module, err = this.service.GetModule(comm.SM_HeroModule); err != nil {
|
||||
if module, err = this.service.GetModule(comm.ModuleHero); err != nil {
|
||||
return
|
||||
}
|
||||
this.hero = module.(comm.IHero)
|
||||
|
@ -33,7 +33,7 @@ func (this *apiComp) Login(session comm.IUserSession, result map[string]interfac
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
event.TriggerEvent(comm.Event_UserLogin, user.Uid)
|
||||
event.TriggerEvent(comm.EventUserLogin, user.Uid)
|
||||
}
|
||||
}()
|
||||
|
||||
|
@ -21,7 +21,7 @@ type User struct {
|
||||
}
|
||||
|
||||
func (this *User) GetType() core.M_Modules {
|
||||
return comm.SM_UserModule
|
||||
return comm.ModuleUser
|
||||
}
|
||||
|
||||
func (this *User) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
@ -38,7 +38,7 @@ func (this *User) OnInstallComp() {
|
||||
}
|
||||
|
||||
//获取英雄列表
|
||||
func (this *User) GetHeroList(uid string) []*pb.DB_HeroData {
|
||||
func (this *User) GetHeroList(uid string) []*pb.DBHero {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ type Web struct {
|
||||
|
||||
//模块名
|
||||
func (this *Web) GetType() core.M_Modules {
|
||||
return comm.SM_WebModule
|
||||
return comm.ModuleWeb
|
||||
}
|
||||
|
||||
//模块自定义参数
|
||||
|
@ -692,7 +692,8 @@ type NoticeUserCloseReq struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
UserId string `protobuf:"bytes,1,opt,name=UserId,proto3" json:"UserId"`
|
||||
UserSessionId string `protobuf:"bytes,1,opt,name=UserSessionId,proto3" json:"UserSessionId"`
|
||||
UserId string `protobuf:"bytes,2,opt,name=UserId,proto3" json:"UserId"`
|
||||
}
|
||||
|
||||
func (x *NoticeUserCloseReq) Reset() {
|
||||
@ -727,6 +728,13 @@ func (*NoticeUserCloseReq) Descriptor() ([]byte, []int) {
|
||||
return file_comm_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *NoticeUserCloseReq) GetUserSessionId() string {
|
||||
if x != nil {
|
||||
return x.UserSessionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NoticeUserCloseReq) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
@ -814,15 +822,17 @@ var file_comm_proto_rawDesc = []byte{
|
||||
0x6e, 0x74, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x65, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0d, 0x55,
|
||||
0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49,
|
||||
0x64, 0x22, 0x2c, 0x0a, 0x12, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x43,
|
||||
0x6c, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x2a,
|
||||
0x43, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
|
||||
0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x48, 0x70, 0x10, 0x00, 0x12, 0x07, 0x0a,
|
||||
0x03, 0x41, 0x74, 0x6b, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x65, 0x66, 0x10, 0x02, 0x12,
|
||||
0x09, 0x0a, 0x05, 0x53, 0x70, 0x65, 0x65, 0x64, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x72,
|
||||
0x69, 0x74, 0x10, 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
0x64, 0x22, 0x52, 0x0a, 0x12, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x43,
|
||||
0x6c, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53,
|
||||
0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d,
|
||||
0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55,
|
||||
0x73, 0x65, 0x72, 0x49, 0x64, 0x2a, 0x43, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x74, 0x74,
|
||||
0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x48,
|
||||
0x70, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x74, 0x6b, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03,
|
||||
0x44, 0x65, 0x66, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x70, 0x65, 0x65, 0x64, 0x10, 0x03,
|
||||
0x12, 0x08, 0x0a, 0x04, 0x43, 0x72, 0x69, 0x74, 0x10, 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
|
||||
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -20,7 +20,7 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type DB_FriendData struct {
|
||||
type DBFriend struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@ -31,8 +31,8 @@ type DB_FriendData struct {
|
||||
BlackIds []string `protobuf:"bytes,4,rep,name=blackIds,proto3" json:"blackIds" bson:"blackIds"` //黑名单ID
|
||||
}
|
||||
|
||||
func (x *DB_FriendData) Reset() {
|
||||
*x = DB_FriendData{}
|
||||
func (x *DBFriend) Reset() {
|
||||
*x = DBFriend{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_friend_friend_db_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -40,13 +40,13 @@ func (x *DB_FriendData) Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DB_FriendData) String() string {
|
||||
func (x *DBFriend) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DB_FriendData) ProtoMessage() {}
|
||||
func (*DBFriend) ProtoMessage() {}
|
||||
|
||||
func (x *DB_FriendData) ProtoReflect() protoreflect.Message {
|
||||
func (x *DBFriend) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_friend_friend_db_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -58,33 +58,33 @@ func (x *DB_FriendData) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DB_FriendData.ProtoReflect.Descriptor instead.
|
||||
func (*DB_FriendData) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use DBFriend.ProtoReflect.Descriptor instead.
|
||||
func (*DBFriend) Descriptor() ([]byte, []int) {
|
||||
return file_friend_friend_db_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *DB_FriendData) GetUId() string {
|
||||
func (x *DBFriend) GetUId() string {
|
||||
if x != nil {
|
||||
return x.UId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DB_FriendData) GetFriendIds() []string {
|
||||
func (x *DBFriend) GetFriendIds() []string {
|
||||
if x != nil {
|
||||
return x.FriendIds
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DB_FriendData) GetApplyIds() []string {
|
||||
func (x *DBFriend) GetApplyIds() []string {
|
||||
if x != nil {
|
||||
return x.ApplyIds
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DB_FriendData) GetBlackIds() []string {
|
||||
func (x *DBFriend) GetBlackIds() []string {
|
||||
if x != nil {
|
||||
return x.BlackIds
|
||||
}
|
||||
@ -95,16 +95,15 @@ var File_friend_friend_db_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_friend_friend_db_proto_rawDesc = []byte{
|
||||
0x0a, 0x16, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2f, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f,
|
||||
0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x77, 0x0a, 0x0d, 0x44, 0x42, 0x5f, 0x46,
|
||||
0x72, 0x69, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x49, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x66,
|
||||
0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09,
|
||||
0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70,
|
||||
0x6c, 0x79, 0x49, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70,
|
||||
0x6c, 0x79, 0x49, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x49, 0x64,
|
||||
0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x49, 0x64,
|
||||
0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x72, 0x0a, 0x08, 0x44, 0x42, 0x46, 0x72,
|
||||
0x69, 0x65, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x03, 0x75, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64,
|
||||
0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e,
|
||||
0x64, 0x49, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x64, 0x73,
|
||||
0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x64, 0x73,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03,
|
||||
0x28, 0x09, 0x52, 0x08, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x49, 0x64, 0x73, 0x42, 0x06, 0x5a, 0x04,
|
||||
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -121,7 +120,7 @@ func file_friend_friend_db_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_friend_friend_db_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_friend_friend_db_proto_goTypes = []interface{}{
|
||||
(*DB_FriendData)(nil), // 0: DB_FriendData
|
||||
(*DBFriend)(nil), // 0: DBFriend
|
||||
}
|
||||
var file_friend_friend_db_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
@ -138,7 +137,7 @@ func file_friend_friend_db_proto_init() {
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_friend_friend_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DB_FriendData); i {
|
||||
switch v := v.(*DBFriend); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
|
File diff suppressed because it is too large
Load Diff
189
pb/hero_db.pb.go
189
pb/hero_db.pb.go
@ -75,7 +75,7 @@ func (x *SkillData) GetSkillLv() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
type DB_HeroData struct {
|
||||
type DBHero struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@ -103,8 +103,8 @@ type DB_HeroData struct {
|
||||
Count int32 `protobuf:"varint,21,opt,name=count,proto3" json:"count"` // 数量
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) Reset() {
|
||||
*x = DB_HeroData{}
|
||||
func (x *DBHero) Reset() {
|
||||
*x = DBHero{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_hero_hero_db_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -112,13 +112,13 @@ func (x *DB_HeroData) Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) String() string {
|
||||
func (x *DBHero) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DB_HeroData) ProtoMessage() {}
|
||||
func (*DBHero) ProtoMessage() {}
|
||||
|
||||
func (x *DB_HeroData) ProtoReflect() protoreflect.Message {
|
||||
func (x *DBHero) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_hero_hero_db_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@ -130,152 +130,152 @@ func (x *DB_HeroData) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DB_HeroData.ProtoReflect.Descriptor instead.
|
||||
func (*DB_HeroData) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use DBHero.ProtoReflect.Descriptor instead.
|
||||
func (*DBHero) Descriptor() ([]byte, []int) {
|
||||
return file_hero_hero_db_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetId() string {
|
||||
func (x *DBHero) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetUid() string {
|
||||
func (x *DBHero) GetUid() string {
|
||||
if x != nil {
|
||||
return x.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetHeroID() int32 {
|
||||
func (x *DBHero) GetHeroID() int32 {
|
||||
if x != nil {
|
||||
return x.HeroID
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetStar() int32 {
|
||||
func (x *DBHero) GetStar() int32 {
|
||||
if x != nil {
|
||||
return x.Star
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetLv() int32 {
|
||||
func (x *DBHero) GetLv() int32 {
|
||||
if x != nil {
|
||||
return x.Lv
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetExp() int32 {
|
||||
func (x *DBHero) GetExp() int32 {
|
||||
if x != nil {
|
||||
return x.Exp
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetJuexingLv() int32 {
|
||||
func (x *DBHero) GetJuexingLv() int32 {
|
||||
if x != nil {
|
||||
return x.JuexingLv
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetCaptainSkill() int32 {
|
||||
func (x *DBHero) GetCaptainSkill() int32 {
|
||||
if x != nil {
|
||||
return x.CaptainSkill
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetNormalSkill() []*SkillData {
|
||||
func (x *DBHero) GetNormalSkill() []*SkillData {
|
||||
if x != nil {
|
||||
return x.NormalSkill
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetProperty() map[int32]int32 {
|
||||
func (x *DBHero) GetProperty() map[int32]int32 {
|
||||
if x != nil {
|
||||
return x.Property
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetAddProperty() map[int32]int32 {
|
||||
func (x *DBHero) GetAddProperty() map[int32]int32 {
|
||||
if x != nil {
|
||||
return x.AddProperty
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetFormation() int32 {
|
||||
func (x *DBHero) GetFormation() int32 {
|
||||
if x != nil {
|
||||
return x.Formation
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetCardType() int32 {
|
||||
func (x *DBHero) GetCardType() int32 {
|
||||
if x != nil {
|
||||
return x.CardType
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetCurSkin() int32 {
|
||||
func (x *DBHero) GetCurSkin() int32 {
|
||||
if x != nil {
|
||||
return x.CurSkin
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetSkins() []int32 {
|
||||
func (x *DBHero) GetSkins() []int32 {
|
||||
if x != nil {
|
||||
return x.Skins
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetBlock() bool {
|
||||
func (x *DBHero) GetBlock() bool {
|
||||
if x != nil {
|
||||
return x.Block
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetEquipID() []string {
|
||||
func (x *DBHero) GetEquipID() []string {
|
||||
if x != nil {
|
||||
return x.EquipID
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetResonateNum() int32 {
|
||||
func (x *DBHero) GetResonateNum() int32 {
|
||||
if x != nil {
|
||||
return x.ResonateNum
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetDistributionResonate() int32 {
|
||||
func (x *DBHero) GetDistributionResonate() int32 {
|
||||
if x != nil {
|
||||
return x.DistributionResonate
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetEnergy() map[int32]int32 {
|
||||
func (x *DBHero) GetEnergy() map[int32]int32 {
|
||||
if x != nil {
|
||||
return x.Energy
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DB_HeroData) GetCount() int32 {
|
||||
func (x *DBHero) GetCount() int32 {
|
||||
if x != nil {
|
||||
return x.Count
|
||||
}
|
||||
@ -290,62 +290,61 @@ var file_hero_hero_db_proto_rawDesc = []byte{
|
||||
0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x44,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x44, 0x12,
|
||||
0x18, 0x0a, 0x07, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x07, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x22, 0xe2, 0x06, 0x0a, 0x0b, 0x44, 0x42,
|
||||
0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68,
|
||||
0x65, 0x72, 0x6f, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x72,
|
||||
0x6f, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x04, 0x73, 0x74, 0x61, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x06,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x75, 0x65,
|
||||
0x78, 0x69, 0x6e, 0x67, 0x4c, 0x76, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x75,
|
||||
0x65, 0x78, 0x69, 0x6e, 0x67, 0x4c, 0x76, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x61, 0x70, 0x74, 0x61,
|
||||
0x69, 0x6e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x63,
|
||||
0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x12, 0x2f, 0x0a, 0x0b, 0x6e,
|
||||
0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52,
|
||||
0x0b, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x12, 0x39, 0x0a, 0x08,
|
||||
0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d,
|
||||
0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x2e,
|
||||
0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x70,
|
||||
0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x42, 0x0a, 0x0b, 0x61, 0x64, 0x64, 0x50, 0x72,
|
||||
0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70,
|
||||
0x62, 0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x41, 0x64,
|
||||
0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b,
|
||||
0x61, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x66,
|
||||
0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09,
|
||||
0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x72,
|
||||
0x64, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x61, 0x72,
|
||||
0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75, 0x72, 0x53, 0x6b, 0x69, 0x6e,
|
||||
0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x75, 0x72, 0x53, 0x6b, 0x69, 0x6e, 0x12,
|
||||
0x14, 0x0a, 0x05, 0x73, 0x6b, 0x69, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05,
|
||||
0x73, 0x6b, 0x69, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x10,
|
||||
0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x65,
|
||||
0x71, 0x75, 0x69, 0x70, 0x49, 0x44, 0x18, 0x11, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x65, 0x71,
|
||||
0x75, 0x69, 0x70, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74,
|
||||
0x65, 0x4e, 0x75, 0x6d, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x6f,
|
||||
0x6e, 0x61, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x32, 0x0a, 0x14, 0x64, 0x69, 0x73, 0x74, 0x72,
|
||||
0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x18,
|
||||
0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x65,
|
||||
0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x62,
|
||||
0x2e, 0x44, 0x42, 0x5f, 0x48, 0x65, 0x72, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x6e, 0x65,
|
||||
0x72, 0x67, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x3b, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72,
|
||||
0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
||||
0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72,
|
||||
0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
||||
0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x45, 0x6e, 0x74,
|
||||
0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06,
|
||||
0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x52, 0x07, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x22, 0xce, 0x06, 0x0a, 0x06, 0x44, 0x42,
|
||||
0x48, 0x65, 0x72, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x44,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x44, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x73, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x74,
|
||||
0x61, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02,
|
||||
0x6c, 0x76, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x03, 0x65, 0x78, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x75, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x4c,
|
||||
0x76, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x75, 0x65, 0x78, 0x69, 0x6e, 0x67,
|
||||
0x4c, 0x76, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x53, 0x6b, 0x69,
|
||||
0x6c, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x63, 0x61, 0x70, 0x74, 0x61, 0x69,
|
||||
0x6e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x12, 0x2f, 0x0a, 0x0b, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c,
|
||||
0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62,
|
||||
0x2e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x6e, 0x6f, 0x72, 0x6d,
|
||||
0x61, 0x6c, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65,
|
||||
0x72, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44,
|
||||
0x42, 0x48, 0x65, 0x72, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e,
|
||||
0x74, 0x72, 0x79, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x3d, 0x0a,
|
||||
0x0b, 0x61, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x2e, 0x41,
|
||||
0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52,
|
||||
0x0b, 0x61, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09,
|
||||
0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61,
|
||||
0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x61,
|
||||
0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75, 0x72, 0x53, 0x6b, 0x69,
|
||||
0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x75, 0x72, 0x53, 0x6b, 0x69, 0x6e,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x73, 0x6b, 0x69, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x05, 0x52,
|
||||
0x05, 0x73, 0x6b, 0x69, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18,
|
||||
0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x18, 0x0a, 0x07,
|
||||
0x65, 0x71, 0x75, 0x69, 0x70, 0x49, 0x44, 0x18, 0x11, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x65,
|
||||
0x71, 0x75, 0x69, 0x70, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x6e, 0x61,
|
||||
0x74, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x72, 0x65, 0x73,
|
||||
0x6f, 0x6e, 0x61, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x32, 0x0a, 0x14, 0x64, 0x69, 0x73, 0x74,
|
||||
0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65,
|
||||
0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x06,
|
||||
0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70,
|
||||
0x62, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x2e, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x45,
|
||||
0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75,
|
||||
0x6e, 0x74, 0x1a, 0x3b, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e,
|
||||
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a,
|
||||
0x3e, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x45, 0x6e,
|
||||
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a,
|
||||
0x39, 0x0a, 0x0b, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
|
||||
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -362,17 +361,17 @@ func file_hero_hero_db_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_hero_hero_db_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_hero_hero_db_proto_goTypes = []interface{}{
|
||||
(*SkillData)(nil), // 0: pb.SkillData
|
||||
(*DB_HeroData)(nil), // 1: pb.DB_HeroData
|
||||
nil, // 2: pb.DB_HeroData.PropertyEntry
|
||||
nil, // 3: pb.DB_HeroData.AddPropertyEntry
|
||||
nil, // 4: pb.DB_HeroData.EnergyEntry
|
||||
(*SkillData)(nil), // 0: pb.SkillData
|
||||
(*DBHero)(nil), // 1: pb.DBHero
|
||||
nil, // 2: pb.DBHero.PropertyEntry
|
||||
nil, // 3: pb.DBHero.AddPropertyEntry
|
||||
nil, // 4: pb.DBHero.EnergyEntry
|
||||
}
|
||||
var file_hero_hero_db_proto_depIdxs = []int32{
|
||||
0, // 0: pb.DB_HeroData.normalSkill:type_name -> pb.SkillData
|
||||
2, // 1: pb.DB_HeroData.property:type_name -> pb.DB_HeroData.PropertyEntry
|
||||
3, // 2: pb.DB_HeroData.addProperty:type_name -> pb.DB_HeroData.AddPropertyEntry
|
||||
4, // 3: pb.DB_HeroData.energy:type_name -> pb.DB_HeroData.EnergyEntry
|
||||
0, // 0: pb.DBHero.normalSkill:type_name -> pb.SkillData
|
||||
2, // 1: pb.DBHero.property:type_name -> pb.DBHero.PropertyEntry
|
||||
3, // 2: pb.DBHero.addProperty:type_name -> pb.DBHero.AddPropertyEntry
|
||||
4, // 3: pb.DBHero.energy:type_name -> pb.DBHero.EnergyEntry
|
||||
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
|
||||
@ -399,7 +398,7 @@ func file_hero_hero_db_proto_init() {
|
||||
}
|
||||
}
|
||||
file_hero_hero_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DB_HeroData); i {
|
||||
switch v := v.(*DBHero); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -67,7 +67,7 @@ message BroadCastMessageReq {
|
||||
message AgentCloseeReq { string UserSessionId = 1; }
|
||||
|
||||
//通知用户离线
|
||||
message NoticeUserCloseReq { string UserId = 1; }
|
||||
message NoticeUserCloseReq {string UserSessionId = 1; string UserId = 2; }
|
||||
|
||||
//英雄属性类型
|
||||
enum HeroAttributesType{
|
||||
|
@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
option go_package = ".;pb";
|
||||
|
||||
message DB_FriendData {
|
||||
message DBFriend {
|
||||
string uId = 1; //@go_tags(`bson:"uId"`) 用户ID
|
||||
repeated string friendIds = 2; //@go_tags(`bson:"friendIds"`) 好友ID
|
||||
repeated string applyIds = 3; //@go_tags(`bson:"applyIds"`) 申请用户ID
|
||||
|
@ -12,97 +12,97 @@ message FriendBase {
|
||||
}
|
||||
|
||||
//好友列表
|
||||
message Friend_List_Req {}
|
||||
message FriendListReq {}
|
||||
|
||||
message Friend_List_Rsp { repeated FriendBase list = 1; }
|
||||
message FriendListRsp { repeated FriendBase list = 1; }
|
||||
|
||||
//申请好友
|
||||
message Friend_Apply_Req {
|
||||
message FriendApplyReq {
|
||||
string friendId = 1; //好友ID
|
||||
}
|
||||
message Friend_Apply_Rsp {
|
||||
message FriendApplyRsp {
|
||||
string userId = 1; //用户ID
|
||||
string friendId = 2; //好友ID
|
||||
}
|
||||
|
||||
//删除好友
|
||||
message Friend_Del_Req {
|
||||
message FriendDelReq {
|
||||
string friendId = 1; //好友ID
|
||||
}
|
||||
|
||||
message Friend_Del_Rsp {
|
||||
message FriendDelRsp {
|
||||
string friendId = 1; //好友ID
|
||||
string userId = 2; //用户ID
|
||||
}
|
||||
|
||||
//同意
|
||||
message Friend_Agree_Req {
|
||||
message FriendAgreeReq {
|
||||
repeated string friendIds = 1; //被同意的用户
|
||||
}
|
||||
message Friend_Agree_Rsp {
|
||||
message FriendAgreeRsp {
|
||||
int32 Num = 1; //操作的数量
|
||||
}
|
||||
|
||||
//拒绝
|
||||
message Friend_Refuse_Req {
|
||||
message FriendRefuseReq {
|
||||
repeated string friendIds = 1; //被拒绝的用户
|
||||
}
|
||||
message Friend_Refuse_Rsp {
|
||||
message FriendRefuseRsp {
|
||||
int32 Num = 1; //操作的数量
|
||||
}
|
||||
|
||||
//好友申请列表
|
||||
message Friend_ApplyList_Req {}
|
||||
message Friend_ApplyList_Rsp { repeated FriendBase list = 1; }
|
||||
message FriendApplyListReq {}
|
||||
message FriendApplyListRsp { repeated FriendBase list = 1; }
|
||||
|
||||
//好友搜索
|
||||
message Friend_Search_Req {
|
||||
message FriendSearchReq {
|
||||
string nickName = 1; //好友昵称
|
||||
}
|
||||
|
||||
message Friend_Search_Rsp { FriendBase friend = 1; }
|
||||
message FriendSearchRsp { FriendBase friend = 1; }
|
||||
|
||||
//黑名单
|
||||
message Friend_BlackList_Req {}
|
||||
message FriendBlackListReq {}
|
||||
|
||||
message Friend_BlackList_Rsp { repeated FriendBase friends = 1; }
|
||||
message FriendBlackListRsp { repeated FriendBase friends = 1; }
|
||||
|
||||
//添加黑名单
|
||||
message Friend_BlackAdd_Req { string friendId = 1; }
|
||||
message FriendBlackAddReq { string friendId = 1; }
|
||||
|
||||
message Friend_BlackAdd_Rsp {
|
||||
message FriendBlackAddRsp {
|
||||
string friendId = 1;
|
||||
string userId = 2;
|
||||
}
|
||||
|
||||
//删除黑名单
|
||||
message Friend_DelBlack_Req { string friendId = 1; }
|
||||
message FriendDelBlackReq { string friendId = 1; }
|
||||
|
||||
message Friend_DelBlack_Rsp {
|
||||
message FriendDelBlackRsp {
|
||||
string friendId = 1;
|
||||
string userId = 2;
|
||||
}
|
||||
|
||||
//接收
|
||||
message Friend_Receive_Req { string friendId = 1; }
|
||||
message FriendReceiveReq { string friendId = 1; }
|
||||
|
||||
message Friend_Receive_Rsp {
|
||||
message FriendReceiveRsp {
|
||||
string friendId = 1;
|
||||
string userId = 2;
|
||||
}
|
||||
|
||||
//赠送
|
||||
message Friend_Give_Req { string friendId = 1; }
|
||||
message FriendGiveReq { string friendId = 1; }
|
||||
|
||||
message Friend_Give_Rsp {
|
||||
message FriendGiveRsp {
|
||||
string friendId = 1;
|
||||
string userId = 2;
|
||||
}
|
||||
|
||||
//好友数量
|
||||
message Friend_Total_Req { string friendId = 1; }
|
||||
message FriendTotalReq { string friendId = 1; }
|
||||
|
||||
message Friend_Total_Rsp {
|
||||
message FriendTotalRsp {
|
||||
string friendId = 1;
|
||||
int32 total = 2; //好友数量
|
||||
}
|
@ -2,19 +2,12 @@ syntax = "proto3";
|
||||
option go_package = ".;pb";
|
||||
package pb;
|
||||
|
||||
// enum PropertyType{
|
||||
// Hp = 0; //血量
|
||||
// Atk = 1; //攻击
|
||||
// Def = 2; //防御
|
||||
// Speed = 3; //速度
|
||||
// Crit = 4; //暴击
|
||||
// }
|
||||
|
||||
message SkillData{
|
||||
message SkillData {
|
||||
int32 skillID = 1;
|
||||
int32 skillLv = 2;
|
||||
}
|
||||
message DB_HeroData {
|
||||
|
||||
message DBHero {
|
||||
string id = 1; //@go_tags(`bson:"_id"`) ID
|
||||
string uid = 2;
|
||||
int32 heroID = 3; //@go_tags(`bson:"heroID"`) 英雄的配置表ID
|
||||
|
@ -4,15 +4,15 @@ package pb;
|
||||
import "hero/hero_db.proto";
|
||||
|
||||
//英雄基础信息
|
||||
message Hero_Info_Req {
|
||||
message HeroInfoReq {
|
||||
string heroId = 1; //英雄唯一ID
|
||||
}
|
||||
message Hero_Info_Rsp { DB_HeroData base = 1; }
|
||||
message HeroInfoRsp { DBHero base = 1; }
|
||||
|
||||
//英雄列表
|
||||
message Hero_List_Req {}
|
||||
message HeroListReq {}
|
||||
|
||||
message Hero_List_Rsp { repeated DB_HeroData list = 1; }
|
||||
message HeroListRsp { repeated DBHero list = 1; }
|
||||
|
||||
/// 卡牌养成: 强化(卡牌升级、卡牌升星、技能升级)
|
||||
/// 卡牌养成: 共鸣(共鸣消耗、材料返回、能量点使用)
|
||||
@ -24,15 +24,15 @@ message ItemData {
|
||||
}
|
||||
|
||||
// 卡牌升级
|
||||
message Hero_StrengthenUplv_Req {
|
||||
message HeroStrengthenUplvReq {
|
||||
string heroObjID = 1; // 英雄对象ID
|
||||
string expCardID = 2; // 经验卡对象ID
|
||||
int32 amount = 3; // 消耗经验卡数量}
|
||||
}
|
||||
|
||||
// 卡牌升级返回
|
||||
message Hero_StrengthenUplv_Resp {
|
||||
DB_HeroData hero = 1; // 英雄对象
|
||||
message HeroStrengthenUplvResp {
|
||||
DBHero hero = 1; // 英雄对象
|
||||
}
|
||||
|
||||
message CostCardData {
|
||||
@ -40,69 +40,69 @@ message CostCardData {
|
||||
int32 amount = 2; // 数量
|
||||
}
|
||||
// 卡牌升星
|
||||
message Hero_StrengthenUpStar_Req {
|
||||
message HeroStrengthenUpStarReq {
|
||||
string heroObjID = 1; // 英雄对象ID
|
||||
repeated CostCardData hero = 2; // 消耗卡牌对象ID
|
||||
repeated CostCardData heroRace = 3; // 消耗种族卡牌对象ID
|
||||
}
|
||||
|
||||
// 卡牌升星返回
|
||||
message Hero_StrengthenUpStar_Resp {
|
||||
DB_HeroData hero = 1; // 英雄对象
|
||||
message HeroStrengthenUpStarResp {
|
||||
DBHero hero = 1; // 英雄对象
|
||||
}
|
||||
|
||||
// 卡牌技能升级
|
||||
message Hero_StrengthenUpSkill_Req {
|
||||
message HeroStrengthenUpSkillReq {
|
||||
string heroObjID = 1; // 英雄对象ID
|
||||
int32 skillIndex = 2; // 英雄技能索引
|
||||
CostCardData items = 3; // 消耗技能升级卡
|
||||
}
|
||||
|
||||
// 卡牌技能升级返回
|
||||
message Hero_StrengthenUpSkill_Resp {
|
||||
DB_HeroData hero = 1; // 英雄对象
|
||||
message HeroStrengthenUpSkillResp {
|
||||
DBHero hero = 1; // 英雄对象
|
||||
}
|
||||
|
||||
// 共鸣英雄
|
||||
message Hero_Gongming_Req {
|
||||
message HeroGongmingReq {
|
||||
string heroObjID = 1; // 英雄对象ID
|
||||
string costObjID = 2; // 消耗对象
|
||||
}
|
||||
|
||||
message Hero_Gongming_Resp {
|
||||
DB_HeroData hero = 1; // 英雄对象
|
||||
message HeroGongmingResp {
|
||||
DBHero hero = 1; // 英雄对象
|
||||
int32 energy = 2; // 共鸣成功 获得的能量点数
|
||||
DB_HeroData upStarCard = 3; //共鸣成功 获得的升星卡
|
||||
DBHero upStarCard = 3; //共鸣成功 获得的升星卡
|
||||
}
|
||||
|
||||
// 重置共鸣属性
|
||||
message Hero_GongmingReset_Req {
|
||||
message HeroGongmingResetReq {
|
||||
string heroObjID = 1; // 英雄对象ID
|
||||
}
|
||||
|
||||
message Hero_GongmingReset_Resp {
|
||||
DB_HeroData hero = 1; // 英雄对象
|
||||
message HeroGongmingResetResp {
|
||||
DBHero hero = 1; // 英雄对象
|
||||
int32 energy = 2; // 能量点数
|
||||
}
|
||||
|
||||
// 使用能量点数
|
||||
message Hero_GongmingUseEnergy_Req {
|
||||
message HeroGongmingUseEnergyReq {
|
||||
string heroObjID = 1; // 英雄对象ID
|
||||
int32 useEnergy = 2; // 使用的能量点数
|
||||
int32 useType = 3; // 使用的类型 (攻击、血量、防御)
|
||||
}
|
||||
|
||||
message Hero_GongmingUseEnergy_Resp {
|
||||
DB_HeroData hero = 1; // 英雄对象
|
||||
message HeroGongmingUseEnergyResp {
|
||||
DBHero hero = 1; // 英雄对象
|
||||
}
|
||||
|
||||
// 觉醒
|
||||
message Hero_Juexing_Req {
|
||||
message HeroJuexingReq {
|
||||
string heroObjID = 1; // 英雄对象ID
|
||||
ItemData costItmes = 2; // 觉醒消耗待定
|
||||
}
|
||||
|
||||
// 觉醒返回
|
||||
message Hero_Juexing_Resp {
|
||||
DB_HeroData hero = 1; // 英雄对象
|
||||
message HeroJuexingResp {
|
||||
DBHero hero = 1; // 英雄对象
|
||||
}
|
@ -42,9 +42,11 @@ type msghandle struct {
|
||||
//服务网关组件
|
||||
type SCompGateRoute struct {
|
||||
cbase.ServiceCompBase
|
||||
service base.IRPCXService //rpc服务对象 通过这个对象可以发布服务和调用其他服务的接口
|
||||
mrlock sync.RWMutex //msghandles 对象的锁
|
||||
msghandles map[string]*msghandle //处理函数的管理对象
|
||||
service base.IRPCXService //rpc服务对象 通过这个对象可以发布服务和调用其他服务的接口
|
||||
mrlock sync.RWMutex //msghandles 对象的锁
|
||||
msghandles map[string]*msghandle //处理函数的管理对象
|
||||
sessionslock sync.RWMutex //msghandles 对象的锁
|
||||
sessions map[string]comm.IUserSession //用户会话管理 避免频繁创建
|
||||
}
|
||||
|
||||
//设置服务组件名称 方便业务模块中获取此组件对象
|
||||
@ -57,6 +59,7 @@ func (this *SCompGateRoute) Init(service core.IService, comp core.IServiceComp,
|
||||
err = this.ServiceCompBase.Init(service, comp, options)
|
||||
this.service = service.(base.IRPCXService)
|
||||
this.msghandles = make(map[string]*msghandle)
|
||||
this.sessions = make(map[string]comm.IUserSession)
|
||||
return err
|
||||
} //
|
||||
|
||||
@ -106,8 +109,17 @@ func (this *SCompGateRoute) ReceiveMsg(ctx context.Context, args *pb.AgentMessag
|
||||
msghandle, ok := this.msghandles[method]
|
||||
this.mrlock.RUnlock()
|
||||
if ok {
|
||||
//封装用户会话
|
||||
session := comm.NewUserSession(this.service, args.Ip, args.UserSessionId, args.GatewayServiceId, args.UserId)
|
||||
//读取会话对象
|
||||
this.sessionslock.RLock()
|
||||
session, ok := this.sessions[args.UserSessionId]
|
||||
this.sessionslock.RUnlock()
|
||||
if !ok { //没有 创建会话
|
||||
//封装用户会话
|
||||
session = comm.NewUserSession(this.service, args.Ip, args.UserSessionId, args.GatewayServiceId, args.UserId)
|
||||
this.sessionslock.Lock()
|
||||
this.sessions[args.UserSessionId] = session
|
||||
this.sessionslock.Unlock()
|
||||
}
|
||||
//序列化用户消息对象
|
||||
msg := reflect.New(msghandle.msgType.Elem()).Interface()
|
||||
if err := ptypes.UnmarshalAny(args.Message, msg.(proto.Message)); err != nil {
|
||||
@ -154,7 +166,9 @@ func (this *SCompGateRoute) ReceiveMsg(ctx context.Context, args *pb.AgentMessag
|
||||
|
||||
//RPC_NoticeUserClose 接收用户离线通知
|
||||
func (this *SCompGateRoute) NoticeUserClose(ctx context.Context, args *pb.NoticeUserCloseReq, reply *pb.RPCMessageReply) error {
|
||||
event.TriggerEvent(comm.Event_UserOffline, args.UserId)
|
||||
|
||||
event.TriggerEvent(comm.EventUserOffline, args.UserId)
|
||||
this.sessionslock.Lock()
|
||||
delete(this.sessions, args.UserSessionId)
|
||||
this.sessionslock.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user