上传工会boos优化

This commit is contained in:
liwei 2023-07-19 17:44:35 +08:00
parent defae669b4
commit 306c463838
27 changed files with 2475 additions and 734 deletions

View File

@ -339,7 +339,7 @@
"LockSlots": [],
"AssistTeam": 0,
"CanFriendHelp": 0,
"Numrounds": 0
"Numrounds": 100
},
{
"id": 118,
@ -480,7 +480,7 @@
"HeroCount": 5,
"readyScene": "scenesfight_role_interface_02",
"battleScenes": [
"bossfight_chef_02"
"bossfight_translate_01"
],
"disableAiCamera": 1,
"ChoseCamp": [],

View File

@ -1648,5 +1648,521 @@
"card_pool_type": "camp4_pool",
"id": "45004",
"weight": 1000
},
{
"key": 277,
"card_pool_type": "pro_pool70003",
"id": "24002",
"weight": 36
},
{
"key": 278,
"card_pool_type": "pro_pool70003",
"id": "13003",
"weight": 36
},
{
"key": 279,
"card_pool_type": "pro_pool70003",
"id": "43006",
"weight": 9
},
{
"key": 280,
"card_pool_type": "pro_pool70003",
"id": "43001",
"weight": 9
},
{
"key": 281,
"card_pool_type": "pro_pool70003",
"id": "13001",
"weight": 36
},
{
"key": 282,
"card_pool_type": "pro_pool70003",
"id": "33002",
"weight": 36
},
{
"key": 283,
"card_pool_type": "pro_pool70003",
"id": "13005",
"weight": 36
},
{
"key": 284,
"card_pool_type": "pro_pool70003",
"id": "23004",
"weight": 36
},
{
"key": 285,
"card_pool_type": "pro_pool70003",
"id": "13004",
"weight": 36
},
{
"key": 286,
"card_pool_type": "pro_pool70003",
"id": "43003",
"weight": 9
},
{
"key": 287,
"card_pool_type": "pro_pool70003",
"id": "13002",
"weight": 36
},
{
"key": 288,
"card_pool_type": "pro_pool70003",
"id": "33003",
"weight": 36
},
{
"key": 289,
"card_pool_type": "pro_pool70003",
"id": "43002",
"weight": 9
},
{
"key": 290,
"card_pool_type": "pro_pool70004",
"id": "24004",
"weight": 27
},
{
"key": 291,
"card_pool_type": "pro_pool70004",
"id": "24008",
"weight": 27
},
{
"key": 292,
"card_pool_type": "pro_pool70004",
"id": "24003",
"weight": 27
},
{
"key": 293,
"card_pool_type": "pro_pool70004",
"id": "24005",
"weight": 27
},
{
"key": 294,
"card_pool_type": "pro_pool70004",
"id": "14001",
"weight": 27
},
{
"key": 295,
"card_pool_type": "pro_pool70004",
"id": "34007",
"weight": 27
},
{
"key": 296,
"card_pool_type": "pro_pool70004",
"id": "14003",
"weight": 27
},
{
"key": 297,
"card_pool_type": "pro_pool70004",
"id": "14007",
"weight": 27
},
{
"key": 298,
"card_pool_type": "pro_pool70004",
"id": "34006",
"weight": 27
},
{
"key": 299,
"card_pool_type": "pro_pool70004",
"id": "34002",
"weight": 27
},
{
"key": 300,
"card_pool_type": "pro_pool70004",
"id": "44005",
"weight": 16
},
{
"key": 301,
"card_pool_type": "pro_pool70004",
"id": "44006",
"weight": 16
},
{
"key": 302,
"card_pool_type": "pro_pool70004",
"id": "14005",
"weight": 27
},
{
"key": 303,
"card_pool_type": "pro_pool70004",
"id": "24001",
"weight": 27
},
{
"key": 304,
"card_pool_type": "pro_pool70004",
"id": "34008",
"weight": 27
},
{
"key": 305,
"card_pool_type": "pro_pool70004",
"id": "34003",
"weight": 27
},
{
"key": 306,
"card_pool_type": "pro_pool70004",
"id": "24009",
"weight": 27
},
{
"key": 307,
"card_pool_type": "pro_pool70004",
"id": "34005",
"weight": 27
},
{
"key": 308,
"card_pool_type": "pro_pool70004",
"id": "44004",
"weight": 16
},
{
"key": 309,
"card_pool_type": "pro_pool70005",
"id": "25001",
"weight": 100
},
{
"key": 310,
"card_pool_type": "pro_pool70005",
"id": "25004",
"weight": 100
},
{
"key": 311,
"card_pool_type": "pro_pool70005",
"id": "15005",
"weight": 100
},
{
"key": 312,
"card_pool_type": "pro_pool70005",
"id": "35006",
"weight": 100
},
{
"key": 313,
"card_pool_type": "pro_pool70005",
"id": "45003",
"weight": 0
},
{
"key": 314,
"card_pool_type": "pro_pool70005",
"id": "35001",
"weight": 100
},
{
"key": 315,
"card_pool_type": "pro_pool70005",
"id": "15004",
"weight": 100
},
{
"key": 316,
"card_pool_type": "pro_pool70005",
"id": "45001",
"weight": 0
},
{
"key": 317,
"card_pool_type": "pro_pool70005",
"id": "35005",
"weight": 100
},
{
"key": 318,
"card_pool_type": "pro_pool70005",
"id": "15002",
"weight": 100
},
{
"key": 319,
"card_pool_type": "pro_pool70005",
"id": "15003",
"weight": 100
},
{
"key": 320,
"card_pool_type": "base_pool70003",
"id": "24002",
"weight": 36
},
{
"key": 321,
"card_pool_type": "base_pool70003",
"id": "13003",
"weight": 36
},
{
"key": 322,
"card_pool_type": "base_pool70003",
"id": "43006",
"weight": 9
},
{
"key": 323,
"card_pool_type": "base_pool70003",
"id": "43001",
"weight": 9
},
{
"key": 324,
"card_pool_type": "base_pool70003",
"id": "13001",
"weight": 36
},
{
"key": 325,
"card_pool_type": "base_pool70003",
"id": "33002",
"weight": 36
},
{
"key": 326,
"card_pool_type": "base_pool70003",
"id": "13005",
"weight": 36
},
{
"key": 327,
"card_pool_type": "base_pool70003",
"id": "23004",
"weight": 36
},
{
"key": 328,
"card_pool_type": "base_pool70003",
"id": "13004",
"weight": 36
},
{
"key": 329,
"card_pool_type": "base_pool70003",
"id": "43003",
"weight": 9
},
{
"key": 330,
"card_pool_type": "base_pool70003",
"id": "13002",
"weight": 36
},
{
"key": 331,
"card_pool_type": "base_pool70003",
"id": "33003",
"weight": 36
},
{
"key": 332,
"card_pool_type": "base_pool70003",
"id": "43002",
"weight": 9
},
{
"key": 333,
"card_pool_type": "base_pool70004",
"id": "24004",
"weight": 27
},
{
"key": 334,
"card_pool_type": "base_pool70004",
"id": "24008",
"weight": 27
},
{
"key": 335,
"card_pool_type": "base_pool70004",
"id": "24003",
"weight": 27
},
{
"key": 336,
"card_pool_type": "base_pool70004",
"id": "24005",
"weight": 27
},
{
"key": 337,
"card_pool_type": "base_pool70004",
"id": "14001",
"weight": 27
},
{
"key": 338,
"card_pool_type": "base_pool70004",
"id": "34007",
"weight": 27
},
{
"key": 339,
"card_pool_type": "base_pool70004",
"id": "14003",
"weight": 27
},
{
"key": 340,
"card_pool_type": "base_pool70004",
"id": "14007",
"weight": 27
},
{
"key": 341,
"card_pool_type": "base_pool70004",
"id": "34006",
"weight": 27
},
{
"key": 342,
"card_pool_type": "base_pool70004",
"id": "34002",
"weight": 27
},
{
"key": 343,
"card_pool_type": "base_pool70004",
"id": "44005",
"weight": 16
},
{
"key": 344,
"card_pool_type": "base_pool70004",
"id": "44006",
"weight": 16
},
{
"key": 345,
"card_pool_type": "base_pool70004",
"id": "14005",
"weight": 27
},
{
"key": 346,
"card_pool_type": "base_pool70004",
"id": "24001",
"weight": 27
},
{
"key": 347,
"card_pool_type": "base_pool70004",
"id": "34008",
"weight": 27
},
{
"key": 348,
"card_pool_type": "base_pool70004",
"id": "34003",
"weight": 27
},
{
"key": 349,
"card_pool_type": "base_pool70004",
"id": "24009",
"weight": 27
},
{
"key": 350,
"card_pool_type": "base_pool70004",
"id": "34005",
"weight": 27
},
{
"key": 351,
"card_pool_type": "base_pool70004",
"id": "44004",
"weight": 16
},
{
"key": 352,
"card_pool_type": "base_pool70005",
"id": "25001",
"weight": 18
},
{
"key": 353,
"card_pool_type": "base_pool70005",
"id": "25004",
"weight": 18
},
{
"key": 354,
"card_pool_type": "base_pool70005",
"id": "15005",
"weight": 18
},
{
"key": 355,
"card_pool_type": "base_pool70005",
"id": "35006",
"weight": 18
},
{
"key": 356,
"card_pool_type": "base_pool70005",
"id": "45003",
"weight": 9
},
{
"key": 357,
"card_pool_type": "base_pool70005",
"id": "35001",
"weight": 18
},
{
"key": 358,
"card_pool_type": "base_pool70005",
"id": "15004",
"weight": 18
},
{
"key": 359,
"card_pool_type": "base_pool70005",
"id": "45001",
"weight": 9
},
{
"key": 360,
"card_pool_type": "base_pool70005",
"id": "35005",
"weight": 18
},
{
"key": 361,
"card_pool_type": "base_pool70005",
"id": "15002",
"weight": 18
},
{
"key": 362,
"card_pool_type": "base_pool70005",
"id": "15003",
"weight": 18
}
]

