This commit is contained in:
liwei1dao 2023-01-11 16:56:01 +08:00
commit e92a8174b7
39 changed files with 2108 additions and 2779 deletions

View File

@ -88,5 +88,17 @@
"open": true,
"routrules": "~/worker",
"describe": "维京排行榜数据"
},
{
"msgid": "hunting.ranklist",
"open": true,
"routrules": "~/worker",
"describe": "狩猎排行榜数据"
},
{
"msgid": "enchant.ranklist",
"open": true,
"routrules": "~/worker",
"describe": "附魔副本排行榜数据"
}
]

View File

@ -1364,5 +1364,31 @@
"text": "功能暂未开启"
},
"uiid": 0
},
{
"id": "mainline_elite",
"name": {
"key": "num_2031",
"text": "主线关卡-困难"
},
"main": [
{
"key": "platlv",
"param": 5
},
{
"key": "maxmapid",
"param": 1
}
],
"optional": "",
"wkqbx": 0,
"kqbx": 0,
"img": "zc_icon_01",
"prompt": {
"key": "opencond_prompt_mainline_elite",
"text": "功能暂未开启"
},
"uiid": 0
}
]

File diff suppressed because it is too large Load Diff

View File

@ -234,3 +234,10 @@ func FormatFloatCeil(num float64, decimal int) (float64, error) {
res := strconv.FormatFloat(math.Ceil(num*d)/d, 'f', -1, 64)
return strconv.ParseFloat(res, 64)
}
func LastChars(str string, count int) string {
if len(str) <= count {
return str
}
return str[len(str)-count:]
}

View File

@ -59,3 +59,7 @@ func TestDiv(t *testing.T) {
num, _ = FormatFloatFloor(0.2295, 2)
fmt.Println(reflect.TypeOf(num), num)
}
func TestSub(t *testing.T){
fmt.Println(LastChars("23af2", 6))
}

View File

