This commit is contained in:
liwei1dao 2022-11-18 10:04:16 +08:00
commit 99372b33b8
75 changed files with 1164 additions and 1179 deletions

View File

@ -1,120 +1,180 @@
[ [
{ {
"id": 20001, "id": 20001,
"group": 10001,
"subTask": 0, "subTask": 0,
"nodeIndex": 0,
"order": "1",
"group": 10001,
"name": { "name": {
"key": "SubplotMainTask_20001", "key": "SubplotMainTask_20001",
"text": "让阿宝变强1" "text": "让阿宝变强1"
}, },
"describe": {
"key": "SubplotMainTask_10001",
"text": "让阿宝变强1"
},
"img": "", "img": "",
"ending": 0, "ending": 0,
"resetto": [] "resetto": []
}, },
{ {
"id": 20002, "id": 20002,
"group": 10001,
"subTask": 20001, "subTask": 20001,
"nodeIndex": 1,
"order": "2",
"group": 10001,
"name": { "name": {
"key": "SubplotMainTask_20002", "key": "SubplotMainTask_20002",
"text": "让阿宝变强2" "text": "让阿宝变强2"
}, },
"describe": {
"key": "SubplotMainTask_10001",
"text": "让阿宝变强2"
},
"img": "", "img": "",
"ending": 0, "ending": 0,
"resetto": [] "resetto": []
}, },
{ {
"id": 20003, "id": 20003,
"subTask": 20001,
"nodeIndex": 1,
"order": "3",
"group": 10001, "group": 10001,
"subTask": 20002,
"name": { "name": {
"key": "SubplotMainTask_20003", "key": "SubplotMainTask_20003",
"text": "让阿宝变强3" "text": "让阿宝变强3"
}, },
"describe": {
"key": "SubplotMainTask_10001",
"text": "让阿宝变强3"
},
"img": "", "img": "",
"ending": 0, "ending": 0,
"resetto": [] "resetto": []
}, },
{ {
"id": 20004, "id": 20004,
"group": 10001,
"subTask": 20003, "subTask": 20003,
"nodeIndex": 2,
"order": "4",
"group": 10001,
"name": { "name": {
"key": "SubplotMainTask_20004", "key": "SubplotMainTask_20004",
"text": "让阿宝变强4" "text": "让阿宝变强4"
}, },
"describe": {
"key": "SubplotMainTask_10001",
"text": "让阿宝变强4"
},
"img": "", "img": "",
"ending": 0, "ending": 0,
"resetto": [] "resetto": []
}, },
{ {
"id": 20005, "id": 20005,
"subTask": 20002,
"nodeIndex": 2,
"order": "5",
"group": 10001, "group": 10001,
"subTask": 20004,
"name": { "name": {
"key": "SubplotMainTask_20005", "key": "SubplotMainTask_20005",
"text": "让阿宝变强5" "text": "让阿宝变强5"
}, },
"describe": {
"key": "SubplotMainTask_10001",
"text": "让阿宝变强5"
},
"img": "", "img": "",
"ending": 0, "ending": 0,
"resetto": [] "resetto": []
}, },
{ {
"id": 20006, "id": 20006,
"group": 10001,
"subTask": 20005, "subTask": 20005,
"nodeIndex": 3,
"order": "6",
"group": 10001,
"name": { "name": {
"key": "SubplotMainTask_20006", "key": "SubplotMainTask_20006",
"text": "让阿宝变强6" "text": "让阿宝变强6"
}, },
"describe": {
"key": "SubplotMainTask_10001",
"text": "让阿宝变强6"
},
"img": "", "img": "",
"ending": 0, "ending": 0,
"resetto": [] "resetto": []
}, },
{ {
"id": 20007, "id": 20007,
"group": 10001,
"subTask": 20006, "subTask": 20006,
"nodeIndex": 4,
"order": "7",
"group": 10001,
"name": { "name": {
"key": "SubplotMainTask_20007", "key": "SubplotMainTask_20007",
"text": "让阿宝变强7" "text": "让阿宝变强7"
}, },
"describe": {
"key": "SubplotMainTask_10001",
"text": "让阿宝变强7"
},
"img": "", "img": "",
"ending": 0, "ending": 0,
"resetto": [] "resetto": []
}, },
{ {
"id": 20008, "id": 20008,
"group": 10001,
"subTask": 20007, "subTask": 20007,
"nodeIndex": 5,
"order": "8",
"group": 10001,
"name": { "name": {
"key": "SubplotMainTask_20008", "key": "SubplotMainTask_20008",
"text": "让阿宝变强8" "text": "让阿宝变强8"
}, },
"describe": {
"key": "SubplotMainTask_10001",
"text": "让阿宝变强8"
},
"img": "", "img": "",
"ending": 0, "ending": 0,
"resetto": [] "resetto": []
}, },
{ {
"id": 20009, "id": 20009,
"group": 10001,
"subTask": 20008, "subTask": 20008,
"nodeIndex": 6,
"order": "9",
"group": 10001,
"name": { "name": {
"key": "SubplotMainTask_20009", "key": "SubplotMainTask_20009",
"text": "让阿宝变强9" "text": "让阿宝变强9"
}, },
"describe": {
"key": "SubplotMainTask_10001",
"text": "让阿宝变强9"
},
"img": "", "img": "",
"ending": 0, "ending": 0,
"resetto": [] "resetto": []
}, },
{ {
"id": 20010, "id": 20010,
"group": 10001,
"subTask": 20009, "subTask": 20009,
"nodeIndex": 7,
"order": "10",
"group": 10001,
"name": { "name": {
"key": "SubplotMainTask_20010", "key": "SubplotMainTask_20010",
"text": "让阿宝变强10" "text": "让阿宝变强10"
}, },
"describe": {
"key": "SubplotMainTask_10001",
"text": "让阿宝变强10"
},
"img": "", "img": "",
"ending": 1, "ending": 1,
"resetto": [] "resetto": []

View File

@ -1,6 +1,7 @@
[ [
{ {
"group": 10001, "group": 10001,
"order": "1",
"nodeIndex": 0, "nodeIndex": 0,
"cond": [], "cond": [],
"name": { "name": {
@ -23,6 +24,7 @@
}, },
{ {
"group": 10002, "group": 10002,
"order": "2",
"nodeIndex": 1, "nodeIndex": 1,
"cond": [ "cond": [
10001 10001
@ -47,6 +49,7 @@
}, },
{ {
"group": 10003, "group": 10003,
"order": "3",
"nodeIndex": 1, "nodeIndex": 1,
"cond": [ "cond": [
10001 10001
@ -71,6 +74,7 @@
}, },
{ {
"group": 10004, "group": 10004,
"order": "4",
"nodeIndex": 2, "nodeIndex": 2,
"cond": [ "cond": [
10003 10003
@ -95,6 +99,7 @@
}, },
{ {
"group": 10005, "group": 10005,
"order": "5",
"nodeIndex": 2, "nodeIndex": 2,
"cond": [ "cond": [
10003 10003
@ -119,6 +124,7 @@
}, },
{ {
"group": 10006, "group": 10006,
"order": "6",
"nodeIndex": 3, "nodeIndex": 3,
"cond": [ "cond": [
10005 10005
@ -143,6 +149,7 @@
}, },
{ {
"group": 10007, "group": 10007,
"order": "7",
"nodeIndex": 4, "nodeIndex": 4,
"cond": [ "cond": [
10006 10006
@ -167,6 +174,7 @@
}, },
{ {
"group": 10008, "group": 10008,
"order": "8",
"nodeIndex": 5, "nodeIndex": 5,
"cond": [ "cond": [
10007 10007

File diff suppressed because it is too large Load Diff

View File

@ -4,5 +4,5 @@ Website = "http://legu.cc"
Icon = "app.png" Icon = "app.png"
Name = "RobotGUI" Name = "RobotGUI"
ID = "cc.legu.app" ID = "cc.legu.app"
Version = "1.0.20" Version = "1.0.21"
Build = 23 Build = 25

View File

@ -300,6 +300,7 @@ func (ss *SSHService) ScpDownload(localDir, remoteFilePath string) error {
fileName := path.Base(remoteFile.Name()) fileName := path.Base(remoteFile.Name())
if err := os.MkdirAll(localDir, fs.ModePerm); err != nil { if err := os.MkdirAll(localDir, fs.ModePerm); err != nil {
logrus.Error(err)
return err return err
} }

View File

@ -145,7 +145,7 @@ type (
IRtask interface { IRtask interface {
// 条件校验 // 条件校验
CheckCondi(uid string, condiId int32) (code pb.ErrorCode) CheckCondi(uid string, condiId int32) (code pb.ErrorCode)
// 远程条件校验 // 远程任务条件校验
RemoteCheckCondi(uid string, condiId int32, rsp *pb.DBRtaskRecord) error RemoteCheckCondi(uid string, condiId int32, rsp *pb.DBRtaskRecord) error
//任务触发 //任务触发
SendToRtask(session IUserSession, rtaskType TaskType, params ...int32) (code pb.ErrorCode) SendToRtask(session IUserSession, rtaskType TaskType, params ...int32) (code pb.ErrorCode)

View File

@ -90,7 +90,7 @@ func (this *modelArena) queryUserHeros(uid string, heroids []string) (results []
var ( var (
model *db.DBModel model *db.DBModel
) )
if model, err = this.module.GetDBNoduleByUid(uid, comm.TableHero, time.Hour); err != nil { if model, err = this.module.GetDBModuleByUid(uid, comm.TableHero, time.Hour); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
return return
} }

View File

@ -56,7 +56,7 @@ func (this *modelEquipmentComp) QueryUserEquipments(uId string) (equipments []*p
) )
equipments = make([]*pb.DB_Equipment, 0) equipments = make([]*pb.DB_Equipment, 0)
if this.module.IsCross() { if this.module.IsCross() {
if model, err = this.module.GetDBNoduleByUid(uId, this.TableName, this.Expired); err != nil { if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
} else { } else {
if err = model.GetList(uId, &equipments); err != nil { if err = model.GetList(uId, &equipments); err != nil {
@ -121,7 +121,7 @@ func (this *modelEquipmentComp) AddEquipments(session comm.IUserSession, cIds ma
model *db.DBModel model *db.DBModel
) )
if this.module.IsCross() { if this.module.IsCross() {
if model, err = this.module.GetDBNoduleByUid(uId, this.TableName, this.Expired); err != nil { if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
} else { } else {
if err = model.AddLists(uId, add); err != nil { if err = model.AddLists(uId, add); err != nil {
@ -145,7 +145,7 @@ func (this *modelEquipmentComp) addEquipment(equip *pb.DB_Equipment) (err error)
model *db.DBModel model *db.DBModel
) )
if this.module.IsCross() { if this.module.IsCross() {
if model, err = this.module.GetDBNoduleByUid(equip.UId, this.TableName, this.Expired); err != nil { if model, err = this.module.GetDBModuleByUid(equip.UId, this.TableName, this.Expired); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
} else { } else {
if err = model.AddList(equip.UId, equip.Id, equip); err != nil { if err = model.AddList(equip.UId, equip.Id, equip); err != nil {
@ -169,7 +169,7 @@ func (this *modelEquipmentComp) DelEquipments(uId string, eIds []string) (change
) )
change = make([]*pb.DB_Equipment, 0) change = make([]*pb.DB_Equipment, 0)
if this.module.IsCross() { if this.module.IsCross() {
if model, err = this.module.GetDBNoduleByUid(uId, this.TableName, this.Expired); err != nil { if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
} else { } else {
if err = model.DelListlds(uId, eIds...); err != nil { if err = model.DelListlds(uId, eIds...); err != nil {
@ -199,7 +199,7 @@ func (this *modelEquipmentComp) UpdateByHeroId(uid string, equipments ...*pb.DB_
model *db.DBModel model *db.DBModel
) )
if this.module.IsCross() { if this.module.IsCross() {
if model, err = this.module.GetDBNoduleByUid(uid, this.TableName, this.Expired); err != nil { if model, err = this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
} else { } else {
for _, v := range equipments { for _, v := range equipments {

View File

@ -28,9 +28,7 @@ func (this *apiComp) WatchHero(session comm.IUserSession, req *pb.ForumWatchHero
if hero, err = this.module.modelForum.watchHero(req.Stag, req.Uid, req.HerocId); err != nil { if hero, err = this.module.modelForum.watchHero(req.Stag, req.Uid, req.HerocId); err != nil {
code = pb.ErrorCode_HeroNoExist code = pb.ErrorCode_HeroNoExist
} }
if equip, err = this.module.modelForum.watchHeroEquip(req.Stag, req.Uid, hero.EquipID...); err != nil { equip = this.module.modelForum.watchHeroEquip(req.Stag, req.Uid, hero.EquipID...)
code = pb.ErrorCode_EquipmentOnFoundEquipment
}
session.SendMsg(string(this.module.GetType()), "watchhero", &pb.ForumWatchHeroResp{ session.SendMsg(string(this.module.GetType()), "watchhero", &pb.ForumWatchHeroResp{
Hero: hero, Hero: hero,
EquipID: equip, EquipID: equip,

View File

@ -156,16 +156,15 @@ func (this *modelForumComp) watchHero(stage string, uid string, herocid string)
return return
} }
func (this *modelForumComp) watchHeroEquip(stage string, uid string, equipIds ...string) (equips []*pb.DB_Equipment, err error) { func (this *modelForumComp) watchHeroEquip(stage string, uid string, equipIds ...string) (equips []*pb.DB_Equipment) {
var ( if tcoon, err := db.ServerDBConn(stage); err == nil {
tcoon *db.DBConn for _, id := range equipIds {
)
if tcoon, err = db.ServerDBConn(stage); err != nil { if id == "" {
this.module.Errorf("stage:%s err:%v", stage, err) equips = append(equips, nil)
return continue
} }
for id := range equipIds {
sr := tcoon.Mgo.FindOne(comm.TableEquipment, bson.M{ sr := tcoon.Mgo.FindOne(comm.TableEquipment, bson.M{
"_id": id, "_id": id,
}) })
@ -176,6 +175,8 @@ func (this *modelForumComp) watchHeroEquip(stage string, uid string, equipIds ..
this.module.Errorf("find hero equip error: %v", err) this.module.Errorf("find hero equip error: %v", err)
} }
} }
} else {
this.module.Errorf("stage:%s err:%v", stage, err)
}
return return
} }

View File

@ -2,6 +2,7 @@ package friend
import ( import (
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
) )
@ -40,7 +41,7 @@ func (this *apiComp) Init(service core.IService, module core.IModule, comp core.
func (this *apiComp) setDefaultFriendUserBaseInfo(userId string) *pb.FriendBase { func (this *apiComp) setDefaultFriendUserBaseInfo(userId string) *pb.FriendBase {
if user, err := this.moduleFriend.ModuleUser.GetRemoteUser(userId); err != nil { if user, err := this.moduleFriend.ModuleUser.GetRemoteUser(userId); err != nil {
this.moduleFriend.Errorf("GetRmoteUser err:%v", err) this.moduleFriend.Error("GetRmoteUser", log.Fields{"err": err.Error()})
return nil return nil
} else { } else {
if user != nil { if user != nil {

View File

@ -2,20 +2,23 @@ package friend
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/utils" "go_dreamfactory/utils"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
//加入黑名单
func (this *apiComp) AddblackCheck(session comm.IUserSession, req *pb.FriendAddBlackReq) (code pb.ErrorCode) { func (this *apiComp) AddblackCheck(session comm.IUserSession, req *pb.FriendAddBlackReq) (code pb.ErrorCode) {
if req.FriendId == "" { if req.FriendId == "" {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.moduleFriend.Error("加入黑名单参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
//加入黑名单
func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendAddBlackReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendAddBlackReq) (code pb.ErrorCode, data proto.Message) {
if code = this.AddblackCheck(session, req); code != pb.ErrorCode_Success { if code = this.AddblackCheck(session, req); code != pb.ErrorCode_Success {
return return
@ -28,18 +31,8 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendAddBlackR
Resp *pb.FriendAddBlackResp Resp *pb.FriendAddBlackResp
) )
defer func() { uid := session.GetUserId()
Resp = &pb.FriendAddBlackResp{ self = this.moduleFriend.modelFriend.GetFriend(uid)
FriendId: req.FriendId,
UserId: session.GetUserId(),
}
if err = session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeAddBlack, Resp); err != nil {
code = pb.ErrorCode_SystemError
return
}
}()
self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId())
if self == nil { if self == nil {
code = pb.ErrorCode_FriendSelfNoData code = pb.ErrorCode_FriendSelfNoData
return return
@ -51,20 +44,20 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendAddBlackR
return return
} }
//判断目标是否在好友列表里面 //判断目标是否在好友列表里面(目标不在好友列表中也可加入黑名单)
// if _, ok := utils.Find(self.FriendIds, req.FriendId); ok { // if _, ok := utils.Findx(self.FriendIds, req.FriendId); ok {
// code = pb.ErrorCode_FriendYet // code = pb.ErrorCode_FriendYet
// return // return
// } // }
//判断目标是否已经在黑名单中 //判断目标是否已经在黑名单中
if _, ok := utils.Find(self.BlackIds, req.FriendId); ok { if _, ok := utils.Findx(self.BlackIds, req.FriendId); ok {
code = pb.ErrorCode_FriendSelfBlackYet code = pb.ErrorCode_FriendSelfBlackYet
return return
} }
// 判断自己是否在对方的黑名单中 // 判断自己是否在对方的黑名单中
if _, ok := utils.Find(target.BlackIds, self.Uid); ok { if _, ok := utils.Findx(target.BlackIds, self.Uid); ok {
code = pb.ErrorCode_FriendTargetBlackYet code = pb.ErrorCode_FriendTargetBlackYet
return return
} }
@ -79,7 +72,7 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendAddBlackR
self.BlackIds = append(self.BlackIds, req.FriendId) self.BlackIds = append(self.BlackIds, req.FriendId)
// 将目标从好友列表中移除 // 将目标从好友列表中移除
friendIds := utils.DeleteString(self.FriendIds, req.FriendId) friendIds := utils.Deletex(self.FriendIds, req.FriendId)
//更新 //更新
err = this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{ err = this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{
@ -88,6 +81,16 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendAddBlackR
}) })
if err != nil { if err != nil {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
this.moduleFriend.Error("加入黑名单", log.Fields{"uid": uid, "目标人": req.FriendId, "err": err.Error()})
return
}
Resp = &pb.FriendAddBlackResp{
FriendId: req.FriendId,
UserId: session.GetUserId(),
}
if err = session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeAddBlack, Resp); err != nil {
code = pb.ErrorCode_SystemError
return return
} }

View File

@ -2,21 +2,24 @@ package friend
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/utils" "go_dreamfactory/utils"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
//单个/批量同意
func (this *apiComp) AgreeCheck(session comm.IUserSession, req *pb.FriendAgreeReq) (code pb.ErrorCode) { func (this *apiComp) AgreeCheck(session comm.IUserSession, req *pb.FriendAgreeReq) (code pb.ErrorCode) {
if len(req.FriendIds) == 0 { if len(req.FriendIds) == 0 {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.moduleFriend.Error("好友审批同意参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
//单个/批量同意
func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (code pb.ErrorCode, data proto.Message) {
if code = this.AgreeCheck(session, req); code != pb.ErrorCode_Success { if code = this.AgreeCheck(session, req); code != pb.ErrorCode_Success {
return return
@ -25,23 +28,11 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c
err error err error
self *pb.DBFriend self *pb.DBFriend
target *pb.DBFriend target *pb.DBFriend
Resp *pb.FriendAgreeResp
optNum int32 optNum int32
) )
uid := session.GetUserId()
defer func() {
Resp = &pb.FriendAgreeResp{
Num: optNum,
}
err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeAgree, Resp)
if err != nil {
code = pb.ErrorCode_SystemError
return
}
}()
//获取玩家自己好友数据 //获取玩家自己好友数据
self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) self = this.moduleFriend.modelFriend.GetFriend(uid)
if self == nil { if self == nil {
code = pb.ErrorCode_FriendSelfNoData code = pb.ErrorCode_FriendSelfNoData
return return
@ -90,6 +81,7 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c
}) })
if err != nil { if err != nil {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
this.moduleFriend.Error("好友审批同意", log.Fields{"uid": uid, "params": req.FriendIds, "err": err.Error()})
return return
} }
@ -110,5 +102,13 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.FriendAgreeReq) (c
// 拥有xx个好友 // 拥有xx个好友
this.moduleFriend.ModuleRtask.SendToRtask(session, comm.Rtype10, int32(len(agreeIds))) this.moduleFriend.ModuleRtask.SendToRtask(session, comm.Rtype10, int32(len(agreeIds)))
resp := &pb.FriendAgreeResp{
Num: optNum,
}
if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeAgree, resp); err != nil {
code = pb.ErrorCode_SystemError
return
}
return return
} }

View File

@ -9,14 +9,16 @@ import (
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
//好友申请
func (this *apiComp) ApplyCheck(session comm.IUserSession, req *pb.FriendApplyReq) (code pb.ErrorCode) { func (this *apiComp) ApplyCheck(session comm.IUserSession, req *pb.FriendApplyReq) (code pb.ErrorCode) {
if req.FriendId == "" { if req.FriendId == "" {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.moduleFriend.Error("好友申请参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
//好友申请
func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (code pb.ErrorCode, data proto.Message) {
if code = this.ApplyCheck(session, req); code != pb.ErrorCode_Success { if code = this.ApplyCheck(session, req); code != pb.ErrorCode_Success {
return return
@ -26,24 +28,11 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
err error err error
self *pb.DBFriend self *pb.DBFriend
target *pb.DBFriend target *pb.DBFriend
Resp *pb.FriendApplyResp
) )
defer func() { uid := session.GetUserId()
if code == pb.ErrorCode_Success {
Resp = &pb.FriendApplyResp{
UserId: session.GetUserId(),
FriendId: req.FriendId,
}
}
if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeApply, Resp); err != nil {
code = pb.ErrorCode_SystemError
return
}
}()
//获取玩家自己好友数据 //获取玩家自己好友数据
self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) self = this.moduleFriend.modelFriend.GetFriend(uid)
if self == nil { if self == nil {
code = pb.ErrorCode_FriendSelfNoData code = pb.ErrorCode_FriendSelfNoData
return return
@ -57,7 +46,7 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
} }
//判断是否是自己 //判断是否是自己
if req.FriendId == session.GetUserId() { if req.FriendId == uid {
code = pb.ErrorCode_FriendNotSelf code = pb.ErrorCode_FriendNotSelf
return return
} }
@ -104,14 +93,22 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
} }
target.ApplyIds = append(target.ApplyIds, session.GetUserId()) target.ApplyIds = append(target.ApplyIds, session.GetUserId())
err = this.moduleFriend.modelFriend.Change(req.FriendId, map[string]interface{}{ if err = this.moduleFriend.modelFriend.Change(req.FriendId, map[string]interface{}{
"applyIds": target.ApplyIds, "applyIds": target.ApplyIds,
}) }); err != nil {
if err != nil {
log.Errorf("firend Apply err:%v", err)
code = pb.ErrorCode_FriendApplyError code = pb.ErrorCode_FriendApplyError
this.moduleFriend.Error("好友申请", log.Fields{"uid": uid, "params": req.FriendId, "err": err.Error()})
return return
} }
resp := &pb.FriendApplyResp{
UserId: session.GetUserId(),
FriendId: req.FriendId,
}
if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeApply, resp); err != nil {
code = pb.ErrorCode_SystemError
return
}
return return
} }

View File

@ -7,29 +7,18 @@ import (
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
//申请列表
func (this *apiComp) ApplyListCheck(session comm.IUserSession, req *pb.FriendApplyListReq) (code pb.ErrorCode) { func (this *apiComp) ApplyListCheck(session comm.IUserSession, req *pb.FriendApplyListReq) (code pb.ErrorCode) {
return return
} }
//申请列表
func (this *apiComp) ApplyList(session comm.IUserSession, req *pb.FriendApplyListReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) ApplyList(session comm.IUserSession, req *pb.FriendApplyListReq) (code pb.ErrorCode, data proto.Message) {
var ( var (
self *pb.DBFriend self *pb.DBFriend
Resp *pb.FriendApplyListResp
list []*pb.FriendBase list []*pb.FriendBase
) )
defer func() {
if code == pb.ErrorCode_Success {
Resp = &pb.FriendApplyListResp{
List: list,
}
}
if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeApplyList, Resp); err != nil {
code = pb.ErrorCode_SystemError
}
}()
self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId())
if self == nil { if self == nil {
code = pb.ErrorCode_FriendSelfNoData code = pb.ErrorCode_FriendSelfNoData
@ -43,5 +32,13 @@ func (this *apiComp) ApplyList(session comm.IUserSession, req *pb.FriendApplyLis
} }
} }
resp := &pb.FriendApplyListResp{
List: list,
}
if err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeApplyList, resp); err != nil {
code = pb.ErrorCode_SystemError
}
return return
} }

View File

@ -14,6 +14,7 @@ import (
func (this *apiComp) AssistheroCheck(session comm.IUserSession, req *pb.FriendAssistheroReq) (code pb.ErrorCode) { func (this *apiComp) AssistheroCheck(session comm.IUserSession, req *pb.FriendAssistheroReq) (code pb.ErrorCode) {
if req.HeroObjId == "" { if req.HeroObjId == "" {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.moduleFriend.Error("设置助战英雄参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
@ -22,12 +23,12 @@ func (this *apiComp) Assisthero(session comm.IUserSession, req *pb.FriendAssisth
if code = this.AssistheroCheck(session, req); code != pb.ErrorCode_Success { if code = this.AssistheroCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
uid := session.GetUserId()
// 获取英雄 // 获取英雄
hero, err := this.moduleFriend.ModuleHero.QueryCrossHeroinfo(req.HeroObjId) hero, err := this.moduleFriend.ModuleHero.QueryCrossHeroinfo(req.HeroObjId)
if err != nil { if err != nil {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
this.moduleFriend.Errorf("query hero by cross err:%v", err) this.moduleFriend.Error("查询英雄数据 QueryCrossHeroinfo", log.Fields{"uid": uid, "param": req.HeroObjId, "err": err.Error()})
return return
} }
@ -37,7 +38,7 @@ func (this *apiComp) Assisthero(session comm.IUserSession, req *pb.FriendAssisth
} }
//获取玩家自己好友数据 //获取玩家自己好友数据
self := this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) self := this.moduleFriend.modelFriend.GetFriend(uid)
if self == nil { if self == nil {
code = pb.ErrorCode_FriendSelfNoData code = pb.ErrorCode_FriendSelfNoData
return return
@ -54,8 +55,8 @@ func (this *apiComp) Assisthero(session comm.IUserSession, req *pb.FriendAssisth
} }
if err := this.moduleFriend.modelFriend.Change(self.Uid, update); err != nil { if err := this.moduleFriend.modelFriend.Change(self.Uid, update); err != nil {
log.Errorf("Assisthero err:%v", err)
code = pb.ErrorCode_FriendApplyError code = pb.ErrorCode_FriendApplyError
this.moduleFriend.Error("设置助战英雄", log.Fields{"uid": uid, "param": req.HeroObjId, "err": err.Error()})
return return
} }
@ -76,7 +77,7 @@ func (this *apiComp) Assisthero(session comm.IUserSession, req *pb.FriendAssisth
} }
if err := this.moduleFriend.SendMsgToUsers(string(this.moduleFriend.GetType()), "assistheroupdate", push, self.FriendIds...); err != nil { if err := this.moduleFriend.SendMsgToUsers(string(this.moduleFriend.GetType()), "assistheroupdate", push, self.FriendIds...); err != nil {
this.moduleFriend.Errorf("push AssistHeroList err:", err) this.moduleFriend.Error("推送助战英雄列表", log.Fields{"uid": uid, "friends": self.FriendIds, "err": err.Error()})
} }
} }

View File

@ -9,6 +9,8 @@ import (
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
// 助战列表
func (this *apiComp) AssistlistCheck(session comm.IUserSession, req *pb.FriendAssistlistReq) (code pb.ErrorCode) { func (this *apiComp) AssistlistCheck(session comm.IUserSession, req *pb.FriendAssistlistReq) (code pb.ErrorCode) {
return return
} }

View File

@ -7,30 +7,17 @@ import (
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
//黑名单列表
func (this *apiComp) BlacklistCheck(session comm.IUserSession, req *pb.FriendBlackListReq) (code pb.ErrorCode) { func (this *apiComp) BlacklistCheck(session comm.IUserSession, req *pb.FriendBlackListReq) (code pb.ErrorCode) {
return return
} }
//黑名单
func (this *apiComp) Blacklist(session comm.IUserSession, req *pb.FriendBlackListReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) Blacklist(session comm.IUserSession, req *pb.FriendBlackListReq) (code pb.ErrorCode, data proto.Message) {
var ( var (
self *pb.DBFriend self *pb.DBFriend
Resp *pb.FriendBlackListResp
list []*pb.FriendBase list []*pb.FriendBase
) )
defer func() {
Resp = &pb.FriendBlackListResp{
Friends: list,
}
err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeBlacklist, Resp)
if err != nil {
code = pb.ErrorCode_SystemError
return
}
}()
self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId())
if self == nil { if self == nil {
code = pb.ErrorCode_FriendSelfNoData code = pb.ErrorCode_FriendSelfNoData
@ -44,5 +31,14 @@ func (this *apiComp) Blacklist(session comm.IUserSession, req *pb.FriendBlackLis
} }
} }
resp := &pb.FriendBlackListResp{
Friends: list,
}
err := session.SendMsg(string(this.moduleFriend.GetType()), FriendSubTypeBlacklist, resp)
if err != nil {
code = pb.ErrorCode_SystemError
return
}
return return
} }

View File

@ -9,27 +9,29 @@ import (
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
//删除好友
func (this *apiComp) DelCheck(session comm.IUserSession, req *pb.FriendDelReq) (code pb.ErrorCode) { func (this *apiComp) DelCheck(session comm.IUserSession, req *pb.FriendDelReq) (code pb.ErrorCode) {
if req.FriendId == "" { if req.FriendId == "" {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.moduleFriend.Error("删除好友参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
//删除好友
func (this *apiComp) Del(session comm.IUserSession, req *pb.FriendDelReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) Del(session comm.IUserSession, req *pb.FriendDelReq) (code pb.ErrorCode, data proto.Message) {
if code = this.DelCheck(session, req); code != pb.ErrorCode_Success { if code = this.DelCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
self := this.moduleFriend.modelFriend.GetFriend(session.GetUserId()) uid := session.GetUserId()
self := this.moduleFriend.modelFriend.GetFriend(uid)
if self == nil { if self == nil {
code = pb.ErrorCode_FriendSelfNoData code = pb.ErrorCode_FriendSelfNoData
return return
} }
// 从好友列表中删除 // 从好友列表中删除
selfFriendIds := utils.DeleteString(self.FriendIds, req.FriendId) selfFriendIds := utils.Deletex(self.FriendIds, req.FriendId)
if err := this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{ if err := this.moduleFriend.modelFriend.Change(self.Uid, map[string]interface{}{
"friendIds": selfFriendIds, "friendIds": selfFriendIds,
@ -46,13 +48,13 @@ func (this *apiComp) Del(session comm.IUserSession, req *pb.FriendDelReq) (code
} }
// 将自己从对方好友列表中移除 // 将自己从对方好友列表中移除
targetFriendIds := utils.DeleteString(target.FriendIds, session.GetUserId()) targetFriendIds := utils.DeleteString(target.FriendIds, uid)
if err := this.moduleFriend.modelFriend.Change(req.FriendId, map[string]interface{}{ if err := this.moduleFriend.modelFriend.Change(req.FriendId, map[string]interface{}{
"friendIds": targetFriendIds, "friendIds": targetFriendIds,
}); err != nil { }); err != nil {
log.Errorf("Del friend err:%v", err)
code = pb.ErrorCode_FriendApplyError code = pb.ErrorCode_FriendApplyError
this.moduleFriend.Error("删除好友", log.Fields{"uid": uid, "param": req.FriendId, "err": err.Error()})
return return
} }

View File

@ -124,7 +124,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
this.Errorf("资源发放失败,%v", code) this.Errorf("资源发放失败,%v", code)
} }
} }
this.Debugf("使用bingo命令", log.Fields{"uid": session.GetUserId()}, datas[0], res) this.Debug("使用bingo命令", log.Fields{"uid": session.GetUserId(), "param": datas[0], "res": res})
} else if len(datas) == 3 && (datas[0] == "worldtask") { } else if len(datas) == 3 && (datas[0] == "worldtask") {
module, err := this.service.GetModule(comm.ModuleWorldtask) module, err := this.service.GetModule(comm.ModuleWorldtask)
if err != nil { if err != nil {
@ -132,7 +132,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
} }
if wt, ok := module.(comm.IWorldtask); ok { if wt, ok := module.(comm.IWorldtask); ok {
if err = wt.BingoJumpTask(session, utils.ToInt32(datas[1]), utils.ToInt32(datas[2])); err != nil { if err = wt.BingoJumpTask(session, utils.ToInt32(datas[1]), utils.ToInt32(datas[2])); err != nil {
this.Errorf("bingo worldTask Failed ,Parameter :%s,%s %v", datas[1], datas[2], err) this.Error("bingo 世界任务", log.Fields{"params": datas, "err": err.Error()})
} }
} }

View File

@ -132,7 +132,7 @@ func (this *ModelHero) initHeroOverlying(uid string, heroCfgId string, count int
if hero != nil { if hero != nil {
hero.SameCount = count hero.SameCount = count
if this.moduleHero.IsCross() { if this.moduleHero.IsCross() {
if model, err = this.moduleHero.GetDBNoduleByUid(uid, this.TableName, this.Expired); err != nil { if model, err = this.moduleHero.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
this.moduleHero.Errorln(err) this.moduleHero.Errorln(err)
} else { } else {
if err = model.AddList(uid, hero.Id, hero); err != nil { if err = model.AddList(uid, hero.Id, hero); err != nil {
@ -153,7 +153,7 @@ func (this *ModelHero) initHeroOverlying(uid string, heroCfgId string, count int
func (this *ModelHero) createHeroOverlying(uid string, heroCfgId string, count int32) (hero *pb.DBHero, err error) { func (this *ModelHero) createHeroOverlying(uid string, heroCfgId string, count int32) (hero *pb.DBHero, err error) {
heros := make([]*pb.DBHero, 0) heros := make([]*pb.DBHero, 0)
if this.moduleHero.IsCross() { if this.moduleHero.IsCross() {
if dbModel, err := this.moduleHero.GetDBNoduleByUid(uid, this.TableName, this.Expired); err != nil { if dbModel, err := this.moduleHero.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
this.moduleHero.Errorln(err) this.moduleHero.Errorln(err)
} else { } else {
@ -178,7 +178,7 @@ func (this *ModelHero) createHeroOverlying(uid string, heroCfgId string, count i
hero = h hero = h
if this.moduleHero.IsCross() { if this.moduleHero.IsCross() {
if model, err := this.moduleHero.GetDBNoduleByUid(uid, this.TableName, this.Expired); err != nil { if model, err := this.moduleHero.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
this.moduleHero.Errorln(err) this.moduleHero.Errorln(err)
} else { } else {
if err := model.ChangeList(uid, h.Id, data); err != nil { if err := model.ChangeList(uid, h.Id, data); err != nil {

View File

@ -51,7 +51,7 @@ func (this *modelHoroscope) updateInfo(session comm.IUserSession, info *pb.DBHor
"nodes": info.Nodes, "nodes": info.Nodes,
"lastrest": info.Lastrest, "lastrest": info.Lastrest,
}) })
if model, err = this.module.GetDBNoduleByUid(info.Uid, this.TableName, time.Hour); err != nil { if model, err = this.module.GetDBModuleByUid(info.Uid, this.TableName, time.Hour); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
return return
} }

View File

@ -41,7 +41,7 @@ func (this *ModelItemsComp) QueryUserPack(uId string) (itmes []*pb.DB_UserItemDa
) )
itmes = make([]*pb.DB_UserItemData, 0) itmes = make([]*pb.DB_UserItemData, 0)
if this.module.IsCross() { if this.module.IsCross() {
if model, err = this.module.GetDBNoduleByUid(uId, this.TableName, this.Expired); err != nil { if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
} else { } else {
if err = model.GetList(uId, &itmes); err != nil { if err = model.GetList(uId, &itmes); err != nil {
@ -65,7 +65,7 @@ func (this *ModelItemsComp) QueryUserPackByGridId(uId string, grid string) (itme
itme = &pb.DB_UserItemData{} itme = &pb.DB_UserItemData{}
if this.module.IsCross() { if this.module.IsCross() {
if model, err = this.module.GetDBNoduleByUid(uId, this.TableName, this.Expired); err != nil { if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
} else { } else {
if err = model.GetListObj(uId, grid, itme); err != nil { if err = model.GetListObj(uId, grid, itme); err != nil {
@ -91,7 +91,7 @@ func (this *ModelItemsComp) AddUserPack(uId string, itmes ...*pb.DB_UserItemData
model *db.DBModel model *db.DBModel
) )
if this.module.IsCross() { if this.module.IsCross() {
if model, err = this.module.GetDBNoduleByUid(uId, this.TableName, this.Expired); err != nil { if model, err = this.module.GetDBModuleByUid(uId, this.TableName, this.Expired); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
} else { } else {
if err = model.AddLists(uId, data); err != nil { if err = model.AddLists(uId, data); err != nil {
@ -113,7 +113,7 @@ func (this *ModelItemsComp) UpdateUserPack(uid string, itmes ...*pb.DB_UserItemD
model *db.DBModel model *db.DBModel
) )
if this.module.IsCross() { if this.module.IsCross() {
if model, err = this.module.GetDBNoduleByUid(uid, this.TableName, this.Expired); err != nil { if model, err = this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
} else { } else {
for _, v := range itmes { for _, v := range itmes {
@ -147,7 +147,7 @@ func (this *ModelItemsComp) DeleteUserPack(uid string, itmes ...*pb.DB_UserItemD
gridIds[i] = v.GridId gridIds[i] = v.GridId
} }
if this.module.IsCross() { if this.module.IsCross() {
if model, err = this.module.GetDBNoduleByUid(uid, this.TableName, this.Expired); err != nil { if model, err = this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
} else { } else {
if err = model.DelListlds(uid, gridIds...); err != nil { if err = model.DelListlds(uid, gridIds...); err != nil {

View File

@ -2,6 +2,7 @@ package linestory
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -10,6 +11,7 @@ import (
// 支线剧情-我的主线任务 // 支线剧情-我的主线任务
func (this *apiComp) MaintaskCheck(session comm.IUserSession, req *pb.LinestoryMaintaskReq) (code pb.ErrorCode) { func (this *apiComp) MaintaskCheck(session comm.IUserSession, req *pb.LinestoryMaintaskReq) (code pb.ErrorCode) {
if req.ChapterId == 0 { if req.ChapterId == 0 {
this.moduleLinestory.Error("参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
} }
return return

View File

@ -5,6 +5,7 @@ import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/utils"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
@ -12,6 +13,7 @@ import (
// 章节奖励领取 // 章节奖励领取
func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.LinestoryReceiveReq) (code pb.ErrorCode) { func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.LinestoryReceiveReq) (code pb.ErrorCode) {
if req.ChapterId == 0 { if req.ChapterId == 0 {
this.moduleLinestory.Error("参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
} }
return return
@ -24,7 +26,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.LinestoryReceive
uid := session.GetUserId() uid := session.GetUserId()
conf := this.moduleLinestory.configure.getChapterCfgById(req.ChapterId) conf := this.moduleLinestory.configure.getChapterCfgById(req.ChapterId)
if conf == nil { if conf == nil {
log.Errorf("config is nil uid:%v groupId:%v", uid, req.ChapterId) this.moduleLinestory.Error("配置未找到", log.Fields{"uid": uid, "chapterId": req.ChapterId})
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }
@ -41,12 +43,14 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.LinestoryReceive
} }
//发奖 //发奖
if code := this.moduleLinestory.DispenseRes(session, conf.Reward, true); code != pb.ErrorCode_Success { if code = this.moduleLinestory.DispenseRes(session, conf.Reward, true); code != pb.ErrorCode_Success {
this.moduleLinestory.Errorf("奖励发放失败 uid:%v groupId:%v reward:%v", uid, req.ChapterId, conf.Reward) this.moduleLinestory.Error("奖励发放失败", log.Fields{"uid": uid, "chapterId": req.ChapterId, "reward": conf.Reward})
return
} }
rsp := &pb.LinestoryReceiveResp{ rsp := &pb.LinestoryReceiveResp{
ChapterId: req.ChapterId, ChapterId: req.ChapterId,
UserAssets: utils.ConvertReward(conf.Reward...),
} }
if err := session.SendMsg(string(this.moduleLinestory.GetType()), LinestorySubTypeReceive, rsp); err != nil { if err := session.SendMsg(string(this.moduleLinestory.GetType()), LinestorySubTypeReceive, rsp); err != nil {
code = pb.ErrorCode_SystemError code = pb.ErrorCode_SystemError

View File

@ -6,6 +6,7 @@ import (
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/utils"
"go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
@ -32,6 +33,7 @@ func (this *ModelLinestory) getLinestory(uid string) *pb.DBLinestory {
if err := this.Get(uid, ls); err != nil { if err := this.Get(uid, ls); err != nil {
if err == mongo.ErrNoDocuments { if err == mongo.ErrNoDocuments {
ls.Id = primitive.NewObjectID().Hex() ls.Id = primitive.NewObjectID().Hex()
if err := this.Add(uid, ls); err != nil { if err := this.Add(uid, ls); err != nil {
log.Errorf("save linestory err:%v", err) log.Errorf("save linestory err:%v", err)
return ls return ls
@ -51,6 +53,24 @@ func (this *ModelLinestory) getChapters(uid string) map[int32]*pb.TaskChapter {
return ls.TaskChapter return ls.TaskChapter
} }
// 校验前置任务是否完成
// true完成 false未完成
func (this *ModelLinestory) isPreFinished(finishTasks []int32, taskId int32) bool {
maintaskConf, ok := this.moduleLinestory.confMaintask.GetDataMap()[taskId]
if !ok {
return false
}
if maintaskConf.SubTask == 0 {
return true
}
if _, ok := utils.Findx(finishTasks, maintaskConf.SubTask); ok {
return true
}
return false
}
// 获取玩家支线剧情-主线任务 // 获取玩家支线剧情-主线任务
func (this *ModelLinestory) getMaintasks(uid string, groupId int32) (list []*pb.TaskMain) { func (this *ModelLinestory) getMaintasks(uid string, groupId int32) (list []*pb.TaskMain) {
// 调用世界任务接口groupId & taskId // 调用世界任务接口groupId & taskId
@ -58,6 +78,7 @@ func (this *ModelLinestory) getMaintasks(uid string, groupId int32) (list []*pb.
if iwt, ok := module.(comm.IWorldtask); ok { if iwt, ok := module.(comm.IWorldtask); ok {
// 获取玩家世界任务 // 获取玩家世界任务
wt := iwt.GetMyWorldtask(uid) wt := iwt.GetMyWorldtask(uid)
this.moduleLinestory.Debug("获取玩家世界任务", log.Fields{"uid": uid, "groupId": groupId, "worldtask": wt})
if wt != nil { if wt != nil {
mainTasks := this.moduleLinestory.configure.getMainTaskCfgByGroup(groupId) mainTasks := this.moduleLinestory.configure.getMainTaskCfgByGroup(groupId)
for _, conf := range mainTasks { for _, conf := range mainTasks {
@ -66,11 +87,10 @@ func (this *ModelLinestory) getMaintasks(uid string, groupId int32) (list []*pb.
if conf.Id == task.TaskId { if conf.Id == task.TaskId {
list = append(list, &pb.TaskMain{ list = append(list, &pb.TaskMain{
TaskId: conf.Id, TaskId: conf.Id,
Status: 2, Status: 1,
}) })
} }
} }
} }
} }
} }
@ -85,7 +105,7 @@ func (this *ModelLinestory) receive(uid string, groupId int32) (err error) {
if v.Receive == 1 { if v.Receive == 1 {
v.Receive = 2 v.Receive = 2
update := map[string]interface{}{ update := map[string]interface{}{
"receive": v.Receive, "taskChapter": ls.TaskChapter,
} }
return this.Change(uid, update) return this.Change(uid, update)
} else { } else {

View File

@ -6,6 +6,7 @@ package linestory
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs" cfg "go_dreamfactory/sys/configure/structs"
@ -54,31 +55,81 @@ func (this *ModuleLinestory) Start() (err error) {
return return
} }
// 检查真实结局路径是否完成
func (this *ModuleLinestory) isOverRealline(finishTasks []int32) bool {
//真实结局节点ID
var realEndingTaskId int32
for _, v := range this.confMaintask.GetDataList() {
if v.Ending == 1 {
realEndingTaskId = v.Id
break
}
}
log.Debugln(realEndingTaskId)
// 存在真实结局节点
if _, ok := utils.Findx(finishTasks, realEndingTaskId); ok {
return true
}
return false
}
// 世界任务完成通知 // 世界任务完成通知
func (this *ModuleLinestory) TaskFinishNotify(uid string, taskId, groupId int32) error { func (this *ModuleLinestory) TaskFinishNotify(uid string, taskId, groupId int32) error {
ls := this.modelLinestory.getLinestory(uid) ls := this.modelLinestory.getLinestory(uid)
log.Debug("支线剧情任务", log.Fields{"uid": uid, "groupId": groupId, "taskId": taskId})
if v, ok := ls.TaskChapter[groupId]; ok { // 校验groupId 或taskId是否合法
if _, ok := utils.Findx(v.TaskIds, taskId); !ok { if _, ok := this.confTimeline.GetDataMap()[groupId]; !ok {
v.TaskIds = append(v.TaskIds, taskId) this.Debug("非支线剧情任务", log.Fields{"uid": uid, "groupId": groupId, "taskId": taskId})
taskIds := this.configure.converArr(groupId) return comm.NewCustomError(pb.ErrorCode_ReqParameterError)
// 校验当前组下的任务是否全部完成
if utils.ForContainer(taskIds, v.TaskIds) {
//说明组里的所有任务完成
v.Receive = 1
v.Status = 1
} }
if _, ok := this.confMaintask.GetDataMap()[taskId]; !ok {
this.Debug("非支线剧情任务", log.Fields{"uid": uid, "groupId": groupId, "taskId": taskId})
return comm.NewCustomError(pb.ErrorCode_ReqParameterError)
}
var isUpdate bool
if chapter, ok := ls.TaskChapter[groupId]; ok {
if !this.modelLinestory.isPreFinished(chapter.TaskIds, taskId) {
return comm.NewCustomError(pb.ErrorCode_LinestoryPreNoComplete)
}
if _, ok := utils.Findx(chapter.TaskIds, taskId); !ok {
chapter.TaskIds = append(chapter.TaskIds, taskId)
if this.isOverRealline(chapter.TaskIds) {
//说明组里的所有任务完成
chapter.Receive = 1
chapter.Status = 1
}
// 重置任务ID
if conf, ok := this.confMaintask.GetDataMap()[taskId]; ok {
if conf.Group == groupId {
if len(conf.Resetto) > 0 {
newTaskList := []int32{}
for _, v := range conf.Resetto {
newTaskList = utils.Deletex(chapter.TaskIds, v)
}
chapter.TaskIds = newTaskList
}
}
}
isUpdate = true
} }
} else { } else {
tg := &pb.TaskChapter{} tg := &pb.TaskChapter{}
// 设置完成的任务
tg.TaskIds = append(tg.TaskIds, taskId) tg.TaskIds = append(tg.TaskIds, taskId)
if ls.TaskChapter == nil { if ls.TaskChapter == nil {
ls.TaskChapter = make(map[int32]*pb.TaskChapter) ls.TaskChapter = make(map[int32]*pb.TaskChapter)
} }
ls.TaskChapter[groupId] = tg ls.TaskChapter[groupId] = tg
isUpdate = true
} }
if isUpdate {
update := map[string]interface{}{ update := map[string]interface{}{
"taskChapter": ls.TaskChapter, "taskChapter": ls.TaskChapter,
} }
return this.modelLinestory.Change(uid, update) return this.modelLinestory.Change(uid, update)
} }
return nil
}

View File

@ -391,7 +391,7 @@ func (this *ModuleBase) GetDBNodule(session comm.IUserSession, tableName string,
} }
//跨服对象获取数据操作对象 //跨服对象获取数据操作对象
func (this *ModuleBase) GetDBNoduleByUid(uid, tableName string, expired time.Duration) (model *db.DBModel, err error) { func (this *ModuleBase) GetDBModuleByUid(uid, tableName string, expired time.Duration) (model *db.DBModel, err error) {
var ( var (
stag string stag string
conn *db.DBConn conn *db.DBConn

View File

@ -84,11 +84,6 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
mapData["pagodaId"] = conf.LayerNum mapData["pagodaId"] = conf.LayerNum
mapData["type"] = pagoda.Type mapData["type"] = pagoda.Type
// 通关奖励
code = this.module.DispenseRes(session, conf.Reward, true)
if code != pb.ErrorCode_Success {
return
}
pagoda.PagodaId = conf.LayerNum // 更新层数 pagoda.PagodaId = conf.LayerNum // 更新层数
code = this.module.ModifyPagodaData(session.GetUserId(), mapData) code = this.module.ModifyPagodaData(session.GetUserId(), mapData)
session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda}) session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda})
@ -168,7 +163,11 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda}) session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda})
} }
// 通关奖励
code = this.module.DispenseRes(session, conf.Reward, true)
if code != pb.ErrorCode_Success {
return
}
// 任务相关 // 任务相关
if req.PagodaType == comm.PagodaType { if req.PagodaType == comm.PagodaType {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype58, 1) this.module.ModuleRtask.SendToRtask(session, comm.Rtype58, 1)

View File

@ -278,13 +278,6 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
//任务完成则推送 //任务完成则推送
if code := this.CheckCondi(uid, v.cfg.Id); code == pb.ErrorCode_Success { if code := this.CheckCondi(uid, v.cfg.Id); code == pb.ErrorCode_Success {
//任务条件达成推送
// if err := this.SendMsgToUser("taskcond", "finished", &pb.TaskcondFinishedPush{
// CondId: v.cfg.Id,
// }, uid); err != nil {
// log.Errorf("任务条件达成推送失败 err:%v", err)
// }
// log.Errorf("任务条件达成 uid:%v condId:%v", uid, v.cfg.Id)
module, err := this.service.GetModule(comm.ModuleWorldtask) module, err := this.service.GetModule(comm.ModuleWorldtask)
if err == nil { if err == nil {
if worldtask, ok := module.(comm.IWorldtask); ok { if worldtask, ok := module.(comm.IWorldtask); ok {
@ -294,14 +287,17 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
notifyErr := &pb.NotifyErrorNotifyPush{ notifyErr := &pb.NotifyErrorNotifyPush{
ReqMainType: string(comm.ModuleWorldtask), ReqMainType: string(comm.ModuleWorldtask),
ReqSubType: "finish", ReqSubType: "finish",
Code: pb.ErrorCode_WorldtaskLvNotEnough,
Message: "", Message: "",
} }
if customErr.Code == pb.ErrorCode_WorldtaskLvNotEnough { if customErr.Code == pb.ErrorCode_WorldtaskLvNotEnough {
notifyErr.Code = pb.ErrorCode_WorldtaskLvNotEnough
session.SendMsg(string(comm.ModuleWorldtask), "finish", notifyErr)
} else if customErr.Code == pb.ErrorCode_UserSessionNobeing {
notifyErr.Code = pb.ErrorCode_UserSessionNobeing
session.SendMsg(string(comm.ModuleWorldtask), "finish", notifyErr) session.SendMsg(string(comm.ModuleWorldtask), "finish", notifyErr)
} else { } else {
log.Errorf("任务条件达成通知 失败 err:%v", err) log.Error("任务条件达成通知", log.Fields{"uid": uid, "condId": v.cfg.Id, "err": err.Error()})
} }
} }
} }

View File

@ -1,7 +1,9 @@
package sociaty package sociaty
import ( import (
"errors"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -19,12 +21,13 @@ func (this *apiComp) Accuse(session comm.IUserSession, req *pb.SociatyAccuseReq)
} }
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
// 校验权限
if !this.module.modelSociaty.isRight(uid, sociaty, if !this.module.modelSociaty.isRight(uid, sociaty,
pb.SociatyJob_VICEPRESIDENT, pb.SociatyJob_VICEPRESIDENT,
pb.SociatyJob_ADMIN, pb.SociatyJob_ADMIN,
@ -33,9 +36,15 @@ func (this *apiComp) Accuse(session comm.IUserSession, req *pb.SociatyAccuseReq)
return return
} }
// 弹劾
if err := this.module.modelSociaty.accuse(sociaty); err != nil { if err := this.module.modelSociaty.accuse(sociaty); err != nil {
code = pb.ErrorCode_SociatyAccuse var customErr = new(comm.CustomError)
this.module.Errorf("弹劾失败 sociatyId:%s uid:%s err:%v", sociaty.Id, uid, err) if errors.As(err, &customErr) {
code = customErr.Code
}else{
code = pb.ErrorCode_DBError
}
this.module.Error("弹劾", log.Fields{"uid": uid, "sociatyId": sociaty.Id})
return return
} }

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -16,20 +17,14 @@ func (this *apiComp) ActivitylistCheck(session comm.IUserSession, req *pb.Sociat
func (this *apiComp) Activitylist(session comm.IUserSession, req *pb.SociatyActivityListReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) Activitylist(session comm.IUserSession, req *pb.SociatyActivityListReq) (code pb.ErrorCode, data proto.Message) {
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
rsp := &pb.SociatyActivityListResp{} rsp := &pb.SociatyActivityListResp{}
defer func() {
if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeActivityList, rsp); err != nil {
code = pb.ErrorCode_SystemError
}
}()
sociatyTask := this.module.modelSociatyTask.getUserTask(uid, sociaty.Id) sociatyTask := this.module.modelSociatyTask.getUserTask(uid, sociaty.Id)
if sociatyTask.SociatyId != "" { if sociatyTask.SociatyId != "" {
var activityList []*pb.SociatyActivity var activityList []*pb.SociatyActivity
@ -43,5 +38,9 @@ func (this *apiComp) Activitylist(session comm.IUserSession, req *pb.SociatyActi
rsp.List = activityList rsp.List = activityList
} }
if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeActivityList, rsp); err != nil {
code = pb.ErrorCode_SystemError
}
return return
} }

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -10,6 +11,7 @@ import (
// 活跃度领取 // 活跃度领取
func (this *apiComp) ActivityreceiveCheck(session comm.IUserSession, req *pb.SociatyActivityReceiveReq) (code pb.ErrorCode) { func (this *apiComp) ActivityreceiveCheck(session comm.IUserSession, req *pb.SociatyActivityReceiveReq) (code pb.ErrorCode) {
if req.Id == 0 { if req.Id == 0 {
this.module.Error("活跃度领取参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
} }
return return
@ -23,7 +25,7 @@ func (this *apiComp) Activityreceive(session comm.IUserSession, req *pb.SociatyA
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
@ -39,12 +41,7 @@ func (this *apiComp) Activityreceive(session comm.IUserSession, req *pb.SociatyA
} }
} }
ggt, err := this.module.configure.getSociatyActivityCfg() conf, ok := this.module.sociatyActivityConf.GetDataMap()[req.Id]
if err != nil || ggt == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
conf, ok := ggt.GetDataMap()[req.Id]
if !ok { if !ok {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
@ -53,13 +50,15 @@ func (this *apiComp) Activityreceive(session comm.IUserSession, req *pb.SociatyA
//是否满足领取条件 //是否满足领取条件
if sociaty.Activity < conf.Activity { if sociaty.Activity < conf.Activity {
code = pb.ErrorCode_SociatyActivityNoEnough code = pb.ErrorCode_SociatyActivityNoEnough
this.module.Errorf("活跃度不足 sociatyId:%s uid:%s activity:%d", sociaty.Id, uid, sociaty.Activity) this.module.Debug("活跃度不足", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "confId": req.Id,
"实际活跃度": sociaty.Activity, "期望活跃度": conf.Activity})
return return
} }
// 活跃度领取 // 活跃度领取
if err := this.module.modelSociatyTask.activityReceive(req.Id, sociaty.Id, uid); err != nil { if err := this.module.modelSociatyTask.activityReceive(req.Id, sociaty.Id, uid); err != nil {
this.module.Errorf("活跃度领取失败:%v", err) this.module.Error("活跃度领取", log.Fields{"uid": uid, "params": req})
code = pb.ErrorCode_DBError
return return
} }

View File

@ -1,17 +1,20 @@
package sociaty package sociaty
import ( import (
"errors"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
// 申请-同意 // 公会申请-同意
func (this *apiComp) AgreeCheck(session comm.IUserSession, req *pb.SociatyAgreeReq) (code pb.ErrorCode) { func (this *apiComp) AgreeCheck(session comm.IUserSession, req *pb.SociatyAgreeReq) (code pb.ErrorCode) {
if req.Uid == "" { if req.Uid == "" {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.module.Error("公会申请-同意参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
@ -22,12 +25,13 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (
} }
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
// 校验权限
if !this.module.modelSociaty.isRight(uid, sociaty, if !this.module.modelSociaty.isRight(uid, sociaty,
pb.SociatyJob_PRESIDENT, pb.SociatyJob_PRESIDENT,
pb.SociatyJob_VICEPRESIDENT, pb.SociatyJob_VICEPRESIDENT,
@ -37,22 +41,21 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (
} }
if err := this.module.modelSociaty.agree(req.Uid, sociaty); err != nil { if err := this.module.modelSociaty.agree(req.Uid, sociaty); err != nil {
code = pb.ErrorCode_SociatyAgree var customError = new(comm.CustomError)
this.module.Errorf("申请同意失败:%v", err) if errors.As(err, &customError) {
code = customError.Code
} else {
code = pb.ErrorCode_DBError
}
this.module.Error("公会审核-同意", log.Fields{"uid": uid, "申请人": req.Uid, "sociatyId": sociaty.Id})
return return
} }
// 发邮件 // 发邮件
if err := this.module.modelSociaty.sendMail("GuildApproved", []string{sociaty.Name}, []string{req.Uid}); err != nil { if err := this.module.modelSociaty.sendMail("GuildApproved", []string{sociaty.Name}, []string{req.Uid}); err != nil {
this.module.Errorf("发送邮件id:GuildApproved uid:%v 失败 err:%v", uid, err) this.module.Error("发送邮件 模板ID:GuildApproved", log.Fields{"uid": uid, "申请人": req.Uid, "sociatyId": sociaty.Id})
} }
//审核通过推送
this.module.SendMsgToUser(string(this.module.GetType()), "pagree", &pb.SociatyPAgreePush{
Uid: uid,
SociatyId: sociaty.Id,
}, req.Uid)
rsp := &pb.SociatyAgreeResp{ rsp := &pb.SociatyAgreeResp{
Uid: req.Uid, Uid: req.Uid,
SociatyId: sociaty.Id, SociatyId: sociaty.Id,
@ -60,6 +63,15 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (
if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeAgree, rsp); err != nil { if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeAgree, rsp); err != nil {
code = pb.ErrorCode_SystemError code = pb.ErrorCode_SystemError
return
}
//审核通过推送给申请人
if err := this.module.SendMsgToUser(string(this.module.GetType()), "pagree", &pb.SociatyPAgreePush{
Uid: uid,
SociatyId: sociaty.Id,
}, req.Uid); err != nil {
this.module.Error("审核通过推送", log.Fields{"uid": uid, "申请人": req.Uid, "sociatyId": sociaty.Id})
} }
return return
} }

View File

@ -1,8 +1,11 @@
package sociaty package sociaty
import ( import (
"errors"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/utils"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
@ -12,6 +15,7 @@ import (
func (this *apiComp) ApplyCheck(session comm.IUserSession, req *pb.SociatyApplyReq) (code pb.ErrorCode) { func (this *apiComp) ApplyCheck(session comm.IUserSession, req *pb.SociatyApplyReq) (code pb.ErrorCode) {
if req.SociatyId == "" { if req.SociatyId == "" {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.module.Error("公会申请参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
@ -24,28 +28,34 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getSociaty(req.SociatyId) sociaty := this.module.modelSociaty.getSociaty(req.SociatyId)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("sociatyId: %s no found", req.SociatyId) this.module.Error("公会未找到", log.Fields{"uid": uid, "sociatyId": req.SociatyId})
return return
} }
// userex // userex
// userEx, err := this.module.ModuleUser.GetRemoteUserExpand(uid) userEx, err := this.module.ModuleUser.GetRemoteUserExpand(uid)
// if err != nil { if err != nil {
// this.module.Errorf("GetRemoteUserExpand uid: err:%v", uid, err) this.module.Error("GetRemoteUserExpand", log.Fields{"uid": uid, "err": err.Error()})
// code = pb.ErrorCode_UserSessionNobeing code = pb.ErrorCode_UserSessionNobeing
// return return
// } }
// if utils.IsInCDHour(userEx.SociatyCd) { if utils.IsInCDHour(userEx.SociatyCd) {
// code = pb.ErrorCode_SociatyCDLimit code = pb.ErrorCode_SociatyCDLimit
// return return
// } }
// 是否公会成员
if this.module.modelSociaty.isMember(uid, sociaty) {
code = pb.ErrorCode_SociatyBelongTo
return
}
// 是否达到入会等级
user, err := this.module.ModuleUser.GetRemoteUser(uid) user, err := this.module.ModuleUser.GetRemoteUser(uid)
if err != nil { if err != nil {
code = pb.ErrorCode_DBError
return return
} }
@ -54,17 +64,12 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (
return return
} }
// 是否达到入会等级
if user.Lv < sociaty.ApplyLv { if user.Lv < sociaty.ApplyLv {
code = pb.ErrorCode_SociatyAppyLvNoEnough code = pb.ErrorCode_SociatyAppyLvNoEnough
return return
} }
// 是否公会成员
if this.module.modelSociaty.isMember(uid, sociaty) {
code = pb.ErrorCode_SociatyBelongTo
return
}
// 是否已申请 // 是否已申请
if this.module.modelSociaty.isApplied(uid, sociaty) { if this.module.modelSociaty.isApplied(uid, sociaty) {
code = pb.ErrorCode_SociatyApplied code = pb.ErrorCode_SociatyApplied
@ -79,8 +84,13 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (
// 申请 // 申请
if err := this.module.modelSociaty.apply(uid, sociaty); err != nil { if err := this.module.modelSociaty.apply(uid, sociaty); err != nil {
code = pb.ErrorCode_SociatyApply var customError = new(comm.CustomError)
this.module.Errorf("公会申请失败 sociatyId:%s err:%v", req.SociatyId, err) if errors.As(err, &customError) {
code = customError.Code
} else {
code = pb.ErrorCode_DBError
}
this.module.Error("公会申请", log.Fields{"uid": uid, "sociatyId": req.SociatyId, "err": err.Error()})
return return
} }
rsp := &pb.SociatyApplyResp{ rsp := &pb.SociatyApplyResp{

View File

@ -2,14 +2,18 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
// 取消公会申请
func (this *apiComp) ApplyCancelCheck(session comm.IUserSession, req *pb.SociatyApplyCancelReq) (code pb.ErrorCode) { func (this *apiComp) ApplyCancelCheck(session comm.IUserSession, req *pb.SociatyApplyCancelReq) (code pb.ErrorCode) {
if req.SociatyId == "" { if req.SociatyId == "" {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.module.Error("公会申请取消参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
@ -20,9 +24,16 @@ func (this *apiComp) ApplyCancel(session comm.IUserSession, req *pb.SociatyApply
} }
uid := session.GetUserId() uid := session.GetUserId()
if err := this.module.modelSociaty.applyCancel(uid, req.SociatyId); err != nil { sociaty := this.module.modelSociaty.getSociaty(req.SociatyId)
code = pb.ErrorCode_SociatyApplyCanel if sociaty != nil && sociaty.Id == "" {
this.module.Errorf("申请撤销失败:%v", err) code = pb.ErrorCode_SociatyNoFound
this.module.Error("公会未找到", log.Fields{"uid": uid, "sociatyId": req.SociatyId})
return
}
if err := this.module.modelSociaty.applyCancel(uid, sociaty); err != nil {
code = pb.ErrorCode_DBError
this.module.Error("申请撤销", log.Fields{"uid": uid, "sociatyId": req.SociatyId, "err": err.Error()})
return return
} }

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -12,6 +13,7 @@ import (
func (this *apiComp) ApplyListCheck(session comm.IUserSession, req *pb.SociatyApplyListReq) (code pb.ErrorCode) { func (this *apiComp) ApplyListCheck(session comm.IUserSession, req *pb.SociatyApplyListReq) (code pb.ErrorCode) {
if req.SociatyId == "" { if req.SociatyId == "" {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.module.Error("申请列表参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
@ -20,14 +22,15 @@ func (this *apiComp) ApplyList(session comm.IUserSession, req *pb.SociatyApplyLi
if code = this.ApplyListCheck(session, req); code != pb.ErrorCode_Success { if code = this.ApplyListCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
uid := session.GetUserId()
sociaty := this.module.modelSociaty.getSociaty(req.SociatyId) sociaty := this.module.modelSociaty.getSociaty(req.SociatyId)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("sociatyId: %s no found", req.SociatyId) this.module.Error("公会未找到", log.Fields{"uid": uid, "sociatyId": req.SociatyId})
return return
} }
uid := session.GetUserId() // 校验权限
if !this.module.modelSociaty.isRight(uid, sociaty, if !this.module.modelSociaty.isRight(uid, sociaty,
pb.SociatyJob_PRESIDENT, pb.SociatyJob_PRESIDENT,
pb.SociatyJob_VICEPRESIDENT, pb.SociatyJob_VICEPRESIDENT,

View File

@ -1,7 +1,9 @@
package sociaty package sociaty
import ( import (
"errors"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -11,6 +13,7 @@ import (
func (this *apiComp) AssignCheck(session comm.IUserSession, req *pb.SociatyAssignReq) (code pb.ErrorCode) { func (this *apiComp) AssignCheck(session comm.IUserSession, req *pb.SociatyAssignReq) (code pb.ErrorCode) {
if req.TargetId == "" { if req.TargetId == "" {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.module.Error("公会转让参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
@ -23,31 +26,47 @@ func (this *apiComp) Assign(session comm.IUserSession, req *pb.SociatyAssignReq)
uid := session.GetUserId() uid := session.GetUserId()
if uid == req.TargetId { if uid == req.TargetId {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.module.Errorf("不能转让给自己 uid:%s", uid) this.module.Error("不能转让给自己", log.Fields{"uid": uid})
return return
} }
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
// 校验权限
if !this.module.modelSociaty.isRight(uid, sociaty, pb.SociatyJob_PRESIDENT) { if !this.module.modelSociaty.isRight(uid, sociaty, pb.SociatyJob_PRESIDENT) {
code = pb.ErrorCode_SociatyNoRight code = pb.ErrorCode_SociatyNoRight
return return
} }
if err := this.module.modelSociaty.assign(uid, req.TargetId, sociaty); err != nil { // 校验目标是否公会成员
code = pb.ErrorCode_SociatyAssign if !this.module.modelSociaty.isMember(req.TargetId, sociaty) {
this.module.Errorf("转让失败:%v", err) code = pb.ErrorCode_SociatyNoMember
return return
} }
// 公会转让
if err := this.module.modelSociaty.assign(uid, req.TargetId, sociaty); err != nil {
code = pb.ErrorCode_DBError
this.module.Errorf("公会转让", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "targetId": req.TargetId, "err": err.Error()})
return
}
// 添加日志(成员职位变动)
if err := this.module.modelSociatyLog.addLog(Log_Job, sociaty.Id, if err := this.module.modelSociatyLog.addLog(Log_Job, sociaty.Id,
uid, req.TargetId, pb.SociatyJob_PRESIDENT.String()); err != nil { uid, req.TargetId, pb.SociatyJob_PRESIDENT.String()); err != nil {
this.module.Errorf("转让日志 err:%v", err) var customErr = new(comm.CustomError)
if errors.As(err, &customErr) {
code = customErr.Code
} else {
code = pb.ErrorCode_DBError
}
this.module.Error("公会转让日志", log.Fields{"uid": uid, "sociatyId": sociaty.Id,
"targetId": req.TargetId, "日志模板": Log_Job, "err": err.Error()})
} }
rsp := &pb.SociatyAssignResp{ rsp := &pb.SociatyAssignResp{

View File

@ -1,18 +0,0 @@
package sociaty
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
// 申请取消
func (this *apiComp) CancelCheck(session comm.IUserSession, req *pb.SociatyCancelReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) Cancel(session comm.IUserSession, req *pb.SociatyCancelReq) (code pb.ErrorCode, data proto.Message) {
return
}

View File

@ -3,6 +3,7 @@ package sociaty
import ( import (
"errors" "errors"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/utils" "go_dreamfactory/utils"
"strings" "strings"
@ -16,6 +17,7 @@ import (
// 公会创建 // 公会创建
func (this *apiComp) CreateCheck(session comm.IUserSession, req *pb.SociatyCreateReq) (code pb.ErrorCode) { func (this *apiComp) CreateCheck(session comm.IUserSession, req *pb.SociatyCreateReq) (code pb.ErrorCode) {
if len(req.Notice) > 150 || strings.TrimSpace(req.Name) == "" { if len(req.Notice) > 150 || strings.TrimSpace(req.Name) == "" {
this.module.Error("公会创建参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
} }
return return
@ -30,20 +32,18 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq)
user, err := this.module.ModuleUser.GetRemoteUser(uid) user, err := this.module.ModuleUser.GetRemoteUser(uid)
if err != nil { if err != nil {
this.module.Errorf("GetRmoteUser err:%v", err)
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
return return
} }
if user.Uid == "" { if user.Uid == "" {
this.module.Errorf("GetRmoteUser not found uid:%v", uid) this.module.Error("GetRmoteUser not found", log.Fields{"uid": uid})
code = pb.ErrorCode_UserSessionNobeing code = pb.ErrorCode_UserSessionNobeing
return return
} }
userExpand, err := this.module.ModuleUser.GetRemoteUserExpand(uid) userExpand, err := this.module.ModuleUser.GetRemoteUserExpand(uid)
if err != nil { if err != nil {
this.module.Errorf("GetRemoteUserExpand err:%v", err)
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
return return
} }
@ -64,25 +64,23 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq)
if err := this.module.modelSociaty.isNameExist(req.Name); err != nil { if err := this.module.modelSociaty.isNameExist(req.Name); err != nil {
var customErr = new(comm.CustomError) var customErr = new(comm.CustomError)
if errors.As(err, &customErr) { if errors.As(err, &customErr) {
if customErr.Code == pb.ErrorCode_SociatyNameExist { code = customErr.Code
code = pb.ErrorCode_SociatyNameExist
return return
} }
}
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
return return
} }
//检查钻石 //检查钻石
if code = this.module.ConsumeRes(session, []*cfg.Gameatn{ if code = this.module.ConsumeRes(session, []*cfg.Gameatn{this.module.globalConf.GuildBuildCos}, true); code != pb.ErrorCode_Success {
this.module.globalConf.GuildBuildCos}, true); code != pb.ErrorCode_Success { this.module.Warn("资源不足", log.Fields{"uid": uid, "res": this.module.globalConf.GuildBuildCos})
return return
} }
//创建公会 //创建公会
sociaty := &pb.DBSociaty{ sociaty := &pb.DBSociaty{
Creater: user.Uid, Creater: user.Uid,
Name: req.Name, Name: strings.TrimSpace(req.Name),
Icon: req.Icon, Icon: req.Icon,
Notice: req.Notice, Notice: req.Notice,
IsApplyCheck: req.IsApplyCheck, IsApplyCheck: req.IsApplyCheck,
@ -96,8 +94,15 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq)
Ctime: configure.Now().Unix(), Ctime: configure.Now().Unix(),
}) })
if err := this.module.modelSociaty.create(sociaty); err != nil { if err := this.module.modelSociaty.create(sociaty); err != nil {
var customError = new(comm.CustomError)
if errors.As(err, &customError) {
if customError.Code == pb.ErrorCode_SociatyNoFound {
code = pb.ErrorCode_SociatyNoFound
} else {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
this.module.Errorf("创建公会 err:%v", err) }
}
this.module.Error("创建公会", log.Fields{"uid": uid, "params": req, "err": err.Error()})
return return
} }
@ -108,13 +113,13 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.SociatyCreateReq)
if err = this.module.ModuleUser.ChangeRemoteUserExpand(user.Uid, update); err != nil { if err = this.module.ModuleUser.ChangeRemoteUserExpand(user.Uid, update); err != nil {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
this.module.Errorf("更新玩家公会ID err:%v", err) this.module.Error("更新玩家公会ID", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "err": err.Error()})
return return
} }
// 初始化任务 // 初始化玩家公会任务
if err := this.module.modelSociatyTask.initSociatyTask(user.Uid, sociaty.Id); err != nil { if err := this.module.modelSociatyTask.initSociatyTask(user.Uid, sociaty.Id); err != nil {
this.module.Errorf("初始化玩家任务 err:%v", err) this.module.Error("初始化玩家公会任务", log.Fields{"uid": uid, "err": err.Error()})
} }
if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeCreate, &pb.SociatyCreateResp{ if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeCreate, &pb.SociatyCreateResp{

View File

@ -1,7 +1,9 @@
package sociaty package sociaty
import ( import (
"errors"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -12,6 +14,7 @@ import (
func (this *apiComp) DischargeCheck(session comm.IUserSession, req *pb.SociatyDischargeReq) (code pb.ErrorCode) { func (this *apiComp) DischargeCheck(session comm.IUserSession, req *pb.SociatyDischargeReq) (code pb.ErrorCode) {
if req.TargetId == "" { if req.TargetId == "" {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.module.Error("踢出公会参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
@ -22,12 +25,13 @@ func (this *apiComp) Discharge(session comm.IUserSession, req *pb.SociatyDischar
} }
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
// 校验权限
if !this.module.modelSociaty.isRight(uid, sociaty, if !this.module.modelSociaty.isRight(uid, sociaty,
pb.SociatyJob_PRESIDENT, pb.SociatyJob_PRESIDENT,
pb.SociatyJob_VICEPRESIDENT) { pb.SociatyJob_VICEPRESIDENT) {
@ -37,27 +41,37 @@ func (this *apiComp) Discharge(session comm.IUserSession, req *pb.SociatyDischar
// 踢人 // 踢人
if err := this.module.modelSociaty.discharge(req.TargetId, sociaty); err != nil { if err := this.module.modelSociaty.discharge(req.TargetId, sociaty); err != nil {
code = pb.ErrorCode_SociatyDischarge var customError = new(comm.CustomError)
this.module.Errorf("踢出公会失败:%v", err) if errors.As(err, &customError) {
code = customError.Code
} else {
code = pb.ErrorCode_DBError
}
this.module.Error("踢出公会", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "被踢人": req.TargetId, "err": err.Error()})
return return
} }
// 发邮件 // 发邮件
receiver := this.module.modelSociaty.getMemberIds(sociaty) receiver := this.module.modelSociaty.getMemberIds(sociaty)
this.module.modelSociaty.sendMail("GuildExpel", []string{sociaty.Name}, receiver) if err := this.module.modelSociaty.sendMail("GuildExpel", []string{sociaty.Name}, receiver); err != nil {
this.module.Error("发送邮件 模板ID:GuildExpel", log.Fields{"uid": uid, "被踢人": req.TargetId, "sociatyId": sociaty.Id})
}
//清除玩家sociatyId //清除玩家sociatyId
update := map[string]interface{}{ update := map[string]interface{}{
"sociatyId": "", //公会ID置空 "sociatyId": "", //公会ID置空
} }
if err := this.module.ModuleUser.ChangeRemoteUserExpand(req.TargetId, update); err != nil { if err := this.module.ModuleUser.ChangeRemoteUserExpand(req.TargetId, update); err != nil {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
this.module.Errorf("更新玩家公会ID err:%v", err) this.module.Error("更新玩家公会ID", log.Fields{"uid": uid, "被踢人": req.TargetId, "err": err.Error()})
return return
} }
// 添加日志
if err := this.module.modelSociatyLog.addLog(Log_Discharge, sociaty.Id, uid, req.TargetId); err != nil { if err := this.module.modelSociatyLog.addLog(Log_Discharge, sociaty.Id, uid, req.TargetId); err != nil {
this.module.Errorf("踢出公会日志 err:%v", err) this.module.Error("踢出公会日志", log.Fields{"uid": uid, "sociatyId": sociaty.Id,
"targetId": req.TargetId, "日志模板": Log_Discharge, "err": err.Error()})
} }
rsp := &pb.SociatyDischargeResp{ rsp := &pb.SociatyDischargeResp{

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/utils" "go_dreamfactory/utils"
@ -11,15 +12,22 @@ import (
// 公会解散 // 公会解散
func (this *apiComp) DismissCheck(session comm.IUserSession, req *pb.SociatyDismissReq) (code pb.ErrorCode) { func (this *apiComp) DismissCheck(session comm.IUserSession, req *pb.SociatyDismissReq) (code pb.ErrorCode) {
if req.Dismiss > 1 {
code = pb.ErrorCode_ReqParameterError
this.module.Error("公会解散参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
}
return return
} }
func (this *apiComp) Dismiss(session comm.IUserSession, req *pb.SociatyDismissReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) Dismiss(session comm.IUserSession, req *pb.SociatyDismissReq) (code pb.ErrorCode, data proto.Message) {
if code = this.DismissCheck(session, req); code != pb.ErrorCode_Success {
return
}
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
@ -28,16 +36,21 @@ func (this *apiComp) Dismiss(session comm.IUserSession, req *pb.SociatyDismissRe
SociatyId: sociaty.Id, SociatyId: sociaty.Id,
} }
// 校验权限
if !this.module.modelSociaty.isRight(uid, sociaty, if !this.module.modelSociaty.isRight(uid, sociaty,
pb.SociatyJob_PRESIDENT) { pb.SociatyJob_PRESIDENT) {
code = pb.ErrorCode_SociatyNoRight code = pb.ErrorCode_SociatyNoRight
return return
} }
//公会解散
update := map[string]interface{}{} update := map[string]interface{}{}
globalCnf := this.module.globalConf globalCnf := this.module.globalConf
var isUpdate bool
if sociaty.DismissTime == 0 { if sociaty.DismissTime == 0 {
//更新解散倒计时 //更新解散倒计时
update["dismissTime"] = utils.AddHour(int(globalCnf.GuildDissolutionCountDownCd)).Unix() update["dismissTime"] = utils.AddHour(int(globalCnf.GuildDissolutionCountDownCd)).Unix()
isUpdate = true
} else { } else {
if req.Dismiss == 1 { //取消解散 if req.Dismiss == 1 { //取消解散
if utils.IsInCDHour(int64(sociaty.DismissCD)) { if utils.IsInCDHour(int64(sociaty.DismissCD)) {
@ -49,13 +62,16 @@ func (this *apiComp) Dismiss(session comm.IUserSession, req *pb.SociatyDismissRe
} }
//取消倒计时 //取消倒计时
update["dismissTime"] = 0 update["dismissTime"] = 0
isUpdate = true
} }
} }
if isUpdate {
if err := this.module.modelSociaty.updateSociaty(sociaty.Id, update); err != nil { if err := this.module.modelSociaty.updateSociaty(sociaty.Id, update); err != nil {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
return return
} }
}
if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeDismiss, rsp); err != nil { if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeDismiss, rsp); err != nil {
code = pb.ErrorCode_SystemError code = pb.ErrorCode_SystemError

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -9,6 +10,10 @@ import (
// 公会列表 // 公会列表
func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.SociatyListReq) (code pb.ErrorCode) { func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.SociatyListReq) (code pb.ErrorCode) {
if req.Filter > 3 {
code = pb.ErrorCode_ReqParameterError
this.module.Error("公会列表参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
}
return return
} }

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -16,12 +17,13 @@ func (this *apiComp) LogCheck(session comm.IUserSession, req *pb.SociatyLogReq)
func (this *apiComp) Log(session comm.IUserSession, req *pb.SociatyLogReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) Log(session comm.IUserSession, req *pb.SociatyLogReq) (code pb.ErrorCode, data proto.Message) {
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
// 日志列表
sl := this.module.modelSociatyLog.logList(sociaty.Id) sl := this.module.modelSociatyLog.logList(sociaty.Id)
rsp := &pb.SociatyLogResp{ rsp := &pb.SociatyLogResp{

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -16,12 +17,13 @@ func (this *apiComp) MembersCheck(session comm.IUserSession, req *pb.SociatyMemb
func (this *apiComp) Members(session comm.IUserSession, req *pb.SociatyMembersReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) Members(session comm.IUserSession, req *pb.SociatyMembersReq) (code pb.ErrorCode, data proto.Message) {
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
// 成员列表
members := this.module.modelSociaty.members(sociaty) members := this.module.modelSociaty.members(sociaty)
rsp := &pb.SociatyMembersResp{ rsp := &pb.SociatyMembersResp{
List: members, List: members,

View File

@ -2,12 +2,15 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/utils" "go_dreamfactory/utils"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
// 我的公会
func (this *apiComp) MineCheck(session comm.IUserSession, req *pb.SociatyMineReq) (code pb.ErrorCode) { func (this *apiComp) MineCheck(session comm.IUserSession, req *pb.SociatyMineReq) (code pb.ErrorCode) {
return return
} }
@ -16,23 +19,28 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.SociatyMineReq) (co
uid := session.GetUserId() uid := session.GetUserId()
userEx, err := this.module.ModuleUser.GetRemoteUserExpand(uid) userEx, err := this.module.ModuleUser.GetRemoteUserExpand(uid)
if err != nil { if err != nil {
this.module.Errorf("GetRemoteUserExpand uid: err:%v", uid, err) this.module.Error("GetRemoteUserExpand", log.Fields{"uid": uid, "err": err})
code = pb.ErrorCode_UserSessionNobeing code = pb.ErrorCode_UserSessionNobeing
return return
} }
rsp := &pb.SociatyMineResp{} rsp := &pb.SociatyMineResp{}
// 已加入公会 // 未加入公会
if userEx.SociatyId != "" { if userEx.SociatyId == "" {
sociaty := this.module.modelSociaty.getUserSociaty(uid) code = pb.ErrorCode_SociatyNoAdded
if sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("sociatyId: %s no found", userEx.SociatyId)
return return
} }
//验证是否解散 // 获取公会
sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound
this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return
}
//判断公会是否解散(公会解散非立即执行)
if this.module.modelSociaty.isDismiss(sociaty) { if this.module.modelSociaty.isDismiss(sociaty) {
code = pb.ErrorCode_SociatyDismissed code = pb.ErrorCode_SociatyDismissed
return return
@ -41,10 +49,13 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.SociatyMineReq) (co
// 初始玩家公会任务 // 初始玩家公会任务
sociatyTask := this.module.modelSociatyTask.getUserTask(uid, sociaty.Id) sociatyTask := this.module.modelSociatyTask.getUserTask(uid, sociaty.Id)
if sociatyTask.SociatyId != "" { if sociatyTask.SociatyId != "" {
// 今日首次进入公会
if utils.IsFirstTody(sociatyTask.LastUpdateTime) { if utils.IsFirstTody(sociatyTask.LastUpdateTime) {
// 删除任务
if err := this.module.modelSociatyTask.deleTask(sociaty.Id, uid); err == nil { if err := this.module.modelSociatyTask.deleTask(sociaty.Id, uid); err == nil {
// 初始新的公会任务
if err = this.module.modelSociatyTask.initSociatyTask(uid, sociaty.Id); err != nil { if err = this.module.modelSociatyTask.initSociatyTask(uid, sociaty.Id); err != nil {
this.module.Errorf("初始化玩家攻击任务失败 err:%v", err) this.module.Error("初始化玩家公会任务", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "err": err})
} }
} }
} }
@ -53,14 +64,17 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.SociatyMineReq) (co
// 获取会长 // 获取会长
master := this.module.modelSociaty.getMasterInfo(sociaty) master := this.module.modelSociaty.getMasterInfo(sociaty)
if master != nil { if master != nil {
// 会长弹劾判断
if err := this.module.modelSociaty.extendJob(master.Uid, sociaty); err == nil { if err := this.module.modelSociaty.extendJob(master.Uid, sociaty); err == nil {
// 获取新的会长 // 获取新的会长
master = this.module.modelSociaty.getMasterInfo(sociaty) master = this.module.modelSociaty.getMasterInfo(sociaty)
} else {
code = pb.ErrorCode_DBError
this.module.Error("会长弹劾", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "master": master.Uid, "err": err})
} }
} }
rsp.Sociaty = sociaty rsp.Sociaty = sociaty
rsp.Master = master rsp.Master = master
}
if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeMine, rsp); err != nil { if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeMine, rsp); err != nil {
code = pb.ErrorCode_SystemError code = pb.ErrorCode_SystemError

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/utils" "go_dreamfactory/utils"
@ -17,9 +18,9 @@ func (this *apiComp) QuitCheck(session comm.IUserSession, req *pb.SociatyQuitReq
func (this *apiComp) Quit(session comm.IUserSession, req *pb.SociatyQuitReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) Quit(session comm.IUserSession, req *pb.SociatyQuitReq) (code pb.ErrorCode, data proto.Message) {
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
@ -30,9 +31,10 @@ func (this *apiComp) Quit(session comm.IUserSession, req *pb.SociatyQuitReq) (co
return return
} }
// 退出公会
if err := this.module.modelSociaty.quit(uid, sociaty); err != nil { if err := this.module.modelSociaty.quit(uid, sociaty); err != nil {
code = pb.ErrorCode_SociatyQuit code = pb.ErrorCode_SociatyQuit
this.module.Errorf("退出公会失败:%v", err) this.module.Errorf("退出公会", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "err": err.Error()})
return return
} }
@ -44,12 +46,14 @@ func (this *apiComp) Quit(session comm.IUserSession, req *pb.SociatyQuitReq) (co
if err := this.module.ModuleUser.ChangeRemoteUserExpand(uid, update); err != nil { if err := this.module.ModuleUser.ChangeRemoteUserExpand(uid, update); err != nil {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
this.module.Errorf("更新玩家公会ID err:%v", err) this.module.Error("退出公会,更新玩家公会ID", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "err": err.Error()})
return return
} }
// 添加退出公会日志
if err := this.module.modelSociatyLog.addLog(Log_Quit, sociaty.Id, uid); err != nil { if err := this.module.modelSociatyLog.addLog(Log_Quit, sociaty.Id, uid); err != nil {
this.module.Errorf("退出公会日志 err:%v", err) this.module.Error("踢出公会日志", log.Fields{"uid": uid, "sociatyId": sociaty.Id,
"日志模板": Log_Quit, "err": err.Error()})
} }
rsp := &pb.SociatyQuitResp{ rsp := &pb.SociatyQuitResp{

View File

@ -14,6 +14,7 @@ func (this *apiComp) RankCheck(session comm.IUserSession, req *pb.SociatyRankReq
} }
func (this *apiComp) Rank(session comm.IUserSession, req *pb.SociatyRankReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) Rank(session comm.IUserSession, req *pb.SociatyRankReq) (code pb.ErrorCode, data proto.Message) {
// 排行榜
list := this.module.modelSociaty.rank() list := this.module.modelSociaty.rank()
rsp := &pb.SociatyRankResp{ rsp := &pb.SociatyRankResp{
Rank: list, Rank: list,

View File

@ -2,16 +2,18 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
// 任务奖励领取 // 公会任务奖励领取
func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.SociatyReceiveReq) (code pb.ErrorCode) { func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.SociatyReceiveReq) (code pb.ErrorCode) {
if req.TaskId == 0 { if req.TaskId == 0 {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.module.Error("公会任务奖励领取参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
@ -22,9 +24,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.SociatyReceiveRe
} }
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
@ -43,40 +45,35 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.SociatyReceiveRe
// 验证任务是否完成 // 验证任务是否完成
if err, ok := this.module.modelSociaty.validTask(uid, req.TaskId); err != nil || !ok { if err, ok := this.module.modelSociaty.validTask(uid, req.TaskId); err != nil || !ok {
code = pb.ErrorCode_SociatyTaskValidation code = pb.ErrorCode_SociatyTaskValidation
this.module.Errorf("任务 taskId:%v 验证未通过", req.TaskId) this.module.Error("公会任务未通过", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "taskId": req.TaskId, "err": err.Error()})
return return
} }
// 领取 // 奖励领取
if err := this.module.modelSociatyTask.receive(req.TaskId, sociaty.Id, uid); err != nil { if err := this.module.modelSociatyTask.receive(req.TaskId, sociaty.Id, uid); err != nil {
code = pb.ErrorCode_SociatyRewardReceive code = pb.ErrorCode_SociatyRewardReceive
this.module.Errorf("领取任务奖励 err:%v", err) this.module.Error("领取公会任务奖励", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "taskId": req.TaskId, "err": err.Error()})
return return
} }
//获取奖励配置 //获取奖励配置
ggt, err := this.module.configure.getSociatyTaskCfg() conf, ok := this.module.sociatyTaskConf.GetDataMap()[req.TaskId]
if err != nil || ggt == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
conf, ok := ggt.GetDataMap()[req.TaskId]
if ok { if ok {
// 发放个人奖励 // 发放个人奖励
if code = this.module.DispenseRes(session, conf.Reward, true); code != pb.ErrorCode_Success { if code = this.module.DispenseRes(session, conf.Reward, true); code != pb.ErrorCode_Success {
this.module.Errorf("发放个人奖励失败 sociatyId:%s uid:%s taskId:%d code:%v", sociaty.Id, uid, req.TaskId, code) this.module.Error("发放公会个人奖励失败", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "taskId": req.TaskId, "code": code})
} }
} }
// 更新公会经验和活跃度 // 更新公会经验和活跃度
if err := this.module.modelSociaty.updateResourceFromTask(sociaty, conf); err != nil { if err := this.module.modelSociaty.updateResourceFromTask(sociaty, conf); err != nil {
this.module.Errorf("更新公会资源 sociatyId:%s uid:%s taskId:%d err:%v", sociaty.Id, uid, req.TaskId, err) this.module.Error("更新公会资源", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "taskId": req.TaskId, "err": err.Error()})
return return
} }
// 更新成员贡献值 // 更新成员贡献值
if err := this.module.modelSociaty.updateMemberContribution(uid, conf.Contribution, sociaty); err != nil { if err := this.module.modelSociaty.updateMemberContribution(uid, conf.Contribution, sociaty); err != nil {
this.module.Errorf("更新成员贡献值 sociatyId:%s uid:%s taskId:%d err:%v", sociaty.Id, uid, req.TaskId, err) this.module.Error("更新公会成员贡献值", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "taskId": req.TaskId, "err": err.Error()})
return return
} }

View File

@ -2,16 +2,18 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
// 申请复查 // 公会申请审核-拒绝
func (this *apiComp) RefuseCheck(session comm.IUserSession, req *pb.SociatyRefuseReq) (code pb.ErrorCode) { func (this *apiComp) RefuseCheck(session comm.IUserSession, req *pb.SociatyRefuseReq) (code pb.ErrorCode) {
if req.Uid == "" { if req.Uid == "" {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.module.Error("公会申请审核-拒绝参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
@ -22,12 +24,13 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.SociatyRefuseReq)
} }
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
// 校验权限
if !this.module.modelSociaty.isRight(uid, sociaty, if !this.module.modelSociaty.isRight(uid, sociaty,
pb.SociatyJob_PRESIDENT, pb.SociatyJob_PRESIDENT,
pb.SociatyJob_VICEPRESIDENT, pb.SociatyJob_VICEPRESIDENT,
@ -36,9 +39,16 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.SociatyRefuseReq)
return return
} }
// 已是公会成员
if this.module.modelSociaty.isMember(uid, sociaty) {
code = pb.ErrorCode_SociatyAdded
return
}
// 拒绝公会申请
if err := this.module.modelSociaty.refuse(req.Uid, sociaty); err != nil { if err := this.module.modelSociaty.refuse(req.Uid, sociaty); err != nil {
code = pb.ErrorCode_SociatyRefuse code = pb.ErrorCode_SociatyRefuse
this.module.Errorf("申请拒绝失败:%v", err) this.module.Error("申请拒绝", log.Fields{"uid": uid, "拒绝目标人": req.Uid, "err": err.Error()})
return return
} }

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -11,6 +12,7 @@ import (
func (this *apiComp) SearchCheck(session comm.IUserSession, req *pb.SociatySearchReq) (code pb.ErrorCode) { func (this *apiComp) SearchCheck(session comm.IUserSession, req *pb.SociatySearchReq) (code pb.ErrorCode) {
if req.Name == "" { if req.Name == "" {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.module.Error("公会搜索参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
@ -22,7 +24,7 @@ func (this *apiComp) Search(session comm.IUserSession, req *pb.SociatySearchReq)
rsp := &pb.SociatySearchResp{} rsp := &pb.SociatySearchResp{}
sociaty := this.module.modelSociaty.findByName(req.Name) sociaty := this.module.modelSociaty.findByName(req.Name)
if sociaty.Id != "" { if sociaty != nil && sociaty.Id != "" {
rsp.List = append(rsp.List, sociaty) rsp.List = append(rsp.List, sociaty)
} }

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -10,6 +11,10 @@ import (
// 公会设置 // 公会设置
func (this *apiComp) SettingCheck(session comm.IUserSession, req *pb.SociatySettingReq) (code pb.ErrorCode) { func (this *apiComp) SettingCheck(session comm.IUserSession, req *pb.SociatySettingReq) (code pb.ErrorCode) {
if req.ApplyLv == 0 || req.Icon == "" {
code = pb.ErrorCode_ReqParameterError
this.module.Error("公会设置参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
}
return return
} }
@ -20,12 +25,13 @@ func (this *apiComp) Setting(session comm.IUserSession, req *pb.SociatySettingRe
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
// 校验权限
if !this.module.modelSociaty.isRight(uid, sociaty, if !this.module.modelSociaty.isRight(uid, sociaty,
pb.SociatyJob_PRESIDENT, pb.SociatyJob_VICEPRESIDENT) { pb.SociatyJob_PRESIDENT, pb.SociatyJob_VICEPRESIDENT) {
code = pb.ErrorCode_SociatyNoRight code = pb.ErrorCode_SociatyNoRight
@ -37,9 +43,10 @@ func (this *apiComp) Setting(session comm.IUserSession, req *pb.SociatySettingRe
sociaty.IsApplyCheck = req.IsApplyCheck sociaty.IsApplyCheck = req.IsApplyCheck
sociaty.ApplyLv = req.ApplyLv sociaty.ApplyLv = req.ApplyLv
// 设置
if err := this.module.modelSociaty.setting(sociaty); err != nil { if err := this.module.modelSociaty.setting(sociaty); err != nil {
code = pb.ErrorCode_SociatySetting code = pb.ErrorCode_SociatySetting
this.module.Errorf("公会修改失败:%v", err) this.module.Error("公会修改", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "params": req, "err": err.Error()})
return return
} }

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -11,6 +12,7 @@ import (
func (this *apiComp) SettingJobCheck(session comm.IUserSession, req *pb.SociatySettingJobReq) (code pb.ErrorCode) { func (this *apiComp) SettingJobCheck(session comm.IUserSession, req *pb.SociatySettingJobReq) (code pb.ErrorCode) {
if req.TargetId == "" || req.Job == 0 { if req.TargetId == "" || req.Job == 0 {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
this.module.Error("公会设置职位参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
} }
return return
} }
@ -22,9 +24,9 @@ func (this *apiComp) SettingJob(session comm.IUserSession, req *pb.SociatySettin
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
@ -35,6 +37,12 @@ func (this *apiComp) SettingJob(session comm.IUserSession, req *pb.SociatySettin
return return
} }
// 不能设置自己
if uid == req.TargetId {
code = pb.ErrorCode_SociatySelfSetting
return
}
// 判断职位人数 // 判断职位人数
globalConf := this.module.globalConf globalConf := this.module.globalConf
jobCount := this.module.modelSociaty.getJobCount(req.Job, sociaty) jobCount := this.module.modelSociaty.getJobCount(req.Job, sociaty)
@ -44,16 +52,10 @@ func (this *apiComp) SettingJob(session comm.IUserSession, req *pb.SociatySettin
return return
} }
// 不能设置自己
if uid == req.TargetId {
code = pb.ErrorCode_SociatySelfSetting
return
}
// 设置职位 // 设置职位
if err := this.module.modelSociaty.settingJob(req.TargetId, req.Job, sociaty); err != nil { if err := this.module.modelSociaty.settingJob(req.TargetId, req.Job, sociaty); err != nil {
code = pb.ErrorCode_SociatySettingJob code = pb.ErrorCode_SociatySettingJob
this.module.Errorf("设置职位失败:%v", err) this.module.Errorf("设置公会职位", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "params": req, "err": err.Error()})
return return
} }

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -19,9 +20,15 @@ func (this *apiComp) Sign(session comm.IUserSession, req *pb.SociatySignReq) (co
uid := session.GetUserId() uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return
}
// 不是该公会成员
if !this.module.modelSociaty.isMember(uid, sociaty) {
code = pb.ErrorCode_SociatyNoAdded
return return
} }
@ -34,38 +41,34 @@ func (this *apiComp) Sign(session comm.IUserSession, req *pb.SociatySignReq) (co
// 签到 // 签到
if err := this.module.modelSociaty.sign(uid, sociaty); err != nil { if err := this.module.modelSociaty.sign(uid, sociaty); err != nil {
code = pb.ErrorCode_SociatyAgree code = pb.ErrorCode_SociatyAgree
this.module.Errorf("签到失败:%v", err) this.module.Error("签到失败", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "err": err.Error()})
return
}
ggs, err := this.module.configure.getSociatySignCfg()
if err != nil {
code = pb.ErrorCode_ConfigNoFound
return return
} }
// 发奖 // 发奖
lastSignCount := sociaty.LastSignCount lastSignCount := sociaty.LastSignCount
var signCfgId int32 //签到配置ID var signCfgId int32 //签到配置ID
for _, v := range ggs.GetDataList() { for _, v := range this.module.sociatySignConf.GetDataList() {
if lastSignCount >= v.Down && lastSignCount <= v.Up { if lastSignCount >= v.Down && lastSignCount <= v.Up {
// 发放签到奖励 // 发放签到奖励
if code = this.module.DispenseRes(session, v.Reward, true); code == pb.ErrorCode_Success { if code = this.module.DispenseRes(session, v.Reward, true); code == pb.ErrorCode_Success {
signCfgId = v.Id signCfgId = v.Id
} else {
log.Error("发放签到奖励失败", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "code": code})
} }
break break
} }
} }
if cfg, ok := ggs.GetDataMap()[signCfgId]; ok { if cfg, ok := this.module.sociatySignConf.GetDataMap()[signCfgId]; ok {
// 更新公会经验 // 更新公会经验
if cfg.Exp.T == "guildexp" { if cfg.Exp.T == "guildexp" {
if err := this.module.modelSociaty.updateSociatyExp(cfg.Exp.N, sociaty); err != nil { if err := this.module.modelSociaty.updateSociatyExp(cfg.Exp.N, sociaty); err != nil {
this.module.Errorf("公会经验更新失败:%v", err) this.module.Error("公会经验更新", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "经验": cfg.Exp.N, "err": err.Error()})
} }
// 更新等级 // 更新等级
if err := this.module.modelSociaty.changeLv(sociaty); err != nil { if err := this.module.modelSociaty.changeLv(sociaty); err != nil {
this.module.Errorf("公会等级更新失败:%v", err) this.module.Error("公会等级更新", log.Fields{"uid": uid, "sociatyId": sociaty.Id, "err": err.Error()})
} }
} }
} }

View File

@ -2,6 +2,7 @@ package sociaty
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -18,17 +19,11 @@ func (this *apiComp) TaskList(session comm.IUserSession, req *pb.SociatyTaskList
sociaty := this.module.modelSociaty.getUserSociaty(uid) sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" { if sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid) this.module.Error("当前玩家所在的公会未找到", log.Fields{"uid": uid})
return return
} }
rsp := &pb.SociatyTaskListResp{} rsp := &pb.SociatyTaskListResp{}
defer func() {
if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeTasklist, rsp); err != nil {
code = pb.ErrorCode_SystemError
}
}()
sociatyTask := this.module.modelSociatyTask.getUserTask(uid, sociaty.Id) sociatyTask := this.module.modelSociatyTask.getUserTask(uid, sociaty.Id)
if sociatyTask.SociatyId != "" { if sociatyTask.SociatyId != "" {
var taskList []*pb.SociatyTask var taskList []*pb.SociatyTask
@ -42,5 +37,8 @@ func (this *apiComp) TaskList(session comm.IUserSession, req *pb.SociatyTaskList
rsp.List = taskList rsp.List = taskList
} }
if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeTasklist, rsp); err != nil {
code = pb.ErrorCode_SystemError
}
return return
} }

View File

@ -2,7 +2,6 @@ package sociaty
import ( import (
"context" "context"
"fmt"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
event_v2 "go_dreamfactory/lego/sys/event/v2" event_v2 "go_dreamfactory/lego/sys/event/v2"
@ -60,7 +59,7 @@ func (this *ModelSociaty) Init(service core.IService, module core.IModule, comp
// 创建公会 // 创建公会
func (this *ModelSociaty) create(sociaty *pb.DBSociaty) error { func (this *ModelSociaty) create(sociaty *pb.DBSociaty) error {
if sociaty == nil { if sociaty == nil {
return fmt.Errorf("sociaty is nil") return comm.NewCustomError(pb.ErrorCode_SociatyNoFound)
} }
_id := primitive.NewObjectID().Hex() _id := primitive.NewObjectID().Hex()
sociaty.Id = _id sociaty.Id = _id
@ -99,16 +98,17 @@ func (this *ModelSociaty) list(uid string, filter pb.SociatyListFilter) (list []
return return
} }
logFields := log.Fields{"uid": uid, "filter": filter}
switch filter { switch filter {
case pb.SociatyListFilter_ALL: //所有 case pb.SociatyListFilter_ALL: //所有
if err := this.GetList("", &list); err != nil { if err := this.GetList("", &list); err != nil {
log.Errorf("sociaty list err:%v", err) log.Error("公会列表", logFields)
return return
} }
case pb.SociatyListFilter_CONDI: //满足条件 case pb.SociatyListFilter_CONDI: //满足条件
//玩家等级大于等于公会的申请等级限制 //玩家等级大于等于公会的申请等级限制
if err := this.GetList("", &list); err != nil { if err := this.GetList("", &list); err != nil {
log.Errorf("sociaty list err:%v", err) log.Error("公会列表", logFields)
return return
} }
var newList []*pb.DBSociaty var newList []*pb.DBSociaty
@ -131,7 +131,7 @@ func (this *ModelSociaty) list(uid string, filter pb.SociatyListFilter) (list []
} }
case pb.SociatyListFilter_APPLYING: //申请中 case pb.SociatyListFilter_APPLYING: //申请中
if err := this.GetList("", &list); err != nil { if err := this.GetList("", &list); err != nil {
log.Errorf("sociaty list err:%v", err) log.Error("公会列表", logFields)
return return
} }
@ -167,8 +167,8 @@ 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) {
sociaty = &pb.DBSociaty{} sociaty = &pb.DBSociaty{}
if err := this.GetListObj("", sociatyId, sociaty); err != nil { if err := this.GetListObj(comm.RDS_EMPTY, sociatyId, sociaty); err != nil {
this.moduleSociaty.Errorf("sociaty [%s] found err:%v", sociatyId, err) log.Error("GetListObj", log.Fields{"sociatyId": sociatyId})
return return
} }
return return
@ -198,7 +198,6 @@ func (this *ModelSociaty) getUserSociaty(uid string) (sociaty *pb.DBSociaty) {
if this.moduleSociaty.IsCross() { if this.moduleSociaty.IsCross() {
userEx, err = this.moduleSociaty.ModuleUser.GetRemoteUserExpand(uid) userEx, err = this.moduleSociaty.ModuleUser.GetRemoteUserExpand(uid)
if err != nil { if err != nil {
log.Errorf("GetUserExpand uid:%v err:%v", uid, err)
return return
} }
if userEx.SociatyId != "" { if userEx.SociatyId != "" {
@ -213,7 +212,6 @@ func (this *ModelSociaty) getUserSociaty(uid string) (sociaty *pb.DBSociaty) {
} else { } else {
userEx, err = this.moduleSociaty.ModuleUser.GetUserExpand(uid) userEx, err = this.moduleSociaty.ModuleUser.GetUserExpand(uid)
if err != nil { if err != nil {
log.Errorf("GetUserExpand uid:%v err:%v", uid, err)
return return
} }
if userEx.SociatyId != "" { if userEx.SociatyId != "" {
@ -267,12 +265,7 @@ func (this *ModelSociaty) setting(sociaty *pb.DBSociaty) error {
} }
// 申请撤销 // 申请撤销
func (this *ModelSociaty) applyCancel(uid, sociatyId string) error { func (this *ModelSociaty) applyCancel(uid string, sociaty *pb.DBSociaty) error {
sociaty := this.getSociaty(sociatyId)
if sociaty.Id == "" {
return fmt.Errorf("sociatyId: %s 公会不存在", sociatyId)
}
return this.delFromApplyRecord(uid, sociaty) return this.delFromApplyRecord(uid, sociaty)
} }
@ -360,13 +353,11 @@ func (this *ModelSociaty) dismiss(sociaty *pb.DBSociaty) error {
return err return err
} }
//推送 //推送
if err := this.moduleSociaty.SendMsgToUsers( this.moduleSociaty.SendMsgToUsers(
string(this.moduleSociaty.GetType()), string(this.moduleSociaty.GetType()),
"pdismiss", "pdismiss",
&pb.SociatyPDismissPush{SociatyId: sociaty.Id}, &pb.SociatyPDismissPush{SociatyId: sociaty.Id},
this.getMemberIds(sociaty)...); err != nil { this.getMemberIds(sociaty)...)
log.Errorf("公会解散推送 err:%v", err)
}
//发邮件 //发邮件
this.sendMail("GuildDissolution", []string{sociaty.Name}, this.getMemberIds(sociaty)) this.sendMail("GuildDissolution", []string{sociaty.Name}, this.getMemberIds(sociaty))
@ -389,7 +380,7 @@ func (this *ModelSociaty) delFromApplyRecord(uid string, sociaty *pb.DBSociaty)
//添加成员 //添加成员
func (this *ModelSociaty) addMember(uid string, sociaty *pb.DBSociaty) error { func (this *ModelSociaty) addMember(uid string, sociaty *pb.DBSociaty) error {
if int32(len(sociaty.Members)) >= this.getMemberMax(sociaty) { if int32(len(sociaty.Members)) >= this.getMemberMax(sociaty) {
return fmt.Errorf("member max") return comm.NewCustomError(pb.ErrorCode_SociatyMemberCountLimit)
} }
sociaty.Members = append(sociaty.Members, &pb.SociatyMember{ sociaty.Members = append(sociaty.Members, &pb.SociatyMember{
Uid: uid, Uid: uid,
@ -459,7 +450,7 @@ func (this *ModelSociaty) getMemberIds(sociaty *pb.DBSociaty) (ids []string) {
// 同意 // 同意
func (this *ModelSociaty) agree(uid string, sociaty *pb.DBSociaty) error { func (this *ModelSociaty) agree(uid string, sociaty *pb.DBSociaty) error {
if this.isMember(uid, sociaty) { if this.isMember(uid, sociaty) {
return fmt.Errorf("已是该公会成员 uid:%s sociatyId:%s", uid, sociaty.Id) return comm.NewCustomError(pb.ErrorCode_SociatyBelongTo)
} }
//删除申请记录 //删除申请记录
if err := this.delFromApplyRecord(uid, sociaty); err != nil { if err := this.delFromApplyRecord(uid, sociaty); err != nil {
@ -477,9 +468,6 @@ func (this *ModelSociaty) agree(uid string, sociaty *pb.DBSociaty) error {
//拒绝 //拒绝
func (this *ModelSociaty) refuse(uid string, sociaty *pb.DBSociaty) error { func (this *ModelSociaty) refuse(uid string, sociaty *pb.DBSociaty) error {
if this.isMember(uid, sociaty) {
return fmt.Errorf("已是该公会成员 uid:%s sociatyId:%s", uid, sociaty.Id)
}
return this.delFromApplyRecord(uid, sociaty) return this.delFromApplyRecord(uid, sociaty)
} }
@ -487,10 +475,6 @@ func (this *ModelSociaty) refuse(uid string, sociaty *pb.DBSociaty) error {
// targetId 目标玩家ID // targetId 目标玩家ID
// srcId 玩家ID 会长 // srcId 玩家ID 会长
func (this *ModelSociaty) assign(srcId, targetId string, sociaty *pb.DBSociaty) error { func (this *ModelSociaty) assign(srcId, targetId string, sociaty *pb.DBSociaty) error {
if !this.isMember(targetId, sociaty) {
return fmt.Errorf("不是该公会成员 uid:%s sociatyId:%s", targetId, sociaty.Id)
}
for _, m := range sociaty.Members { for _, m := range sociaty.Members {
if m.Uid == srcId { if m.Uid == srcId {
m.Uid = targetId m.Uid = targetId
@ -511,7 +495,7 @@ func (this *ModelSociaty) discharge(targetId string, sociaty *pb.DBSociaty) erro
for i, m := range sociaty.Members { for i, m := range sociaty.Members {
if m.Uid == targetId { if m.Uid == targetId {
if m.Job == pb.SociatyJob_PRESIDENT { if m.Job == pb.SociatyJob_PRESIDENT {
return fmt.Errorf("会长 %s 不可以被踢出", targetId) return comm.NewCustomError(pb.ErrorCode_SociatyMasterNoDiss)
} }
sociaty.Members = append(sociaty.Members[:i], sociaty.Members[i+1:]...) sociaty.Members = append(sociaty.Members[:i], sociaty.Members[i+1:]...)
} }
@ -569,7 +553,7 @@ func (this *ModelSociaty) getMasterInfo(sociaty *pb.DBSociaty) *pb.SociatyMember
func (this *ModelSociaty) accuse(sociaty *pb.DBSociaty) error { func (this *ModelSociaty) accuse(sociaty *pb.DBSociaty) error {
master := this.getMasterInfo(sociaty) master := this.getMasterInfo(sociaty)
if master == nil { if master == nil {
return errors.New("会长不存在") return comm.NewCustomError(pb.ErrorCode_SociatyNoMaster)
} }
user, err := this.moduleSociaty.ModuleUser.GetRemoteUser(master.Uid) user, err := this.moduleSociaty.ModuleUser.GetRemoteUser(master.Uid)
@ -583,7 +567,7 @@ func (this *ModelSociaty) accuse(sociaty *pb.DBSociaty) error {
now := configure.Now().Unix() now := configure.Now().Unix()
left := now - user.Offlinetime left := now - user.Offlinetime
if left < int64(globalCnf.GuildInitiateImpeachmentTime*3600) || user.Offlinetime == 0 { if left < int64(globalCnf.GuildInitiateImpeachmentTime*3600) || user.Offlinetime == 0 {
return errors.New("会长很称职,无需弹劾") return comm.NewCustomError(pb.ErrorCode_SociatyNoAccuse)
} else { } else {
//更新会长的弹劾倒计时时间 //更新会长的弹劾倒计时时间
update := map[string]interface{}{ update := map[string]interface{}{
@ -594,10 +578,11 @@ func (this *ModelSociaty) accuse(sociaty *pb.DBSociaty) error {
} }
// 弹劾倒计时判断 // 弹劾倒计时判断
// 会长在截至时间前进入公会终止弹劾,否则进行新会长选举
// srcMasterId 原会长ID // srcMasterId 原会长ID
func (this *ModelSociaty) extendJob(srcMasterId string, sociaty *pb.DBSociaty) error { func (this *ModelSociaty) extendJob(srcMasterId string, sociaty *pb.DBSociaty) error {
if sociaty.AccuseTime != 0 { if sociaty.AccuseTime != 0 {
//终止弹劾 //会长在截至时间前进入公会终止弹劾
now := configure.Now().Unix() now := configure.Now().Unix()
if now < sociaty.AccuseTime { if now < sociaty.AccuseTime {
update := map[string]interface{}{ update := map[string]interface{}{
@ -654,7 +639,7 @@ func (this *ModelSociaty) electNewMaster(srcMasterId string, sociaty *pb.DBSocia
} }
} }
if maxCount >= 1 { //有两个以上的最大值 if maxCount >= 1 { //有两个以上的最大值
//比较时间 升序 //比较时间 升序,先加入公会的人有优先候选权
sort.SliceStable(data, func(i, j int) bool { sort.SliceStable(data, func(i, j int) bool {
return data[i].Ctime < data[j].Ctime return data[i].Ctime < data[j].Ctime
}) })
@ -684,9 +669,6 @@ func (this *ModelSociaty) electNewMaster(srcMasterId string, sociaty *pb.DBSocia
// 签到 // 签到
func (this *ModelSociaty) sign(uid string, sociaty *pb.DBSociaty) error { func (this *ModelSociaty) sign(uid string, sociaty *pb.DBSociaty) error {
if !this.isMember(uid, sociaty) {
return fmt.Errorf("不是该公会成员 uid:%s sociatyId:%s", uid, sociaty.Id)
}
sociaty.SignIds = append(sociaty.SignIds, uid) sociaty.SignIds = append(sociaty.SignIds, uid)
@ -821,7 +803,7 @@ func (this *ModelSociaty) rankDataChanged(event interface{}, next func(event int
func (this *ModelSociaty) rank() (rank []*pb.DBSociatyRank) { func (this *ModelSociaty) rank() (rank []*pb.DBSociatyRank) {
var list []*pb.DBSociaty var list []*pb.DBSociaty
if err := this.GetList("", &list); err != nil { if err := this.GetList("", &list); err != nil {
log.Errorf("sociaty list err:%v", err) log.Error("公会列表", log.Fields{"err": err.Error()})
return nil return nil
} }
@ -836,6 +818,7 @@ func (this *ModelSociaty) rank() (rank []*pb.DBSociatyRank) {
rank = this.sort(rank) rank = this.sort(rank)
// 只取前20条数据
if len(rank) > 20 { if len(rank) > 20 {
rank = append(rank[:0], rank[19:]...) rank = append(rank[:0], rank[19:]...)
} }
@ -901,18 +884,10 @@ func (this *ModelSociaty) validTask(uid string, taskId int32) (err error, ok boo
return return
} }
grc, err := this.moduleSociaty.configure.getRtaskCondiCfg()
if err != nil {
return
}
if grc == nil {
return errors.New("RtaskCondiCfg is nil"), false
}
// 遍历玩家任务数据 // 遍历玩家任务数据
if data, ok := rsp.Vals[taskId]; ok { if data, ok := rsp.Vals[taskId]; ok {
//查找表配置 //查找表配置
conf, ok := grc.GetDataMap()[taskId] conf, ok := this.moduleSociaty.rtaskCondConf.GetDataMap()[taskId]
if ok { if ok {
if data.Rtype == conf.Type && data.Data[0] >= conf.Data1 { if data.Rtype == conf.Type && data.Data[0] >= conf.Data1 {
return nil, true return nil, true

View File

@ -1,9 +1,9 @@
package sociaty package sociaty
import ( import (
"fmt"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/configure" "go_dreamfactory/sys/configure"
@ -37,7 +37,7 @@ func (this *ModelSociatyLog) addLog(tag Tag, sociatyId string, params ...string)
content = string(Log_Add) content = string(Log_Add)
count := strings.Count(content, "%s") count := strings.Count(content, "%s")
if count != len(params) { if count != len(params) {
return fmt.Errorf("参数和模板参数不匹配 期望:%d 实际%d", count, len(params)) return comm.NewCustomError(pb.ErrorCode_SociatyLogParams)
} }
for i := 0; i < len(params); i++ { for i := 0; i < len(params); i++ {
user, err := this.moduleSociaty.ModuleUser.GetRemoteUser(params[i]) user, err := this.moduleSociaty.ModuleUser.GetRemoteUser(params[i])
@ -49,7 +49,7 @@ func (this *ModelSociatyLog) addLog(tag Tag, sociatyId string, params ...string)
content = string(Log_Quit) content = string(Log_Quit)
count := strings.Count(content, "%s") count := strings.Count(content, "%s")
if count != len(params) { if count != len(params) {
return fmt.Errorf("参数和模板参数不匹配 期望:%d 实际%d", count, len(params)) return comm.NewCustomError(pb.ErrorCode_SociatyLogParams)
} }
for i := 0; i < len(params); i++ { for i := 0; i < len(params); i++ {
user, err := this.moduleSociaty.ModuleUser.GetRemoteUser(params[i]) user, err := this.moduleSociaty.ModuleUser.GetRemoteUser(params[i])
@ -61,7 +61,7 @@ func (this *ModelSociatyLog) addLog(tag Tag, sociatyId string, params ...string)
content = string(Log_Job) content = string(Log_Job)
count := strings.Count(content, "%s") count := strings.Count(content, "%s")
if count != len(params) { if count != len(params) {
return fmt.Errorf("参数和模板参数不匹配 期望:%d 实际%d", count, len(params)) return comm.NewCustomError(pb.ErrorCode_SociatyLogParams)
} }
for i := 0; i < len(params); i++ { for i := 0; i < len(params); i++ {
if i == 2 { if i == 2 {
@ -88,7 +88,7 @@ func (this *ModelSociatyLog) addLog(tag Tag, sociatyId string, params ...string)
content = string(Log_Job) content = string(Log_Job)
count := strings.Count(content, "%s") count := strings.Count(content, "%s")
if count != len(params) { if count != len(params) {
return fmt.Errorf("参数和模板参数不匹配 期望:%d 实际%d", count, len(params)) return comm.NewCustomError(pb.ErrorCode_SociatyLogParams)
} }
for i := 0; i < len(params); i++ { for i := 0; i < len(params); i++ {
user, err := this.moduleSociaty.ModuleUser.GetRemoteUser(params[i]) user, err := this.moduleSociaty.ModuleUser.GetRemoteUser(params[i])
@ -100,7 +100,7 @@ func (this *ModelSociatyLog) addLog(tag Tag, sociatyId string, params ...string)
content = string(Log_Job) content = string(Log_Job)
count := strings.Count(content, "%s") count := strings.Count(content, "%s")
if count != len(params) { if count != len(params) {
return fmt.Errorf("参数和模板参数不匹配 期望:%d 实际%d", count, len(params)) return comm.NewCustomError(pb.ErrorCode_SociatyLogParams)
} }
for i := 0; i < len(params); i++ { for i := 0; i < len(params); i++ {
content = strings.Replace(content, "%s", params[i], 1) content = strings.Replace(content, "%s", params[i], 1)
@ -160,17 +160,19 @@ func (this *ModelSociatyLog) addLog(tag Tag, sociatyId string, params ...string)
// 查询日志 // 查询日志
func (this *ModelSociatyLog) logList(sociatyId string) (slist []*pb.SociatyLog) { func (this *ModelSociatyLog) logList(sociatyId string) (slist []*pb.SociatyLog) {
log := &pb.DBSociatyLog{} sociatyLog := &pb.DBSociatyLog{}
if err := this.Get(sociatyId, log); err != nil { if err := this.Get(sociatyId, sociatyLog); err != nil {
log.Error("公会日志列表", log.Fields{"sociatyId": sociatyId})
return nil return nil
} }
for _, l := range log.List { for _, l := range sociatyLog.List {
slist = append(slist, &pb.SociatyLog{ slist = append(slist, &pb.SociatyLog{
Content: l.Content, Content: l.Content,
Ctime: l.Ctime, Ctime: l.Ctime,
}) })
} }
// 创建时间排序 降序
sort.SliceStable(slist, func(i, j int) bool { sort.SliceStable(slist, func(i, j int) bool {
return slist[i].Ctime > slist[j].Ctime return slist[i].Ctime > slist[j].Ctime
}) })

View File

@ -1,7 +1,6 @@
package sociaty package sociaty
import ( import (
"errors"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/modules" "go_dreamfactory/modules"
@ -26,29 +25,25 @@ func (this *ModelSociatyTask) Init(service core.IService, module core.IModule, c
// 初始化公会任务 加入成员时初始化 // 初始化公会任务 加入成员时初始化
func (this *ModelSociatyTask) initSociatyTask(uid, sociatyId string) error { func (this *ModelSociatyTask) initSociatyTask(uid, sociatyId string) error {
ggt, err := this.moduleSociaty.configure.getSociatyTaskCfg()
if err != nil || ggt == nil {
return errors.New("SociatyTaskCfg not found")
}
sociatyTask := &pb.DBSociatyTask{ sociatyTask := &pb.DBSociatyTask{
SociatyId: sociatyId, SociatyId: sociatyId,
Uid: uid, Uid: uid,
} }
var taskList []*pb.SociatyTask var taskList []*pb.SociatyTask
list := ggt.GetDataList() taskListConf := this.moduleSociaty.sociatyTaskConf.GetDataList()
globalConf := this.moduleSociaty.globalConf globalConf := this.moduleSociaty.globalConf
// 大于4条配置 // 大于4条配置
if len(list) > int(globalConf.GuildTaskNum) { if len(taskListConf) > int(globalConf.GuildTaskNum) {
//随机4条任务 //随机4条任务
randInts := utils.RandomNumbers(0, len(list)-1, int(globalConf.GuildTaskNum)) randInts := utils.RandomNumbers(0, len(taskListConf)-1, int(globalConf.GuildTaskNum))
for _, v := range randInts { for _, v := range randInts {
taskList = append(taskList, &pb.SociatyTask{ taskList = append(taskList, &pb.SociatyTask{
TaskId: list[v].TypeId, TaskId: taskListConf[v].TypeId,
}) })
} }
} else { } else {
for _, v := range list { for _, v := range taskListConf {
taskList = append(taskList, &pb.SociatyTask{ taskList = append(taskList, &pb.SociatyTask{
TaskId: v.TypeId, TaskId: v.TypeId,
}) })
@ -59,7 +54,7 @@ func (this *ModelSociatyTask) initSociatyTask(uid, sociatyId string) error {
return this.moduleSociaty.modelSociatyTask.AddList(sociatyId, uid, sociatyTask) return this.moduleSociaty.modelSociatyTask.AddList(sociatyId, uid, sociatyTask)
} }
//任务列表 //公会任务列表
func (this *ModelSociatyTask) getUserTask(uid, sociatyId string) (task *pb.DBSociatyTask) { func (this *ModelSociatyTask) getUserTask(uid, sociatyId string) (task *pb.DBSociatyTask) {
task = &pb.DBSociatyTask{} task = &pb.DBSociatyTask{}
this.GetListObj(sociatyId, uid, task) this.GetListObj(sociatyId, uid, task)
@ -91,14 +86,19 @@ func (this *ModelSociatyTask) receive(taskId int32, sociatyId, uid string) error
func (this *ModelSociatyTask) activityReceive(id int32, sociatyId, uid string) error { func (this *ModelSociatyTask) activityReceive(id int32, sociatyId, uid string) error {
sociatyTask := &pb.DBSociatyTask{} sociatyTask := &pb.DBSociatyTask{}
this.GetListObj(sociatyId, uid, sociatyTask) this.GetListObj(sociatyId, uid, sociatyTask)
var isUpdate bool
for _, t := range sociatyTask.ActivityList { for _, t := range sociatyTask.ActivityList {
if t.Id == id { if t.Id == id {
t.Status = 1 //领取 t.Status = 1 //领取
isUpdate = true
break break
} }
} }
if isUpdate {
update := map[string]interface{}{ update := map[string]interface{}{
"activityList": sociatyTask.ActivityList, "activityList": sociatyTask.ActivityList,
} }
return this.ChangeList(sociatyId, uid, update) return this.ChangeList(sociatyId, uid, update)
} }
return nil
}

View File

@ -27,6 +27,10 @@ type Sociaty struct {
modelSociatyLog *ModelSociatyLog modelSociatyLog *ModelSociatyLog
configure *configureComp configure *configureComp
globalConf *cfg.GameGlobalData globalConf *cfg.GameGlobalData
sociatyActivityConf *cfg.GameGuildActivity
sociatyTaskConf *cfg.GameGuildTask
sociatySignConf *cfg.GameGuildSign
rtaskCondConf *cfg.GameRdtaskCondi
} }
func NewModule() core.IModule { func NewModule() core.IModule {
@ -58,6 +62,19 @@ func (this *Sociaty) Start() (err error) {
this.globalConf = this.configure.GetGlobalConf() this.globalConf = this.configure.GetGlobalConf()
if this.globalConf == nil { if this.globalConf == nil {
err = errors.New("global config not found") err = errors.New("global config not found")
return
}
if this.sociatyActivityConf, err = this.configure.getSociatyActivityCfg(); err != nil {
return err
}
if this.sociatyTaskConf, err = this.configure.getSociatyTaskCfg(); err != nil {
return err
}
if this.rtaskCondConf, err = this.configure.getRtaskCondiCfg(); err != nil {
return err
}
if this.sociatySignConf, err = this.configure.getSociatySignCfg(); err != nil {
return err
} }
return return
} }

View File

@ -3,6 +3,7 @@ package user
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/db" "go_dreamfactory/sys/db"
@ -28,20 +29,21 @@ func (this *ModelExpand) Init(service core.IService, module core.IModule, comp c
func (this *ModelExpand) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) { func (this *ModelExpand) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) {
result = &pb.DBUserExpand{} result = &pb.DBUserExpand{}
if db.IsCross() { if db.IsCross() {
if model, err := this.module.GetDBNoduleByUid(uid, this.TableName, this.Expired); err != nil { if model, err := this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
this.module.Errorln(err) this.module.Error("Cross GetDBModuleByUid", log.Fields{"uid": uid})
return result, err
} else { } else {
if err = model.Get(uid, result); err != nil && mongo.ErrNoDocuments != err { if err = model.Get(uid, result); err != nil && mongo.ErrNoDocuments != err {
this.module.Errorf("err:%v", err) this.module.Error("Cross Get", log.Fields{"uid": uid})
return result,err
} }
} }
} else { } else {
if err = this.Get(uid, result); err != nil && mongo.ErrNoDocuments != err { if err = this.Get(uid, result); err != nil && mongo.ErrNoDocuments != err {
this.module.Errorf("err:%v", err) this.module.Error("Get", log.Fields{"uid": uid})
} }
} }
err = nil return
return result, err
} }
//修改用户扩展数据 //修改用户扩展数据
@ -53,7 +55,7 @@ func (this *ModelExpand) ChangeUserExpand(uid string, value map[string]interface
model *db.DBModel model *db.DBModel
) )
if db.IsCross() { if db.IsCross() {
if model, err = this.module.GetDBNoduleByUid(uid, this.TableName, this.Expired); err == nil { if model, err = this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err == nil {
return model.Change(uid, value) return model.Change(uid, value)
} else { } else {
this.module.Errorln(err) this.module.Errorln(err)

View File

@ -78,7 +78,7 @@ func (this *ModelUser) GetUser(uid string) (user *pb.DBUser) {
// return // return
// } // }
if this.module.IsCross() { if this.module.IsCross() {
if model, err := this.module.GetDBNoduleByUid(uid, this.TableName, this.Expired); err != nil { if model, err := this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
} else { } else {
if err = model.Get(uid, user); err != nil { if err = model.Get(uid, user); err != nil {
@ -96,7 +96,7 @@ func (this *ModelUser) GetUser(uid string) (user *pb.DBUser) {
//设置属性 //设置属性
func (this *ModelUser) updateUserAttr(uid string, data map[string]interface{}) error { func (this *ModelUser) updateUserAttr(uid string, data map[string]interface{}) error {
if this.module.IsCross() { if this.module.IsCross() {
if model, err := this.module.GetDBNoduleByUid(uid, this.TableName, this.Expired); err != nil { if model, err := this.module.GetDBModuleByUid(uid, this.TableName, this.Expired); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
} else { } else {
if err = model.Change(uid, data); err != nil { if err = model.Change(uid, data); err != nil {

View File

@ -164,7 +164,6 @@ func (this *User) CrossUserOnlineList() ([]*pb.CacheUser, error) {
err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(),
comm.Service_Worker, Rpc_GetAllOnlineUser, nil, reply) comm.Service_Worker, Rpc_GetAllOnlineUser, nil, reply)
if err != nil { if err != nil {
log.Errorf("Rpc_GetAllOnlineUser err:%v", err)
return nil, err return nil, err
} }
return reply.Users, err return reply.Users, err
@ -176,7 +175,6 @@ func (this *User) CrossUserSession(uid string) *pb.CacheUser {
err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(),
comm.Service_Worker, Rpc_GetCrossUserSession, &pb.UIdReq{Uid: uid}, cacheUser) comm.Service_Worker, Rpc_GetCrossUserSession, &pb.UIdReq{Uid: uid}, cacheUser)
if err != nil { if err != nil {
log.Errorf("Rpc_GetCrossUserSession err:%v", err)
return nil return nil
} }
return cacheUser return cacheUser
@ -192,7 +190,6 @@ func (this *User) CrossSearchUser(nickName string) ([]*pb.DBUser, error) {
err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(),
comm.Service_Worker, Rpc_QueryUser, &pb.NameReq{Name: name}, reply) comm.Service_Worker, Rpc_QueryUser, &pb.NameReq{Name: name}, reply)
if err != nil { if err != nil {
log.Errorf("Rpc_QueryUser err:%v", err)
return nil, err return nil, err
} }
@ -243,7 +240,7 @@ func (this *User) QueryAttributeValue(uid string, attr string) (value int64) {
func (this *User) change(session comm.IUserSession, attr string, add int32) (change *pb.UserResChangedPush, code pb.ErrorCode) { func (this *User) change(session comm.IUserSession, attr string, add int32) (change *pb.UserResChangedPush, code pb.ErrorCode) {
if add == 0 { if add == 0 {
log.Errorf("attr no changed,uid: %s attr: %s add: %d", session.GetUserId(), attr, add) log.Error("attr no changed", log.Fields{"uid": session.GetUserId(), "attr": attr, "add": add})
// code = pb.ErrorCode_ReqParameterError // code = pb.ErrorCode_ReqParameterError
return return
} }
@ -435,7 +432,6 @@ func (this *User) EventUserChanged(session comm.IUserSession) {
} }
func (this *User) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) { func (this *User) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) {
return this.modelExpand.GetUserExpand(uid) return this.modelExpand.GetUserExpand(uid)
} }

View File

@ -2,6 +2,7 @@ package worldtask
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -10,6 +11,7 @@ import (
// 战斗结束的请求 // 战斗结束的请求
func (this *apiComp) BattlefinishCheck(session comm.IUserSession, req *pb.WorldtaskBattleFinishReq) (code pb.ErrorCode) { func (this *apiComp) BattlefinishCheck(session comm.IUserSession, req *pb.WorldtaskBattleFinishReq) (code pb.ErrorCode) {
if req.BattleConfId == 0 || req.TaskId == 0 || req.Report == nil { if req.BattleConfId == 0 || req.TaskId == 0 || req.Report == nil {
this.module.Error("世界任务战斗结束参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
} }
return return
@ -20,9 +22,6 @@ func (this *apiComp) Battlefinish(session comm.IUserSession, req *pb.WorldtaskBa
return return
} }
defer func() {
this.module.Errorf("战斗结束 taskId:%v", req.TaskId)
}()
taskConf, err := this.module.configure.getWorldtaskById(req.TaskId) taskConf, err := this.module.configure.getWorldtaskById(req.TaskId)
if err != nil || taskConf == nil { if err != nil || taskConf == nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
@ -40,11 +39,12 @@ func (this *apiComp) Battlefinish(session comm.IUserSession, req *pb.WorldtaskBa
} }
if ibattle, ok := battleModule.(comm.IBattle); ok { if ibattle, ok := battleModule.(comm.IBattle); ok {
// var isWin bool var isWin bool
if code, _ = ibattle.CheckBattleReport(session, req.Report); code == pb.ErrorCode_Success { if code, isWin = ibattle.CheckBattleReport(session, req.Report); code == pb.ErrorCode_Success {
//触发任务 //触发任务
this.module.ModuleRtask.SendToRtask(session, comm.Rtype70, 1, req.BattleConfId) this.module.ModuleRtask.SendToRtask(session, comm.Rtype70, 1, req.BattleConfId)
} }
this.module.Debug("校验战报", log.Fields{"uid": session.GetUserId(), "taskId": req.TaskId, "战斗结果": isWin})
} }
if err := session.SendMsg(string(this.module.GetType()), WorldtaskBattleFinish, rsp); err != nil { if err := session.SendMsg(string(this.module.GetType()), WorldtaskBattleFinish, rsp); err != nil {

View File

@ -10,6 +10,10 @@ import (
// 战斗开始 // 战斗开始
func (this *apiComp) BattlestartCheck(session comm.IUserSession, req *pb.WorldtaskBattleStartReq) (code pb.ErrorCode) { func (this *apiComp) BattlestartCheck(session comm.IUserSession, req *pb.WorldtaskBattleStartReq) (code pb.ErrorCode) {
if req.BattleConfId == 0 || req.Battle == nil {
this.module.Error("世界任务战斗开始参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
code = pb.ErrorCode_ReqParameterError
}
return return
} }
@ -17,11 +21,11 @@ func (this *apiComp) Battlestart(session comm.IUserSession, req *pb.WorldtaskBat
if code = this.BattlestartCheck(session, req); code != pb.ErrorCode_Success { if code = this.BattlestartCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
uid := session.GetUserId()
battleConf, err := this.module.configure.getWorldtaskBattleById(req.BattleConfId) battleConf, err := this.module.configure.getWorldtaskBattleById(req.BattleConfId)
if err != nil || battleConf == nil { if err != nil || battleConf == nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
log.Errorf("world_battle %v no found", req.BattleConfId) log.Error("战斗配置未找到", log.Fields{"uid": uid, "battleConfId": req.BattleConfId})
return return
} }

View File

@ -2,15 +2,17 @@ package worldtask
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
// 任务完成 // 世界任务完成
func (this *apiComp) FinishCheck(session comm.IUserSession, req *pb.WorldtaskFinishReq) (code pb.ErrorCode) { func (this *apiComp) FinishCheck(session comm.IUserSession, req *pb.WorldtaskFinishReq) (code pb.ErrorCode) {
if req.GroupId == 0 || req.TaskId == 0 { if req.GroupId == 0 || req.TaskId == 0 {
this.module.Error("世界任务完成参数错误", log.Fields{"uid": session.GetUserId(), "params": req})
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
} }
return return
@ -58,12 +60,14 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
userTask.Uid = uid userTask.Uid = uid
} }
// 前置任务ID // 前置任务ID 只有世界任务才校验前置
if curTaskConf.Des == 2 {
if !this.module.modelWorldtask.IsPreFinished(userTask, curTaskConf) { if !this.module.modelWorldtask.IsPreFinished(userTask, curTaskConf) {
this.module.Warnf("前置任务未完成 uid:%v preTaskId:%v taskId:", uid, curTaskConf.Ontxe, curTaskConf.Key) this.module.Debug("前置任务未完成", log.Fields{"uid": uid, "preTaskId": curTaskConf.Ontxe, "taskId": curTaskConf.Key})
code = pb.ErrorCode_WorldtaskLastUnFinished code = pb.ErrorCode_WorldtaskLastUnFinished
return return
} }
}
//判断任务是否已完成 //判断任务是否已完成
for _, t := range userTask.TaskList { for _, t := range userTask.TaskList {
@ -76,16 +80,19 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
var nextTaskId int32 var nextTaskId int32
finishCall := func() { finishCall := func() {
defer func() {
this.module.Debug("世界任务完成", log.Fields{"uid": uid, "params": req})
}()
nextTaskId = curTaskConf.IdAfter nextTaskId = curTaskConf.IdAfter
// 完成任务 // 完成任务
if err := this.module.modelWorldtask.finishTask(req.GroupId, req.TaskId, userTask); err != nil { if err := this.module.modelWorldtask.finishTask(req.GroupId, req.TaskId, userTask); err != nil {
code = pb.ErrorCode_WorldtaskFinish code = pb.ErrorCode_WorldtaskFinish
this.module.Errorf("finishTask err:%v", err) this.module.Error("finishTask", log.Fields{"uid": uid, "groupId": req.GroupId, "taskId": req.TaskId, "err": err.Error()})
return return
} }
// 发奖 // 发奖
if code = this.module.DispenseRes(session, curTaskConf.Reword, true); code != pb.ErrorCode_Success { if code = this.module.DispenseRes(session, curTaskConf.Reword, true); code != pb.ErrorCode_Success {
this.module.Errorf("资源发放失败 err:%v", err) this.module.Error("资源发放", log.Fields{"uid": uid, "groupId": req.GroupId, "taskId": req.TaskId, "reword": curTaskConf.Reword, "code": code})
} }
} }
@ -107,11 +114,13 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
} }
// 任务完成推送 // 任务完成推送
if curTaskConf.Des == 2 {
if err := session.SendMsg(string(this.module.GetType()), WorldtaskNexttaskPush, &pb.WorldtaskNexttaskPush{ if err := session.SendMsg(string(this.module.GetType()), WorldtaskNexttaskPush, &pb.WorldtaskNexttaskPush{
NextTaskId: nextTaskId, NextTaskId: nextTaskId,
}); err != nil { }); err != nil {
code = pb.ErrorCode_SystemError code = pb.ErrorCode_SystemError
} }
}
return return
} }

View File

@ -2,6 +2,7 @@ package worldtask
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -16,6 +17,7 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.WorldtaskMineReq) (
uid := session.GetUserId() uid := session.GetUserId()
myWorldtask, err := this.module.modelWorldtask.getWorldtask(uid) myWorldtask, err := this.module.modelWorldtask.getWorldtask(uid)
if err != nil { if err != nil {
this.module.Error("获取玩家世界任务失败", log.Fields{"uid": uid, "err": err.Error()})
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
return return
} }

View File

@ -31,6 +31,7 @@ func (this *ModelWorldtask) getWorldtask(uid string) (*pb.DBWorldtask, error) {
d := &pb.DBWorldtask{} d := &pb.DBWorldtask{}
if err := this.Get(uid, d); err != nil { if err := this.Get(uid, d); err != nil {
if err != mongo.ErrNoDocuments { if err != mongo.ErrNoDocuments {
log.Error("getWorldtask", log.Fields{"uid": uid})
return d, err return d, err
} }
} }
@ -38,6 +39,7 @@ func (this *ModelWorldtask) getWorldtask(uid string) (*pb.DBWorldtask, error) {
} }
//判断前置任务是否完成 //判断前置任务是否完成
// true 已完成 false未完成
func (this *ModelWorldtask) IsPreFinished(userTask *pb.DBWorldtask, curTaskConf *cfg.GameWorldTaskData) bool { func (this *ModelWorldtask) IsPreFinished(userTask *pb.DBWorldtask, curTaskConf *cfg.GameWorldTaskData) bool {
var ( var (
lastTaskId int32 lastTaskId int32
@ -94,7 +96,7 @@ func (this *ModelWorldtask) finishTask(groupId, taskId int32, task *pb.DBWorldta
if module, err := this.service.GetModule(comm.ModuleLinestory); err == nil { if module, err := this.service.GetModule(comm.ModuleLinestory); err == nil {
if iLinestory, ok := module.(comm.ILinestory); ok { if iLinestory, ok := module.(comm.ILinestory); ok {
if err := iLinestory.TaskFinishNotify(task.Uid, taskId, groupId); err != nil { if err := iLinestory.TaskFinishNotify(task.Uid, taskId, groupId); err != nil {
log.Errorf("任务完成通知失败 groupId:%v taskId:%v err:%v", groupId, taskId, err) log.Error("世界任务完成通知支线剧情任务", log.Fields{"uid": task.Uid, "groupId": groupId, "taskId": taskId, "err": err.Error()})
} }
} }
} }

View File

@ -1,7 +1,6 @@
package worldtask package worldtask
import ( import (
"errors"
"fmt" "fmt"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/base" "go_dreamfactory/lego/base"
@ -9,6 +8,7 @@ import (
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
) )
var _ comm.IWorldtask = (*Worldtask)(nil) var _ comm.IWorldtask = (*Worldtask)(nil)
@ -19,6 +19,7 @@ type Worldtask struct {
service base.IRPCXService service base.IRPCXService
configure *configureComp configure *configureComp
modelWorldtask *ModelWorldtask modelWorldtask *ModelWorldtask
worldtaskConf *cfg.GameWorldTask
} }
func NewModule() core.IModule { func NewModule() core.IModule {
@ -35,90 +36,106 @@ func (this *Worldtask) OnInstallComp() {
this.api = this.RegisterComp(new(apiComp)).(*apiComp) this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelWorldtask = this.RegisterComp(new(ModelWorldtask)).(*ModelWorldtask) this.modelWorldtask = this.RegisterComp(new(ModelWorldtask)).(*ModelWorldtask)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp) this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
} }
func (this *Worldtask) GetType() core.M_Modules { func (this *Worldtask) GetType() core.M_Modules {
return comm.ModuleWorldtask return comm.ModuleWorldtask
} }
func (this *Worldtask) Start() (err error) {
err = this.ModuleBase.Start()
if this.worldtaskConf, err = this.configure.getWorldtaskCfg(); err != nil {
return err
}
return
}
// 任务条件达成通知 // 任务条件达成通知
func (this *Worldtask) TaskcondNotify(session comm.IUserSession, condId int32) error { func (this *Worldtask) TaskcondNotify(session comm.IUserSession, condId int32) error {
uid := session.GetUserId() uid := session.GetUserId()
conf, err := this.configure.getWorldtaskCfg()
if err != nil || conf == nil {
return err
}
finishedTaskIds := make(map[int32]int32) //达成的任务条件 finishedTaskIds := make(map[int32]int32) //达成的任务条件
for _, c := range conf.GetDataList() { for _, c := range this.worldtaskConf.GetDataList() {
if c.Completetask == condId && c.Completetask != 0 { if c.Completetask != 0 && c.Completetask == condId {
finishedTaskIds[c.Group] = c.Key finishedTaskIds[c.Group] = c.Key
} }
} }
if len(finishedTaskIds) == 0 { if len(finishedTaskIds) == 0 {
this.Debug("没有匹配到任务世界任务", log.Fields{"uid": uid, "condId": condId})
return nil return nil
} }
log.Debug("世界任务完成通知-查找到世界任务", log.Fields{"uid": uid, "condId": condId, "params": finishedTaskIds})
//下一个任务ID //下一个任务ID
var nextTaskId int32 var nextTaskId int32
// 获取用户信息 // 获取用户信息
user := this.ModuleUser.GetUser(uid) user := this.ModuleUser.GetUser(uid)
if user == nil { if user == nil {
return fmt.Errorf("玩家uid:%v not found", uid) return comm.NewCustomError(pb.ErrorCode_UserSessionNobeing)
} }
// 玩家世界任务 // 玩家世界任务
userTask, err := this.modelWorldtask.getWorldtask(uid) userTask, err := this.modelWorldtask.getWorldtask(uid)
if err != nil { if err != nil {
this.Error("获取玩家世界任务", log.Fields{"uid": uid, "condId": condId})
return err return err
} }
if userTask.Uid != "" { if userTask.Uid != "" {
//查找任务ID根据condId 可能会找出不同的任务 //查找任务ID根据condId 可能会找出不同的任务
for k, id := range finishedTaskIds { for groupId, taskId := range finishedTaskIds {
logFields := log.Fields{"uid": uid, "group": groupId, "taskId": taskId, "condId": condId}
// 判断任务是否已完成 // 判断任务是否已完成
if this.modelWorldtask.isFinished(id, userTask.TaskList) { if this.modelWorldtask.isFinished(taskId, userTask.TaskList) {
this.Debug("世界任务已完成", logFields)
continue continue
} }
taskConf, err := this.configure.getWorldtaskById(id) taskConf, err := this.configure.getWorldtaskById(taskId)
if err != nil { if err != nil {
return err return err
} }
if taskConf != nil { if taskConf != nil {
if taskConf.Des == 2 { //只有世界任务才校验前置
if !this.modelWorldtask.IsPreFinished(userTask, taskConf) { if !this.modelWorldtask.IsPreFinished(userTask, taskConf) {
this.Errorf("世界任务已完成 uid:%v 要求taskid:%v", uid, id) this.Debug("世界任务前置任务未完成", logFields)
continue continue
} }
}
nextTaskId = taskConf.IdAfter nextTaskId = taskConf.IdAfter
// 判断玩家等级要求 // 判断玩家等级要求
if user.Lv < taskConf.Lock { if user.Lv < taskConf.Lock {
this.Errorf("等级不满足 uid:%v 要求lv:%v", uid, taskConf.Lock) logFields["当前lv"] = user.Lv
logFields["期望等级"] = taskConf.Lock
this.Debug("等级不满足", logFields)
return comm.NewCustomError(pb.ErrorCode_WorldtaskLvNotEnough) return comm.NewCustomError(pb.ErrorCode_WorldtaskLvNotEnough)
} }
//完成任务 //完成任务
if err := this.modelWorldtask.finishTask(k, id, userTask); err != nil { if err := this.modelWorldtask.finishTask(groupId, taskId, userTask); err != nil {
this.Errorf("世界任务完成失败 err:%v", err) logFields["err"] = err.Error()
this.Error("世界任务完成", logFields)
return err return err
} }
this.Debugf("任务条件达成完成 condId:%v group:%v taskId:%d", condId, k, id) this.Debug("任务条件达成完成", logFields)
//发奖 //发奖
if code := this.DispenseRes(session, taskConf.Reword, true); code != pb.ErrorCode_Success { if code := this.DispenseRes(session, taskConf.Reword, true); code != pb.ErrorCode_Success {
this.Errorf("资源发放失败 err:%v", err) logFields["reward"] = taskConf.Reword
logFields["code"] = code
this.Error("资源发放", logFields)
} }
if nextTaskId != 0 { if nextTaskId != 0 && taskConf.Des == 2 {
if err := session.SendMsg(string(this.GetType()), "nexttask", &pb.WorldtaskNexttaskPush{ if err := session.SendMsg(string(this.GetType()), "nexttask", &pb.WorldtaskNexttaskPush{
NextTaskId: nextTaskId, NextTaskId: nextTaskId,
}); err != nil { }); err != nil {
log.Errorf("任务条件达成推送失败 err:%v", err) logFields["err"] = err.Error()
log.Error("任务条件达成推送", logFields)
} }
} else { } else {
this.Debugf("已经是最后一个任务了 taskId:%v", taskConf.Key) this.Debug("已经是最后一个任务了", logFields)
} }
} }
@ -133,7 +150,8 @@ func (this *Worldtask) TaskcondNotify(session comm.IUserSession, condId int32) e
func (this *Worldtask) GetMyWorldtask(uid string) *pb.DBWorldtask { func (this *Worldtask) GetMyWorldtask(uid string) *pb.DBWorldtask {
wt, err := this.modelWorldtask.getWorldtask(uid) wt, err := this.modelWorldtask.getWorldtask(uid)
if err != nil { if err != nil {
log.Errorf("GetMyWorldtask err:%v", err) log.Errorln(err.Error())
return nil
} }
return wt return wt
} }
@ -148,13 +166,8 @@ func (this *Worldtask) BingoJumpTask(session comm.IUserSession, groupId, taskId
// 更新数据 // 更新数据
update := map[string]interface{}{} update := map[string]interface{}{}
conf, err := this.configure.getWorldtaskCfg() taskConf := this.worldtaskConf.GetDataMap()[taskId]
if err != nil || conf == nil { if taskConf == nil {
return errors.New("config is nil")
}
taskConf, err := this.configure.getWorldtaskById(taskId)
if err != nil || taskConf == nil {
return fmt.Errorf("taskId: %v config is nil", taskId) return fmt.Errorf("taskId: %v config is nil", taskId)
} }
@ -166,7 +179,7 @@ func (this *Worldtask) BingoJumpTask(session comm.IUserSession, groupId, taskId
//遍历 //遍历
if taskConf.Ontxe != 0 && taskConf.IdAfter != 0 { if taskConf.Ontxe != 0 && taskConf.IdAfter != 0 {
for _, v := range conf.GetDataList() { for _, v := range this.worldtaskConf.GetDataList() {
if v.Group == groupId && v.Key <= taskId { if v.Group == groupId && v.Key <= taskId {
mytask.LastTaskIds[groupId] = v.Key mytask.LastTaskIds[groupId] = v.Key
mytask.TaskList = append(mytask.TaskList, &pb.Worldtask{ mytask.TaskList = append(mytask.TaskList, &pb.Worldtask{
@ -188,12 +201,13 @@ func (this *Worldtask) BingoJumpTask(session comm.IUserSession, groupId, taskId
"taskList": mytask.TaskList, "taskList": mytask.TaskList,
} }
this.modelWorldtask.Change(uid, update) if err := this.modelWorldtask.Change(uid, update); err != nil {
return err
}
rsp := &pb.WorldtaskFinishIdsPush{ rsp := &pb.WorldtaskFinishIdsPush{
TaskList: mytask.TaskList, TaskList: mytask.TaskList,
} }
session.SendMsg(string(this.GetType()), "finishIds", rsp) return session.SendMsg(string(this.GetType()), "finishIds", rsp)
return nil
} }

View File

@ -186,6 +186,7 @@ const (
ErrorCode_LinestoryNoReceive ErrorCode = 2602 //章节奖励不能领取 ErrorCode_LinestoryNoReceive ErrorCode = 2602 //章节奖励不能领取
ErrorCode_LinestoryTaskDisabledEnter ErrorCode = 2603 //禁止进入 ErrorCode_LinestoryTaskDisabledEnter ErrorCode = 2603 //禁止进入
ErrorCode_LinestoryChapterNoOpen ErrorCode = 2604 //章节未开启 ErrorCode_LinestoryChapterNoOpen ErrorCode = 2604 //章节未开启
ErrorCode_LinestoryPreNoComplete ErrorCode = 2605 //前置任务未完成
// hunting // hunting
ErrorCode_HuntingLvErr ErrorCode = 2701 // 关卡难度不匹配 ErrorCode_HuntingLvErr ErrorCode = 2701 // 关卡难度不匹配
ErrorCode_HuntingBoosType ErrorCode = 2702 // BOSS 类型不对 ErrorCode_HuntingBoosType ErrorCode = 2702 // BOSS 类型不对
@ -203,18 +204,18 @@ const (
ErrorCode_SociatyNoFound ErrorCode = 3000 //公会不存在 ErrorCode_SociatyNoFound ErrorCode = 3000 //公会不存在
ErrorCode_SociatyAdded ErrorCode = 3001 //已在公会里 ErrorCode_SociatyAdded ErrorCode = 3001 //已在公会里
ErrorCode_SociatyDiamondNoEnough ErrorCode = 3002 //钻石不足 ErrorCode_SociatyDiamondNoEnough ErrorCode = 3002 //钻石不足
ErrorCode_SociatyApply ErrorCode = 3003 //申请失败 ErrorCode_SociatyNoMember ErrorCode = 3003 //不是公会成员
ErrorCode_SociatyNoRight ErrorCode = 3004 //无权限 ErrorCode_SociatyNoRight ErrorCode = 3004 //无权限
ErrorCode_SociatyNoAdded ErrorCode = 3005 //未加入公会 ErrorCode_SociatyNoAdded ErrorCode = 3005 //未加入公会
ErrorCode_SociatyDismiss ErrorCode = 3006 //解散失败 ErrorCode_SociatyDismiss ErrorCode = 3006 //解散失败
ErrorCode_SociatyQuit ErrorCode = 3007 //退会失败 ErrorCode_SociatyQuit ErrorCode = 3007 //退会失败
ErrorCode_SociatyAgree ErrorCode = 3008 //申请-同意失败 ErrorCode_SociatyAgree ErrorCode = 3008 //申请-同意失败
ErrorCode_SociatyRefuse ErrorCode = 3009 //申请-拒绝失败 ErrorCode_SociatyRefuse ErrorCode = 3009 //申请-拒绝失败
ErrorCode_SociatyAssign ErrorCode = 30010 //公会转让失败 ErrorCode_SociatyLogParams ErrorCode = 30010 //公会日志参数错误
ErrorCode_SociatyDischarge ErrorCode = 30011 //踢出失败 ErrorCode_SociatyMasterNoDiss ErrorCode = 30011 //会长不能被踢出
ErrorCode_SociatySettingJob ErrorCode = 30012 //设置职位失败 ErrorCode_SociatySettingJob ErrorCode = 30012 //设置职位失败
ErrorCode_SociatySetting ErrorCode = 30013 //公会修改失败 ErrorCode_SociatySetting ErrorCode = 30013 //公会修改失败
ErrorCode_SociatyAccuse ErrorCode = 30014 //弹劾失败 ErrorCode_SociatyNoAccuse ErrorCode = 30014 //无需弹劾
ErrorCode_SociatySign ErrorCode = 30015 //签到失败 ErrorCode_SociatySign ErrorCode = 30015 //签到失败
ErrorCode_SociatySigned ErrorCode = 30016 //已签到 ErrorCode_SociatySigned ErrorCode = 30016 //已签到
ErrorCode_SociatyCDLimit ErrorCode = 30017 // CD时间限制 ErrorCode_SociatyCDLimit ErrorCode = 30017 // CD时间限制
@ -224,7 +225,6 @@ const (
ErrorCode_SociatyRewardReceived ErrorCode = 30021 //奖励已领取 ErrorCode_SociatyRewardReceived ErrorCode = 30021 //奖励已领取
ErrorCode_SociatyRewardReceive ErrorCode = 30022 //奖励领取失败 ErrorCode_SociatyRewardReceive ErrorCode = 30022 //奖励领取失败
ErrorCode_SociatyResource ErrorCode = 30023 //更新公会资源失败 ErrorCode_SociatyResource ErrorCode = 30023 //更新公会资源失败
ErrorCode_SociatyApplyCanel ErrorCode = 30024 //申请撤销失败
ErrorCode_SociatyBelongTo ErrorCode = 30025 //已是公会成员 ErrorCode_SociatyBelongTo ErrorCode = 30025 //已是公会成员
ErrorCode_SociatyApplied ErrorCode = 30026 //已申请 ErrorCode_SociatyApplied ErrorCode = 30026 //已申请
ErrorCode_SociatyAppyLvNoEnough ErrorCode = 30027 //申请等级不满足 ErrorCode_SociatyAppyLvNoEnough ErrorCode = 30027 //申请等级不满足
@ -234,6 +234,7 @@ const (
ErrorCode_SociatyDismissed ErrorCode = 30031 //公会已解散 ErrorCode_SociatyDismissed ErrorCode = 30031 //公会已解散
ErrorCode_SociatyNameExist ErrorCode = 30032 //公会名存在 ErrorCode_SociatyNameExist ErrorCode = 30032 //公会名存在
ErrorCode_SociatyQuitNoAllowed ErrorCode = 30033 //会长不允许退公会 ErrorCode_SociatyQuitNoAllowed ErrorCode = 30033 //会长不允许退公会
ErrorCode_SociatyNoMaster ErrorCode = 30034 //无会长
// arena // arena
ErrorCode_ArenaTicketBuyUp ErrorCode = 3101 //票据上限 ErrorCode_ArenaTicketBuyUp ErrorCode = 3101 //票据上限
ErrorCode_ArenaTicketNotEnough ErrorCode = 3102 //票据不足 ErrorCode_ArenaTicketNotEnough ErrorCode = 3102 //票据不足
@ -422,6 +423,7 @@ var (
2602: "LinestoryNoReceive", 2602: "LinestoryNoReceive",
2603: "LinestoryTaskDisabledEnter", 2603: "LinestoryTaskDisabledEnter",
2604: "LinestoryChapterNoOpen", 2604: "LinestoryChapterNoOpen",
2605: "LinestoryPreNoComplete",
2701: "HuntingLvErr", 2701: "HuntingLvErr",
2702: "HuntingBoosType", 2702: "HuntingBoosType",
2703: "HuntingBuyMaxCount", 2703: "HuntingBuyMaxCount",
@ -435,18 +437,18 @@ var (
3000: "SociatyNoFound", 3000: "SociatyNoFound",
3001: "SociatyAdded", 3001: "SociatyAdded",
3002: "SociatyDiamondNoEnough", 3002: "SociatyDiamondNoEnough",
3003: "SociatyApply", 3003: "SociatyNoMember",
3004: "SociatyNoRight", 3004: "SociatyNoRight",
3005: "SociatyNoAdded", 3005: "SociatyNoAdded",
3006: "SociatyDismiss", 3006: "SociatyDismiss",
3007: "SociatyQuit", 3007: "SociatyQuit",
3008: "SociatyAgree", 3008: "SociatyAgree",
3009: "SociatyRefuse", 3009: "SociatyRefuse",
30010: "SociatyAssign", 30010: "SociatyLogParams",
30011: "SociatyDischarge", 30011: "SociatyMasterNoDiss",
30012: "SociatySettingJob", 30012: "SociatySettingJob",
30013: "SociatySetting", 30013: "SociatySetting",
30014: "SociatyAccuse", 30014: "SociatyNoAccuse",
30015: "SociatySign", 30015: "SociatySign",
30016: "SociatySigned", 30016: "SociatySigned",
30017: "SociatyCDLimit", 30017: "SociatyCDLimit",
@ -456,7 +458,6 @@ var (
30021: "SociatyRewardReceived", 30021: "SociatyRewardReceived",
30022: "SociatyRewardReceive", 30022: "SociatyRewardReceive",
30023: "SociatyResource", 30023: "SociatyResource",
30024: "SociatyApplyCanel",
30025: "SociatyBelongTo", 30025: "SociatyBelongTo",
30026: "SociatyApplied", 30026: "SociatyApplied",
30027: "SociatyAppyLvNoEnough", 30027: "SociatyAppyLvNoEnough",
@ -466,6 +467,7 @@ var (
30031: "SociatyDismissed", 30031: "SociatyDismissed",
30032: "SociatyNameExist", 30032: "SociatyNameExist",
30033: "SociatyQuitNoAllowed", 30033: "SociatyQuitNoAllowed",
30034: "SociatyNoMaster",
3101: "ArenaTicketBuyUp", 3101: "ArenaTicketBuyUp",
3102: "ArenaTicketNotEnough", 3102: "ArenaTicketNotEnough",
3103: "ArenaTicketNpcInCd", 3103: "ArenaTicketNpcInCd",
@ -642,6 +644,7 @@ var (
"LinestoryNoReceive": 2602, "LinestoryNoReceive": 2602,
"LinestoryTaskDisabledEnter": 2603, "LinestoryTaskDisabledEnter": 2603,
"LinestoryChapterNoOpen": 2604, "LinestoryChapterNoOpen": 2604,
"LinestoryPreNoComplete": 2605,
"HuntingLvErr": 2701, "HuntingLvErr": 2701,
"HuntingBoosType": 2702, "HuntingBoosType": 2702,
"HuntingBuyMaxCount": 2703, "HuntingBuyMaxCount": 2703,
@ -655,18 +658,18 @@ var (
"SociatyNoFound": 3000, "SociatyNoFound": 3000,
"SociatyAdded": 3001, "SociatyAdded": 3001,
"SociatyDiamondNoEnough": 3002, "SociatyDiamondNoEnough": 3002,
"SociatyApply": 3003, "SociatyNoMember": 3003,
"SociatyNoRight": 3004, "SociatyNoRight": 3004,
"SociatyNoAdded": 3005, "SociatyNoAdded": 3005,
"SociatyDismiss": 3006, "SociatyDismiss": 3006,
"SociatyQuit": 3007, "SociatyQuit": 3007,
"SociatyAgree": 3008, "SociatyAgree": 3008,
"SociatyRefuse": 3009, "SociatyRefuse": 3009,
"SociatyAssign": 30010, "SociatyLogParams": 30010,
"SociatyDischarge": 30011, "SociatyMasterNoDiss": 30011,
"SociatySettingJob": 30012, "SociatySettingJob": 30012,
"SociatySetting": 30013, "SociatySetting": 30013,
"SociatyAccuse": 30014, "SociatyNoAccuse": 30014,
"SociatySign": 30015, "SociatySign": 30015,
"SociatySigned": 30016, "SociatySigned": 30016,
"SociatyCDLimit": 30017, "SociatyCDLimit": 30017,
@ -676,7 +679,6 @@ var (
"SociatyRewardReceived": 30021, "SociatyRewardReceived": 30021,
"SociatyRewardReceive": 30022, "SociatyRewardReceive": 30022,
"SociatyResource": 30023, "SociatyResource": 30023,
"SociatyApplyCanel": 30024,
"SociatyBelongTo": 30025, "SociatyBelongTo": 30025,
"SociatyApplied": 30026, "SociatyApplied": 30026,
"SociatyAppyLvNoEnough": 30027, "SociatyAppyLvNoEnough": 30027,
@ -686,6 +688,7 @@ var (
"SociatyDismissed": 30031, "SociatyDismissed": 30031,
"SociatyNameExist": 30032, "SociatyNameExist": 30032,
"SociatyQuitNoAllowed": 30033, "SociatyQuitNoAllowed": 30033,
"SociatyNoMaster": 30034,
"ArenaTicketBuyUp": 3101, "ArenaTicketBuyUp": 3101,
"ArenaTicketNotEnough": 3102, "ArenaTicketNotEnough": 3102,
"ArenaTicketNpcInCd": 3103, "ArenaTicketNpcInCd": 3103,
@ -747,7 +750,7 @@ var File_errorcode_proto protoreflect.FileDescriptor
var file_errorcode_proto_rawDesc = []byte{ var file_errorcode_proto_rawDesc = []byte{
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2a, 0xe7, 0x26, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x6f, 0x2a, 0x8d, 0x27, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12,
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
@ -951,114 +954,117 @@ var file_errorcode_proto_rawDesc = []byte{
0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c,
0x65, 0x64, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x10, 0xab, 0x14, 0x12, 0x1b, 0x0a, 0x16, 0x4c, 0x69, 0x65, 0x64, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x10, 0xab, 0x14, 0x12, 0x1b, 0x0a, 0x16, 0x4c, 0x69,
0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x4e, 0x6f,
0x4f, 0x70, 0x65, 0x6e, 0x10, 0xac, 0x14, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x4f, 0x70, 0x65, 0x6e, 0x10, 0xac, 0x14, 0x12, 0x1b, 0x0a, 0x16, 0x4c, 0x69, 0x6e, 0x65, 0x73,
0x6e, 0x67, 0x4c, 0x76, 0x45, 0x72, 0x72, 0x10, 0x8d, 0x15, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x75, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, 0x65, 0x4e, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74,
0x6e, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x10, 0x8e, 0x15, 0x65, 0x10, 0xad, 0x14, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x4c,
0x12, 0x17, 0x0a, 0x12, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x4d, 0x61, 0x76, 0x45, 0x72, 0x72, 0x10, 0x8d, 0x15, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x75, 0x6e, 0x74, 0x69,
0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0x8f, 0x15, 0x12, 0x1d, 0x0a, 0x18, 0x48, 0x75, 0x6e, 0x6e, 0x67, 0x42, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x10, 0x8e, 0x15, 0x12, 0x17, 0x0a,
0x74, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x78, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x12, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x4d, 0x61, 0x78, 0x43, 0x6f,
0x43, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0x90, 0x15, 0x12, 0x11, 0x0a, 0x0c, 0x4c, 0x69, 0x62, 0x72, 0x75, 0x6e, 0x74, 0x10, 0x8f, 0x15, 0x12, 0x1d, 0x0a, 0x18, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e,
0x61, 0x72, 0x79, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0xf1, 0x15, 0x12, 0x12, 0x0a, 0x0d, 0x4c, 0x67, 0x4d, 0x61, 0x78, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x75,
0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4e, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x10, 0xf2, 0x15, 0x12, 0x6e, 0x74, 0x10, 0x90, 0x15, 0x12, 0x11, 0x0a, 0x0c, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79,
0x16, 0x0a, 0x11, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0xf1, 0x15, 0x12, 0x12, 0x0a, 0x0d, 0x4c, 0x69, 0x62, 0x72,
0x74, 0x69, 0x6f, 0x6e, 0x10, 0xf3, 0x15, 0x12, 0x12, 0x0a, 0x0d, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x61, 0x72, 0x79, 0x4e, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x10, 0xf2, 0x15, 0x12, 0x16, 0x0a, 0x11,
0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xf4, 0x15, 0x12, 0x14, 0x0a, 0x0f, 0x4c, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f,
0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x76, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xf5, 0x6e, 0x10, 0xf3, 0x15, 0x12, 0x12, 0x0a, 0x0d, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52,
0x15, 0x12, 0x1b, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xf4, 0x15, 0x12, 0x14, 0x0a, 0x0f, 0x4c, 0x69, 0x62, 0x72,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0xd5, 0x16, 0x12, 0x13, 0x61, 0x72, 0x79, 0x4c, 0x76, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xf5, 0x15, 0x12, 0x1b,
0x0a, 0x0e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4e, 0x6f, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69,
0x10, 0xb8, 0x17, 0x12, 0x11, 0x0a, 0x0c, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x64, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0xd5, 0x16, 0x12, 0x13, 0x0a, 0x0e, 0x53,
0x64, 0x65, 0x64, 0x10, 0xb9, 0x17, 0x12, 0x1b, 0x0a, 0x16, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4e, 0x6f, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xb8, 0x17,
0x79, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x12, 0x11, 0x0a, 0x0c, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x64, 0x64, 0x65, 0x64,
0x10, 0xba, 0x17, 0x12, 0x11, 0x0a, 0x0c, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x70, 0x10, 0xb9, 0x17, 0x12, 0x1b, 0x0a, 0x16, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x44, 0x69,
0x70, 0x6c, 0x79, 0x10, 0xbb, 0x17, 0x12, 0x13, 0x0a, 0x0e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xba, 0x17,
0x12, 0x14, 0x0a, 0x0f, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4e, 0x6f, 0x4d, 0x65, 0x6d,
0x62, 0x65, 0x72, 0x10, 0xbb, 0x17, 0x12, 0x13, 0x0a, 0x0e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74,
0x79, 0x4e, 0x6f, 0x52, 0x69, 0x67, 0x68, 0x74, 0x10, 0xbc, 0x17, 0x12, 0x13, 0x0a, 0x0e, 0x53, 0x79, 0x4e, 0x6f, 0x52, 0x69, 0x67, 0x68, 0x74, 0x10, 0xbc, 0x17, 0x12, 0x13, 0x0a, 0x0e, 0x53,
0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4e, 0x6f, 0x41, 0x64, 0x64, 0x65, 0x64, 0x10, 0xbd, 0x17, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4e, 0x6f, 0x41, 0x64, 0x64, 0x65, 0x64, 0x10, 0xbd, 0x17,
0x12, 0x13, 0x0a, 0x0e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x44, 0x69, 0x73, 0x6d, 0x69, 0x12, 0x13, 0x0a, 0x0e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x44, 0x69, 0x73, 0x6d, 0x69,
0x73, 0x73, 0x10, 0xbe, 0x17, 0x12, 0x10, 0x0a, 0x0b, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x73, 0x73, 0x10, 0xbe, 0x17, 0x12, 0x10, 0x0a, 0x0b, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79,
0x51, 0x75, 0x69, 0x74, 0x10, 0xbf, 0x17, 0x12, 0x11, 0x0a, 0x0c, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x51, 0x75, 0x69, 0x74, 0x10, 0xbf, 0x17, 0x12, 0x11, 0x0a, 0x0c, 0x53, 0x6f, 0x63, 0x69, 0x61,
0x74, 0x79, 0x41, 0x67, 0x72, 0x65, 0x65, 0x10, 0xc0, 0x17, 0x12, 0x12, 0x0a, 0x0d, 0x53, 0x6f, 0x74, 0x79, 0x41, 0x67, 0x72, 0x65, 0x65, 0x10, 0xc0, 0x17, 0x12, 0x12, 0x0a, 0x0d, 0x53, 0x6f,
0x63, 0x69, 0x61, 0x74, 0x79, 0x52, 0x65, 0x66, 0x75, 0x73, 0x65, 0x10, 0xc1, 0x17, 0x12, 0x13, 0x63, 0x69, 0x61, 0x74, 0x79, 0x52, 0x65, 0x66, 0x75, 0x73, 0x65, 0x10, 0xc1, 0x17, 0x12, 0x16,
0x0a, 0x0d, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x10, 0x0a, 0x10, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4c, 0x6f, 0x67, 0x50, 0x61, 0x72, 0x61,
0xba, 0xea, 0x01, 0x12, 0x16, 0x0a, 0x10, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x44, 0x69, 0x6d, 0x73, 0x10, 0xba, 0xea, 0x01, 0x12, 0x19, 0x0a, 0x13, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74,
0x73, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x10, 0xbb, 0xea, 0x01, 0x12, 0x17, 0x0a, 0x11, 0x53, 0x79, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x44, 0x69, 0x73, 0x73, 0x10, 0xbb, 0xea,
0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x4a, 0x6f, 0x62, 0x01, 0x12, 0x17, 0x0a, 0x11, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74,
0x10, 0xbc, 0xea, 0x01, 0x12, 0x14, 0x0a, 0x0e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x53, 0x69, 0x6e, 0x67, 0x4a, 0x6f, 0x62, 0x10, 0xbc, 0xea, 0x01, 0x12, 0x14, 0x0a, 0x0e, 0x53, 0x6f,
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x10, 0xbd, 0xea, 0x01, 0x12, 0x13, 0x0a, 0x0d, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x10, 0xbd, 0xea, 0x01,
0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x63, 0x63, 0x75, 0x73, 0x65, 0x10, 0xbe, 0xea, 0x01, 0x12, 0x12, 0x15, 0x0a, 0x0f, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4e, 0x6f, 0x41, 0x63, 0x63,
0x11, 0x0a, 0x0b, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x10, 0xbf, 0x75, 0x73, 0x65, 0x10, 0xbe, 0xea, 0x01, 0x12, 0x11, 0x0a, 0x0b, 0x53, 0x6f, 0x63, 0x69, 0x61,
0xea, 0x01, 0x12, 0x13, 0x0a, 0x0d, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x53, 0x69, 0x67, 0x74, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x10, 0xbf, 0xea, 0x01, 0x12, 0x13, 0x0a, 0x0d, 0x53, 0x6f,
0x6e, 0x65, 0x64, 0x10, 0xc0, 0xea, 0x01, 0x12, 0x14, 0x0a, 0x0e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x63, 0x69, 0x61, 0x74, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x10, 0xc0, 0xea, 0x01, 0x12,
0x74, 0x79, 0x43, 0x44, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0xc1, 0xea, 0x01, 0x12, 0x15, 0x0a, 0x14, 0x0a, 0x0e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x43, 0x44, 0x4c, 0x69, 0x6d, 0x69,
0x0f, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4d, 0x61, 0x78, 0x74, 0x10, 0xc1, 0xea, 0x01, 0x12, 0x15, 0x0a, 0x0f, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79,
0x10, 0xc2, 0xea, 0x01, 0x12, 0x18, 0x0a, 0x12, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x53, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4d, 0x61, 0x78, 0x10, 0xc2, 0xea, 0x01, 0x12, 0x18, 0x0a, 0x12,
0x65, 0x6c, 0x66, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x10, 0xc3, 0xea, 0x01, 0x12, 0x1d, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x53, 0x65, 0x6c, 0x66, 0x53, 0x65, 0x74, 0x74, 0x69,
0x0a, 0x17, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x43, 0x6e, 0x67, 0x10, 0xc3, 0xea, 0x01, 0x12, 0x1d, 0x0a, 0x17, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74,
0x6f, 0x75, 0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0xc4, 0xea, 0x01, 0x12, 0x1b, 0x0a, 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x4c, 0x69, 0x6d, 0x69,
0x15, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x74, 0x10, 0xc4, 0xea, 0x01, 0x12, 0x1b, 0x0a, 0x15, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79,
0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xc5, 0xea, 0x01, 0x12, 0x1a, 0x0a, 0x14, 0x53, 0x6f, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xc5,
0x63, 0x69, 0x61, 0x74, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x63, 0x65, 0x69, 0xea, 0x01, 0x12, 0x1a, 0x0a, 0x14, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x52, 0x65, 0x77,
0x76, 0x65, 0x10, 0xc6, 0xea, 0x01, 0x12, 0x15, 0x0a, 0x0f, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x61, 0x72, 0x64, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x10, 0xc6, 0xea, 0x01, 0x12, 0x15,
0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x10, 0xc7, 0xea, 0x01, 0x12, 0x17, 0x0a, 0x0a, 0x0f, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x11, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x43, 0x61, 0x6e, 0x65, 0x10, 0xc7, 0xea, 0x01, 0x12, 0x15, 0x0a, 0x0f, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79,
0x65, 0x6c, 0x10, 0xc8, 0xea, 0x01, 0x12, 0x15, 0x0a, 0x0f, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x42, 0x65, 0x6c, 0x6f, 0x6e, 0x67, 0x54, 0x6f, 0x10, 0xc9, 0xea, 0x01, 0x12, 0x14, 0x0a, 0x0e,
0x79, 0x42, 0x65, 0x6c, 0x6f, 0x6e, 0x67, 0x54, 0x6f, 0x10, 0xc9, 0xea, 0x01, 0x12, 0x14, 0x0a, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x10, 0xca,
0x0e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x10, 0xea, 0x01, 0x12, 0x1b, 0x0a, 0x15, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x70, 0x70,
0xca, 0xea, 0x01, 0x12, 0x1b, 0x0a, 0x15, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x70, 0x79, 0x4c, 0x76, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xcb, 0xea, 0x01, 0x12,
0x70, 0x79, 0x4c, 0x76, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xcb, 0xea, 0x01, 0x1b, 0x0a, 0x15, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x56, 0x61,
0x12, 0x1b, 0x0a, 0x15, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x56, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0xcc, 0xea, 0x01, 0x12, 0x1d, 0x0a, 0x17,
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0xcc, 0xea, 0x01, 0x12, 0x1d, 0x0a, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4e,
0x17, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xcd, 0xea, 0x01, 0x12, 0x1c, 0x0a, 0x16, 0x53,
0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xcd, 0xea, 0x01, 0x12, 0x1c, 0x0a, 0x16, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x63, 0x69, 0x74, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65,
0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x63, 0x69, 0x74, 0x76, 0x69, 0x74, 0x79, 0x52, 0x63, 0x65, 0x69, 0x76, 0x65, 0x10, 0xce, 0xea, 0x01, 0x12, 0x16, 0x0a, 0x10, 0x53, 0x6f, 0x63,
0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x10, 0xce, 0xea, 0x01, 0x12, 0x16, 0x0a, 0x10, 0x53, 0x6f, 0x69, 0x61, 0x74, 0x79, 0x44, 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x65, 0x64, 0x10, 0xcf, 0xea,
0x63, 0x69, 0x61, 0x74, 0x79, 0x44, 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x65, 0x64, 0x10, 0xcf, 0x01, 0x12, 0x16, 0x0a, 0x10, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65,
0xea, 0x01, 0x12, 0x16, 0x0a, 0x10, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0xd0, 0xea, 0x01, 0x12, 0x1a, 0x0a, 0x14, 0x53, 0x6f, 0x63,
0x65, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0xd0, 0xea, 0x01, 0x12, 0x1a, 0x0a, 0x14, 0x53, 0x6f, 0x69, 0x61, 0x74, 0x79, 0x51, 0x75, 0x69, 0x74, 0x4e, 0x6f, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65,
0x63, 0x69, 0x61, 0x74, 0x79, 0x51, 0x75, 0x69, 0x74, 0x4e, 0x6f, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x64, 0x10, 0xd1, 0xea, 0x01, 0x12, 0x15, 0x0a, 0x0f, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79,
0x65, 0x64, 0x10, 0xd1, 0xea, 0x01, 0x12, 0x15, 0x0a, 0x10, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x54, 0x4e, 0x6f, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x10, 0xd2, 0xea, 0x01, 0x12, 0x15, 0x0a, 0x10,
0x69, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x75, 0x79, 0x55, 0x70, 0x10, 0x9d, 0x18, 0x12, 0x19, 0x0a, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x75, 0x79, 0x55, 0x70,
0x14, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x45, 0x10, 0x9d, 0x18, 0x12, 0x19, 0x0a, 0x14, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x54, 0x69, 0x63, 0x6b,
0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x9e, 0x18, 0x12, 0x17, 0x0a, 0x12, 0x41, 0x72, 0x65, 0x6e, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x9e, 0x18, 0x12, 0x17,
0x61, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x70, 0x63, 0x49, 0x6e, 0x43, 0x64, 0x10, 0x9f, 0x0a, 0x12, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x70, 0x63,
0x18, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x65, 0x61, 0x49, 0x6e, 0x43, 0x64, 0x10, 0x9f, 0x18, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x6c, 0x65, 0x6e,
0x74, 0x4c, 0x65, 0x61, 0x72, 0x6e, 0x10, 0x81, 0x19, 0x12, 0x12, 0x0a, 0x0d, 0x54, 0x61, 0x6c, 0x74, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x4c, 0x65, 0x61, 0x72, 0x6e, 0x10, 0x81, 0x19, 0x12,
0x65, 0x6e, 0x74, 0x45, 0x72, 0x72, 0x44, 0x61, 0x74, 0x61, 0x10, 0x82, 0x19, 0x12, 0x19, 0x0a, 0x12, 0x0a, 0x0d, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x45, 0x72, 0x72, 0x44, 0x61, 0x74, 0x61,
0x14, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x42, 0x10, 0x82, 0x19, 0x12, 0x19, 0x0a, 0x14, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x4c,
0x65, 0x66, 0x6f, 0x72, 0x65, 0x10, 0x83, 0x19, 0x12, 0x15, 0x0a, 0x10, 0x54, 0x61, 0x6c, 0x65, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x10, 0x83, 0x19, 0x12, 0x15,
0x6e, 0x74, 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x10, 0x84, 0x19, 0x12, 0x0a, 0x10, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61,
0x10, 0x0a, 0x0b, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x42, 0x75, 0x79, 0x4d, 0x61, 0x78, 0x10, 0xe5, 0x74, 0x65, 0x10, 0x84, 0x19, 0x12, 0x10, 0x0a, 0x0b, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x42, 0x75,
0x19, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x53, 0x65, 0x6c, 0x6c, 0x4d, 0x61, 0x79, 0x4d, 0x61, 0x78, 0x10, 0xe5, 0x19, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x72, 0x6f, 0x6c, 0x6c,
0x78, 0x10, 0xe6, 0x19, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x78, 0x53, 0x65, 0x6c, 0x6c, 0x4d, 0x61, 0x78, 0x10, 0xe6, 0x19, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x72,
0x53, 0x65, 0x6c, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0xe7, 0x19, 0x12, 0x16, 0x0a, 0x11, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x78, 0x53, 0x65, 0x6c, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x10,
0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0xe7, 0x19, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x78, 0x49, 0x74,
0x74, 0x10, 0xe8, 0x19, 0x12, 0x18, 0x0a, 0x13, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0xe8, 0x19, 0x12, 0x18, 0x0a, 0x13, 0x54, 0x72,
0x65, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe9, 0x19, 0x12, 0x19, 0x6f, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72,
0x0a, 0x14, 0x48, 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x54, 0x75, 0x64, 0x10, 0xe9, 0x19, 0x12, 0x19, 0x0a, 0x14, 0x48, 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70,
0x72, 0x6e, 0x65, 0x64, 0x4f, 0x6e, 0x10, 0xc9, 0x1a, 0x12, 0x19, 0x0a, 0x14, 0x48, 0x6f, 0x72, 0x65, 0x4e, 0x6f, 0x74, 0x54, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x4f, 0x6e, 0x10, 0xc9, 0x1a, 0x12,
0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x74, 0x43, 0x44, 0x4e, 0x6f, 0x45, 0x6e, 0x19, 0x0a, 0x14, 0x48, 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x74,
0x64, 0x10, 0xca, 0x1a, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x43, 0x44, 0x4e, 0x6f, 0x45, 0x6e, 0x64, 0x10, 0xca, 0x1a, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x72,
0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xad, 0x1b, 0x12, 0x17, 0x0a, 0x12, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10,
0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x52, 0x65, 0x6e, 0x65, 0x77, 0x54, 0x69, 0xad, 0x1b, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x52,
0x6d, 0x65, 0x10, 0xae, 0x1b, 0x12, 0x14, 0x0a, 0x0f, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x65, 0x6e, 0x65, 0x77, 0x54, 0x69, 0x6d, 0x65, 0x10, 0xae, 0x1b, 0x12, 0x14, 0x0a, 0x0f, 0x47,
0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x10, 0x91, 0x1c, 0x12, 0x17, 0x0a, 0x12, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x10, 0x91,
0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x41, 0x64, 0x76, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x1c, 0x12, 0x17, 0x0a, 0x12, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x41, 0x64, 0x76,
0x65, 0x10, 0x92, 0x1c, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x61, 0x79, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x10, 0x92, 0x1c, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x61,
0x6d, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xf5, 0x1c, 0x12, 0x14, 0x0a, 0x79, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68,
0x0f, 0x50, 0x61, 0x79, 0x52, 0x65, 0x6e, 0x65, 0x77, 0x54, 0x69, 0x6d, 0x65, 0x45, 0x72, 0x72, 0x10, 0xf5, 0x1c, 0x12, 0x14, 0x0a, 0x0f, 0x50, 0x61, 0x79, 0x52, 0x65, 0x6e, 0x65, 0x77, 0x54,
0x10, 0xf6, 0x1c, 0x12, 0x14, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x69, 0x6d, 0x65, 0x45, 0x72, 0x72, 0x10, 0xf6, 0x1c, 0x12, 0x14, 0x0a, 0x0f, 0x57, 0x6f, 0x72,
0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x10, 0xd9, 0x1d, 0x12, 0x19, 0x0a, 0x14, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x10, 0xd9, 0x1d, 0x12,
0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x76, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x19, 0x0a, 0x14, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x76, 0x4e, 0x6f,
0x68, 0x10, 0xda, 0x1d, 0x12, 0x16, 0x0a, 0x11, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xda, 0x1d, 0x12, 0x16, 0x0a, 0x11, 0x57, 0x6f,
0x6b, 0x4e, 0x6f, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x10, 0xdb, 0x1d, 0x12, 0x18, 0x0a, 0x13, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x10,
0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0xdb, 0x1d, 0x12, 0x18, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4e,
0x65, 0x74, 0x65, 0x10, 0xdc, 0x1d, 0x12, 0x15, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x10, 0xdc, 0x1d, 0x12, 0x15, 0x0a, 0x10,
0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x68, 0x65, 0x64, 0x10, 0xdd, 0x1d, 0x12, 0x1c, 0x0a, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x68, 0x65, 0x64,
0x17, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x6e, 0x10, 0xdd, 0x1d, 0x12, 0x1c, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b,
0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xde, 0x1d, 0x12, 0x1e, 0x0a, 0x19, 0x41, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x6e, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xde,
0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x1d, 0x12, 0x1e, 0x0a, 0x19, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x54, 0x61, 0x73, 0x6b,
0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x10, 0xbd, 0x1e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x4e, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x10, 0xbd,
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x1e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
} }
var ( var (

View File

@ -255,6 +255,7 @@ type LinestoryReceiveResp struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ChapterId int32 `protobuf:"varint,1,opt,name=chapterId,proto3" json:"chapterId"` ChapterId int32 `protobuf:"varint,1,opt,name=chapterId,proto3" json:"chapterId"`
UserAssets []*UserAssets `protobuf:"bytes,2,rep,name=userAssets,proto3" json:"userAssets"`
} }
func (x *LinestoryReceiveResp) Reset() { func (x *LinestoryReceiveResp) Reset() {
@ -296,40 +297,51 @@ func (x *LinestoryReceiveResp) GetChapterId() int32 {
return 0 return 0
} }
func (x *LinestoryReceiveResp) GetUserAssets() []*UserAssets {
if x != nil {
return x.UserAssets
}
return nil
}
var File_linestory_linestory_msg_proto protoreflect.FileDescriptor var File_linestory_linestory_msg_proto protoreflect.FileDescriptor
var file_linestory_linestory_msg_proto_rawDesc = []byte{ var file_linestory_linestory_msg_proto_rawDesc = []byte{
0x0a, 0x1d, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x6c, 0x69, 0x6e, 0x65, 0x0a, 0x1d, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x6c, 0x69, 0x6e, 0x65,
0x73, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x1c, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x1c, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x6c, 0x69, 0x6e, 0x65, 0x73,
0x74, 0x6f, 0x72, 0x79, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x15, 0x0a, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63,
0x13, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x15, 0x0a, 0x13, 0x4c, 0x69, 0x6e,
0x72, 0x52, 0x65, 0x71, 0x22, 0xae, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71,
0x72, 0x79, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, 0x0a, 0x22, 0xae, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x68,
0x0b, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, 0x0a, 0x0b, 0x74, 0x61, 0x73,
0x28, 0x0b, 0x32, 0x26, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x68, 0x6b, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26,
0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65,
0x61, 0x70, 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x74, 0x61, 0x73, 0x6b, 0x72, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65,
0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x1a, 0x4c, 0x0a, 0x10, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x70,
0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x74, 0x65, 0x72, 0x1a, 0x4c, 0x0a, 0x10, 0x54, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x70, 0x74,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x22, 0x0a, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x54, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x22, 0x0a, 0x05, 0x76, 0x61, 0x6c,
0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x43,
0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x34, 0x0a, 0x14, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
0x72, 0x79, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x01, 0x22, 0x34, 0x0a, 0x14, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x61,
0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x69, 0x6e, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61,
0x52, 0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x36, 0x0a, 0x15, 0x4c, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68,
0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x73, 0x6b, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x36, 0x0a, 0x15, 0x4c, 0x69, 0x6e, 0x65, 0x73,
0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70,
0x28, 0x0b, 0x32, 0x09, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x69, 0x6e, 0x52, 0x04, 0x6c, 0x12, 0x1d, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09,
0x69, 0x73, 0x74, 0x22, 0x33, 0x0a, 0x13, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x4d, 0x61, 0x69, 0x6e, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22,
0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x33, 0x0a, 0x13, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x63, 0x65,
0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65,
0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x14, 0x4c, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, 0x70, 0x74,
0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x65, 0x72, 0x49, 0x64, 0x22, 0x61, 0x0a, 0x14, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x74, 0x6f, 0x72,
0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x79, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09,
0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x42, 0x06, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x09, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x0a, 0x75, 0x73,
0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b,
0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x0a, 0x75, 0x73, 0x65,
0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -354,17 +366,19 @@ var file_linestory_linestory_msg_proto_goTypes = []interface{}{
(*LinestoryReceiveResp)(nil), // 5: LinestoryReceiveResp (*LinestoryReceiveResp)(nil), // 5: LinestoryReceiveResp
nil, // 6: LinestoryChapterResp.TaskChapterEntry nil, // 6: LinestoryChapterResp.TaskChapterEntry
(*TaskMain)(nil), // 7: TaskMain (*TaskMain)(nil), // 7: TaskMain
(*TaskChapter)(nil), // 8: TaskChapter (*UserAssets)(nil), // 8: UserAssets
(*TaskChapter)(nil), // 9: TaskChapter
} }
var file_linestory_linestory_msg_proto_depIdxs = []int32{ var file_linestory_linestory_msg_proto_depIdxs = []int32{
6, // 0: LinestoryChapterResp.taskChapter:type_name -> LinestoryChapterResp.TaskChapterEntry 6, // 0: LinestoryChapterResp.taskChapter:type_name -> LinestoryChapterResp.TaskChapterEntry
7, // 1: LinestoryMaintaskResp.list:type_name -> TaskMain 7, // 1: LinestoryMaintaskResp.list:type_name -> TaskMain
8, // 2: LinestoryChapterResp.TaskChapterEntry.value:type_name -> TaskChapter 8, // 2: LinestoryReceiveResp.userAssets:type_name -> UserAssets
3, // [3:3] is the sub-list for method output_type 9, // 3: LinestoryChapterResp.TaskChapterEntry.value:type_name -> TaskChapter
3, // [3:3] is the sub-list for method input_type 4, // [4:4] is the sub-list for method output_type
3, // [3:3] is the sub-list for extension type_name 4, // [4:4] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension extendee 4, // [4:4] is the sub-list for extension type_name
0, // [0:3] is the sub-list for field type_name 4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
} }
func init() { file_linestory_linestory_msg_proto_init() } func init() { file_linestory_linestory_msg_proto_init() }
@ -373,6 +387,7 @@ func file_linestory_linestory_msg_proto_init() {
return return
} }
file_linestory_linestory_db_proto_init() file_linestory_linestory_db_proto_init()
file_comm_proto_init()
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_linestory_linestory_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_linestory_linestory_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LinestoryChapterReq); i { switch v := v.(*LinestoryChapterReq); i {

View File

@ -12,9 +12,12 @@ import "errors"
type GameLinestoryMainTaskData struct { type GameLinestoryMainTaskData struct {
Id int32 Id int32
Group int32
SubTask int32 SubTask int32
NodeIndex int32
Order string
Group int32
Name string Name string
Describe string
Img string Img string
Ending int32 Ending int32
Resetto []int32 Resetto []int32
@ -28,9 +31,12 @@ func (*GameLinestoryMainTaskData) GetTypeId() int32 {
func (_v *GameLinestoryMainTaskData)Deserialize(_buf map[string]interface{}) (err error) { func (_v *GameLinestoryMainTaskData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["group"].(float64); !_ok_ { err = errors.New("group error"); return }; _v.Group = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["subTask"].(float64); !_ok_ { err = errors.New("subTask error"); return }; _v.SubTask = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["subTask"].(float64); !_ok_ { err = errors.New("subTask error"); return }; _v.SubTask = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["nodeIndex"].(float64); !_ok_ { err = errors.New("nodeIndex error"); return }; _v.NodeIndex = int32(_tempNum_) }
{ var _ok_ bool; if _v.Order, _ok_ = _buf["order"].(string); !_ok_ { err = errors.New("order error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["group"].(float64); !_ok_ { err = errors.New("group error"); return }; _v.Group = int32(_tempNum_) }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["name"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Name error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Name, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["name"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Name error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Name, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["describe"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Describe error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Describe, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; if _v.Img, _ok_ = _buf["img"].(string); !_ok_ { err = errors.New("img error"); return } } { var _ok_ bool; if _v.Img, _ok_ = _buf["img"].(string); !_ok_ { err = errors.New("img error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["ending"].(float64); !_ok_ { err = errors.New("ending error"); return }; _v.Ending = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["ending"].(float64); !_ok_ { err = errors.New("ending error"); return }; _v.Ending = int32(_tempNum_) }
{ {

View File

@ -12,6 +12,7 @@ import "errors"
type GameLinestoryTimeLineData struct { type GameLinestoryTimeLineData struct {
Group int32 Group int32
Order string
NodeIndex int32 NodeIndex int32
Cond []int32 Cond []int32
Name string Name string
@ -27,6 +28,7 @@ func (*GameLinestoryTimeLineData) GetTypeId() int32 {
func (_v *GameLinestoryTimeLineData)Deserialize(_buf map[string]interface{}) (err error) { func (_v *GameLinestoryTimeLineData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["group"].(float64); !_ok_ { err = errors.New("group error"); return }; _v.Group = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["group"].(float64); !_ok_ { err = errors.New("group error"); return }; _v.Group = int32(_tempNum_) }
{ var _ok_ bool; if _v.Order, _ok_ = _buf["order"].(string); !_ok_ { err = errors.New("order error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["nodeIndex"].(float64); !_ok_ { err = errors.New("nodeIndex error"); return }; _v.NodeIndex = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["nodeIndex"].(float64); !_ok_ { err = errors.New("nodeIndex error"); return }; _v.NodeIndex = int32(_tempNum_) }
{ {
var _arr_ []interface{} var _arr_ []interface{}

View File

@ -39,6 +39,17 @@ func Find(slice []string, val string) (int, bool) {
return -1, false return -1, false
} }
func Deletex[T string | int32](slice []T, val T) []T {
result := make([]T, 0)
for _, v := range slice {
if v != val {
result = append(result, v)
}
}
return result
}
// Deprecated: Use Deletex instead
func DeleteString(list []string, ele string) []string { func DeleteString(list []string, ele string) []string {
result := make([]string, 0) result := make([]string, 0)
for _, v := range list { for _, v := range list {

17
utils/trans.go Normal file
View File

@ -0,0 +1,17 @@
package utils
import (
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
)
func ConvertReward(data ...*cfg.Gameatn) (res []*pb.UserAssets) {
for _, v := range data {
res = append(res, &pb.UserAssets{
A: v.A,
T: v.T,
N: v.N,
})
}
return
}

View File

@ -82,3 +82,9 @@ func TestCompre(t *testing.T){
b:=[]int32{1,2,4} b:=[]int32{1,2,4}
fmt.Println(utils.ForContainer(a,b)) fmt.Println(utils.ForContainer(a,b))
} }
func TestDeletex(t *testing.T){
a:=[]int32{1,2,3,4}
c:=utils.Deletex(a, 2)
fmt.Println(c)
}