This commit is contained in:
liwei1dao 2024-02-07 16:49:50 +08:00
commit caa8f1cb83
4 changed files with 436 additions and 336 deletions

View File

@ -525,10 +525,10 @@ func (this *MapData) SkillUp(pos int32, color int32, skillid int32, value int32,
x = make(map[int]struct{})
switch skillid {
case 1:
case 1: // 随机一组数
randNum := utils.RandomNumbers(0, Total-1, int(value)*2)
for _, v := range randNum {
if this.Plat[v].Special > 0 {
if this.Plat[v].Special == 0 {
ids = append(ids, v)
if len(ids) >= int(value) {
break

View File

@ -113,11 +113,12 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PlunderGetListRe
if user, err := this.module.ModuleUser.GetUser(session.GetUserId()); err == nil {
uinfo := comm.GetUserBaseInfo(user)
if !reflect.DeepEqual(uinfo, list.Uinfo) {
list.Uinfo = uinfo
update["uinfo"] = uinfo
// 同步岛屿上的信息
var lock *redis.RedisMutex
lock, err = this.module.modelLand.landMutexLock(list.Landid)
lock.Lock()
err = lock.Lock()
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
@ -128,16 +129,16 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PlunderGetListRe
}
defer lock.Unlock()
for _, v := range land.Uinfo {
if v == list.Uinfo {
v = uinfo
for pos, v := range land.Uinfo {
if v.Uid == uinfo.Uid {
land.Uinfo[pos] = uinfo
this.module.modelLand.changePlunderLandData(list.Landid, map[string]interface{}{
"uinfo": land.Uinfo,
})
break
}
}
list.Uinfo = uinfo
}
}
if len(update) > 0 {

View File

@ -1,6 +1,7 @@
package plunder
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/mgo"
@ -75,6 +76,10 @@ func (this *modelPlunder) getPlunderData(session comm.IUserSession) (info *pb.DB
this.module.Errorln(err)
return
}
if user.Name == "" { // 临时处理没创角不让进 后面走功能开启配置
err = fmt.Errorf("getPlunderData need create ")
return
}
info = &pb.DBPlunder{
Id: primitive.NewObjectID().Hex(),
Uid: session.GetUserId(),

File diff suppressed because it is too large Load Diff