lt 4 сар өмнө
parent
commit
3752263b45

+ 1 - 0
RO_Server_Trunk-branch_0.1.39/roserver/baseserver/router/route_table.go

@@ -362,6 +362,7 @@ func init() {
 	addRule("SSClimbingTowerWjBossNtf", "game", "game", 6065)
 	addRule("CSClimbingTowerWjBuffReq", "game", "game", 6066)
 	addRule("CSPayOrderCompleteReq", "game", "game", 6072)
+	addRule("SCDnySdkNtf", "game", "game", 6076)
 
 	//req和ack消息映射处理
 	ReqAckKVList[1000] = ReqAckKVInfo{1000, 1001, "CSPingReq|SCPingAck"}

+ 78 - 0
RO_Server_Trunk-branch_0.1.39/roserver/db/model/orm_helper.go

@@ -1806,6 +1806,84 @@ func GetRolePetDataFromRedis(uid uint64, ev rocommon.ProcEvent) bool {
 	return true
 }
 
+func GetRolePetDataFromRedis2(uid, cuid uint64, ev rocommon.ProcEvent) bool {
+	uidStr := strconv.FormatUint(uid, 10)
+	keyStr := RolePetDataPrefix + uidStr
+	cuidStr := strconv.FormatUint(cuid, 10)
+	ckeyStr := RolePetDataPrefix + cuidStr
+	if !model.ExistKey(keyStr) {
+		return false
+	}
+
+	//base
+	baseStr, err := service.GetRedis().HGetAll(keyStr).Result()
+	if err != nil {
+		util.ErrorF("GetRolePetDataFromRedis uid=%v err=%v", uid, err)
+		return false
+	}
+	util.InfoF("uid=%v GetRolePetDataFromRedis len=%v", uid, len(baseStr))
+	var tmpPetList []*serverproto.PetData
+	var tmpPetBondList []*serverproto.PetBondData
+	dataCount := 0
+	for key, val := range baseStr {
+		service.GetRedis().HSet(ckeyStr, key, val)
+		if key == RolePetDataFieldPrefix_base {
+			msg := &serverproto.SSLoadPetNtf{}
+			msg.Pet = &serverproto.RolePet{}
+			err = model.GetDecodeMessage(msg.Pet, val)
+			if err != nil {
+				util.ErrorF("GetRolePetDataFromRedis Base Unmarshal uid=%v err=%v", uid, err)
+				continue
+			}
+			model.ServiceReplay(ev, msg)
+		} else if strings.Contains(key, RolePetDataFieldPrefix_petlist) {
+			tmpPetData := &serverproto.PetData{}
+			err = model.GetDecodeMessage(tmpPetData, val)
+			if err != nil {
+				util.ErrorF("GetRolePetDataFromRedis PetData Unmarshal uid=%v err=%v", uid, err)
+				continue
+			}
+			tmpPetData.BattleAttrListOld = tmpPetData.BattleAttrListOld[:0]
+			tmpPetList = append(tmpPetList, tmpPetData)
+			dataCount++
+		} else if strings.Contains(key, RolePetDataFieldPrefix_bond) {
+			tmpBondData := &serverproto.PetBondData{}
+			err = model.GetDecodeMessage(tmpBondData, val)
+			if err != nil {
+				util.ErrorF("GetRolePetDataFromRedis BondData Unmarshal uid=%v err=%v", uid, err)
+				continue
+			}
+			tmpPetBondList = append(tmpPetBondList, tmpBondData)
+			dataCount++
+		}
+
+		if dataCount >= 100 {
+			msg := &serverproto.SSLoadPetNtf{}
+			msg.Pet = &serverproto.RolePet{}
+			msg.Pet.PetList = append(msg.Pet.PetList, tmpPetList...)
+			msg.Pet.BondList = append(msg.Pet.BondList, tmpPetBondList...)
+			model.ServiceReplay(ev, msg)
+
+			tmpPetList = tmpPetList[:0]
+			tmpPetBondList = tmpPetBondList[:0]
+			dataCount = 0
+		}
+	}
+
+	if dataCount > 0 {
+		msg := &serverproto.SSLoadPetNtf{}
+		msg.Pet = &serverproto.RolePet{}
+		msg.Pet.PetList = append(msg.Pet.PetList, tmpPetList...)
+		msg.Pet.BondList = append(msg.Pet.BondList, tmpPetBondList...)
+		model.ServiceReplay(ev, msg)
+
+		tmpPetList = tmpPetList[:0]
+		tmpPetBondList = tmpPetBondList[:0]
+		dataCount = 0
+	}
+	return true
+}
+
 // //skill equip
 func GetRoleSkillEquipDataFromRedis(uid uint64, roleSkillEquip *serverproto.RoleSkillEquip) bool {
 	uidStr := strconv.FormatUint(uid, 10)

+ 33 - 5
RO_Server_Trunk-branch_0.1.39/roserver/db/model/role_msg.go

@@ -63,11 +63,34 @@ func init() {
 			util.InfoF("SSAccountGetRoleListReq openid=%v zone=%v account data not empty need create", msg.OpenId, msg.ZoneId)
 			//数据不存在
 			//东南亚审核使用账号覆盖
-			_ = GetRoleListFromRedis("h2z8udyf8ga741708", msg.ZoneId, ack)
-			ack.Roles[0].OpenId = msg.OpenId
-
-			err = SetRoleListToRedis(msg.OpenId, msg.ZoneId, ack)
-			model.ServiceReplay(ev, ack)
+			//_ = GetRoleListFromRedis("h2z8udyf8ga741708", msg.ZoneId, ack)
+			//ack.Roles[0].OpenId = msg.OpenId
+			//
+			//err = SetRoleListToRedis(msg.OpenId, msg.ZoneId, ack)
+			ack2 := &serverproto.SSAccountGetRoleListAck{}
+			_ = GetRoleListFromRedis("h2z8udyf8ga741708", msg.ZoneId, ack2)
+			uidd := ack2.Roles[0].Uid
+			//获取copy玩家的基本数据
+			tmpRoleBase2 := &serverproto.RoleBase{}
+			GetRoleBaseFromRedis(uidd, tmpRoleBase2)
+			tmpRoleBase2.Id = cliId.SessID
+			tmpRoleBase2.NickName = ""
+			tmpRoleHero2 := &serverproto.RoleHero{}
+			GetRoleHeroDataFromRedis(uidd, tmpRoleHero2)
+			tmpRoleBattle2 := &serverproto.RoleBattle{}
+			GetSystemDataFromRedis(RoleBattleDataPrefix, uidd, tmpRoleBattle2)
+			tmpRoleEquip2 := &serverproto.RoleEquip{}
+			GetSystemDataFromRedis(RoleEquipDataPrefix, uidd, tmpRoleEquip2)
+			//复制到新号上
+			_ = SetRoleToRedis(cliId.SessID, tmpRoleBase2)
+			SetRoleHeroDataToRedis(cliId.SessID, tmpRoleHero2)
+			SetSystemDataToRedis(RoleBattleDataPrefix, cliId.SessID, tmpRoleBattle2)
+			SetSystemDataToRedis(RoleEquipDataPrefix, cliId.SessID, tmpRoleEquip2)
+			ack2.Roles[0].OpenId = msg.OpenId
+			ack2.Roles[0].Uid = cliId.SessID
+			err = SetRoleListToRedis(msg.OpenId, msg.ZoneId, ack2)
+			GetRolePetDataFromRedis2(uidd, cliId.SessID, ev)
+			model.ServiceReplay(ev, ack2)
 		} else {
 			model.ServiceReplay(ev, ack)
 		}
@@ -140,6 +163,10 @@ func init() {
 				//SetRoleHeroDataToRedis(cliId.SessID, tmpRoleHero2)
 				//SetSystemDataToRedis(RoleBattleDataPrefix, cliId.SessID, tmpRoleBattle2)
 				//SetSystemDataToRedis(RoleEquipDataPrefix, cliId.SessID, tmpRoleEquip2)
+				//ack.Err = int32(serverproto.ErrorCode_ERROR_ROLE_HAS_CREATE)
+				//ack.CreateRoleUid = tmpRoleBase2.Id
+				//model.ServiceReplay(ev, ack)
+				//return
 				//以上
 				err := SetRoleToRedis(cliId.SessID, msg.Base)
 				if err != nil {
@@ -165,6 +192,7 @@ func init() {
 					}
 					UpdatePlayerBriefInfo(cliId.SessID, briefInfo, true, msg.ActiveCode, msg.OpenId, msg.SubPlatform)
 				}
+				return
 			}
 			ack.Err = int32(serverproto.ErrorCode_ERROR_OK)
 		}

+ 4 - 4
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_activity.go

@@ -664,16 +664,16 @@ func (this *RoleActivity) SignUp(ackMsg *serverproto.SCSignUpAck) serverproto.Er
 	}
 	this.SetDirty(true)
 	if this.signInfo.CurDay == 2 {
-		ntf := serverproto.SCDnySdkNtf{Type: 22}
+		ntf := &serverproto.SCDnySdkNtf{Type: 22}
 		this.role.ReplayGate(ntf, true)
 	} else if this.signInfo.CurDay == 3 {
-		ntf := serverproto.SCDnySdkNtf{Type: 23}
+		ntf := &serverproto.SCDnySdkNtf{Type: 23}
 		this.role.ReplayGate(ntf, true)
 	} else if this.signInfo.CurDay == 8 {
-		ntf := serverproto.SCDnySdkNtf{Type: 24}
+		ntf := &serverproto.SCDnySdkNtf{Type: 24}
 		this.role.ReplayGate(ntf, true)
 	} else if this.signInfo.CurDay == 30 {
-		ntf := serverproto.SCDnySdkNtf{Type: 25}
+		ntf := &serverproto.SCDnySdkNtf{Type: 25}
 		this.role.ReplayGate(ntf, true)
 	}
 	return serverproto.ErrorCode_ERROR_OK