@ -112,7 +112,7 @@ var (
ff(comm.ModuleRtask, rtask.RtaskSubTypeGetrecord): &formview.RtaskRecordView{},
// linestory
ff(comm.ModuleLinestory, linestory.LinestorySubTypeChapter): &formview.LinestoryMineView{},
ff(comm.ModuleLibrary, library.LibraryFetterstoryTaskResp): &formview.FetterstoryView{},
ff(comm.ModuleLibrary, library.LibraryFetterstoryTaskResp): &formview.FetterstoryView{},
// gourmet
ff(comm.ModuleGourmet, "getranduser"): &formview.GourmentGetRandView{},
// sociaty
@ -121,6 +121,7 @@ var (
ff(comm.ModuleSociaty, sociaty.SociatySubTypeMine): &formview.SociatyMineView{},
ff(comm.ModuleSociaty, sociaty.SociatySubTypeTasklist): &formview.SociatyTasklistView{},
ff(comm.ModuleSociaty, sociaty.SociatySubTypeRank): &formview.SociatyRankView{},
ff(comm.ModuleSociaty, "boss"): &formview.SociatyBossView{},
// troll
ff(comm.ModuleTroll, "getlist"): &formview.TrollGetlistView{},
// growtask
@ -248,6 +249,7 @@ var (
ff(comm.ModuleSociaty, sociaty.SociatySubTypeMine),
ff(comm.ModuleSociaty, sociaty.SociatySubTypeTasklist),
ff(comm.ModuleSociaty, sociaty.SociatySubTypeRank),
ff(comm.ModuleSociaty, "boss"),
},
"troll": {
ff(comm.ModuleTroll, "getlist"),
@ -894,6 +896,13 @@ var (
SubType: sociaty.SociatySubTypeRank,
Enabled: true,
},
ff(comm.ModuleSociaty, "boss"): {
NavLabel: "BOSS",
Desc: "BOSS",
MainType: string(comm.ModuleSociaty),
SubType: "boss",
Enabled: true,
},
//troll
string(comm.ModuleTroll): {
NavLabel: "巨兽",

View File

@ -45,11 +45,11 @@ func (this *HeroListView) CreateView(t *model.TestCase) fyne.CanvasObject {
buttonBar := container.NewHBox(refreshBtn)
c := container.NewBorder(buttonBar, nil, nil, nil, this.itemList.ItemList)
this.dataListener()
this.DataListener()
return c
}
func (this *HeroListView) dataListener() {
func (this *HeroListView) DataListener() {
if this.flag {
return
}

View File

@ -0,0 +1,244 @@
package formview
import (
"fmt"
"go_dreamfactory/cmd/v2/lib/common"
"go_dreamfactory/cmd/v2/model"
"go_dreamfactory/cmd/v2/service"
"go_dreamfactory/cmd/v2/service/observer"
"go_dreamfactory/comm"
"go_dreamfactory/modules/hero"
"go_dreamfactory/modules/sociaty"
"go_dreamfactory/pb"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/widget"
"github.com/sirupsen/logrus"
)
type SociatyBossView struct {
BaseformView
itemList common.ItemList
heroListFlag bool
teamFlag bool
heroList func()
sociatyId string
teams map[int32]*pb.ChallengeTeams
}
func (s *SociatyBossView) CreateView(t *model.TestCase) fyne.CanvasObject {
s.teams = make(map[int32]*pb.ChallengeTeams)
loadSociaty := func() {
if err := service.GetPttService().SendToClient(
t.MainType,
sociaty.SociatySubTypeMine,
&pb.SociatyMineReq{},
); err != nil {
logrus.Error(err)
return
}
}
defer loadSociaty()
buzhenBtn := widget.NewButton("布阵", s.buzhen)
challengeBtn := widget.NewButton("挑战", s.challenge)
btns := container.NewHBox(buzhenBtn, challengeBtn)
c := container.NewBorder(btns, nil, nil, nil)
s.listenTeams()
return c
}
//加载team数据
func (s *SociatyBossView) listenTeams() {
if s.teamFlag {
return
}
s.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
OnNotify: func(d interface{}, args ...interface{}) {
data := d.(*pb.UserMessage)
if !(data.MainType == string(comm.ModuleSociaty) &&
data.SubType == sociaty.SociatySubTypeMine) {
return
}
rsp := &pb.SociatyMineResp{}
if !comm.ProtoUnmarshal(data, rsp) {
logrus.Error("unmarshal err")
return
}
if rsp.Sociaty != nil {
s.sociatyId = rsp.Sociaty.Id
s.teams = rsp.Teams
}
},
})
s.teamFlag = true
}
// 挑战
func (s *SociatyBossView) challenge() {
}
//布阵
func (s *SociatyBossView) buzhen() {
//英雄列表
s.itemList = *common.NewItemList()
s.itemList.ItemList = s.itemList.CreateDefaultCheckList()
s.heroList = func() {
if err := service.GetPttService().SendToClient(string(comm.ModuleHero), "list", &pb.HeroListReq{}); err != nil {
logrus.Error(err)
return
}
}
defer s.heroList()
s.HeroDataListener()
//队伍数据
addHero1 := widget.NewButton("添加至一队", nil)
addHero2 := widget.NewButton("添加至二队", nil)
addHero3 := widget.NewButton("添加至三队", nil)
saveBuzhen := widget.NewButton("保存布阵", nil)
btns := container.NewHBox(addHero1, addHero2, addHero3, saveBuzhen)
content := container.NewGridWithRows(3)
team1 := container.NewGridWithColumns(5)
//refresh team1
team1Box := container.NewHBox(widget.NewLabel("一队:"), team1)
if t, ok := s.teams[1]; ok {
for _, i := range t.Infos {
team1.AddObject(widget.NewLabel(common.LastChars(i.HeroId, 4)))
}
}
team2 := container.NewGridWithColumns(5)
team2Box := container.NewHBox(widget.NewLabel("二队:"), team2)
team3 := container.NewGridWithColumns(5)
team3Box := container.NewHBox(widget.NewLabel("三队:"), team3)
content.AddObject(team1Box)
content.AddObject(team2Box)
content.AddObject(team3Box)
// 添加一队英雄
addHero1.OnTapped = func() {
team1 = container.NewGridWithColumns(5)
if t, ok := s.teams[1]; ok {
for _, i := range t.Infos {
team1.AddObject(widget.NewLabel(common.LastChars(i.HeroId, 4)))
}
}
teams := []*pb.ChallengeTeamInfo{}
for _, id := range s.itemList.SelItemIds {
team1.AddObject(widget.NewLabel(common.LastChars(id, 4)))
teams = append(teams, &pb.ChallengeTeamInfo{
HeroId: id,
})
}
if s.teams == nil {
s.teams = make(map[int32]*pb.ChallengeTeams)
}
s.teams[1] = &pb.ChallengeTeams{Infos: teams}
}
// 添加二队英雄
addHero2.OnTapped = func() {
team2 = container.NewGridWithColumns(5)
if t, ok := s.teams[2]; ok {
for _, i := range t.Infos {
team2.AddObject(widget.NewLabel(common.LastChars(i.HeroId, 4)))
}
}
teams := []*pb.ChallengeTeamInfo{}
for _, id := range s.itemList.SelItemIds {
team2.AddObject(widget.NewLabel(common.LastChars(id, 4)))
teams = append(teams, &pb.ChallengeTeamInfo{
HeroId: id,
})
}
if s.teams == nil {
s.teams = make(map[int32]*pb.ChallengeTeams)
}
s.teams[2] = &pb.ChallengeTeams{Infos: teams}
}
// 添加三队英雄
addHero3.OnTapped = func() {
team3 = container.NewGridWithColumns(5)
if t, ok := s.teams[3]; ok {
for _, i := range t.Infos {
team3.AddObject(widget.NewLabel(common.LastChars(i.HeroId, 4)))
}
}
teams := []*pb.ChallengeTeamInfo{}
for _, id := range s.itemList.SelItemIds {
team3.AddObject(widget.NewLabel(common.LastChars(id, 4)))
teams = append(teams, &pb.ChallengeTeamInfo{
HeroId: id,
})
}
if s.teams == nil {
s.teams = make(map[int32]*pb.ChallengeTeams)
}
s.teams[3] = &pb.ChallengeTeams{Infos: teams}
}
// 保存阵容
saveBuzhen.OnTapped = func() {
if err := service.GetPttService().SendToClient(string(comm.ModuleSociaty),
sociaty.SociatySubTypeFormation, &pb.SociatyBFormationReq{
SociatyId: s.sociatyId,
Teams: s.teams,
}); err != nil {
logrus.Error(err)
return
}
}
split := container.NewHSplit(s.itemList.ItemList, content)
split.Offset = 0.55
layout := container.NewBorder(btns, nil, nil, nil, split)
dconf := dialog.NewCustom("布阵", "关闭", layout, s.w)
dconf.Resize(fyne.NewSize(800, 500))
dconf.Show()
}
func (this *SociatyBossView) HeroDataListener() {
if this.heroListFlag {
return
}
this.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
OnNotify: func(d interface{}, args ...interface{}) {
data := d.(*pb.UserMessage)
if !(data.MainType == string(comm.ModuleHero) &&
data.SubType == hero.HeroSubTypeList) {
return
}
rsp := &pb.HeroListResp{}
if !comm.ProtoUnmarshal(data, rsp) {
logrus.Error("unmarshal err")
return
}
for i, v := range rsp.List {
item := common.Item{
Id: v.Id,
Text: fmt.Sprintf("%d ID:%v Star:%d Lv:%d Type:%d Count:%d",
i+1, v.HeroID, v.Star, v.Lv, v.CardType, v.SameCount),
}
this.itemList.AddItem(item)
}
},
})
this.heroListFlag = true
}

View File

@ -38,6 +38,7 @@ func (this *TaskActiveListView) CreateView(t *model.TestCase) fyne.CanvasObject
// task active list button
taskListBtn := widget.NewButtonWithIcon("活跃度", theme.ConfirmIcon(), func() {
this.itemList.Reset()
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.TaskActiveListReq{
TaskTag: cast.ToInt32(tagSelect.Selected),
}); err != nil {

View File

@ -183,6 +183,8 @@ const (
TableSociatyTask = "sociatytask"
// 公会日志
TableSociatyLog = "sociatylog"
// 公会BOSS
TableSociatyBoss = "sociatybsoss"
///充值数据表
TablePay = "payorder"

View File

@ -3,9 +3,6 @@ package enchant
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
"google.golang.org/protobuf/proto"
)
@ -19,119 +16,9 @@ func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.EnchantBuyReq)
return
}
// 协议废除 走通用购买逻辑
func (this *apiComp) Buy(session comm.IUserSession, req *pb.EnchantBuyReq) (code pb.ErrorCode, data proto.Message) {
var (
curByCount int32
costRes *cfg.Gameatn // 门票atn 类型 只取T
mapData map[string]interface{}
szCostRes []*cfg.Gameatn // 购买累计消耗
curCount int32 // 当前门票数量
addCount int32 //获得数量
)
mapData = make(map[string]interface{}, 0)
code = this.BuyCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
list, err := this.module.modelEnchant.getEnchantList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
// 校验是不是今天
if !utils.IsToday(list.CTime) {
list.CTime = configure.Now().Unix()
list.BuyCount = 0
mapData["cTime"] = list.CTime
mapData["buyCount"] = list.BuyCount
} else {
curByCount = list.BuyCount
}
curByCount += req.Count // 当前需要购买的数量
if this.configure.GetMaxBuyChallengeCount() < curByCount {
code = pb.ErrorCode_EnchantBuyMaxCount
return
}
conf := this.module.configure.GetGlobalConf()
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
costRes = conf.EnchantbossCos
if costRes == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
amount := int32(this.module.ModuleItems.QueryItemAmount(session.GetUserId(), costRes.T)) // 获取当前数量
curCount = amount
if amount < conf.EnchantbossMax {
if list.RecoveryTime == 0 {
list.RecoveryTime = configure.Now().Unix()
}
for { // 计算恢复时间
if list.RecoveryTime+int64(conf.EnchantbossRecovery*60) <= configure.Now().Unix() {
curCount++
list.RecoveryTime += int64(conf.EnchantbossRecovery * 60)
if curCount >= conf.EnchantbossMax {
list.RecoveryTime = 0
break
}
} else {
break
}
}
if curCount-amount > 0 {
addCount = curCount - amount
}
} else {
list.RecoveryTime = 0
}
addCount += req.Count
if amount+addCount > conf.EnchantbossMax {
code = pb.ErrorCode_EnchantBuyMaxCount
return
}
mapData["recoveryTime"] = list.RecoveryTime
for i := list.BuyCount + 1; i <= curByCount; i++ {
_cfg := this.configure.GetBuyChallengeCount(i)
if _cfg == nil {
code = pb.ErrorCode_EnchantBuyMaxCount
return
}
szCostRes = append(szCostRes, _cfg.Need...)
}
sz := make([]*cfg.Gameatn, 0)
for _, v := range szCostRes {
bFound := false
for _, v1 := range sz {
if v.A == v1.A && v.T == v1.T {
v1.N += v.N
bFound = true
break
}
}
if !bFound {
sz = append(sz, v)
}
}
//消耗
if code = this.module.ConsumeRes(session, sz, true); code != pb.ErrorCode_Success {
return
}
res := &cfg.Gameatn{
A: "item",
T: costRes.T,
N: addCount,
}
if code = this.module.DispenseRes(session, []*cfg.Gameatn{res}, true); code != pb.ErrorCode_Success {
return
}
list.BuyCount = curByCount
mapData["buyCount"] = curByCount
code = this.module.ModifyEnchantData(session.GetUserId(), mapData)
session.SendMsg(string(this.module.GetType()), EnchantBuyResp, &pb.EnchantBuyResp{Data: list})
session.SendMsg(string(this.module.GetType()), EnchantBuyResp, &pb.EnchantBuyResp{})
return
}

View File

@ -3,7 +3,6 @@ package enchant
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"google.golang.org/protobuf/proto"
)
@ -30,26 +29,21 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.EnchantChallen
code = pb.ErrorCode_PagodaNotFound
return
}
conf := this.module.configure.GetGlobalConf()
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
costRes := conf.EnchantbossCos
if costRes == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
if code = this.module.CheckRes(session, []*cfg.Gameatn{costRes}); code != pb.ErrorCode_Success {
code = pb.ErrorCode_EnchantNoChallengeCount
return
}
cfgData := this.module.configure.GetEnchantBossConfigData(req.BossType)
if cfgData == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
if len(cfgData) <= 0 {
code = pb.ErrorCode_ConfigNoFound
return
}
if code = this.module.CheckRes(session, cfgData[0].PsConsume); code != pb.ErrorCode_Success {
code = pb.ErrorCode_ItemsNoEnough
return
}
_, ok := enchant.Boss[req.BossType]
if !ok { // 类型校验
enchant.Boss[req.BossType] = 0

View File

@ -3,8 +3,6 @@ package enchant
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"google.golang.org/protobuf/proto"
)
@ -37,21 +35,6 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha
code = pb.ErrorCode_PagodaNotFound
return
}
conf := this.module.configure.GetGlobalConf()
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
costRes := conf.EnchantbossCos
if costRes == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
if code = this.module.CheckRes(session, []*cfg.Gameatn{costRes}); code != pb.ErrorCode_Success {
code = pb.ErrorCode_EnchantNoChallengeCount
return
}
cfgEnchant := this.module.configure.GetEnchantBossConfigData(req.BossType)
if cfgEnchant == nil {
@ -59,25 +42,30 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha
return
}
// 校验门票数量够不够
if code = this.module.ConsumeRes(session, []*cfg.Gameatn{costRes}, true); code != pb.ErrorCode_Success {
return
}
// check
code, bWin = this.module.battle.CheckBattleReport(session, req.Report)
if code != pb.ErrorCode_Success {
return
}
amount := int32(this.module.ModuleItems.QueryItemAmount(session.GetUserId(), costRes.T)) // 获取当前数量
if amount < conf.EnchantbossMax { // 挑战卷 小于副本最大存储数的时候开始恢复
enchant.RecoveryTime = configure.Now().Unix()
mapData["recoveryTime"] = enchant.RecoveryTime
if !bWin { // 战斗失败了 直接返回
if code = this.module.ConsumeRes(session, cfgEnchant[0].PsMg, true); code != pb.ErrorCode_Success {
return
}
session.SendMsg(string(this.module.GetType()), EnchantChallengeOverResp, &pb.EnchantChallengeOverResp{Data: enchant})
return
}
if bWin {
this.module.CheckRank(session.GetUserId(), req.BossType, enchant, req.Report, req.Score)
if code = this.module.ConsumeRes(session, cfgEnchant[0].PsConsume, true); code != pb.ErrorCode_Success {
return
}
key := req.BossType
if enchant.BossTime[key] > req.Report.Costtime || enchant.BossTime[key] == 0 {
enchant.BossTime[key] = req.Report.Costtime
mapData["bossTime"] = enchant.BossTime // 更新时间
userinfo := this.module.ModuleUser.GetUser(session.GetUserId())
this.module.CheckRank(session.GetUserId(), req.BossType, req.Report, userinfo, req.Score)
}
//this.module.CheckRank(session.GetUserId(), req.BossType, enchant, req.Report, req.Score)
enchant.Boss[req.BossType] = req.Score // 获得的积分
// 发放通关随机奖励
for _, v := range cfgEnchant {
@ -94,6 +82,11 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha
mapData["bossTime"] = enchant.BossTime
mapData["boss"] = enchant.Boss
code = this.module.ModifyEnchantData(session.GetUserId(), mapData)
if session.GetUserId() != "" { // 恢复时间
if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
enchant.RecoveryTime = userexpand.Recovertimeunifiedticket
}
}
session.SendMsg(string(this.module.GetType()), EnchantChallengeOverResp, &pb.EnchantChallengeOverResp{Data: enchant})
return

View File

@ -4,9 +4,6 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/mgo"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
"go.mongodb.org/mongo-driver/bson/primitive"
"google.golang.org/protobuf/proto"
@ -19,14 +16,10 @@ func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.EnchantGetL
}
func (this *apiComp) GetList(session comm.IUserSession, req *pb.EnchantGetListReq) (code pb.ErrorCode, data proto.Message) {
var (
mapData map[string]interface{}
curCount int32
)
mapData = make(map[string]interface{}, 0)
code = this.GetListCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
// 刷新挑战卷
if code = this.module.ModuleItems.RecoverTicket(session); code != pb.ErrorCode_Success {
return
}
list, err := this.module.modelEnchant.getEnchantList(session.GetUserId())
@ -41,81 +34,13 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.EnchantGetListRe
for k := range _cfg {
list.BossTime[k] = 0
}
this.module.modelEnchant.Add(session.GetUserId(), list)
conf := this.module.configure.GetGlobalConf()
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
iCont := conf.EnchantbossInitial
atn := conf.EnchantbossCos
if iCont > 0 {
res := &cfg.Gameatn{
A: atn.A,
T: atn.T,
N: iCont,
}
this.module.DispenseRes(session, []*cfg.Gameatn{res}, true)
}
} else if err != nil {
code = pb.ErrorCode_DBError
return
}
// 校验 是不是当天
if !utils.IsToday(list.CTime) {
list.CTime = configure.Now().Unix()
list.BuyCount = 0
mapData["cTime"] = list.CTime
mapData["buyCount"] = list.BuyCount
}
// 检查恢复时间
conf := this.module.configure.GetGlobalConf()
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
costRes := conf.EnchantbossCos
if costRes == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
amount := int32(this.module.ModuleItems.QueryItemAmount(session.GetUserId(), costRes.T)) // 获取当前数量
curCount = amount
if amount < conf.EnchantbossMax {
if list.RecoveryTime == 0 {
list.RecoveryTime = configure.Now().Unix()
if session.GetUserId() != "" { // 恢复时间
if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
list.RecoveryTime = userexpand.Recovertimeunifiedticket
}
for { // 计算恢复时间
if list.RecoveryTime+int64(conf.EnchantbossRecovery*60) <= configure.Now().Unix() {
curCount++
list.RecoveryTime += int64(conf.EnchantbossRecovery * 60)
if curCount >= conf.EnchantbossMax {
list.RecoveryTime = 0
break
}
} else {
break
}
}
addCount := curCount - amount
if addCount > 0 {
res := &cfg.Gameatn{
A: "item",
T: costRes.T,
N: addCount,
}
if code = this.module.DispenseRes(session, []*cfg.Gameatn{res}, true); code != pb.ErrorCode_Success {
return
}
}
} else {
list.RecoveryTime = 0
}
mapData["recoveryTime"] = list.RecoveryTime
code = this.module.ModifyEnchantData(session.GetUserId(), mapData) //修改内存信息
session.SendMsg(string(this.module.GetType()), EnchantGetListResp, &pb.EnchantGetListResp{Data: list})
return

View File

@ -5,6 +5,7 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/redis/pipe"
"go_dreamfactory/pb"
"go_dreamfactory/sys/db"
"strconv"
"github.com/go-redis/redis/v8"
@ -26,11 +27,13 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.EnchantRankList
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
conn, _ := db.Local()
dbModel := db.NewDBModel(comm.TableEnchantRank, 0, conn)
if !req.Friend {
var (
pipe *pipe.RedisPipe = this.module.modelEnchant.Redis.RedisPipe(context.TODO())
)
rd = pipe.ZRange("enchantRank"+strconv.Itoa(int(req.BoosType)), 0, -1)
rd = pipe.ZRange("enchantRank"+strconv.Itoa(int(req.BoosType)), 0, comm.MaxRankList)
if _, err := pipe.Exec(); err != nil {
this.module.Errorln(err)
@ -39,7 +42,8 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.EnchantRankList
_dataList := rd.Val()
for _, v := range _dataList {
result := &pb.DBEnchantRank{}
if err := this.module.modulerank.GetListObj(session.GetUserId(), v, result); err == nil {
if err := dbModel.Redis.HGetAll(v, result); err == nil {
szRank = append(szRank, result)
}
}

View File

@ -1,14 +1,16 @@
package enchant
import (
"context"
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/redis/pipe"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go_dreamfactory/sys/db"
"strconv"
"time"
"github.com/go-redis/redis/v8"
"go.mongodb.org/mongo-driver/bson/primitive"
)
@ -76,79 +78,80 @@ func (this *Enchant) CheckUserBaseEnchantInfo(uid string) (data []*pb.DBEnchantR
}
return
}
func (this *Enchant) CheckRank(uid string, boosID int32, Enchant *pb.DBEnchant, report *pb.BattleReport, score int64) {
func (this *Enchant) CheckRank(uid string, boosID int32, report *pb.BattleReport, userinfo *pb.DBUser, score int64) {
conn_, _ := db.Cross() // 获取跨服数据库对象
model := db.NewDBModel(comm.TableEnchantRank, 0, conn_)
costTime := report.Costtime
if Enchant.BossTime[boosID] > costTime || Enchant.BossTime[boosID] == 0 { // 刷新记录
Enchant.BossTime[boosID] = costTime
szLine := make([]*pb.LineUp, 0)
Leadpos := 0
if report != nil && report.Info != nil && len(report.Info.Redflist) > 0 {
costTime = report.Costtime
Leadpos = int(report.Info.Redflist[0].Leadpos)
for _, v := range report.Info.Redflist[0].Team {
if v != nil {
szLine = append(szLine, &pb.LineUp{
Cid: v.HeroID,
Star: v.Star,
Lv: v.Lv,
})
}
szLine := make([]*pb.LineUp, len(report.Info.Redflist[0].Team))
Leadpos := 0
if report != nil && report.Info != nil && len(report.Info.Redflist) > 0 {
costTime = report.Costtime
Leadpos = int(report.Info.Redflist[0].Leadpos)
for _, v := range report.Info.Redflist[0].Team {
if v != nil {
szLine = append(szLine, &pb.LineUp{
Cid: v.HeroID,
Star: v.Star,
Lv: v.Lv,
})
}
}
// 写入排行榜
objID := ""
bFind := false
ranks := this.modulerank.getEnchantRankList(uid)
for _, v := range ranks {
if v.Bosstype == boosID {
mapRankData := make(map[string]interface{}, 0)
mapRankData["bosstype"] = boosID
mapRankData["Leadpos"] = Leadpos
mapRankData["line"] = szLine
mapRankData["costTime"] = costTime
mapRankData["score"] = score
conn_, _ := db.Cross()
dbModel := db.NewDBModel(comm.TableEnchantRank, time.Hour, conn_)
dbModel.ChangeList(uid, v.Id, mapRankData)
objID = v.Id
bFind = true
break
}
}
if !bFind {
userinfo := this.ModuleUser.GetUser(uid)
new := &pb.DBEnchantRank{
Id: primitive.NewObjectID().Hex(),
Uid: uid,
Bosstype: boosID,
Nickname: userinfo.Name,
Lv: userinfo.Lv,
Leadpos: int32(Leadpos),
Line: szLine,
CostTime: costTime,
Score: score,
}
objID = new.Id
conn_, _ := db.Cross()
dbModel := db.NewDBModel(comm.TableEnchantRank, time.Hour, conn_)
dbModel.AddList(uid, new.Id, new)
}
this.modulerank.SetRankListData("EnchantRank"+strconv.Itoa(int(boosID)), score, objID)
}
}
// 写入排行榜
objID := ""
bFind := false
ranks := this.modulerank.getEnchantRankList(uid)
for _, v := range ranks {
if v.Bosstype == boosID {
mapRankData := make(map[string]interface{}, 0)
mapRankData["bosstype"] = boosID
mapRankData["Leadpos"] = Leadpos
mapRankData["line"] = szLine
mapRankData["costTime"] = costTime
mapRankData["score"] = score
//红点查询
func (this *Enchant) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) {
reddot = make(map[comm.ReddotType]bool)
for _, v := range rid {
switch v {
case comm.Reddot32:
reddot[comm.Reddot32] = this.modelEnchant.checkReddot32(session.GetUserId())
model.ChangeList(uid, v.Id, mapRankData)
objID = v.Id
bFind = true
break
}
}
return
if !bFind {
userinfo := this.ModuleUser.GetUser(uid)
new := &pb.DBEnchantRank{
Id: primitive.NewObjectID().Hex(),
Uid: uid,
Bosstype: boosID,
Nickname: userinfo.Name,
Lv: userinfo.Lv,
Leadpos: int32(Leadpos),
Line: szLine,
CostTime: costTime,
Score: score,
}
objID = new.Id
model.AddList(uid, new.Id, new)
}
var (
pipe *pipe.RedisPipe = conn_.Redis.RedisPipe(context.TODO())
menbers *redis.Z
tableName string
)
tableName = "enchantRank" + strconv.Itoa(int(boosID))
strKey := "enchantRank:" + uid + "-" + objID
menbers = &redis.Z{Score: float64(costTime), Member: strKey}
if cmd := pipe.ZAdd(tableName, menbers); cmd != nil {
dock, err1 := cmd.Result()
if err1 != nil {
this.Errorln(dock, err1)
}
}
if _, err := pipe.Exec(); err != nil {
this.Errorln(err)
return
}
}

View File

@ -158,7 +158,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
code = module1.(comm.IHero).GetAllMaxHero(session)
this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[1]},
log.Field{Key: "0", Value: datas[0]},
)
} else if len(datas) == 2 && (datas[0] == "season") { // 赛季塔跳转
module1, err := this.service.GetModule(comm.ModulePagoda)
@ -193,7 +193,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC
code = module1.(comm.IHunting).CompleteAllLevel(session)
this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[1]})
log.Field{Key: "0", Value: datas[0]})
} else if len(datas) == 3 && (datas[0] == "mainline") {
module1, err := this.service.GetModule(comm.ModuleMainline)
if err != nil {

View File

@ -3,9 +3,6 @@ package hunting
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
"google.golang.org/protobuf/proto"
)
@ -20,121 +17,7 @@ func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.HuntingBuyReq)
}
func (this *apiComp) Buy(session comm.IUserSession, req *pb.HuntingBuyReq) (code pb.ErrorCode, data proto.Message) {
var (
curByCount int32
costRes *cfg.Gameatn // 门票atn 类型 只取T
mapData map[string]interface{}
szCostRes []*cfg.Gameatn // 购买累计消耗
curCount int32 // 当前门票数量
addCount int32 //获得数量
PrivilegeBuyCount int32 // 特权购买次数
)
mapData = make(map[string]interface{}, 0)
code = this.BuyCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
list, err := this.module.modelHunting.getHuntingList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
// 校验是不是今天
if !utils.IsToday(list.CTime) {
list.CTime = configure.Now().Unix()
list.BuyCount = 0
mapData["cTime"] = list.CTime
mapData["buyCount"] = list.BuyCount
} else {
curByCount = list.BuyCount
}
PrivilegeBuyCount = this.module.ModulePrivilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType4)
curByCount += req.Count // 当前需要购买的数量
if this.configure.GetMaxBuyChallengeCount()+PrivilegeBuyCount < curByCount {
code = pb.ErrorCode_HuntingBuyMaxCount
return
}
conf := this.module.configure.GetGlobalConf()
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
costRes = conf.HuntingCos
if costRes == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
amount := int32(this.module.ModuleItems.QueryItemAmount(session.GetUserId(), costRes.T)) // 获取当前数量
curCount = amount
if amount < conf.HuntingNum {
if list.RecoveryTime == 0 {
list.RecoveryTime = configure.Now().Unix()
}
for { // 计算恢复时间
if list.RecoveryTime+int64(conf.HuntingRecovery*60) <= configure.Now().Unix() {
curCount++
list.RecoveryTime += int64(conf.HuntingRecovery * 60)
if curCount >= conf.HuntingNum {
list.RecoveryTime = 0
break
}
} else {
break
}
}
if curCount-amount > 0 {
addCount = curCount - amount
}
} else {
list.RecoveryTime = 0
}
addCount += req.Count
if amount+addCount > conf.HuntingNum {
code = pb.ErrorCode_HuntingBuyMaxCount
return
}
mapData["recoveryTime"] = list.RecoveryTime
for i := list.BuyCount + 1; i <= curByCount; i++ {
_cfg := this.configure.GetBuyChallengeCount(i)
if _cfg == nil {
// 取最后一条
_cfg = this.configure.GetLastBuyChallenge()
}
szCostRes = append(szCostRes, _cfg.Need...)
}
sz := make([]*cfg.Gameatn, 0)
for _, v := range szCostRes {
bFound := false
for _, v1 := range sz {
if v.A == v1.A && v.T == v1.T {
v1.N += v.N
bFound = true
break
}
}
if !bFound {
sz = append(sz, v)
}
}
//消耗
if code = this.module.ConsumeRes(session, sz, true); code != pb.ErrorCode_Success {
return
}
res := &cfg.Gameatn{
A: "item",
T: costRes.T,
N: addCount,
}
if code = this.module.DispenseRes(session, []*cfg.Gameatn{res}, true); code != pb.ErrorCode_Success {
return
}
list.BuyCount = curByCount
mapData["buyCount"] = curByCount
code = this.module.ModifyHuntingData(session.GetUserId(), mapData)
session.SendMsg(string(this.module.GetType()), HuntingBuyResp, &pb.HuntingBuyResp{Data: list})
session.SendMsg(string(this.module.GetType()), HuntingBuyResp, &pb.HuntingBuyResp{})
return
}

View File

@ -101,6 +101,11 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
mapData["bossTime"] = hunting.BossTime
code = this.module.ModifyHuntingData(session.GetUserId(), mapData)
if session.GetUserId() != "" { // 恢复时间
if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
hunting.RecoveryTime = userexpand.Recovertimeunifiedticket
}
}
session.SendMsg(string(this.module.GetType()), HuntingChallengeOverResp, &pb.HuntingChallengeOverResp{Data: hunting})
// 随机任务统计
@ -108,7 +113,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
this.module.ModuleRtask.SendToRtask(session, comm.Rtype82, req.BossType)
// 狩猎副本掉落觉醒材料
for _, v := range reward {
if _conf, err := this.configure.GetItemConfigureData(v.T); err == nil {
if _conf, err := this.module.configure.GetItemConfigureData(v.T); err == nil {
if _conf.Usetype == 8 {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype154, v.N)
}
@ -116,7 +121,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
}
if newChallenge && bWin {
for _, v := range cfgHunting.Firstprize {
if _conf, err := this.configure.GetItemConfigureData(v.T); err == nil {
if _conf, err := this.module.configure.GetItemConfigureData(v.T); err == nil {
if _conf.Usetype == 8 {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype154, v.N)
}

View File

@ -4,9 +4,6 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/mgo"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
"strconv"
"go.mongodb.org/mongo-driver/bson/primitive"
@ -20,16 +17,15 @@ func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.HuntingGetL
}
func (this *apiComp) GetList(session comm.IUserSession, req *pb.HuntingGetListReq) (code pb.ErrorCode, data proto.Message) {
var (
mapData map[string]interface{}
curCount int32
)
mapData = make(map[string]interface{}, 0)
code = this.GetListCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
// 刷新挑战卷
if code = this.module.ModuleItems.RecoverTicket(session); code != pb.ErrorCode_Success {
return
}
list, err := this.module.modelHunting.getHuntingList(session.GetUserId())
if mgo.MongodbNil == err {
list = &pb.DBHunting{
@ -46,80 +42,13 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.HuntingGetListRe
}
this.module.modelHunting.Add(session.GetUserId(), list)
conf := this.module.configure.GetGlobalConf()
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
iCont := conf.HuntingNum
atn := conf.HuntingCos
if iCont > 0 {
res := &cfg.Gameatn{
A: atn.A,
T: atn.T,
N: iCont,
}
this.module.DispenseRes(session, []*cfg.Gameatn{res}, true)
}
} else if err != nil {
code = pb.ErrorCode_DBError
return
}
// 校验 是不是当天
if !utils.IsToday(list.CTime) {
list.CTime = configure.Now().Unix()
list.BuyCount = 0
mapData["cTime"] = list.CTime
mapData["buyCount"] = list.BuyCount
}
// 检查恢复时间
conf := this.module.configure.GetGlobalConf()
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
costRes := conf.HuntingCos
if costRes == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
amount := int32(this.module.ModuleItems.QueryItemAmount(session.GetUserId(), costRes.T)) // 获取当前数量
curCount = amount
if amount < conf.HuntingNum {
if list.RecoveryTime == 0 {
list.RecoveryTime = configure.Now().Unix()
if session.GetUserId() != "" { // 恢复时间
if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
list.RecoveryTime = userexpand.Recovertimeunifiedticket
}
for { // 计算恢复时间
if list.RecoveryTime+int64(conf.HuntingRecovery*60) <= configure.Now().Unix() {
curCount++
list.RecoveryTime += int64(conf.HuntingRecovery * 60)
if curCount >= conf.HuntingNum {
list.RecoveryTime = 0
break
}
} else {
break
}
}
addCount := curCount - amount
if addCount > 0 {
res := &cfg.Gameatn{
A: "item",
T: costRes.T,
N: addCount,
}
if code = this.module.DispenseRes(session, []*cfg.Gameatn{res}, true); code != pb.ErrorCode_Success {
return
}
}
} else {
list.RecoveryTime = 0
}
mapData["recoveryTime"] = list.RecoveryTime
code = this.module.ModifyHuntingData(session.GetUserId(), mapData) //修改内存信息
session.SendMsg(string(this.module.GetType()), HuntingGetListResp, &pb.HuntingGetListResp{Data: list})
return
}

View File

@ -5,6 +5,7 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/redis/pipe"
"go_dreamfactory/pb"
"go_dreamfactory/sys/db"
"strconv"
"github.com/go-redis/redis/v8"
@ -26,11 +27,13 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.HuntingRankList
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
conn, _ := db.Local()
dbModel := db.NewDBModel(comm.TableHuntingRank, 0, conn)
if !req.Friend {
var (
pipe *pipe.RedisPipe = this.module.modelHunting.Redis.RedisPipe(context.TODO())
pipe *pipe.RedisPipe = conn.Redis.RedisPipe(context.TODO())
)
rd = pipe.ZRange("huntingRank"+strconv.Itoa(int(req.BoosType)), 0, -1)
rd = pipe.ZRevRange("huntingRank"+strconv.Itoa(int(req.BoosType)), 0, comm.MaxRankList)
if _, err := pipe.Exec(); err != nil {
this.module.Errorln(err)
@ -39,11 +42,11 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.HuntingRankList
_dataList := rd.Val()
for _, v := range _dataList {
result := &pb.DBHuntingRank{}
if err := this.module.modulerank.GetListObj(session.GetUserId(), v, result); err == nil {
if err := dbModel.Redis.HGetAll(v, result); err == nil {
szRank = append(szRank, result)
}
}
} else {
uids := this.friend.GetFriendList(session.GetUserId())
for _, id := range uids {

View File

@ -86,7 +86,7 @@ func (this *Hunting) CheckRank(uid string, boosID int32, difficulty int32, repor
model := db.NewDBModel(comm.TableHuntingRank, time.Hour, conn_)
costTime := report.Costtime
szLine := make([]*pb.LineUp, 5)
szLine := make([]*pb.LineUp, len(report.Info.Redflist[0].Team))
Leadpos := 0
if report != nil && report.Info != nil && len(report.Info.Redflist) > 0 {
costTime = report.Costtime
@ -147,7 +147,8 @@ func (this *Hunting) CheckRank(uid string, boosID int32, difficulty int32, repor
)
score = int64(difficulty)<<31 + int64(math.MaxInt32-costTime)
tableName = "huntingRank" + strconv.Itoa(int(boosID))
menbers = &redis.Z{Score: float64(score), Member: objID}
strKey := "huntingRank:" + uid + "-" + objID
menbers = &redis.Z{Score: float64(score), Member: strKey}
if cmd := pipe.ZAdd(tableName, menbers); cmd != nil {

View File

@ -33,6 +33,8 @@ const (
SociatySubTypeTasklist = "tasklist"
SociatySubTypeLog = "log"
SociatySubTypeAgreePush = "agree"
SociatySubTypeRecord = "record"
SociatySubTypeFormation = "formation"
)
type apiComp struct {

View File

@ -0,0 +1,43 @@
package sociaty
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
// 设置阵容
func (this *apiComp) FormationCheck(session comm.IUserSession, req *pb.SociatyBFormationReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) Formation(session comm.IUserSession, req *pb.SociatyBFormationReq) (code pb.ErrorCode, data proto.Message) {
if code = this.FormationCheck(session, req); code != pb.ErrorCode_Success {
return
}
uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty != nil && sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound
this.module.Error("当前玩家所在的公会未找到", log.Field{Key: "uid", Value: uid})
return
}
if err := this.module.modelSociatyBoss.setFormation(sociaty, uid, req.Teams); err != nil {
this.module.Error("设置阵容", log.Field{Key: "uid", Value: uid})
code = pb.ErrorCode_DBError
return
}
rsp := &pb.SociatyBFormationResp{
SociatyId: sociaty.Id,
}
if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeFormation, rsp); err != nil {
code = pb.ErrorCode_SystemError
}
return
}

View File

@ -0,0 +1,16 @@
package sociaty
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
func (this *apiComp) BreceiveCheck(session comm.IUserSession, req *pb.SociatyBReceiveReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) Breceive(session comm.IUserSession, req *pb.SociatyBReceiveReq) (code pb.ErrorCode, data proto.Message) {
return
}

View File

@ -0,0 +1,16 @@
package sociaty
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.SociatyBChallengeReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) Challenge(session comm.IUserSession, req *pb.SociatyBChallengeReq) (code pb.ErrorCode, data proto.Message) {
return
}

View File

@ -58,7 +58,7 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.SociatyMineReq) (co
// 今日首次进入公会
if utils.IsFirstTody(sociatyTask.LastUpdateTime) {
//更新昨日签到数
this.module.modelSociaty.updateSign(sociaty)
this.module.modelSociaty.clearSigned(sociaty)
// 删除任务
if err := this.module.modelSociatyTask.deleTask(sociaty.Id, uid); err == nil {
// 初始新的公会任务
@ -90,6 +90,11 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.SociatyMineReq) (co
)
}
}
if sm := this.module.modelSociaty.getMemberInfo(sociaty, uid); sm != nil {
rsp.Teams = sm.Teams
}
rsp.Sociaty = sociaty
rsp.Master = master

View File

@ -468,6 +468,16 @@ func (this *ModelSociaty) getMemberIds(sociaty *pb.DBSociaty) (ids []string) {
return
}
// 获取成员信息
func (this *ModelSociaty) getMemberInfo(sociaty *pb.DBSociaty, uid string) *pb.SociatyMember {
for _, s := range sociaty.Members {
if s.Uid == uid {
return s
}
}
return nil
}
// 同意
func (this *ModelSociaty) agree(uid string, sociaty *pb.DBSociaty) error {
if this.isMember(uid, sociaty) {
@ -951,7 +961,8 @@ func (this *ModelSociaty) memberClear(sociaty *pb.DBSociaty) error {
return nil
}
func (s *ModelSociaty) updateSign(sociaty *pb.DBSociaty) error {
// 清理签到数据
func (s *ModelSociaty) clearSigned(sociaty *pb.DBSociaty) error {
lastSignCount := len(sociaty.SignIds)
update := map[string]interface{}{
"lastSignCount": lastSignCount,

View File

@ -0,0 +1,57 @@
package sociaty
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
type ModelSociatyBoss struct {
modules.MCompModel
moduleSociaty *Sociaty
service core.IService
}
func (this *ModelSociatyBoss) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.TableName = comm.TableSociatyBoss
err = this.MCompModel.Init(service, module, comp, options)
this.moduleSociaty = module.(*Sociaty)
this.service = service
return
}
// 设置阵容
func (s *ModelSociatyBoss) setFormation(sociaty *pb.DBSociaty, uid string, teams map[int32]*pb.ChallengeTeams) error {
if !s.moduleSociaty.modelSociaty.isMember(uid, sociaty) {
return comm.NewCustomError(pb.ErrorCode_SociatyBelongTo)
}
for _, m := range sociaty.Members {
if m.Uid == uid {
m.Teams = teams
}
}
update := map[string]interface{}{
"members": sociaty.Members,
}
return s.moduleSociaty.modelSociaty.updateSociaty(sociaty.Id, update)
}
//挑战
func (s *ModelSociatyBoss) challenge(session comm.IUserSession) error {
iBattle, err := s.moduleSociaty.service.GetModule(comm.ModuleBattle)
if err != nil {
return err
}
if b, y := iBattle.(comm.IBattle); y {
b.CreatePveBattle(session, &pb.BattlePVEReq{
Ptype: pb.PlayType_sociaty,
Title: "公会BOSS",
Format: &pb.BattleFormation{},
})
}
return nil
}

View File

@ -29,6 +29,7 @@ type Sociaty struct {
modelSociaty *ModelSociaty
modelSociatyTask *ModelSociatyTask
modelSociatyLog *ModelSociatyLog
modelSociatyBoss *ModelSociatyBoss
configure *configureComp
globalConf *cfg.GameGlobalData
sociatyActivityConf *cfg.GameGuildActivity
@ -57,6 +58,7 @@ func (this *Sociaty) OnInstallComp() {
this.modelSociaty = this.RegisterComp(new(ModelSociaty)).(*ModelSociaty)
this.modelSociatyTask = this.RegisterComp(new(ModelSociatyTask)).(*ModelSociatyTask)
this.modelSociatyLog = this.RegisterComp(new(ModelSociatyLog)).(*ModelSociatyLog)
this.modelSociatyBoss = this.RegisterComp(new(ModelSociatyBoss)).(*ModelSociatyBoss)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}

View File

@ -91,6 +91,11 @@ func (this *ModelTaskActive) getActiveListByTag(uid string, taskTag comm.TaskTag
// 查询完成的且未领取的任务 发现未领取返回true
func (this *ModelTaskActive) noReceiveTaskActive(uid string, taskTag comm.TaskTag) (bool, error) {
// 获取玩家活跃度
expand, err := this.moduleTask.ModuleUser.GetUserExpand(uid)
if err != nil {
return false, err
}
task := &pb.DBActivity{}
if err := this.Get(uid, task); err != nil {
this.moduleTask.Errorf("getTaskActivityList err %v", err)
@ -99,7 +104,19 @@ func (this *ModelTaskActive) noReceiveTaskActive(uid string, taskTag comm.TaskTa
for _, v := range task.ActivityList {
if v.Tag == int32(taskTag) && v.Received == 0 {
return true, nil
conf := this.moduleTask.configure.getTaskActiveById(v.TaskId)
if conf != nil && expand != nil {
switch taskTag {
case comm.TASK_DAILY:
if expand.Activeday >= conf.Active {
return true, nil
}
case comm.TASK_WEEKLY:
if expand.Activeweek >= conf.Active {
return true, nil
}
}
}
}
}
return false, nil
@ -129,8 +146,8 @@ func (this *ModelTaskActive) clearTask(uid string, taskTag ...comm.TaskTag) {
this.moduleTask.Errorf("least one param for taskTag")
return
}
data := this.getActiveListByTag(uid, taskTag[0])
for i:=0; i<len(data); i++ {
data := this.getActiveList(uid)
for i := 0; i < len(data); i++ {
if data[i].Tag == int32(taskTag[0]) {
data = append(data[:i], data[i+1:]...)
i--

View File

@ -66,11 +66,11 @@ func (this *SeasonPagoda) Start() (err error) {
if db.IsCross() {
return
}
time.Sleep(time.Second * 1)
//time.Sleep(time.Second * 1)
//this.DbTest()
conn, err := db.Cross()
if err == nil {
this.DbTest()
//this.DbTest()
model := db.NewDBModel(comm.TableServerData, 0, conn)
_len, err1 := model.DB.CountDocuments(comm.TableServerData, bson.M{})
@ -197,7 +197,7 @@ func (this *SeasonPagoda) TimerSeasonStar() {
func (this *SeasonPagoda) DbTest() {
conn, _ := db.Cross()
model1 := db.NewDBModel(comm.TableVikingRank, time.Hour, conn)
model1 := db.NewDBModel(comm.TableVikingRank, 0, conn)
model1.Redis.Delete("vikingRank2")
_d, err := model1.Redis.Keys("vikingrank:*")
if err == nil {
@ -221,8 +221,8 @@ func (this *SeasonPagoda) DbTest() {
Line: make([]*pb.LineUp, 5),
CostTime: 12000 + int32(i),
}
//model1.AddList(new.Uid, new.Id, new)
model1.Add(new.Uid, new)
model1.AddList(new.Uid, new.Id, new)
//model1.Add(new.Uid, new)
var (
pipe *pipe.RedisPipe = conn.Redis.RedisPipe(context.TODO())
menbers *redis.Z
@ -232,7 +232,7 @@ func (this *SeasonPagoda) DbTest() {
score = int64(i)<<31 + int64(math.MaxInt32-new.CostTime)
tableName = "vikingRank" + strconv.Itoa(int(new.Bosstype))
//vikingrank:mmmxxx1-63bbb137b96efbd321222ce7
strKey := new.Uid //"vikingrank:" + new.Uid + "-" + new.Id // 自定义key
strKey := "vikingrank:" + new.Uid + "-" + new.Id // 自定义key new.Uid //
menbers = &redis.Z{Score: float64(score), Member: strKey}
if cmd := pipe.ZAdd(tableName, menbers); cmd != nil {
@ -262,17 +262,17 @@ func (this *SeasonPagoda) DbTest() {
_dataList := rd.Val()
for _, v := range _dataList {
result := &pb.DBVikingRank{}
if err := model1.Get(v, result); err == nil {
//for _, v2 := range result {
szRank = append(szRank, result)
//}
if err := model1.Redis.HGetAll(v, result); err == nil {
szRank = append(szRank, result)
}
// result := make([]*pb.DBVikingRank, 0)
// if err := model1.GetList(v, &result); err == nil {
// for _, v2 := range result {
// szRank = append(szRank, v2)
// }
// }
}
this.module.Debugf("%v", szRank)
}

View File

@ -3,9 +3,6 @@ package viking
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
"google.golang.org/protobuf/proto"
)
@ -19,124 +16,9 @@ func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.VikingBuyReq) (
return
}
// 协议废弃 走通用字段
func (this *apiComp) Buy(session comm.IUserSession, req *pb.VikingBuyReq) (code pb.ErrorCode, data proto.Message) {
var (
curByCount int32
costRes *cfg.Gameatn
mapData map[string]interface{}
curCount int32 // 当前门票数量
szcostRes []*cfg.Gameatn // 购买累计消耗
addCount int32 //获得数量
PrivilegeBuyCount int32 // 特权购买次数
)
mapData = make(map[string]interface{}, 0)
code = this.BuyCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
list, err := this.module.modelViking.getVikingList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
// 校验是不是今天
if !utils.IsToday(list.CTime) {
list.CTime = configure.Now().Unix()
list.BuyCount = 0
mapData["cTime"] = list.CTime
mapData["buyCount"] = list.BuyCount
} else {
curByCount = list.BuyCount
}
PrivilegeBuyCount = this.module.ModulePrivilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType3)
conf := this.module.configure.GetGlobalConf()
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
costRes = conf.VikingExpeditionCos
if costRes == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
amount := int32(this.module.ModuleItems.QueryItemAmount(session.GetUserId(), costRes.T)) // 获取当前数量
curCount = amount
if amount < conf.VikingNum {
if list.RecoveryTime == 0 {
list.RecoveryTime = configure.Now().Unix()
}
for { // 计算恢复时间
if list.RecoveryTime+int64(conf.VikingExpeditionRecoveryTime*60) <= configure.Now().Unix() {
curCount++
list.RecoveryTime += int64(conf.VikingExpeditionRecoveryTime * 60)
if curCount >= conf.VikingNum {
list.RecoveryTime = 0
break
}
} else {
break
}
}
if curCount-amount > 0 {
addCount = curCount - amount
}
} else {
list.RecoveryTime = 0
}
addCount += req.Count
if amount+addCount > conf.VikingNum {
code = pb.ErrorCode_VikingBuyMaxCount
return
}
mapData["recoveryTime"] = list.RecoveryTime // 更新刷新时间
curByCount += req.Count // 当前需要购买的数量
if this.configure.GetMaxBuyChallengeCount()+PrivilegeBuyCount < curByCount {
code = pb.ErrorCode_VikingBuyMaxCount
return
}
// 消耗资源整合
for i := list.BuyCount + 1; i <= curByCount; i++ {
_cfg := this.configure.GetBuyChallengeCount(i)
if _cfg == nil {
// 取最后一条
_cfg = this.configure.GetLastBuyChallenge()
}
szcostRes = append(szcostRes, _cfg.Need...)
}
sz := make([]*cfg.Gameatn, 0)
for _, v := range szcostRes {
bFound := false
for _, v1 := range sz {
if v.A == v1.A && v.T == v1.T {
v1.N += v.N
bFound = true
}
}
if !bFound {
sz = append(sz, v)
}
}
//消耗
if code = this.module.ConsumeRes(session, sz, true); code != pb.ErrorCode_Success {
return
}
res := &cfg.Gameatn{
A: "item",
T: costRes.T,
N: addCount,
}
if code = this.module.DispenseRes(session, []*cfg.Gameatn{res}, true); code != pb.ErrorCode_Success {
return
}
list.BuyCount = curByCount
mapData["buyCount"] = curByCount
code = this.module.ModifyVikingData(session.GetUserId(), mapData)
session.SendMsg(string(this.module.GetType()), VikingBuyResp, &pb.VikingBuyResp{Data: list})
session.SendMsg(string(this.module.GetType()), VikingBuyResp, &pb.VikingBuyResp{})
return
}

View File

@ -129,6 +129,12 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
// }
// }
code = this.module.ModifyVikingData(session.GetUserId(), mapData)
if session.GetUserId() != "" { // 恢复时间
if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
viking.RecoveryTime = userexpand.Recovertimeunifiedticket
}
}
session.SendMsg(string(this.module.GetType()), VikingChallengeOverResp, &pb.VikingChallengeOverResp{
Data: viking,
Asset: atno,

View File

@ -4,9 +4,6 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/mgo"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
"strconv"
"go.mongodb.org/mongo-driver/bson/primitive"
@ -20,16 +17,14 @@ func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.VikingGetLi
}
func (this *apiComp) GetList(session comm.IUserSession, req *pb.VikingGetListReq) (code pb.ErrorCode, data proto.Message) {
var (
mapData map[string]interface{}
curCount int32
)
mapData = make(map[string]interface{}, 0)
code = this.GetListCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
// 刷新挑战卷
if code = this.module.ModuleItems.RecoverTicket(session); code != pb.ErrorCode_Success {
return
}
list, err := this.module.modelViking.getVikingList(session.GetUserId())
if mgo.MongodbNil == err {
list = &pb.DBViking{
@ -46,78 +41,12 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.VikingGetListReq
}
this.module.modelViking.Add(session.GetUserId(), list)
conf := this.module.configure.GetGlobalConf()
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
iCont := conf.VikingNum
atn := conf.VikingExpeditionCos
if iCont > 0 {
res := &cfg.Gameatn{
A: atn.A,
T: atn.T,
N: iCont,
}
this.module.DispenseRes(session, []*cfg.Gameatn{res}, true)
}
if session.GetUserId() != "" { // 恢复时间
if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
list.RecoveryTime = userexpand.Recovertimeunifiedticket
}
}
// 校验 是不是当天
if !utils.IsToday(list.CTime) {
list.CTime = configure.Now().Unix()
list.BuyCount = 0
mapData["cTime"] = list.CTime
mapData["buyCount"] = list.BuyCount
}
// 检查恢复时间
conf := this.module.configure.GetGlobalConf()
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
costRes := conf.VikingExpeditionCos
if costRes == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
amount := int32(this.module.ModuleItems.QueryItemAmount(session.GetUserId(), costRes.T)) // 获取当前数量
curCount = amount
// 道具上限
if amount < conf.VikingNum {
if list.RecoveryTime == 0 {
list.RecoveryTime = configure.Now().Unix()
}
for { // 计算恢复时间
if list.RecoveryTime+int64(conf.VikingExpeditionRecoveryTime*60) <= configure.Now().Unix() {
curCount++
list.RecoveryTime += int64(conf.VikingExpeditionRecoveryTime * 60)
if curCount >= conf.VikingNum {
list.RecoveryTime = 0
break
}
} else {
break
}
}
addCount := curCount - amount
if addCount > 0 {
res := &cfg.Gameatn{
A: "item",
T: costRes.T,
N: addCount,
}
if code = this.module.DispenseRes(session, []*cfg.Gameatn{res}, true); code != pb.ErrorCode_Success {
return
}
}
} else {
list.RecoveryTime = 0
}
mapData["recoveryTime"] = list.RecoveryTime
code = this.module.ModifyVikingData(session.GetUserId(), mapData) //修改内存信息
session.SendMsg(string(this.module.GetType()), VikingGetListResp, &pb.VikingGetListResp{Data: list})
return
}

View File

@ -30,11 +30,12 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.VikingRankListR
return // 参数校验失败直接返回
}
conn, _ := db.Local()
dbModel := db.NewDBModel(comm.TableVikingRank, 0, conn)
if !req.Friend {
var (
pipe *pipe.RedisPipe = conn.Redis.RedisPipe(context.TODO())
)
rd = pipe.ZRange("vikingRank"+strconv.Itoa(int(req.BoosType)), 0, -1)
rd = pipe.ZRevRange("vikingRank"+strconv.Itoa(int(req.BoosType)), 0, comm.MaxRankList)
if _, err := pipe.Exec(); err != nil {
this.module.Errorln(err)
@ -42,13 +43,10 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.VikingRankListR
}
_dataList := rd.Val()
for _, v := range _dataList {
result := make([]*pb.DBVikingRank, 0)
if err := this.module.modulerank.GetList(v, &result); err == nil {
for _, v2 := range result {
if v2.Bosstype == req.BoosType {
szRank = append(szRank, v2)
}
}
result := &pb.DBVikingRank{}
if err := dbModel.Redis.HGetAll(v, result); err == nil {
szRank = append(szRank, result)
}
}

View File

@ -12,12 +12,10 @@ import (
"go_dreamfactory/lego/sys/redis/pipe"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/sys/db"
"math"
"strconv"
"time"
"github.com/go-redis/redis/v8"
"go.mongodb.org/mongo-driver/bson/primitive"
@ -91,10 +89,10 @@ func (this *Viking) CheckUserBaseVikingInfo(uid string) (data []*pb.DBVikingRank
func (this *Viking) CheckRank(uid string, boosID int32, difficulty int32, report *pb.BattleReport, userinfo *pb.DBUser) {
conn_, _ := db.Cross() // 获取跨服数据库对象
model := db.NewDBModel(comm.TableVikingRank, time.Hour, conn_)
model := db.NewDBModel(comm.TableVikingRank, 0, conn_)
costTime := report.Costtime
szLine := make([]*pb.LineUp, 5)
szLine := make([]*pb.LineUp, len(report.Info.Redflist[0].Team))
Leadpos := 0
if report != nil && report.Info != nil && len(report.Info.Redflist) > 0 {
costTime = report.Costtime
@ -155,7 +153,8 @@ func (this *Viking) CheckRank(uid string, boosID int32, difficulty int32, report
)
score = int64(difficulty)<<31 + int64(math.MaxInt32-costTime)
tableName = "vikingRank" + strconv.Itoa(int(boosID))
menbers = &redis.Z{Score: float64(score), Member: objID}
strKey := "vikingrank:" + uid + "-" + objID // 自定义key
menbers = &redis.Z{Score: float64(score), Member: strKey}
if cmd := pipe.ZAdd(tableName, menbers); cmd != nil {
@ -261,22 +260,12 @@ func (this *Viking) AutoBattleOver(session comm.IUserSession, Report *pb.BattleR
if code = this.ConsumeRes(session, []*cfg.Gameatn{costRes}, true); code != pb.ErrorCode_Success {
return
}
amount := int32(this.ModuleItems.QueryItemAmount(session.GetUserId(), costRes.T)) // 获取当前数量
viking, err := this.modelViking.getVikingList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_VikingBoosType
return
}
conf := this.configure.GetGlobalConf()
if conf != nil {
if amount < conf.VikingNum && viking.RecoveryTime == 0 {
mapData := make(map[string]interface{}, 0)
viking.RecoveryTime = configure.Now().Unix()
mapData["recoveryTime"] = viking.RecoveryTime
code = this.ModifyVikingData(session.GetUserId(), mapData)
}
}
code, bWin := this.battle.CheckBattleReport(session, Report)
if !bWin { // 战斗失败了 直接返回
code = pb.ErrorCode_BattleNoWin

View File

@ -321,10 +321,12 @@ type SociatyMember struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid" bson:"uid"` //成员ID
Job SociatyJob `protobuf:"varint,2,opt,name=job,proto3,enum=SociatyJob" json:"job" bson:"job"` //职位
Ctime int64 `protobuf:"varint,3,opt,name=ctime,proto3" json:"ctime" bson:"ctime"` //入会时间
Contribution int32 `protobuf:"varint,4,opt,name=contribution,proto3" json:"contribution" bson:"contribution"` //贡献值
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid" bson:"uid"` //成员ID
Job SociatyJob `protobuf:"varint,2,opt,name=job,proto3,enum=SociatyJob" json:"job" bson:"job"` //职位
Ctime int64 `protobuf:"varint,3,opt,name=ctime,proto3" json:"ctime" bson:"ctime"` //入会时间
Contribution int32 `protobuf:"varint,4,opt,name=contribution,proto3" json:"contribution" bson:"contribution"` //贡献值
ChallengeTicket int32 `protobuf:"varint,5,opt,name=challengeTicket,proto3" json:"challengeTicket" bson:"challengeTicket"` //挑战券
Teams map[int32]*ChallengeTeams `protobuf:"bytes,6,rep,name=teams,proto3" json:"teams" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" bson:"teams"` // 公会BOSS 队伍
}
func (x *SociatyMember) Reset() {
@ -387,6 +389,20 @@ func (x *SociatyMember) GetContribution() int32 {
return 0
}
func (x *SociatyMember) GetChallengeTicket() int32 {
if x != nil {
return x.ChallengeTicket
}
return 0
}
func (x *SociatyMember) GetTeams() map[int32]*ChallengeTeams {
if x != nil {
return x.Teams
}
return nil
}
// 日志
type SociatyLog struct {
state protoimpl.MessageState
@ -698,7 +714,7 @@ func (x *SociatyActivity) GetStatus() int32 {
return 0
}
//排行榜
//任务活跃度排行榜
type DBSociatyRank struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -778,6 +794,197 @@ func (x *DBSociatyRank) GetCtime() int64 {
return 0
}
// 挑战队伍
type ChallengeTeamInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
HeroId string `protobuf:"bytes,1,opt,name=heroId,proto3" json:"heroId" bson:"heroId"` //英雄ID
}
func (x *ChallengeTeamInfo) Reset() {
*x = ChallengeTeamInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_sociaty_sociaty_db_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChallengeTeamInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChallengeTeamInfo) ProtoMessage() {}
func (x *ChallengeTeamInfo) ProtoReflect() protoreflect.Message {
mi := &file_sociaty_sociaty_db_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ChallengeTeamInfo.ProtoReflect.Descriptor instead.
func (*ChallengeTeamInfo) Descriptor() ([]byte, []int) {
return file_sociaty_sociaty_db_proto_rawDescGZIP(), []int{9}
}
func (x *ChallengeTeamInfo) GetHeroId() string {
if x != nil {
return x.HeroId
}
return ""
}
type ChallengeTeams struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Infos []*ChallengeTeamInfo `protobuf:"bytes,1,rep,name=infos,proto3" json:"infos" bson:"teamInfo"` //队伍
}
func (x *ChallengeTeams) Reset() {
*x = ChallengeTeams{}
if protoimpl.UnsafeEnabled {
mi := &file_sociaty_sociaty_db_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChallengeTeams) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChallengeTeams) ProtoMessage() {}
func (x *ChallengeTeams) ProtoReflect() protoreflect.Message {
mi := &file_sociaty_sociaty_db_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ChallengeTeams.ProtoReflect.Descriptor instead.
func (*ChallengeTeams) Descriptor() ([]byte, []int) {
return file_sociaty_sociaty_db_proto_rawDescGZIP(), []int{10}
}
func (x *ChallengeTeams) GetInfos() []*ChallengeTeamInfo {
if x != nil {
return x.Infos
}
return nil
}
// 成员公会BOSS历史记录
type DBSociatyBossRecord struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SociatyId string `protobuf:"bytes,1,opt,name=sociatyId,proto3" json:"sociatyId" bson:"sociatyId"` //公会ID
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //玩家ID
Integral int32 `protobuf:"varint,3,opt,name=integral,proto3" json:"integral" bson:"integral"` //公会BOSS挑战积分
Evaluate int32 `protobuf:"varint,4,opt,name=evaluate,proto3" json:"evaluate" bson:"evaluate"` //评价
Teams map[int32]*ChallengeTeams `protobuf:"bytes,5,rep,name=teams,proto3" json:"teams" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" bson:"teams"` //挑战队伍
Duration int32 `protobuf:"varint,6,opt,name=duration,proto3" json:"duration" bson:"duration"` //战斗耗时
Rtime int64 `protobuf:"varint,7,opt,name=rtime,proto3" json:"rtime" bson:"rtime"` //记录时间
}
func (x *DBSociatyBossRecord) Reset() {
*x = DBSociatyBossRecord{}
if protoimpl.UnsafeEnabled {
mi := &file_sociaty_sociaty_db_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBSociatyBossRecord) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBSociatyBossRecord) ProtoMessage() {}
func (x *DBSociatyBossRecord) ProtoReflect() protoreflect.Message {
mi := &file_sociaty_sociaty_db_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DBSociatyBossRecord.ProtoReflect.Descriptor instead.
func (*DBSociatyBossRecord) Descriptor() ([]byte, []int) {
return file_sociaty_sociaty_db_proto_rawDescGZIP(), []int{11}
}
func (x *DBSociatyBossRecord) GetSociatyId() string {
if x != nil {
return x.SociatyId
}
return ""
}
func (x *DBSociatyBossRecord) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *DBSociatyBossRecord) GetIntegral() int32 {
if x != nil {
return x.Integral
}
return 0
}
func (x *DBSociatyBossRecord) GetEvaluate() int32 {
if x != nil {
return x.Evaluate
}
return 0
}
func (x *DBSociatyBossRecord) GetTeams() map[int32]*ChallengeTeams {
if x != nil {
return x.Teams
}
return nil
}
func (x *DBSociatyBossRecord) GetDuration() int32 {
if x != nil {
return x.Duration
}
return 0
}
func (x *DBSociatyBossRecord) GetRtime() int64 {
if x != nil {
return x.Rtime
}
return 0
}
var File_sociaty_sociaty_db_proto protoreflect.FileDescriptor
var file_sociaty_sociaty_db_proto_rawDesc = []byte{
@ -818,60 +1025,96 @@ var file_sociaty_sociaty_db_proto_rawDesc = []byte{
0x0a, 0x0b, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a,
0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12,
0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
0x63, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x7a, 0x0a, 0x0d, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79,
0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x03, 0x6a, 0x6f, 0x62, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4a,
0x6f, 0x62, 0x52, 0x03, 0x6a, 0x6f, 0x62, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65,
0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x22, 0x0a,
0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20,
0x01, 0x28, 0x05, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f,
0x6e, 0x22, 0x3c, 0x0a, 0x0a, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4c, 0x6f, 0x67, 0x12,
0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69,
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x22,
0x4d, 0x0a, 0x0c, 0x44, 0x42, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4c, 0x6f, 0x67, 0x12,
0x1c, 0x0a, 0x09, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x09, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x49, 0x64, 0x12, 0x1f, 0x0a,
0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x53, 0x6f,
0x63, 0x69, 0x61, 0x74, 0x79, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xc7,
0x01, 0x0a, 0x0d, 0x44, 0x42, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x54, 0x61, 0x73, 0x6b,
0x12, 0x1c, 0x0a, 0x09, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x49, 0x64, 0x12, 0x10,
0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64,
0x12, 0x28, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x54, 0x61, 0x73, 0x6b,
0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x0c, 0x61, 0x63,
0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x10, 0x2e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69,
0x74, 0x79, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74,
0x12, 0x26, 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69,
0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x59, 0x0a, 0x0b, 0x53, 0x6f, 0x63, 0x69,
0x61, 0x74, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12,
0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69,
0x76, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69,
0x76, 0x65, 0x64, 0x22, 0x39, 0x0a, 0x0f, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x63,
0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x83,
0x01, 0x0a, 0x0d, 0x44, 0x42, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x52, 0x61, 0x6e, 0x6b,
0x12, 0x1c, 0x0a, 0x09, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x49, 0x64, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02,
0x6c, 0x76, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, 0x04,
0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x14,
0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63,
0x74, 0x69, 0x6d, 0x65, 0x2a, 0x50, 0x0a, 0x0a, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4a,
0x6f, 0x62, 0x12, 0x09, 0x0a, 0x05, 0x4e, 0x4f, 0x4a, 0x4f, 0x42, 0x10, 0x00, 0x12, 0x0a, 0x0a,
0x06, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x44, 0x4d,
0x49, 0x4e, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x56, 0x49, 0x43, 0x45, 0x50, 0x52, 0x45, 0x53,
0x49, 0x44, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x52, 0x45, 0x53, 0x49,
0x44, 0x45, 0x4e, 0x54, 0x10, 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x63, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xa0, 0x02, 0x0a, 0x0d, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74,
0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x03, 0x6a, 0x6f, 0x62,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79,
0x4a, 0x6f, 0x62, 0x52, 0x03, 0x6a, 0x6f, 0x62, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x22,
0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04,
0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69,
0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x54,
0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x63, 0x68, 0x61,
0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x2f, 0x0a, 0x05,
0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x53, 0x6f,
0x63, 0x69, 0x61, 0x74, 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x61, 0x6d,
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x1a, 0x49, 0x0a,
0x0a, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x25, 0x0a,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x43,
0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3c, 0x0a, 0x0a, 0x53, 0x6f, 0x63, 0x69,
0x61, 0x74, 0x79, 0x4c, 0x6f, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x4d, 0x0a, 0x0c, 0x44, 0x42, 0x53, 0x6f, 0x63, 0x69,
0x61, 0x74, 0x79, 0x4c, 0x6f, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74,
0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x6f, 0x63, 0x69, 0x61,
0x74, 0x79, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x4c, 0x6f, 0x67, 0x52,
0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xc7, 0x01, 0x0a, 0x0d, 0x44, 0x42, 0x53, 0x6f, 0x63, 0x69,
0x61, 0x74, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x6f, 0x63, 0x69, 0x61,
0x74, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x6f, 0x63, 0x69,
0x61, 0x74, 0x79, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4c,
0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x53, 0x6f, 0x63, 0x69,
0x61, 0x74, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73,
0x74, 0x12, 0x34, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4c, 0x69, 0x73,
0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74,
0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76,
0x69, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52,
0x0e, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22,
0x59, 0x0a, 0x0b, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x16,
0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06,
0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a,
0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x22, 0x39, 0x0a, 0x0f, 0x53, 0x6f,
0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a,
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x0d, 0x44, 0x42, 0x53, 0x6f, 0x63, 0x69,
0x61, 0x74, 0x79, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x6f, 0x63, 0x69, 0x61,
0x74, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x6f, 0x63, 0x69,
0x61, 0x74, 0x79, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x63, 0x74,
0x69, 0x76, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x63, 0x74,
0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05,
0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x2b, 0x0a, 0x11, 0x43,
0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f,
0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x22, 0x3a, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6c,
0x6c, 0x65, 0x6e, 0x67, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x28, 0x0a, 0x05, 0x69, 0x6e,
0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x43, 0x68, 0x61, 0x6c,
0x6c, 0x65, 0x6e, 0x67, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69,
0x6e, 0x66, 0x6f, 0x73, 0x22, 0xb1, 0x02, 0x0a, 0x13, 0x44, 0x42, 0x53, 0x6f, 0x63, 0x69, 0x61,
0x74, 0x79, 0x42, 0x6f, 0x73, 0x73, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1c, 0x0a, 0x09,
0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x09, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08,
0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x76, 0x61, 0x6c,
0x75, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x65, 0x76, 0x61, 0x6c,
0x75, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x44, 0x42, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x42,
0x6f, 0x73, 0x73, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x64,
0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64,
0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65,
0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x49, 0x0a,
0x0a, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x25, 0x0a,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x43,
0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x50, 0x0a, 0x0a, 0x53, 0x6f, 0x63, 0x69,
0x61, 0x74, 0x79, 0x4a, 0x6f, 0x62, 0x12, 0x09, 0x0a, 0x05, 0x4e, 0x4f, 0x4a, 0x4f, 0x42, 0x10,
0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x01, 0x12, 0x09, 0x0a,
0x05, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x56, 0x49, 0x43, 0x45,
0x50, 0x52, 0x45, 0x53, 0x49, 0x44, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x50,
0x52, 0x45, 0x53, 0x49, 0x44, 0x45, 0x4e, 0x54, 0x10, 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -887,31 +1130,41 @@ func file_sociaty_sociaty_db_proto_rawDescGZIP() []byte {
}
var file_sociaty_sociaty_db_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_sociaty_sociaty_db_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_sociaty_sociaty_db_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_sociaty_sociaty_db_proto_goTypes = []interface{}{
(SociatyJob)(0), // 0: SociatyJob
(*DBSociaty)(nil), // 1: DBSociaty
(*ApplyRecord)(nil), // 2: ApplyRecord
(*SociatyMember)(nil), // 3: SociatyMember
(*SociatyLog)(nil), // 4: SociatyLog
(*DBSociatyLog)(nil), // 5: DBSociatyLog
(*DBSociatyTask)(nil), // 6: DBSociatyTask
(*SociatyTask)(nil), // 7: SociatyTask
(*SociatyActivity)(nil), // 8: SociatyActivity
(*DBSociatyRank)(nil), // 9: DBSociatyRank
(SociatyJob)(0), // 0: SociatyJob
(*DBSociaty)(nil), // 1: DBSociaty
(*ApplyRecord)(nil), // 2: ApplyRecord
(*SociatyMember)(nil), // 3: SociatyMember
(*SociatyLog)(nil), // 4: SociatyLog
(*DBSociatyLog)(nil), // 5: DBSociatyLog
(*DBSociatyTask)(nil), // 6: DBSociatyTask
(*SociatyTask)(nil), // 7: SociatyTask
(*SociatyActivity)(nil), // 8: SociatyActivity
(*DBSociatyRank)(nil), // 9: DBSociatyRank
(*ChallengeTeamInfo)(nil), // 10: ChallengeTeamInfo
(*ChallengeTeams)(nil), // 11: ChallengeTeams
(*DBSociatyBossRecord)(nil), // 12: DBSociatyBossRecord
nil, // 13: SociatyMember.TeamsEntry
nil, // 14: DBSociatyBossRecord.TeamsEntry
}
var file_sociaty_sociaty_db_proto_depIdxs = []int32{
2, // 0: DBSociaty.applyRecord:type_name -> ApplyRecord
3, // 1: DBSociaty.members:type_name -> SociatyMember
0, // 2: SociatyMember.job:type_name -> SociatyJob
4, // 3: DBSociatyLog.list:type_name -> SociatyLog
7, // 4: DBSociatyTask.taskList:type_name -> SociatyTask
8, // 5: DBSociatyTask.activityList:type_name -> SociatyActivity
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
2, // 0: DBSociaty.applyRecord:type_name -> ApplyRecord
3, // 1: DBSociaty.members:type_name -> SociatyMember
0, // 2: SociatyMember.job:type_name -> SociatyJob
13, // 3: SociatyMember.teams:type_name -> SociatyMember.TeamsEntry
4, // 4: DBSociatyLog.list:type_name -> SociatyLog
7, // 5: DBSociatyTask.taskList:type_name -> SociatyTask
8, // 6: DBSociatyTask.activityList:type_name -> SociatyActivity
10, // 7: ChallengeTeams.infos:type_name -> ChallengeTeamInfo
14, // 8: DBSociatyBossRecord.teams:type_name -> DBSociatyBossRecord.TeamsEntry
11, // 9: SociatyMember.TeamsEntry.value:type_name -> ChallengeTeams
11, // 10: DBSociatyBossRecord.TeamsEntry.value:type_name -> ChallengeTeams
11, // [11:11] is the sub-list for method output_type
11, // [11:11] is the sub-list for method input_type
11, // [11:11] is the sub-list for extension type_name
11, // [11:11] is the sub-list for extension extendee
0, // [0:11] is the sub-list for field type_name
}
func init() { file_sociaty_sociaty_db_proto_init() }
@ -1028,6 +1281,42 @@ func file_sociaty_sociaty_db_proto_init() {
return nil
}
}
file_sociaty_sociaty_db_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChallengeTeamInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_sociaty_sociaty_db_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChallengeTeams); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_sociaty_sociaty_db_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBSociatyBossRecord); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -1035,7 +1324,7 @@ func file_sociaty_sociaty_db_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_sociaty_sociaty_db_proto_rawDesc,
NumEnums: 1,
NumMessages: 9,
NumMessages: 14,
NumExtensions: 0,
NumServices: 0,
},

File diff suppressed because it is too large Load Diff