View File

@ -43,7 +43,7 @@
"load_chat": 10,
"channel_allocation_max": 2000,
"channel_switching_max": 3000,
"draw_toplimit": 20,
"draw_toplimit": 9999,
"draw10_star4_max": 8,
"draw10_star5_max": 2,
"draw_floor_star4": 20,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -319,5 +319,26 @@
},
"reword": [],
"duration": 720
},
{
"id": "PeackReward",
"title": {
"key": "",
"text": ""
},
"recipient": {
"key": "",
"text": ""
},
"content": {
"key": "mail_mail_content_16",
"text": "这是圣桃抽卡没有领取的奖励。"
},
"sender": {
"key": "",
"text": ""
},
"reword": [],
"duration": 720
}
]

View File

@ -130,5 +130,11 @@
"open": true,
"routrules": "~/worker",
"describe": "好友排行"
},
{
"msgid": "uniongve",
"open": true,
"routrules": "~/worker",
"describe": "工会boos战"
}
]

View File

@ -5251,7 +5251,8 @@
"heroid": 25001,
"datas": [
"WuGuanScene",
"武馆的老虎"
"武馆的老虎",
"137"
],
"event": [
2,
@ -5263,7 +5264,8 @@
"id": 300018,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0
@ -5274,7 +5276,8 @@
"id": 300019,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0
@ -5286,7 +5289,8 @@
"heroid": 25001,
"datas": [
"GameMain",
"烹饪处的阿宝"
"烹饪处的阿宝",
"901"
],
"event": [
2,
@ -5299,7 +5303,8 @@
"heroid": 25001,
"datas": [
"WuGuanScene",
"武馆的老虎"
"武馆的老虎",
"137"
],
"event": [
2,
@ -5312,7 +5317,8 @@
"heroid": 25001,
"datas": [
"WuGuanScene",
"武馆的老虎"
"武馆的老虎",
"137"
],
"event": [
2,
@ -5325,7 +5331,8 @@
"heroid": 25001,
"datas": [
"GameMain",
"功能入口-维京远征"
"功能入口-维京远征",
"901"
],
"event": [
2,
@ -5338,7 +5345,8 @@
"heroid": 25001,
"datas": [
"GameMain",
"装木炭的箱子"
"装木炭的箱子",
"901"
],
"event": [],
"goto": 0
@ -5348,7 +5356,8 @@
"heroid": 25001,
"datas": [
"GameMain",
"功能入口-维京远征"
"功能入口-维京远征",
"901"
],
"event": [
2,
@ -5361,7 +5370,8 @@
"heroid": 25001,
"datas": [
"GameMain",
"希卡普旁的亚丝翠"
"希卡普旁的亚丝翠",
"901"
],
"event": [
2,
@ -5374,7 +5384,8 @@
"heroid": 25001,
"datas": [
"GameMain",
"亚丝翠旁的鼻涕粗"
"亚丝翠旁的鼻涕粗",
"901"
],
"event": [
1,
@ -5386,7 +5397,8 @@
"id": 300049,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0
@ -5398,7 +5410,8 @@
"heroid": 25001,
"datas": [
"GameMain",
"亚丝翠旁的鼻涕粗"
"亚丝翠旁的鼻涕粗",
"901"
],
"event": [
2,
@ -5411,7 +5424,8 @@
"heroid": 25001,
"datas": [
"GameMain",
"亚丝翠旁的鼻涕粗"
"亚丝翠旁的鼻涕粗",
"901"
],
"event": [
1,
@ -5423,7 +5437,8 @@
"id": 300059,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0
@ -5435,7 +5450,8 @@
"heroid": 25001,
"datas": [
"GameMain",
"亚丝翠旁的鼻涕粗"
"亚丝翠旁的鼻涕粗",
"901"
],
"event": [
2,
@ -5447,7 +5463,8 @@
"id": 300068,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0
@ -5458,7 +5475,8 @@
"id": 300069,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0
@ -5470,7 +5488,8 @@
"heroid": 25001,
"datas": [
"GameMain",
"车站旁的鼻涕粗"
"车站旁的鼻涕粗",
"901"
],
"event": [
2,
@ -5482,7 +5501,8 @@
"id": 300618,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0
@ -5493,7 +5513,8 @@
"id": 300619,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0
@ -5505,7 +5526,8 @@
"heroid": 25001,
"datas": [
"GameMain",
"希卡普旁的亚丝翠"
"希卡普旁的亚丝翠",
"901"
],
"event": [
2,
@ -5517,7 +5539,8 @@
"id": 300628,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0
@ -5528,7 +5551,8 @@
"id": 300629,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0
@ -5540,7 +5564,8 @@
"heroid": 25001,
"datas": [
"GameMain",
"功能入口-烹饪"
"功能入口-烹饪",
"901"
],
"event": [
2,
@ -5552,7 +5577,8 @@
"id": 300078,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0
@ -5563,7 +5589,8 @@
"id": 300079,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0
@ -5575,7 +5602,8 @@
"heroid": 25001,
"datas": [
"GameMain",
"铁匠铺门口的暴芙那特"
"铁匠铺门口的暴芙那特",
"901"
],
"event": [
2,
@ -5587,7 +5615,8 @@
"id": 300088,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0
@ -5598,7 +5627,8 @@
"id": 300089,
"heroid": 25001,
"datas": [
"GameMain"
"GameMain",
"901"
],
"event": [
0

View File

@ -6,7 +6,7 @@
"text": "[color=#37d8a9]攻击提升[/color] "
},
"Desc": {
"key": "skill_skill_buff_Desc_390001001",
"key": "780002904",
"text": "攻击提升60%。"
},
"BuffType": 1,
@ -324,7 +324,7 @@
},
"BuffType": 30,
"EffectArgu": [
-1,
14,
100
],
"BufParNum": 1,

View File

@ -295,6 +295,8 @@ const (
TableUniongve = "uniongve"
///工会轮盘
TableUnionroulette = "unionroulette"
///工会排行榜
TableUnionrank = "unionrank"
//全局表
TableGlobal = "global"
)

View File

@ -367,7 +367,7 @@ type (
// 获取我的公会成员
MembersByUid(uid string) (list []*pb.SociatyMemberInfo)
// 获取公会成员
MembersBySociatyId(sociatyId string) (list []*pb.SociatyMemberInfo)
MembersBySociatyId(sociatyId string) (list []*pb.SociatyMemberInfo, errdata *pb.ErrorData)
// 设置工会经验
BingoSetExp(session IUserSession, exp int32) error
// 设置工会活跃度

View File

@ -113,6 +113,11 @@ func (this *MCompModel) Get(id string, data interface{}, opt ...db.DBOption) (er
return this.DBModel.Get(id, data, opt...)
}
// 读取全部数据
func (this *MCompModel) GetByID(id string, data interface{}, opt ...db.DBOption) (err error) {
return this.DBModel.GetByID(id, data, opt...)
}
// 读取多个数据对象
func (this *MCompModel) Gets(ids []string, data interface{}, opt ...db.DBOption) (onfound []string, err error) {
return this.DBModel.Gets(ids, data, opt...)

View File

@ -23,17 +23,22 @@ func (this *apiComp) ApplyCheck(session comm.IUserSession, req *pb.SociatyApplyR
}
func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (errdata *pb.ErrorData) {
var (
sociaty *pb.DBSociaty
err error
)
if errdata = this.ApplyCheck(session, req); errdata != nil {
return
}
uid := session.GetUserId()
sociaty := this.module.modelSociaty.getSociaty(req.SociatyId)
if sociaty == nil {
if sociaty, err = this.module.modelSociaty.getSociaty(req.SociatyId); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_SociatyNoFound,
Title: pb.ErrorCode_SociatyNoFound.ToString(),
Code: pb.ErrorCode_SociatyNoFound,
Title: pb.ErrorCode_SociatyNoFound.ToString(),
Message: err.Error(),
}
return
}

View File

@ -20,17 +20,22 @@ func (this *apiComp) ApplyCancelCheck(session comm.IUserSession, req *pb.Sociaty
}
func (this *apiComp) ApplyCancel(session comm.IUserSession, req *pb.SociatyApplyCancelReq) (errdata *pb.ErrorData) {
var (
uid string
sociaty *pb.DBSociaty
err error
)
if errdata = this.ApplyCancelCheck(session, req); errdata != nil {
return
}
uid := session.GetUserId()
sociaty := this.module.modelSociaty.getSociaty(req.SociatyId)
if sociaty != nil && sociaty.Id == "" {
uid = session.GetUserId()
if sociaty, err = this.module.modelSociaty.getSociaty(req.SociatyId); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_SociatyNoFound,
Title: pb.ErrorCode_SociatyNoFound.ToString(),
Code: pb.ErrorCode_SociatyNoFound,
Title: pb.ErrorCode_SociatyNoFound.ToString(),
Message: err.Error(),
}
return
}

View File

@ -20,16 +20,22 @@ func (this *apiComp) ApplyListCheck(session comm.IUserSession, req *pb.SociatyAp
}
func (this *apiComp) ApplyList(session comm.IUserSession, req *pb.SociatyApplyListReq) (errdata *pb.ErrorData) {
var (
uid string
sociaty *pb.DBSociaty
err error
)
if errdata = this.ApplyListCheck(session, req); errdata != nil {
return
}
uid := session.GetUserId()
sociaty := this.module.modelSociaty.getSociaty(req.SociatyId)
if sociaty == nil {
uid = session.GetUserId()
if sociaty, err = this.module.modelSociaty.getSociaty(req.SociatyId); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_SociatyNoFound,
Title: pb.ErrorCode_SociatyNoFound.ToString(),
Code: pb.ErrorCode_SociatyNoFound,
Title: pb.ErrorCode_SociatyNoFound.ToString(),
Message: err.Error(),
}
return
}

View File

@ -62,9 +62,13 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq)
user := this.module.ModuleUser.GetUser(uid)
if user == nil {
this.module.Error("GetRmoteUser not found", log.Field{Key: "uid", Value: uid})
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: fmt.Sprintf("not found user: %s", uid),
}
return
}
userExpand, err := this.module.ModuleUser.GetUserExpand(uid)
if err != nil {
errdata = &pb.ErrorData{

View File

@ -167,14 +167,11 @@ func (this *ModelSociaty) findByName(name string) *pb.DBSociaty {
}
// 获取公会
func (this *ModelSociaty) getSociaty(sociatyId string) (sociaty *pb.DBSociaty) {
func (this *ModelSociaty) getSociaty(sociatyId string) (sociaty *pb.DBSociaty, err error) {
sociaty = &pb.DBSociaty{}
if err := this.GetListObj(comm.RDS_EMPTY, sociatyId, sociaty); err != nil {
log.Error("GetListObj", log.Field{Key: "sociatyId", Value: sociatyId})
return nil
}
if sociaty.Id == "" {
return nil
if err = this.GetListObj(comm.RDS_EMPTY, sociatyId, sociaty); err != nil {
this.module.Error("获取工会信息 失败", log.Field{Key: "sociatyId", Value: sociatyId}, log.Field{Key: "err", Value: err.Error()})
return
}
return
}
@ -217,7 +214,7 @@ func (this *ModelSociaty) getUserSociaty(uid string) (sociaty *pb.DBSociaty) {
return
}
if userEx.SociatyId != "" {
sociaty = this.getSociaty(userEx.SociatyId)
sociaty, _ = this.getSociaty(userEx.SociatyId)
if sociaty != nil {
//验证是否解散
if this.isDismiss(sociaty) {

View File

@ -115,7 +115,7 @@ func (this *Sociaty) ProcessAccuse(uid, sociatyId string) {
if t == 0 {
return
}
sociaty := this.modelSociaty.getSociaty(sociatyId)
sociaty, _ := this.modelSociaty.getSociaty(sociatyId)
if sociaty != nil {
if sociaty.AccuseTime > 0 {
now := configure.Now().Unix()
@ -142,9 +142,20 @@ func (this *Sociaty) MembersByUid(uid string) (list []*pb.SociatyMemberInfo) {
}
// 获取公会成员
func (this *Sociaty) MembersBySociatyId(sociatyId string) (list []*pb.SociatyMemberInfo) {
sociaty := this.modelSociaty.getSociaty(sociatyId)
return this.modelSociaty.members(sociaty)
func (this *Sociaty) MembersBySociatyId(sociatyId string) (list []*pb.SociatyMemberInfo, errdata *pb.ErrorData) {
var (
sociaty *pb.DBSociaty
err error
)
if sociaty, err = this.modelSociaty.getSociaty(sociatyId); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
return this.modelSociaty.members(sociaty), nil
}
// 批量获取公户信息
@ -212,7 +223,11 @@ func (this *Sociaty) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (
// 跨服获取公会
func (this *Sociaty) RpcGetSociaty(ctx context.Context, req *pb.RPCGeneralReqA1, reply *pb.DBSociaty) error {
this.Debug("Rpc_ModuleSociaty", log.Field{Key: "req", Value: req.String()})
sociaty := this.modelSociaty.getSociaty(req.Param1)
var (
sociaty *pb.DBSociaty
err error
)
sociaty, err = this.modelSociaty.getSociaty(req.Param1)
reply.Id = sociaty.Id
reply.Lv = sociaty.Lv
reply.Exp = sociaty.Exp
@ -229,7 +244,7 @@ func (this *Sociaty) RpcGetSociaty(ctx context.Context, req *pb.RPCGeneralReqA1,
reply.Activity = sociaty.Activity
reply.AccuseTime = sociaty.AccuseTime
reply.ApplyRecord = sociaty.ApplyRecord
return nil
return err
}
type SociatyUpdateParam struct {

View File

@ -29,11 +29,12 @@ type Timer struct {
//season *SeasonPagoda
forum *ForumComp
arena *ArenaComp
sociaty *SociatyComp
parkour *ParkourComp
caravan *CaravanRank
}
//模块名
// 模块名
func (this *Timer) GetType() core.M_Modules {
return comm.ModuleTimer
}
@ -43,7 +44,7 @@ func (this *Timer) NewOptions() (options core.IModuleOptions) {
return new(Options)
}
//模块初始化接口 注册用户创建角色事件
// 模块初始化接口 注册用户创建角色事件
func (this *Timer) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
this.service = service.(base.IRPCXService)
@ -62,11 +63,12 @@ func (this *Timer) OnInstallComp() {
this.chat = this.RegisterComp(new(ChatComp)).(*ChatComp)
//this.season = this.RegisterComp(new(SeasonPagoda)).(*SeasonPagoda)
this.arena = this.RegisterComp(new(ArenaComp)).(*ArenaComp)
this.sociaty = this.RegisterComp(new(SociatyComp)).(*SociatyComp)
this.parkour = this.RegisterComp(new(ParkourComp)).(*ParkourComp)
this.caravan = this.RegisterComp(new(CaravanRank)).(*CaravanRank)
}
//跨服对象获取数据操作对象
// 跨服对象获取数据操作对象
func (this *Timer) getDBModelByUid(uid, tableName string) (model *db.DBModel, err error) {
var (
stag string
@ -88,7 +90,7 @@ func (this *Timer) getDBModelByUid(uid, tableName string) (model *db.DBModel, er
return
}
//日志
// 日志
func (this *Timer) Enabled(lvl log.Loglevel) bool {
return this.options.GetLog().Enabled(lvl)
}
@ -96,7 +98,7 @@ func (this *Timer) SetName(name string) {
this.options.GetLog().SetName(name)
}
//日志接口
// 日志接口
func (this *Timer) Debug(msg string, args ...log.Field) {
this.options.GetLog().Debug(msg, args...)
}

54
modules/timer/sociaty.go Normal file
View File

@ -0,0 +1,54 @@
package timer
import (
"context"
"go_dreamfactory/comm"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go_dreamfactory/sys/db"
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/cron"
)
/*
工会结算计时器
*/
type SociatyComp struct {
modules.MCompConfigure
service base.IRPCXService
module *Timer
takes []cron.EntryID
}
// 组件初始化接口
func (this *SociatyComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.MCompConfigure.Init(service, module, comp, options)
this.service = service.(base.IRPCXService)
this.module = module.(*Timer)
this.takes = make([]cron.EntryID, 0)
return
}
// 自由跨服环境下开启此功能
func (this *SociatyComp) Start() (err error) {
err = this.MCompConfigure.Start()
if db.IsCross() {
if _, err = cron.AddFunc("0 0 1 ? * 1", this.timer); err != nil {
this.module.Errorf("cron.AddFunc err:%v", err)
}
}
return
}
func (this *SociatyComp) timer() {
if _, err := this.service.RpcGo(context.Background(),
comm.Service_Worker,
string(comm.Rpc_ModuleGuildBossSettlement),
pb.EmptyReq{},
nil,
); err != nil {
this.module.Errorln(err)
}
}

View File

@ -33,7 +33,7 @@ func (this *modelGlobal) GetGlobalData(key string, v interface{}) (err error) {
// 更新全局配置
func (this *modelGlobal) UpdateGlobalData(key string, v interface{}) (err error) {
if _, err = this.DBModel.DB.UpdateOne(core.SqlTable(this.TableName), bson.M{"_id": key}, v, options.Update().SetUpsert(true)); err != nil {
if _, err = this.DBModel.DB.UpdateOne(core.SqlTable(this.TableName), bson.M{"_id": key}, bson.M{"$set": v}, options.Update().SetUpsert(true)); err != nil {
this.module.Error("GetGlobalData err", log.Field{Key: "key", Value: key}, log.Field{Key: "err", Value: err.Error()})
}
return

View File

@ -58,7 +58,7 @@ func (this *apiComp) Roulette(session comm.IUserSession, req *pb.UniongveRoulett
}
if confs[index].Push == 1 { //推送通知
go this.module.modelUnionroulette.roulettechangePush(session.GetUserId(), req.Unionid, award)
go this.module.modelUnionroulette.roulettechangePush(req.Unionid, session.GetUserId(), award)
}
session.SendMsg(string(this.module.GetType()), "roulette", &pb.UniongveRouletteResp{Cid: confs[index].Id, Award: award})

View File

@ -60,7 +60,7 @@ func (this *ModelUnionroulette) updateUnionRoulette(data *pb.DBUnionRouletteReco
// 分布式锁
func (this *ModelUnionroulette) userlock(id string) (result *redis.RedisMutex, err error) {
return this.DBModel.Redis.NewRedisMutex(fmt.Sprintf("unionroulette:%s", id))
return this.DBModel.Redis.NewRedisMutex(fmt.Sprintf("lockunionroulette:%s", id))
}
// boos 信息变化推送
@ -69,11 +69,11 @@ func (this *ModelUnionroulette) roulettechangePush(unionid string, uid string, a
info *pb.DBUnionRouletteRecord
members []*pb.SociatyMemberInfo
users []string = make([]string, 0)
errdata *pb.ErrorData
err error
)
members = this.module.sociaty.MembersBySociatyId(unionid)
if members == nil || len(members) == 0 {
this.module.Error("MembersBySociatyId is nil !")
if members, errdata = this.module.sociaty.MembersBySociatyId(unionid); errdata != nil {
this.module.Debug("获取工会成员列表!", log.Field{Key: "errdata", Value: errdata})
return
}
for _, v := range members {

View File

@ -46,8 +46,10 @@ func (this *ModelUniongve) getUnionGve(unionid string) (results *pb.DBUnionGve,
confs *pb.DBUnionGveBossConf
conf *cfg.GameGuildBossData
)
results = &pb.DBUnionGve{}
if err = this.Get(unionid, results); err != nil && err != mgo.MongodbNil {
results = &pb.DBUnionGve{
Boos: make([]*pb.DBUnionGveBoss, 0),
}
if err = this.GetByID(unionid, results); err != nil && err != mgo.MongodbNil {
this.module.Errorln(err)
return
}
@ -120,12 +122,16 @@ func (this *ModelUniongve) getGlobalBoos() (conf *pb.DBUnionGveBossConf, err err
)
this.conflock.RLock()
bossconf = this.bossconf
this.conflock.Unlock()
this.conflock.RUnlock()
if bossconf == nil || !utils.IsSameWeek(bossconf.Rtime) {
if bossconf, err = this.refreshGlobalBoos(); err != nil {
return
}
this.conflock.Lock()
this.bossconf = bossconf
this.conflock.Unlock()
}
conf = bossconf
return
}
@ -154,13 +160,16 @@ func (this *ModelUniongve) refreshGlobalBoos() (conf *pb.DBUnionGveBossConf, err
this.conflock.Lock()
this.bossconf = conf
this.conflock.Unlock()
this.module.ModuleTools.UpdateGlobalData(UnionGveBoosCoonfKey, conf)
this.module.ModuleTools.UpdateGlobalData(UnionGveBoosCoonfKey, map[string]interface{}{
"rtime": conf.Rtime,
"boos": conf.Boos,
})
return
}
// 分布式锁
func (this *ModelUniongve) userlock(id string) (result *redis.RedisMutex, err error) {
return this.DBModel.Redis.NewRedisMutex(fmt.Sprintf("uniongve:%s", id))
return this.DBModel.Redis.NewRedisMutex(fmt.Sprintf("lockuniongve:%s", id))
}
// boos 血量变化推送
@ -168,10 +177,10 @@ func (this *ModelUniongve) booshpchangepush(unionid string, info *pb.DBUnionGve)
var (
members []*pb.SociatyMemberInfo
users []string = make([]string, 0)
errdata *pb.ErrorData
)
members = this.module.sociaty.MembersBySociatyId(unionid)
if members == nil || len(members) == 0 {
this.module.Error("MembersBySociatyId is nil !")
if members, errdata = this.module.sociaty.MembersBySociatyId(unionid); errdata != nil {
this.module.Debug("获取工会成员列表!", log.Field{Key: "errdata", Value: errdata})
return
}
for _, v := range members {
@ -189,15 +198,15 @@ func (this *ModelUniongve) booskill(unionid string, boosid int32, info *pb.DBUni
conf *cfg.GameGuildBossData
members []*pb.SociatyMemberInfo
users []string = make([]string, 0)
errdata *pb.ErrorData
err error
)
if conf, err = this.module.configure.getguildbossByid(boosid); err != nil {
this.module.Errorln(err)
return
}
members = this.module.sociaty.MembersBySociatyId(unionid)
if members == nil || len(members) == 0 {
this.module.Error("MembersBySociatyId is nil !")
if members, errdata = this.module.sociaty.MembersBySociatyId(unionid); errdata != nil {
this.module.Debug("获取工会成员列表!", log.Field{Key: "errdata", Value: errdata})
return
}
for _, v := range members {
@ -246,10 +255,10 @@ func (this *ModelUniongve) infochangepush(unionid string, info *pb.DBUnionGve) {
var (
members []*pb.SociatyMemberInfo
users []string = make([]string, 0)
errdata *pb.ErrorData
)
members = this.module.sociaty.MembersBySociatyId(unionid)
if members == nil || len(members) == 0 {
this.module.Error("MembersBySociatyId is nil !")
if members, errdata = this.module.sociaty.MembersBySociatyId(unionid); errdata != nil {
this.module.Debug("获取工会成员列表!", log.Field{Key: "errdata", Value: errdata})
return
}
for _, v := range members {
@ -258,5 +267,5 @@ func (this *ModelUniongve) infochangepush(unionid string, info *pb.DBUnionGve) {
}
this.module.SendMsgToUsers(string(this.module.GetType()), "infochange", &pb.UniongveInfoChangePush{
Info: info,
})
}, users...)
}

View File

@ -25,7 +25,7 @@ type modelRank struct {
func (this *modelRank) 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.TableUnionroulette
this.TableName = comm.TableUnionrank
this.module = module.(*UnionGve)
return
}
@ -121,12 +121,13 @@ func (this *modelRank) rankRewardPush(unionid string, reward []*cfg.Gameatn) {
var (
members []*pb.SociatyMemberInfo
users []string = make([]string, 0)
errdata *pb.ErrorData
)
members = this.module.sociaty.MembersBySociatyId(unionid)
if members == nil || len(members) == 0 {
this.module.Error("MembersBySociatyId is nil !")
if members, errdata = this.module.sociaty.MembersBySociatyId(unionid); errdata != nil {
this.module.Debug("获取工会成员列表!", log.Field{Key: "errdata", Value: errdata})
return
}
for _, v := range members {
users = append(users, v.Uid)
}

View File

@ -26,7 +26,7 @@ type DBUnionGveBossConf struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key" bson:"_id"` //刷新时间 //唯一ID
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key" bson:"_id"` //唯一ID
Rtime int64 `protobuf:"varint,2,opt,name=rtime,proto3" json:"rtime"` //刷新时间
Boos []int32 `protobuf:"varint,3,rep,packed,name=boos,proto3" json:"boos"` //boosid
}
@ -90,7 +90,7 @@ type DBUnionGve struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Unionid string `protobuf:"bytes,1,opt,name=unionid,proto3" json:"unionid"` //工会id
Unionid string `protobuf:"bytes,1,opt,name=unionid,proto3" json:"unionid" bson:"_id"` // 背包格子Id
Notice string `protobuf:"bytes,2,opt,name=notice,proto3" json:"notice"` //公告
Fire int32 `protobuf:"varint,3,opt,name=fire,proto3" json:"fire"` //火力
Currstage int32 `protobuf:"varint,4,opt,name=currstage,proto3" json:"currstage"` //当前第几阶段

View File

@ -386,6 +386,27 @@ func (this *DBModel) Get(uid string, data interface{}, opt ...DBOption) (err err
return
}
// 读取全部数据
func (this *DBModel) GetByID(id string, data interface{}, opt ...DBOption) (err error) {
//defer log.Debug("DBModel Get", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "data", Value: data})
if err = this.Redis.HGetAll(this.ukey(id), data); err != nil && err != lgredis.RedisNil {
log.Error("HGetAll 错误!", log.Field{Key: "ukey", Value: this.ukey(id)}, log.Field{Key: "err", Value: err.Error()})
return
}
if err == lgredis.RedisNil {
if err = this.DB.FindOne(core.SqlTable(this.TableName), bson.M{"_id": id}).Decode(data); err != nil {
return
}
err = this.Redis.HMSet(this.ukey(id), data)
}
// option := newDBOption(opt...)
if this.Expired > 0 {
// this.Redis.Expire(this.ukey(uid), option.Expire)
this.conn.UpDateModelExpired(this.ukey(id), nil, this.Expired)
}
return
}
// 读取多个数据对象
func (this *DBModel) Gets(ids []string, data interface{}, opt ...DBOption) (onfound []string, err error) {
//defer log.Debug("DBModel GetListObjs", log.Field{Key: "TableName", Value: this.TableName}, log.Field{Key: "uid", Value: uid}, log.Field{Key: "ids", Value: ids}, log.Field{Key: "data", Value: data})