Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
afa59bd93b
@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -38,7 +38,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -64,7 +64,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -90,7 +90,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -116,7 +116,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -142,7 +142,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -168,7 +168,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -194,7 +194,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -220,7 +220,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -246,7 +246,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -272,7 +272,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -298,7 +298,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -324,7 +324,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -350,7 +350,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -376,7 +376,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -402,7 +402,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -428,7 +428,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -454,7 +454,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -480,7 +480,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -506,7 +506,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -532,7 +532,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -558,7 +558,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -584,7 +584,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -610,7 +610,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -636,7 +636,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -662,7 +662,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -688,7 +688,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -714,7 +714,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -762,7 +762,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -788,7 +788,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -814,7 +814,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -840,7 +840,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -866,7 +866,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -892,7 +892,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -918,7 +918,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -944,7 +944,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -970,7 +970,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -996,7 +996,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1022,7 +1022,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1048,7 +1048,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1074,7 +1074,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1100,7 +1100,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1126,7 +1126,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1152,7 +1152,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1178,7 +1178,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1204,7 +1204,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1296,7 +1296,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1322,7 +1322,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1348,7 +1348,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1374,7 +1374,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1400,7 +1400,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1426,7 +1426,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1452,7 +1452,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1478,7 +1478,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1504,7 +1504,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1530,7 +1530,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
@ -1556,7 +1556,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"param": 1
|
"param": 1100101
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optional": "",
|
"optional": "",
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
|
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
|
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ModelFriend struct {
|
type ModelFriend struct {
|
||||||
@ -21,6 +22,10 @@ func (this *ModelFriend) Init(service core.IService, module core.IModule, comp c
|
|||||||
this.TableName = comm.TableFriend
|
this.TableName = comm.TableFriend
|
||||||
err = this.MCompModel.Init(service, module, comp, options)
|
err = this.MCompModel.Init(service, module, comp, options)
|
||||||
this.moduleFriend = module.(*Friend)
|
this.moduleFriend = module.(*Friend)
|
||||||
|
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
|
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||||
|
})
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import (
|
|||||||
9、bingo:season,10 赛季塔层数
|
9、bingo:season,10 赛季塔层数
|
||||||
10、bingo:viking // 解锁维京所有难度
|
10、bingo:viking // 解锁维京所有难度
|
||||||
11、bingo:hunting // 解锁狩猎所有难度
|
11、bingo:hunting // 解锁狩猎所有难度
|
||||||
12、bingo:mainline,11001 // 难度 id
|
12、bingo:mainline,1100104 // mainstage 关卡ID
|
||||||
13、bingo:moon,1 // 触发月之秘境
|
13、bingo:moon,1 // 触发月之秘境
|
||||||
14、bingo:arena,100 // 设置竞技场用户积分
|
14、bingo:arena,100 // 设置竞技场用户积分
|
||||||
15、bingo:sociatyexp,100 // 设置工会经验
|
15、bingo:sociatyexp,100 // 设置工会经验
|
||||||
@ -38,7 +38,7 @@ import (
|
|||||||
21、bingo:allequip
|
21、bingo:allequip
|
||||||
21、bingo:chat,1
|
21、bingo:chat,1
|
||||||
22、bingo:itemtype,1,1 // 获取某种类型所有道具(道具类型,数量)
|
22、bingo:itemtype,1,1 // 获取某种类型所有道具(道具类型,数量)
|
||||||
18、bingo:viplv,50
|
23、bingo:viplv,50
|
||||||
*/
|
*/
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (code pb.ErrorCode) {
|
func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (code pb.ErrorCode) {
|
||||||
|
@ -90,16 +90,11 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
|
|||||||
}
|
}
|
||||||
_heroMap["normalSkill"] = _hero.NormalSkill
|
_heroMap["normalSkill"] = _hero.NormalSkill
|
||||||
} else { // 加属性
|
} else { // 加属性
|
||||||
value, err := strconv.Atoi(awakenData.Phasebonus[1])
|
this.module.modelHero.resetJuexingProperty(_hero)
|
||||||
if err == nil {
|
|
||||||
if value > 0 {
|
|
||||||
this.module.modelHero.setJuexingProperty(_hero, awakenData.Phasebonus[0], int32(value))
|
|
||||||
_heroMap["juexProperty"] = _hero.JuexProperty
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_hero.JuexingLv += 1
|
_hero.JuexingLv += 1
|
||||||
_heroMap["juexingLv"] = _hero.JuexingLv
|
_heroMap["juexingLv"] = _hero.JuexingLv
|
||||||
|
_heroMap["juexProperty"] = _hero.JuexProperty
|
||||||
// 保存数据
|
// 保存数据
|
||||||
err := this.module.modelHero.ChangeList(session.GetUserId(), _hero.Id, _heroMap)
|
err := this.module.modelHero.ChangeList(session.GetUserId(), _hero.Id, _heroMap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -159,8 +159,8 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt
|
|||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
/////
|
|
||||||
this.module.modelHero.ChangeHeroProperty(session, _hero) // 推送属性变化
|
//this.module.modelHero.ChangeHeroProperty(session, _hero) // 推送属性变化
|
||||||
ChangeList = append(ChangeList, _hero)
|
ChangeList = append(ChangeList, _hero)
|
||||||
session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: ChangeList})
|
session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: ChangeList})
|
||||||
session.SendMsg(string(this.module.GetType()), StrengthenUpSkill, &pb.HeroStrengthenUpSkillResp{Hero: _hero})
|
session.SendMsg(string(this.module.GetType()), StrengthenUpSkill, &pb.HeroStrengthenUpSkillResp{Hero: _hero})
|
||||||
|
@ -13,6 +13,7 @@ import (
|
|||||||
"math"
|
"math"
|
||||||
"math/big"
|
"math/big"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"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"
|
||||||
@ -252,6 +253,41 @@ func (this *ModelHero) getHeroList(uid string) []*pb.DBHero {
|
|||||||
return heroes
|
return heroes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 重置觉醒属性
|
||||||
|
func (this *ModelHero) resetJuexingProperty(hero *pb.DBHero) {
|
||||||
|
hero.JuexProperty = make(map[string]int32)
|
||||||
|
for i := 1; i <= int(hero.JuexingLv); i++ {
|
||||||
|
awakenData := this.moduleHero.configure.GetHeroAwakenConfig(hero.HeroID, int32(i))
|
||||||
|
if awakenData != nil {
|
||||||
|
if len(awakenData.Phasebonus) != 2 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
key := awakenData.Phasebonus[0]
|
||||||
|
value, err := strconv.Atoi(awakenData.Phasebonus[1])
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
switch key {
|
||||||
|
case comm.Hp:
|
||||||
|
hero.JuexProperty[comm.Hp] += int32(value)
|
||||||
|
case comm.Def:
|
||||||
|
hero.JuexProperty[comm.Def] += int32(value)
|
||||||
|
case comm.Atk:
|
||||||
|
hero.JuexProperty[comm.Atk] += int32(value)
|
||||||
|
case comm.Speed:
|
||||||
|
hero.JuexProperty[comm.Speed] += int32(value)
|
||||||
|
case comm.ResonanceHpPro:
|
||||||
|
hero.JuexProperty[comm.Hp] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Hp])))
|
||||||
|
case comm.ResonanceAtkPro:
|
||||||
|
hero.JuexProperty[comm.Atk] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Atk])))
|
||||||
|
case comm.ResonanceDefPro:
|
||||||
|
hero.JuexProperty[comm.Def] += int32(math.Floor((float64(value) / 1000) * float64(hero.Property[comm.Def])))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// 觉醒
|
// 觉醒
|
||||||
func (this *ModelHero) setJuexingProperty(hero *pb.DBHero, key string, value int32) {
|
func (this *ModelHero) setJuexingProperty(hero *pb.DBHero, key string, value int32) {
|
||||||
switch key {
|
switch key {
|
||||||
@ -474,9 +510,9 @@ func (this *ModelHero) PropertyCompute(hero *pb.DBHero) {
|
|||||||
if growCfg == nil || heroCfg == nil || lvCfg == nil || starCfg == nil || starLvfg == nil {
|
if growCfg == nil || heroCfg == nil || lvCfg == nil || starCfg == nil || starLvfg == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var atk = (this.StarAtkAddition(hero.Star) + lvCfg.Atk + float32(growCfg.Atk)) * (growCfg.Atkgrow / 1000.0) * 1.0
|
var atk = (this.StarAtkAddition(hero.Star) + lvCfg.Atk + float32(growCfg.Atk)) * (growCfg.Atkgrow / 1000.0)
|
||||||
var def = (this.StarDefAddition(hero.Star) + lvCfg.Def + float32(growCfg.Def)) * (growCfg.Defgrow / 1000.0) * 1.0
|
var def = (this.StarDefAddition(hero.Star) + lvCfg.Def + float32(growCfg.Def)) * (growCfg.Defgrow / 1000.0)
|
||||||
var hp = (this.StarHpAddition(hero.Star) + lvCfg.Hp + float32(growCfg.Hp)) * (growCfg.Hpgrow / 1000.0) * 1.0
|
var hp = (this.StarHpAddition(hero.Star) + lvCfg.Hp + float32(growCfg.Hp)) * (growCfg.Hpgrow / 1000.0)
|
||||||
speed := growCfg.Speed
|
speed := growCfg.Speed
|
||||||
hero.Property = map[string]int32{
|
hero.Property = map[string]int32{
|
||||||
comm.Hp: int32(math.Floor(float64(hp))),
|
comm.Hp: int32(math.Floor(float64(hp))),
|
||||||
@ -492,6 +528,7 @@ func (this *ModelHero) PropertyCompute(hero *pb.DBHero) {
|
|||||||
if hero.Id != "" { // objID 为空表示是怪物对象 不享受天赋属性加成
|
if hero.Id != "" { // objID 为空表示是怪物对象 不享受天赋属性加成
|
||||||
this.resetTalentProperty(hero)
|
this.resetTalentProperty(hero)
|
||||||
}
|
}
|
||||||
|
this.resetJuexingProperty(hero)
|
||||||
}
|
}
|
||||||
|
|
||||||
//重新计算英雄属性
|
//重新计算英雄属性
|
||||||
@ -500,6 +537,7 @@ func (this *ModelHero) ChangeHeroProperty(session comm.IUserSession, hero *pb.DB
|
|||||||
update := map[string]interface{}{
|
update := map[string]interface{}{
|
||||||
"property": hero.Property,
|
"property": hero.Property,
|
||||||
"talentProperty": hero.TalentProperty,
|
"talentProperty": hero.TalentProperty,
|
||||||
|
"juexProperty": hero.JuexProperty,
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = this.ChangeList(session.GetUserId(), hero.Id, update); err != nil {
|
if err = this.ChangeList(session.GetUserId(), hero.Id, update); err != nil {
|
||||||
|
@ -175,7 +175,18 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 加主角经验
|
||||||
|
// if stageConf.Exp > 0 {
|
||||||
|
// res := make([]*cfg.Gameatn, 0)
|
||||||
|
// res = append(res, &cfg.Gameatn{
|
||||||
|
// A: "attr",
|
||||||
|
// T: "exp",
|
||||||
|
// N: stageConf.Exp,
|
||||||
|
// })
|
||||||
|
// if code = this.module.DispenseRes(session, res, true); code != pb.ErrorCode_Success {
|
||||||
|
// this.module.Debugf("Mline Commonaward DispenseRes err:+%v", res)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
// 加英雄经验
|
// 加英雄经验
|
||||||
if stageConf.HeroExp > 0 {
|
if stageConf.HeroExp > 0 {
|
||||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||||
|
@ -92,6 +92,10 @@ func (this *Mline) CheckPoint(uid string) bool {
|
|||||||
// 参数 难度 + 章节id
|
// 参数 难度 + 章节id
|
||||||
func (this *Mline) ModifyMlineDataByNanduID(session comm.IUserSession, id int32) (code pb.ErrorCode) {
|
func (this *Mline) ModifyMlineDataByNanduID(session comm.IUserSession, id int32) (code pb.ErrorCode) {
|
||||||
var del []string
|
var del []string
|
||||||
|
connf := this.configure.GetMainStageConf(id)
|
||||||
|
if connf == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
list, err := this.modelMline.getMainlineList(session.GetUserId())
|
list, err := this.modelMline.getMainlineList(session.GetUserId())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
@ -103,10 +107,6 @@ func (this *Mline) ModifyMlineDataByNanduID(session comm.IUserSession, id int32)
|
|||||||
// 清除
|
// 清除
|
||||||
this.modelMline.cleanChapterDataById(session.GetUserId(), del...)
|
this.modelMline.cleanChapterDataById(session.GetUserId(), del...)
|
||||||
|
|
||||||
connf := this.configure.GetMainStageConf(id)
|
|
||||||
if connf == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_data := this.configure.GetAllChapterID()
|
_data := this.configure.GetAllChapterID()
|
||||||
for _, v := range _data {
|
for _, v := range _data {
|
||||||
if v <= connf.Chapterid {
|
if v <= connf.Chapterid {
|
||||||
|
@ -9,6 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
|
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ModelRtaskRecord struct {
|
type ModelRtaskRecord struct {
|
||||||
@ -22,6 +23,10 @@ func (this *ModelRtaskRecord) Init(service core.IService, module core.IModule, c
|
|||||||
err = this.MCompModel.Init(service, module, comp, options)
|
err = this.MCompModel.Init(service, module, comp, options)
|
||||||
this.moduleRtask = module.(*ModuleRtask)
|
this.moduleRtask = module.(*ModuleRtask)
|
||||||
this.service = service
|
this.service = service
|
||||||
|
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
|
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
||||||
|
})
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,9 @@ func (this *ModelSociaty) Init(service core.IService, module core.IModule, comp
|
|||||||
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
Keys: bsonx.Doc{{Key: "_id", Value: bsonx.Int32(1)}},
|
Keys: bsonx.Doc{{Key: "_id", Value: bsonx.Int32(1)}},
|
||||||
})
|
})
|
||||||
|
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
|
Keys: bsonx.Doc{{Key: "name", Value: bsonx.Int32(1)}},
|
||||||
|
})
|
||||||
this.module = module.(*Sociaty)
|
this.module = module.(*Sociaty)
|
||||||
this.service = service
|
this.service = service
|
||||||
this.EventApp = event_v2.NewApp()
|
this.EventApp = event_v2.NewApp()
|
||||||
|
Loading…
Reference in New Issue
Block a user