+ 8 - 4
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_base.go

@@ -583,12 +583,16 @@ func (this *RoleBase) AddPayRecharge(payRewardInfo *serverproto.PayOrderSaveInfo
 	this.roleBase.DayRecharge += amount
 	this.roleBase.LastRechargeTime = util.GetTimeMilliseconds()
 	this.SetDirty(true)
-	if this.roleBase.TotalRecharge >= 9.9 {
-		ntf := serverproto.SCDnySdkNtf{Type: 13}
+	if this.roleBase.TotalRecharge >= 9.9 && !this.roleBase.RoleDelete {
+		ntf := &serverproto.SCDnySdkNtf{Type: 13}
 		this.role.ReplayGate(ntf, true)
-	} else if this.roleBase.TotalRecharge >= 19.9 {
-		ntf := serverproto.SCDnySdkNtf{Type: 14}
+		this.roleBase.RoleDelete = true
+		this.SetDirty(true)
+	} else if this.roleBase.TotalRecharge >= 19.9 && !this.roleBase.RoleDelete2 {
+		ntf := &serverproto.SCDnySdkNtf{Type: 14}
 		this.role.ReplayGate(ntf, true)
+		this.roleBase.RoleDelete2 = true
+		this.SetDirty(true)
 	}
 
 	// bt服务器真假累计充值

+ 3 - 9
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_battle.go

@@ -331,15 +331,9 @@ func (this *RoleBattle) Load(msg interface{}) bool {
 		this.mapId = proRole.RoleBattle.MapId
 		this.mapLevelHard = proRole.RoleBattle.MapLevelHard
 		this.mapIdHard = proRole.RoleBattle.MapIdHard
-		if !this.role.GetRoleBase().roleBase.RoleDelete7 {
-			this.mapLevelHard2 = 0
-			this.mapIdHard2 = 0
-			this.role.GetRoleBase().roleBase.RoleDelete7 = true
-			this.role.GetRoleBase().SetDirty(true)
-		} else {
-			this.mapLevelHard2 = proRole.RoleBattle.HardSMapLevel
-			this.mapIdHard2 = proRole.RoleBattle.HardSMapId
-		}
+		this.mapLevelHard2 = proRole.RoleBattle.HardSMapLevel
+		this.mapIdHard2 = proRole.RoleBattle.HardSMapId
+
 		//累计的挑战boss成功次数
 		this.mapRewardCount = proRole.RoleBattle.RewardMapCount
 		this.mapRewardId = proRole.RoleBattle.RewardMapId

+ 1 - 1
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_send.go

@@ -40,7 +40,7 @@ func (this *Role) ReplayGate(msg interface{}, transmit bool) int {
 			return 0
 		}
 	}
-	util.InfoF("[game model role_send] replygate clientID:%v msgid:%v msg:%+v", this.cliID.SessID, info.ID, msg)
+	//util.ErrorF("[game model role_send] replygate clientID:%v msgid:%v msg:%+v", this.cliID.SessID, info.ID, msg)
 
 	var ackSeqId uint32 = 0
 	var confirmId = uint32(info.ConfirmMsgId)