Răsfoiți Sursa

噩梦模式关闭bug回档红卡

lt 1 an în urmă
părinte
comite
6080b4be0a

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

@@ -68,9 +68,37 @@ func (this *RoleBase) CopyStoryData(msgNtf *serverproto.SCRoleStoryNtf) {
 
 func (this *RoleBase) Load(msg interface{}) bool {
 	proRole := msg.(*serverproto.Role)
+	m := map[int32]int{
+		22100: 1, 22101: 1, 22102: 1, 22103: 1, 22104: 1, 22105: 1, 22106: 1, 22107: 1, 22108: 1, 22109: 1, 22110: 1, 22111: 1,
+		22200: 1, 22201: 1, 22202: 1, 22203: 1, 22204: 1, 22205: 1, 22206: 1, 22207: 1, 22208: 1, 22209: 1, 22210: 1, 22211: 1,
+		22300: 1, 22301: 1, 22302: 1, 22303: 1, 22304: 1, 22305: 1, 22306: 1, 22307: 1, 22308: 1, 22309: 1, 22310: 1, 22311: 1,
+		22400: 1, 22401: 1, 22402: 1, 22403: 1, 22404: 1, 22405: 1, 22406: 1, 22407: 1, 22408: 1, 22409: 1, 22410: 1, 22411: 1,
+		22500: 1, 22501: 1, 22502: 1, 22503: 1, 22504: 1, 22505: 1, 22506: 1, 22507: 1, 22508: 1, 22509: 1, 22510: 1, 22511: 1,
+	}
 	*this.roleBase = *proRole.RoleBase
 	if this.roleBase.RoleData != nil {
-
+		if this.roleBase.RoleData.HeroData != nil {
+			if this.roleBase.RoleData.HeroData.Slot != nil {
+				for _, v := range this.roleBase.RoleData.HeroData.Slot.SlotList {
+					var newS []int32
+					for _, c := range v.CardIdList {
+						if _, ok := m[c]; !ok {
+							newS = append(newS, c)
+						}
+					}
+					v.CardIdList = newS
+				}
+			}
+			//金币
+			if this.roleBase.Coin > 10000000 {
+				util.ErrorF("coin more than 1 million uuid:%v,coin:%v,name:%v", this.role.GetUUid(), this.roleBase.Coin, this.roleBase.NickName)
+			}
+			//ro币
+			if this.roleBase.Rmb > 30000 {
+				util.ErrorF("ro more than 30000 uuid:%v,ro:%v,name:%v", this.role.GetUUid(), this.roleBase.Rmb, this.roleBase.NickName)
+			}
+			this.SetDirty(true)
+		}
 		//if this.roleBase.RoleData.HeroData.SkillEquipSlot == nil {
 		//	this.roleBase.RoleData.HeroData.SkillEquipSlot = &serverproto.SkillEquipSlotData{}
 		//	for i := 0; i < SKILL_EQUIP_SLOT_TYPE_NUM; i++ {

+ 24 - 12
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_card.go

@@ -44,11 +44,23 @@ func newRoleCard(r *Role) *RoleCard {
 func (this *RoleCard) Load(msg interface{}) bool {
 	proRole := msg.(*serverproto.Role)
 	if proRole.RoleCard != nil {
+		m := map[int32]int{
+			22100: 1, 22101: 1, 22102: 1, 22103: 1, 22104: 1, 22105: 1, 22106: 1, 22107: 1, 22108: 1, 22109: 1, 22110: 1, 22111: 1,
+			22200: 1, 22201: 1, 22202: 1, 22203: 1, 22204: 1, 22205: 1, 22206: 1, 22207: 1, 22208: 1, 22209: 1, 22210: 1, 22211: 1,
+			22300: 1, 22301: 1, 22302: 1, 22303: 1, 22304: 1, 22305: 1, 22306: 1, 22307: 1, 22308: 1, 22309: 1, 22310: 1, 22311: 1,
+			22400: 1, 22401: 1, 22402: 1, 22403: 1, 22404: 1, 22405: 1, 22406: 1, 22407: 1, 22408: 1, 22409: 1, 22410: 1, 22411: 1,
+			22500: 1, 22501: 1, 22502: 1, 22503: 1, 22504: 1, 22505: 1, 22506: 1, 22507: 1, 22508: 1, 22509: 1, 22510: 1, 22511: 1,
+		}
 		for _, data := range proRole.RoleCard.CardList {
 			_, ok := serverproto.CardCfgLoader[data.ConfigId]
 			if !ok || data.Num <= 0 {
 				continue
 			}
+			//噩梦bug删除红卡
+			if _, ok2 := m[data.ConfigId]; ok2 {
+				continue
+			}
+
 			this.cardList[data.ConfigId] = data
 		}
 
@@ -64,6 +76,7 @@ func (this *RoleCard) Load(msg interface{}) bool {
 		}
 
 		this.totalCardNumList = proRole.RoleCard.TotalCardNumList
+		this.SetDirty(true)
 	}
 	return true
 }
@@ -140,7 +153,7 @@ func (this *RoleCard) cardChangNtf(cardList set.Interface, ignore bool) {
 	this.role.ReplayGate(ntfMsg, true)
 }
 
-//判断对应卡槽是否解锁
+// 判断对应卡槽是否解锁
 func (this *RoleCard) isCardSlotUnlock(slotIndex, cardSlotIndex int32) bool {
 	if slotIndex <= int32(len(this.cardSlotList)) && cardSlotIndex > 0 {
 		return this.cardSlotList[slotIndex-1]&(1<<uint32(cardSlotIndex-1)) > 0
@@ -221,7 +234,7 @@ func (this *RoleCard) ReduceCard(cardCfgId, reduceNum int32, notify bool) {
 	}
 }
 
-//装备对应槽位镶嵌卡片
+// 装备对应槽位镶嵌卡片
 func (this *RoleCard) Mount(slotData *serverproto.SlotData, heroId, subSlotIndex, cardSlotIndex, cardCfgId int32, fightChange bool) serverproto.ErrorCode {
 	if subSlotIndex <= 0 || cardSlotIndex <= 0 {
 		return serverproto.ErrorCode_ERROR_CARD_SLOT_LOCK
@@ -684,7 +697,7 @@ func (this *RoleCard) GetCardNum(cardCfgId int32) int32 {
 	return card.Num
 }
 
-//对槽位中的装备升级
+// 对槽位中的装备升级
 func (this *RoleCard) SlotCardLevelUp(cardCfgId int32, changeList set.Interface) (bool, int32) {
 	//	globalData, ok1 := serverproto.GlobalCfgLoader[int32(serverproto.GlobalType_Global_Card_Up_Grade_Resource)]
 	cfgData, ok2 := serverproto.CardCfgLoader[cardCfgId]
@@ -945,7 +958,7 @@ func (this *RoleCard) AddCardCollect(cardCfgId int32) serverproto.ErrorCode {
 	return serverproto.ErrorCode_ERROR_FAIL
 }
 
-//key 卡片类型ID, value
+// key 卡片类型ID, value
 func (this *RoleCard) CardCollectChangeNtf(cardData []*serverproto.KeyValueType) {
 	ntfMsg := &serverproto.SCCardCollectChangeNtf{}
 	for _, changedCard := range cardData {
@@ -973,7 +986,7 @@ func (this *RoleCard) CardCollectChangeNtf(cardData []*serverproto.KeyValueType)
 	this.role.ReplayGate(ntfMsg, true)
 }
 
-///Task
+// /Task
 func (this *RoleCard) GetQualityCardNum(quality int32) int32 {
 	var retNum int32 = 0
 	if quality <= 0 {
@@ -990,7 +1003,7 @@ func (this *RoleCard) GetQualityCardNum(quality int32) int32 {
 	return retNum
 }
 
-//检查是否有过此类型卡片
+// 检查是否有过此类型卡片
 func (this *RoleCard) CheckNewCard(cardId int32) bool {
 	cardCfg, ok := serverproto.CardCfgLoader[cardId]
 	if !ok {
@@ -1014,7 +1027,7 @@ func (this *RoleCard) CheckNewCard(cardId int32) bool {
 	return true
 }
 
-//卡片祝福属性
+// 卡片祝福属性
 func (this *RoleCard) GetCardSuitAttr(heroData *serverproto.HeroData, attrList map[serverproto.Attr]float32) {
 	type tmpLevelNumSt struct {
 		CardLevel  int32
@@ -1129,7 +1142,6 @@ func (this *RoleCard) GetCardSuitAttr(heroData *serverproto.HeroData, attrList m
 	//}
 }
 
-
 func (this *RoleCard) CardExchange(sourceCardId, targetCardId int32, ackMsg *serverproto.SCCardLevelExchangeAck) serverproto.ErrorCode {
 	if ackMsg == nil {
 		return serverproto.ErrorCode_ERROR_FAIL
@@ -1188,7 +1200,7 @@ func (this *RoleCard) CardExchange(sourceCardId, targetCardId int32, ackMsg *ser
 	}
 
 	//查看资源是否够
-	var costItemList= map[int32]int32{}
+	var costItemList = map[int32]int32{}
 	if targetCfgData.CardLevel > sourceCfgData.CardLevel {
 		this.GetCardExchangeCost(sourceCfgData.CardLevel, targetCfgData.CardLevel, costItemList)
 	} else {
@@ -1222,12 +1234,12 @@ func (this *RoleCard) GetCardExchangeCost(smallLevel, bigLevel int32, costItemLi
 	}
 
 	for key, data := range model.GlobalCardLevelExchange {
-		if key - 1 <= 0 {
+		if key-1 <= 0 {
 			//打个Error日志
 			continue
 		}
-		if smallLevel <= key - 1 && bigLevel >= key {
+		if smallLevel <= key-1 && bigLevel >= key {
 			costItemList[data.Key] += data.Value
 		}
 	}
-}
+}

+ 22 - 0
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role_hero.go

@@ -59,6 +59,26 @@ func (this *RoleHero) Load(msg interface{}) bool {
 	proRole := msg.(*serverproto.Role)
 	if proRole.RoleHero != nil {
 		for idx, data := range proRole.RoleHero.HeroData {
+			m := map[int32]int{
+				22100: 1, 22101: 1, 22102: 1, 22103: 1, 22104: 1, 22105: 1, 22106: 1, 22107: 1, 22108: 1, 22109: 1, 22110: 1, 22111: 1,
+				22200: 1, 22201: 1, 22202: 1, 22203: 1, 22204: 1, 22205: 1, 22206: 1, 22207: 1, 22208: 1, 22209: 1, 22210: 1, 22211: 1,
+				22300: 1, 22301: 1, 22302: 1, 22303: 1, 22304: 1, 22305: 1, 22306: 1, 22307: 1, 22308: 1, 22309: 1, 22310: 1, 22311: 1,
+				22400: 1, 22401: 1, 22402: 1, 22403: 1, 22404: 1, 22405: 1, 22406: 1, 22407: 1, 22408: 1, 22409: 1, 22410: 1, 22411: 1,
+				22500: 1, 22501: 1, 22502: 1, 22503: 1, 22504: 1, 22505: 1, 22506: 1, 22507: 1, 22508: 1, 22509: 1, 22510: 1, 22511: 1,
+			}
+			if proRole.RoleHero.HeroData[idx].Slot != nil {
+				for _, v := range proRole.RoleHero.HeroData[idx].Slot.SlotList {
+					var newS []int32
+					if v != nil {
+						for _, c := range v.CardIdList {
+							if _, ok := m[c]; !ok {
+								newS = append(newS, c)
+							}
+						}
+					}
+					v.CardIdList = newS
+				}
+			}
 			this.heroList[data.Id] = proRole.RoleHero.HeroData[idx]
 			if data.Id > this.maxHeroId {
 				this.maxHeroId = data.Id
@@ -68,7 +88,9 @@ func (this *RoleHero) Load(msg interface{}) bool {
 					PetId: this.heroList[data.Id].BattlePetId,
 				}
 			}
+			this.saveHeroList[data.Id] = true
 		}
+		this.SetDirty(true)
 	}
 	return true
 }

+ 8 - 3
RO_Server_Trunk-branch_0.1.39/roserver/game/msg/role_msg.go

@@ -1123,19 +1123,24 @@ func init() {
 		if msg.Type == 1 {
 			if role.GetHardFight() == 1 {
 				ackMsg.Error = int32(serverproto.ErrorCode_ERROR_FAIL)
+			} else {
+				role.SetHardFight(1)
 			}
-			role.SetHardFight(1)
 			//ackMsg.Type = role.GetHardFightHigh()
 		} else if msg.Type == 0 { //转为普通模式
 			if role.GetHardFight() == 0 {
 				ackMsg.Error = int32(serverproto.ErrorCode_ERROR_FAIL)
+			} else {
+				role.SetHardFight(0)
 			}
-			role.SetHardFight(0)
 		} else if msg.Type == 2 { //噩梦模式
 			if role.GetHardFight() == 2 {
 				ackMsg.Error = int32(serverproto.ErrorCode_ERROR_FAIL)
+			} else {
+				ackMsg.Error = int32(serverproto.ErrorCode_ERROR_FAIL)
+				//暂时关闭噩梦模式
+				//role.SetHardFight(2)
 			}
-			role.SetHardFight(2)
 		}
 		util.InfoF("uid=%v cliId=%v receive CSMapLevelTypeChangeReq msg=%v", role.GetUUid(), cliId, msg)
 		role.ReplayGate(ackMsg, true)