Merge branch 'master' of 60.1.1.230:backend/jieling_server
commit
de2cd9a21a
|
@ -84,7 +84,11 @@ local effectList = {
|
|||
local f2 = args[3]
|
||||
local ct = args[4]
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro1], f1, ct))
|
||||
local buff = Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro1], f1, ct)
|
||||
if f2 == 0 then
|
||||
buff.cover = true
|
||||
end
|
||||
target:AddBuff(buff)
|
||||
end)
|
||||
end,
|
||||
--持续恢复[a]*[b]%生命,持续[c]秒
|
||||
|
@ -181,7 +185,7 @@ local effectList = {
|
|||
local f2 = args[4]
|
||||
casterBulletEffect(caster, target, interval)
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
if target.professionId == i1 then
|
||||
if target.roleData.professionId == i1 then
|
||||
f1 = f1 + f2
|
||||
end
|
||||
BattleUtil.CalDamage(caster, target, dt, f1)
|
||||
|
@ -282,7 +286,7 @@ local effectList = {
|
|||
casterBulletEffect(caster, target, interval)
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
local dmg = floor(caster:GetRoleData(propertyList[dt]) * f1)
|
||||
if target.professionId == i1 then
|
||||
if target.roleData.professionId == i1 then
|
||||
BattleUtil.RandomAction(f2, function ()
|
||||
target.isFlagCrit = true
|
||||
BattleUtil.CalDamage(caster, target, dmg)
|
||||
|
@ -485,7 +489,7 @@ local effectList = {
|
|||
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, d, target)
|
||||
BattleLogic.WaitForTrigger(d, function ()
|
||||
if target.professionId == pt then
|
||||
if target.roleData.professionId == pt then
|
||||
f1 = f1 + f2
|
||||
end
|
||||
BattleUtil.CalDamage(caster, target, dt, f1)
|
||||
|
@ -579,7 +583,7 @@ local effectList = {
|
|||
local f2 = args[4]
|
||||
local ct = args[5]
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
if target.professionId == pt then
|
||||
if target.roleData.professionId == pt then
|
||||
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro1], f1, ct))
|
||||
end
|
||||
end)
|
||||
|
@ -695,15 +699,22 @@ local effectList = {
|
|||
local f2 = args[2]
|
||||
local f3 = args[3]
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
local brand = Buff.Create(caster, BuffName.Brand, f3, "weak")
|
||||
brand.exDmg = f2
|
||||
brand.coverFunc = function (oldBuff)
|
||||
brand.exDmg = brand.exDmg + oldBuff.exDmg
|
||||
end
|
||||
local trigger = function(atkRole, damagingFunc, damageType)
|
||||
BattleUtil.RandomAction(f1, function ()
|
||||
damagingFunc(f2)
|
||||
damagingFunc(brand.exDmg)
|
||||
end)
|
||||
end
|
||||
target.Event:AddEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
||||
target:AddBuff(Buff.Create(caster, BuffName.Brand, f3, "weak", function ()
|
||||
brand.endFunc = function ()
|
||||
brand.exDmg = nil
|
||||
target.Event:RemoveEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
||||
end))
|
||||
end
|
||||
target:AddBuff(brand)
|
||||
end)
|
||||
end,
|
||||
--瞬间恢复[a]的生命
|
||||
|
@ -714,20 +725,22 @@ local effectList = {
|
|||
BattleUtil.CalTreat(caster, target, i1)
|
||||
end)
|
||||
end,
|
||||
--造成[a]%的[b]伤害,计算伤害时,额外计算[c]%的[d]和[e]%的[f]
|
||||
--a[float],b[伤害类型],c[float],d[属性],e[float],f[属性]
|
||||
--造成[a]%的[b]伤害,计算伤害时额外计算[c]%的[d][e]和[f]%的[g][h]
|
||||
--a[float],b[伤害类型],c[float],d[属性],e[改变类型],f[float],g[属性],h[改变类型]
|
||||
[44] = function(caster, target, args, interval)
|
||||
local f1 = args[1]
|
||||
local dt = args[2]
|
||||
local f2 = args[3]
|
||||
local pro1 = args[4]
|
||||
local f3 = args[5]
|
||||
local pro2 = args[6]
|
||||
local ct1 = args[5]
|
||||
local f3 = args[6]
|
||||
local pro2 = args[7]
|
||||
local ct2 = args[8]
|
||||
|
||||
casterBulletEffect(caster, target, interval)
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
local proTran1 = {proName = propertyList[pro1], tranProName = propertyList[pro1], tranFactor = f2}
|
||||
local proTran2 = {proName = propertyList[pro2], tranProName = propertyList[pro2], tranFactor = f3}
|
||||
local proTran1 = {proName = propertyList[pro1], tranProName = propertyList[pro1], tranFactor = f2, changeType = ct1}
|
||||
local proTran2 = {proName = propertyList[pro2], tranProName = propertyList[pro2], tranFactor = f3, changeType = ct2}
|
||||
caster.proTranList:Add(proTran1)
|
||||
caster.proTranList:Add(proTran2)
|
||||
BattleUtil.CalDamage(caster, target, dt, f1)
|
||||
|
@ -776,7 +789,7 @@ local effectList = {
|
|||
local f3 = args[5]
|
||||
casterBulletEffect(caster, target, interval)
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
if target.professionId == pt then
|
||||
if target.roleData.professionId == pt then
|
||||
BattleUtil.CalDamage(caster, target, dt, f1+f3, f2)
|
||||
else
|
||||
BattleUtil.CalDamage(caster, target, dt, f1)
|
||||
|
@ -807,15 +820,17 @@ local effectList = {
|
|||
end
|
||||
local OnSkillCast, OnSkillCastEnd
|
||||
OnSkillCast = function(skill)
|
||||
caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||||
caster.Event:RemoveEvent(BattleEventName.SkillCast, OnSkillCast)
|
||||
caster.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
||||
caster.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||||
end
|
||||
OnSkillCastEnd = function(skill)
|
||||
caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||||
caster.Event:RemoveEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
||||
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function () --延迟一帧移除事件,防止触发帧和结束帧为同一帧时,被动未移除
|
||||
caster.Event:RemoveEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
||||
caster.Event:RemoveEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging)
|
||||
end)
|
||||
end
|
||||
caster.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast)
|
||||
caster.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
||||
end)
|
||||
end,
|
||||
--造成[a]%的[b]伤害,如果目标受到此次伤害前,生命低于最大生命[c]%,则直接击杀。
|
||||
|
@ -833,38 +848,47 @@ local effectList = {
|
|||
end
|
||||
end)
|
||||
end,
|
||||
--增加[c]层缚灵印记,每层印记[f]改变[d]属性[e]%,[i]改变[g]属性[h]%,最大[j]层(0为无限)
|
||||
--c[int],d[属性],e[float],f[改变类型],g[属性],h[float],i[改变类型],j[int]
|
||||
--增加[c]层缚灵印记,每层使受到的伤害增加[d],减少[e]%的受治疗效果,最大[f]层(0为无限)
|
||||
--c[int],d[float],e[float],f[int]
|
||||
[51] = function(caster, target, args, interval)
|
||||
local i1 = args[1]
|
||||
local pro1 = args[2]
|
||||
local f2 = args[3]
|
||||
local ct1 = args[4]
|
||||
local pro2 = args[5]
|
||||
local f3 = args[6]
|
||||
local ct2 = args[7]
|
||||
local i2 = args[8]
|
||||
local f2 = args[2]
|
||||
local f3 = args[3]
|
||||
local i2 = args[4]
|
||||
local flag = "fuling"..caster.uid
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
local changeBuff1 = Buff.Create(target, BuffName.PropertyChange, 0, propertyList[pro1], f2*i1, ct1)
|
||||
changeBuff1.cover = true
|
||||
changeBuff1.maxLayer = i2
|
||||
for i=1, i1 do
|
||||
local brand
|
||||
brand = Buff.Create(caster, BuffName.Brand, 0, flag)
|
||||
brand.exDmg = f2
|
||||
brand.exHeal = f3
|
||||
brand.maxLayer = i2
|
||||
brand.coverFunc = function (oldBuff)
|
||||
if i2 == 0 or oldBuff.layer < i2 then
|
||||
brand.exDmg = brand.exDmg + oldBuff.exDmg
|
||||
brand.exHeal = brand.exHeal + oldBuff.exHeal
|
||||
else
|
||||
brand.exDmg = oldBuff.exDmg
|
||||
brand.exHeal = oldBuff.exHeal
|
||||
end
|
||||
end
|
||||
local trigger = function(atkRole, damagingFunc, damageType)
|
||||
damagingFunc(brand.exDmg)
|
||||
end
|
||||
local OnPassiveBeTreated = function(treatingFunc)
|
||||
treatingFunc(-brand.exHeal)
|
||||
end
|
||||
|
||||
local changeBuff2 = Buff.Create(target, BuffName.PropertyChange, 0, propertyList[pro2], f3*i1, ct2)
|
||||
changeBuff2.cover = true
|
||||
changeBuff2.maxLayer = i2
|
||||
|
||||
target:AddBuff(changeBuff1)
|
||||
target:AddBuff(changeBuff2)
|
||||
|
||||
local brandBuff
|
||||
brandBuff = Buff.Create(caster, BuffName.Brand, 0, flag, function ()
|
||||
brandBuff.linkBuff1 = nil
|
||||
brandBuff.linkBuff2 = nil
|
||||
end)
|
||||
brandBuff.linkBuff1 = changeBuff1
|
||||
brandBuff.linkBuff2 = changeBuff2
|
||||
target:AddBuff(brandBuff)
|
||||
target.Event:AddEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
||||
target.Event:AddEvent(BattleEventName.PassiveBeTreated, OnPassiveBeTreated)
|
||||
brand.endFunc = function ()
|
||||
brand.exDmg = nil
|
||||
brand.exHeal = nil
|
||||
target.Event:RemoveEvent(BattleEventName.RoleBeDamagedBefore, trigger)
|
||||
target.Event:RemoveEvent(BattleEventName.PassiveBeTreated, OnPassiveBeTreated)
|
||||
end
|
||||
target:AddBuff(brand)
|
||||
end
|
||||
end)
|
||||
end,
|
||||
--造成[a]%的[b]伤害,引爆目标身上所有缚灵印记,每层造成攻击*[c]的真实伤害。
|
||||
|
@ -910,7 +934,7 @@ local effectList = {
|
|||
end
|
||||
end)
|
||||
end,
|
||||
--[e]改变[a]属性[b]%的[c],持续[d]秒
|
||||
--[e]改变[a]属性*[b]%的[c],持续[d]秒
|
||||
--a[属性],b[float],c[属性],d[int],e[改变类型]
|
||||
[54] = function(caster, target, args, interval)
|
||||
local pro1 = args[1]
|
||||
|
@ -919,7 +943,7 @@ local effectList = {
|
|||
local f2 = args[4]
|
||||
local ct = args[5]
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro1], floor(caster:GetRoleData(propertyList[pro2]) * f1), ct))
|
||||
target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, f2, propertyList[pro2], floor(caster:GetRoleData(propertyList[pro1]) * f1), ct))
|
||||
end)
|
||||
end,
|
||||
--清除[a]状态
|
||||
|
@ -957,9 +981,9 @@ local effectList = {
|
|||
local i1 = args[2]
|
||||
casterBulletEffect(caster, target, interval)
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
local damage = BattleUtil.ApplyDamage(caster, target, floor(caster:GetRoleData(RoleDataName.Hp) * f1))
|
||||
local damage = BattleUtil.ApplyDamage(caster, target, floor(target:GetRoleData(RoleDataName.Hp) * f1))
|
||||
local arr = BattleUtil.ChooseTarget(caster, 10110)
|
||||
local count = math.min(#arr, i1)
|
||||
local count = min(#arr, i1)
|
||||
local heal = floor(damage / count)
|
||||
for i=1, count do
|
||||
BattleUtil.CalTreat(caster, arr[i], heal)
|
||||
|
|
|
@ -41,7 +41,7 @@ local passivityList = {
|
|||
for i=1, skill.effectList.size do
|
||||
duration = max(duration, skill.effectList.buffer[i].duration)
|
||||
end
|
||||
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], duration + BattleLogic.GameDeltaTime * 2)
|
||||
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], 2, duration + BattleLogic.GameDeltaTime * 2)
|
||||
end)
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast)
|
||||
|
@ -203,7 +203,7 @@ local passivityList = {
|
|||
local OnRoleBeDamagedBefore = function(atkRole, func, damageType)
|
||||
if damageType == dt then
|
||||
BattleUtil.RandomAction(f1, function ()
|
||||
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], BattleLogic.GameDeltaTime)
|
||||
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], 2, BattleLogic.GameDeltaTime)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
@ -292,7 +292,7 @@ local passivityList = {
|
|||
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType)
|
||||
if damageType == dt then
|
||||
BattleUtil.RandomAction(f1, function ()
|
||||
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], f3)
|
||||
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], 2, f3)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
@ -331,7 +331,7 @@ local passivityList = {
|
|||
|
||||
local OnSkillCastEnd = function(skill)
|
||||
BattleUtil.RandomAction(f1, function ()
|
||||
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], f3)
|
||||
role:AddPropertyTransfer(propertyList[pro1], f2, propertyList[pro2], 2, f3)
|
||||
end)
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
||||
|
@ -375,7 +375,6 @@ local passivityList = {
|
|||
--a[float]
|
||||
[19] = function(role, args)
|
||||
local f1 = args[1]
|
||||
|
||||
role.data:AddValue(RoleDataName.CureFacter, f1)
|
||||
end,
|
||||
|
||||
|
@ -733,7 +732,7 @@ local passivityList = {
|
|||
local f1 = args[2]
|
||||
|
||||
local OnBeHit = function(atkRole)
|
||||
if atkRole.professionId == i1 then
|
||||
if atkRole.roleData.professionId == i1 then
|
||||
BattleUtil.CalTreat(role, role, f1)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -26,7 +26,9 @@ function Brand:OnEnd()
|
|||
--log("Brand:OnEnd")
|
||||
if self.endFunc then
|
||||
self.endFunc()
|
||||
self.endFunc = nil
|
||||
end
|
||||
self.coverFunc = nil
|
||||
end
|
||||
|
||||
--只有当cover字段为true时触发,返回true则被新效果覆盖
|
||||
|
@ -40,6 +42,9 @@ function Brand:OnCover(newBuff)
|
|||
newBuff.layer = math.min(self.layer + 1, newBuff.maxLayer)
|
||||
end
|
||||
end
|
||||
if newBuff.coverFunc then
|
||||
newBuff.coverFunc(self)
|
||||
end
|
||||
return b
|
||||
end
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ function Shield:SetData(...)
|
|||
self.shieldValue, --护盾值
|
||||
self.dmgReboundFactor = ... --伤害反弹系数
|
||||
self.damageSum = 0 --记录承受的伤害
|
||||
self.isBuff = true
|
||||
end
|
||||
|
||||
--初始化后调用一次
|
||||
|
|
|
@ -37,6 +37,7 @@ BattleEventName = {
|
|||
SkillCastEnd = indexAdd(),
|
||||
|
||||
PassiveTreating = indexAdd(),
|
||||
PassiveBeTreated = indexAdd(),
|
||||
PassiveBeDamaging = indexAdd(),
|
||||
PassiveDamaging = indexAdd(),
|
||||
PassiveCriting = indexAdd(),
|
||||
|
|
|
@ -295,7 +295,8 @@ function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor)
|
|||
|
||||
--加入被动效果
|
||||
local treatingFunc = function(exFactor) baseTreat = floor(baseTreat * (exFactor + 1) + 0.5) end
|
||||
castRole.Event:DispatchEvent(BattleEventName.PassiveTreating, treatingFunc)
|
||||
castRole.Event:DispatchEvent(BattleEventName.PassiveTreating, treatingFunc, targetRole)
|
||||
targetRole.Event:DispatchEvent(BattleEventName.PassiveBeTreated, treatingFunc, castRole)
|
||||
|
||||
local treat = min(baseTreat, maxHp - hp)
|
||||
if treat > 0 then
|
||||
|
|
|
@ -235,7 +235,17 @@ function RoleLogic:GetRoleData(property)
|
|||
for i=1, self.proTranList.size do
|
||||
item = self.proTranList.buffer[i]
|
||||
if item.proName == property then
|
||||
tarPro = tarPro + BattleUtil.ErrorCorrection(self.data:GetData(item.tranProName) * item.tranFactor)
|
||||
local value
|
||||
if item.changeType == 1 then --加算
|
||||
value = item.tranFactor
|
||||
elseif item.changeType == 2 then --乘加算(百分比属性加算)
|
||||
value = BattleUtil.ErrorCorrection(self.data:GetData(item.tranProName) * item.tranFactor)
|
||||
elseif item.changeType == 3 then --减算
|
||||
value = -item.tranFactor
|
||||
elseif item.changeType == 4 then --乘减算(百分比属性减算)
|
||||
value = -BattleUtil.ErrorCorrection(self.data:GetData(item.tranProName) * item.tranFactor)
|
||||
end
|
||||
tarPro = tarPro + value
|
||||
end
|
||||
end
|
||||
return tarPro
|
||||
|
@ -243,8 +253,8 @@ end
|
|||
|
||||
--proA替换的属性,factor系数,proB被替换的属性, duration持续时间
|
||||
--读取proB属性时,得到的值为proB + proA * factor
|
||||
function RoleLogic:AddPropertyTransfer(proA, factor, proB, duration)
|
||||
local proTran = {proName = proB, tranProName = proA, tranFactor = factor}
|
||||
function RoleLogic:AddPropertyTransfer(proA, factor, proB, ct, duration)
|
||||
local proTran = {proName = proB, tranProName = proA, tranFactor = factor, changeType = ct}
|
||||
self.proTranList:Add(proTran)
|
||||
local index = self.proTranList.size
|
||||
BattleLogic.WaitForTrigger(duration, function ()
|
||||
|
|
|
@ -52,7 +52,7 @@ public class MapPointConfig implements BaseConfig{
|
|||
|
||||
private int[][] randomProbability;
|
||||
|
||||
private int isShowFightAbility;
|
||||
private int[] isShowFightAbility;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
@ -95,7 +95,7 @@ public class MapPointConfig implements BaseConfig{
|
|||
return randomProbability;
|
||||
}
|
||||
|
||||
public int getIsShowFightAbility() {
|
||||
public int[] getIsShowFightAbility() {
|
||||
return isShowFightAbility;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,8 @@ public class SEndlessMapConfig implements BaseConfig {
|
|||
|
||||
private int[] mapItem;
|
||||
|
||||
private int[][] endlessPoint;
|
||||
|
||||
public static Map<Integer,SEndlessMapConfig> sEndlessMapConfigMap;
|
||||
|
||||
@Override
|
||||
|
@ -48,5 +50,7 @@ public class SEndlessMapConfig implements BaseConfig {
|
|||
return deathCost;
|
||||
}
|
||||
|
||||
|
||||
public int[][] getEndlessPoint() {
|
||||
return endlessPoint;
|
||||
}
|
||||
}
|
|
@ -14,7 +14,7 @@ public class SGuildLevelConfig implements BaseConfig {
|
|||
|
||||
private int num;
|
||||
|
||||
private int[] shopSort;
|
||||
private int shopSort;
|
||||
|
||||
private int officalNum;
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class SGuildLevelConfig implements BaseConfig {
|
|||
return num;
|
||||
}
|
||||
|
||||
public int[] getShopSort() {
|
||||
public int getShopSort() {
|
||||
return shopSort;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,10 @@ public class SGuildSetting implements BaseConfig {
|
|||
|
||||
private int[] nameSize;
|
||||
|
||||
private int[] totemItem;
|
||||
|
||||
private int recruitCD;
|
||||
|
||||
public static SGuildSetting sGuildSetting;
|
||||
|
||||
|
||||
|
@ -175,4 +179,12 @@ public class SGuildSetting implements BaseConfig {
|
|||
public int[] getNameSize() {
|
||||
return nameSize;
|
||||
}
|
||||
|
||||
public int[] getTotemItem() {
|
||||
return totemItem;
|
||||
}
|
||||
|
||||
public int getRecruitCD() {
|
||||
return recruitCD;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Table(name = "SpecialConfig")
|
||||
public class SSpecialConfig implements BaseConfig {
|
||||
|
||||
private static Map<String, String> enumers;
|
||||
private int id;
|
||||
|
||||
private String key;
|
||||
|
||||
private String value;
|
||||
|
||||
public static final String PHONE_BINDING = "Phone_Binding";
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
Map<Integer, SSpecialConfig> config = STableManager.getConfig(SSpecialConfig.class);
|
||||
Map<String, String> stringStringMap = new ConcurrentHashMap<>();
|
||||
for (Map.Entry<Integer, SSpecialConfig> entry : config.entrySet()) {
|
||||
SSpecialConfig sSpecialConfig = entry.getValue();
|
||||
stringStringMap.put(sSpecialConfig.getKey(), sSpecialConfig.getValue());
|
||||
}
|
||||
enumers = stringStringMap;
|
||||
}
|
||||
|
||||
|
||||
public static String getStringValue(String key) {
|
||||
String value = enumers.get(key);
|
||||
return value;
|
||||
}
|
||||
|
||||
public static int getIntegerValue(String key) {
|
||||
String value = enumers.get(key);
|
||||
if(value==null){
|
||||
return -1;
|
||||
}
|
||||
return Integer.valueOf(value);
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -77,6 +77,7 @@ public interface BIReason {
|
|||
int UPHERO_DECOMPOS_HERO_REWARD= 47 ;//进阶妖灵师返还奖励
|
||||
|
||||
int GM_CHANGENAME = 48; // gm改名赠送
|
||||
int BIND_PHONE = 49; // 修改手机号
|
||||
|
||||
//道具消耗原因 1000开头
|
||||
int ADVENTURE_UPLEVEL_CONSUME = 1000; //秘境升级
|
||||
|
|
|
@ -93,6 +93,9 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
.setHadTakeDailyBox(playerInfoManager.getHadTakeDailyBoxVip())
|
||||
.setHadTakeLevelBox(playerInfoManager.getHadTakeLevelBoxVip())
|
||||
.setVipLevel(playerInfoManager.getVipLevel()).build();
|
||||
CommonProto.PlayerBindPhone playerBindPhone = CommonProto.PlayerBindPhone.newBuilder()
|
||||
.setPhoneNum(user.getPlayerInfoManager().getPhoneBindInfo().getPhoneNum())
|
||||
.setState(user.getPlayerInfoManager().getPhoneBindInfo().getState()).build();
|
||||
RechargeInfo rechargeInfo = playerInfoManager.getRechargeInfo();
|
||||
Map<Integer, Integer> totalCountMap = user.getHeroManager().getTotalCount();
|
||||
int alreadyCount =0;
|
||||
|
@ -141,6 +144,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
.setFirstTenth(user.getHeroManager().getFirstTenth())
|
||||
.setIsDayFirst(playerInfoManager.getIsdayFirst())
|
||||
.setEndInfo(endless)
|
||||
.setPlayerBindPhone(playerBindPhone)
|
||||
.build();
|
||||
try {
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package com.ljsd.jieling.handler.activity;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ToBeStrongerHandler extends BaseHandler<PlayerInfoProto.GetToBeStrongerRequest>{
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.TO_BE_STRONGER_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, PlayerInfoProto.GetToBeStrongerRequest proto){
|
||||
ActivityLogic.getInstance().toBeStronger(iSession,proto.getTempId(),MessageTypeProto.MessageType.TO_BE_STRONGER_RESPONSE);
|
||||
}
|
||||
}
|
|
@ -420,11 +420,12 @@ public class MapLogic {
|
|||
continue;
|
||||
}
|
||||
Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId());
|
||||
if(xy>1000){
|
||||
cellValue.setForce(123456);
|
||||
}
|
||||
if(mapPointConfig.getIsShowFightAbility()==1){
|
||||
cellValue.setForce(123456);
|
||||
if(mapPointConfig.getIsShowFightAbility()!=null&&mapPointConfig.getIsShowFightAbility().length>0){
|
||||
int force = 0;
|
||||
for(int i = 0 ; i <mapPointConfig.getIsShowFightAbility().length;i++){
|
||||
force+=mapPointConfig.getIsShowFightAbility()[i];
|
||||
}
|
||||
cellValue.setForce(force);
|
||||
}
|
||||
newMap.put(xy, cellValue);
|
||||
}
|
||||
|
@ -3056,7 +3057,7 @@ public class MapLogic {
|
|||
if(heroEntry.getValue().getLevel()<20){
|
||||
continue;
|
||||
}
|
||||
int calHp = HeroLogic.getInstance().calHeroNotBufferAttribute(user, heroEntry.getValue(), false,401).get(1);
|
||||
int calHp = HeroLogic.getInstance().calHeroNotBufferAttribute(user, heroEntry.getValue(), true,401).get(1);
|
||||
if(!endlessHeroInfo.containsKey(heroEntry.getKey())){
|
||||
mapManager.addEndlessHero(heroEntry.getKey(),calHp);
|
||||
}
|
||||
|
@ -3243,4 +3244,41 @@ public class MapLogic {
|
|||
public static int getEndlessMapId() {
|
||||
return endlessMapId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 无尽副本小地图信息
|
||||
* @param session
|
||||
* @param messageType
|
||||
*/
|
||||
public void endlessMinMapInfo(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
MapManager mapManager = UserManager.getUser(session.getUid()).getMapManager();
|
||||
int[][] endlessMinMapPoint = SEndlessMapConfig.sEndlessMapConfigMap.get(MapLogic.endlessMapId).getEndlessPoint();
|
||||
MapInfoProto.EndlessMinMapResponse.Builder response = MapInfoProto.EndlessMinMapResponse.newBuilder();
|
||||
Map<Integer, SCMap> scMap = SCMap.sCMap.get(MapLogic.endlessMapId);
|
||||
for(Map.Entry<Integer, SCMap> entry:scMap.entrySet()){
|
||||
for(int i = 0 ; i <endlessMinMapPoint.length;i++){
|
||||
if(entry.getValue().getEvent()==endlessMinMapPoint[i][0]){
|
||||
int[][] groups = entry.getValue().getGroups();
|
||||
for(int j = 0 ; j <groups.length;j++){
|
||||
CommonProto.EndlessPoint.Builder point = CommonProto.EndlessPoint.newBuilder();
|
||||
int x = groups[j][0];
|
||||
int y = groups[j][1];
|
||||
int xy = CellUtil.xy2Pos(x, y);
|
||||
point.setLocation(xy).setMonsterId(endlessMinMapPoint[i][1]);
|
||||
response.addPoints(point);
|
||||
LOGGER.info("小地图怪物坐标点{}",xy);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
EndlessMapInfo endlessMapInfo = mapManager.getEndlessMapInfo();
|
||||
if(endlessMapInfo.getCurCell()!=0){
|
||||
response.setMyXY(endlessMapInfo.getCurCell());
|
||||
}else{
|
||||
SChallengeMapConfig sChallengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(MapLogic.endlessMapId);
|
||||
int[] position = sChallengeMapConfig.getPosition();
|
||||
response.setMyXY( CellUtil.xy2Pos(position[0],position[1]));
|
||||
}
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class EndlessMinMapHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.ENDLESS_MIN_MAP_INFO_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
MapLogic.getInstance().endlessMinMapInfo(iSession, MessageTypeProto.MessageType.ENDLESS_MIN_MAP_INFO_RESPONSE);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.ljsd.jieling.handler.phone;
|
||||
|
||||
import com.ljsd.jieling.config.SSpecialConfig;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class GetPhoneRewardRequestHandler extends BaseHandler<PlayerInfoProto.GetPhoneRewardRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.GET_PHONE_REWARD_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, PlayerInfoProto.GetPhoneRewardRequest proto) throws Exception {
|
||||
|
||||
int reward = SSpecialConfig.getIntegerValue(SSpecialConfig.PHONE_BINDING);
|
||||
if (-1 == reward) {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.GET_PHONE_REWARD_RESPONSE_VALUE, "手机号不合法");
|
||||
}
|
||||
|
||||
int[] rewardIds = new int[1];
|
||||
rewardIds[0] = reward;
|
||||
int uid = iSession.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user,rewardIds, 1, 1, BIReason.BIND_PHONE);
|
||||
|
||||
PlayerInfoProto.GetPhoneRewardResponse.Builder builder = PlayerInfoProto.GetPhoneRewardResponse.newBuilder().setDrop(drop);
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PHONE_REWARD_RESPONSE_VALUE,builder.build() , true);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.ljsd.jieling.handler.phone;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class UpdatePhoneinfoRequestHandler extends BaseHandler<PlayerInfoProto.UpdatePhoneinfoRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.UPDATE_PHONE_INFO_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, PlayerInfoProto.UpdatePhoneinfoRequest proto) throws Exception {
|
||||
|
||||
if(!proto.getPhoneNum().matches("(1[3-9])\\d{9}")){
|
||||
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.UPDATE_PHONE_INFO_RESPONSE_VALUE,"手机号不合法");
|
||||
return;
|
||||
}
|
||||
int uid = iSession.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
user.getPlayerInfoManager().getPhoneBindInfo().setPhoneNum(proto.getPhoneNum());
|
||||
if(user.getPlayerInfoManager().getPhoneBindInfo().getState()==0){
|
||||
user.getPlayerInfoManager().getPhoneBindInfo().setState(1);
|
||||
}
|
||||
PlayerInfoProto.UpdatePhoneinfoResponse.Builder builder = PlayerInfoProto.UpdatePhoneinfoResponse.newBuilder().setState( user.getPlayerInfoManager().getPhoneBindInfo().getState());
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.UPDATE_PHONE_INFO_RESPONSE_VALUE,builder.build() , true);
|
||||
|
||||
}
|
||||
}
|
|
@ -120,7 +120,7 @@ public class KtEventUtils {
|
|||
|
||||
KTParam ktParam = ParamBuilder.paramBuild(user, eventType, paramEventBean);
|
||||
DataMessageUtils.addLogQueue(ktParam);
|
||||
// LOGGER.info("ktparm -- > {}",gson.toJson(ktParam));
|
||||
// LOGGER.info("ktparm -- > {}",gson.toJson(ktParam));
|
||||
}
|
||||
public static ParamEnvironmentBean enviromentBuild(int uid){
|
||||
return KTEnvironmentUtil.getUserEnviromentInfoById(uid);
|
||||
|
|
|
@ -266,6 +266,7 @@ public class GlobalDataManaager {
|
|||
//活动刷新
|
||||
ActivityLogic.getInstance().flushEveryDay(user,fBuilder);
|
||||
PlayerLogic.getInstance().vipflushEveryDay(user,fBuilder);
|
||||
PlayerLogic.getInstance().flushUserdataEvery(user,fBuilder);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_REFRESH,0);
|
||||
FriendLogic.getInstance().refreshState(session);
|
||||
int sendDays = user.getPlayerInfoManager().getSendDays();
|
||||
|
|
|
@ -980,6 +980,8 @@ public class ActivityLogic {
|
|||
.setName(playerInfoManager.getNickName())
|
||||
.setForce(score)
|
||||
.setRank(++start)
|
||||
.setHeadFrame(playerInfoManager.getHeadFrame())
|
||||
.setHead(0)
|
||||
.build();
|
||||
useForceInfoList.add(personInfoBuild);
|
||||
}
|
||||
|
@ -1046,5 +1048,17 @@ public class ActivityLogic {
|
|||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 我要变强
|
||||
* @param session
|
||||
* @param messageType
|
||||
*/
|
||||
public void toBeStronger(ISession session, int tempId,MessageTypeProto.MessageType messageType){
|
||||
PlayerInfoProto.GetToBeStrongerResponse.Builder response = PlayerInfoProto.GetToBeStrongerResponse.newBuilder();
|
||||
for(int i = 0 ; i <6;i++){
|
||||
CommonProto.StrongerInfo.Builder info = CommonProto.StrongerInfo.newBuilder().setCurScore(1000).setMaxScore(6000);
|
||||
response.addInfos(info);
|
||||
}
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,10 +58,6 @@ public class GuilidManager {
|
|||
RedisUtil.getInstence().removeMapEntrys("apply-user-play",Integer.toString(uid),Integer.toString(guild));
|
||||
}
|
||||
|
||||
public static void removeMineApplyGuildInfos(int guild,int uid){
|
||||
RedisUtil.getInstence().removeMapEntrys("apply-user-play",Integer.toString(uid),Integer.toString(guild));
|
||||
}
|
||||
|
||||
public static void addGuildLog(GuildLog guildLog) throws Exception {
|
||||
MongoUtil.getInstence().getMyMongoTemplate().save(guildLog);
|
||||
if(!guildLogInfoMap.containsKey(guildLog.getGuildId())){
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package com.ljsd.jieling.logic.dao;
|
||||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
|
||||
public class PhoneBindInfo extends MongoBase {
|
||||
private String phoneNum;
|
||||
private int state ;//本月绑定状态 0 未绑定 1已绑定未领奖 2已领奖
|
||||
|
||||
public String getPhoneNum() {
|
||||
return phoneNum;
|
||||
}
|
||||
|
||||
public PhoneBindInfo(String phoneNum) {
|
||||
updateString("phoneNum",phoneNum);
|
||||
this.phoneNum = phoneNum;
|
||||
}
|
||||
|
||||
public void setPhoneNum(String phoneNum) {
|
||||
updateString("phoneNum",phoneNum);
|
||||
this.phoneNum = phoneNum;
|
||||
}
|
||||
|
||||
public int getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(int state) {
|
||||
updateString("state",state);
|
||||
this.state = state;
|
||||
}
|
||||
}
|
|
@ -84,7 +84,7 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
private int silence;//是否被禁言0为可发言,1为不可发言
|
||||
|
||||
private Map<Integer,Long> onlineTimeOfDay = new HashMap<>(); // 20190808
|
||||
private PhoneBindInfo phoneBindInfo;
|
||||
|
||||
public PlayerManager(){
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
|
@ -440,7 +440,6 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
public void addOnlineTime(long onlineTime) {
|
||||
this.onlineTime += onlineTime;
|
||||
//setOnlineTimeOfDay(onlineTime);
|
||||
updateString("onlineTime", this.onlineTime);
|
||||
}
|
||||
|
||||
|
@ -462,13 +461,6 @@ public class PlayerManager extends MongoBase {
|
|||
this.sendDays = sendDays;
|
||||
}
|
||||
|
||||
private void setOnlineTimeOfDay(long time) {
|
||||
int day= Integer.valueOf(TimeUtils.getTimeStampYMD(System.currentTimeMillis()));
|
||||
this.onlineTimeOfDay.put(day,this.onlineTimeOfDay.getOrDefault(day,0L)+time);
|
||||
updateString("onlineTimeOfDay", this.onlineTimeOfDay);
|
||||
}
|
||||
|
||||
|
||||
public String getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
@ -478,10 +470,6 @@ public class PlayerManager extends MongoBase {
|
|||
this.channel = channel;
|
||||
}
|
||||
|
||||
public Map<Integer, Long> getOnlineTimeOfDay() {
|
||||
return onlineTimeOfDay;
|
||||
}
|
||||
|
||||
public int getSilence() {
|
||||
return silence;
|
||||
}
|
||||
|
@ -490,4 +478,13 @@ public class PlayerManager extends MongoBase {
|
|||
this.silence = silence;
|
||||
updateString("silence",silence);
|
||||
}
|
||||
|
||||
public PhoneBindInfo getPhoneBindInfo() {
|
||||
return phoneBindInfo;
|
||||
}
|
||||
|
||||
public void setPhoneBindInfo(PhoneBindInfo phoneBindInfo) {
|
||||
updateString("phoneBindInfo",phoneBindInfo);
|
||||
this.phoneBindInfo = phoneBindInfo;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ public class UserManager {
|
|||
playerManager.setSendDays(1);
|
||||
playerManager.updateVipInfo(user,0);
|
||||
playerManager.setRechargeInfo(new RechargeInfo());
|
||||
playerManager.setPhoneBindInfo(new PhoneBindInfo(""));
|
||||
playerManager.setChannel(channel);
|
||||
playerManager.setHeadFrame(SGameSetting.getGameSetting().getDefaultPicture());
|
||||
SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(1);
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package com.ljsd.jieling.logic.dao.root;
|
||||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.config.SGuildSetting;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.util.MathUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -64,6 +66,7 @@ public class GuildInfo extends MongoBase {
|
|||
joinType =1;
|
||||
level = 1;
|
||||
totalMembers=1;
|
||||
icon = MathUtils.randomInt(SGuildSetting.sGuildSetting.getTotemItem().length)+1;
|
||||
defendInfo = new ConcurrentHashMap<>();
|
||||
}
|
||||
|
||||
|
|
|
@ -190,8 +190,19 @@ public class GuildLogic {
|
|||
MessageUtil.sendErrorResponse(session,0,msgId,"已加入过公会");
|
||||
return;
|
||||
}
|
||||
Map<Integer, GuildApply> applyGuildPersonInfos = GuilidManager.getApplyGuildInfos(session.getUid(), 1);
|
||||
SGuildSetting guildSetting = SGuildSetting.sGuildSetting;
|
||||
if(applyGuildPersonInfos.size()>=guildSetting.getApplyLimit()){
|
||||
MessageUtil.sendErrorResponse(session,0,msgId,"已达申请上线,无法继续申请");
|
||||
return;
|
||||
}
|
||||
for(Integer applyGuildId : applyGuilds){
|
||||
GuildApply guildApply = new GuildApply(uid,applyGuildId);
|
||||
Map<Integer, GuildApply> applyGuildFamilyInfos = GuilidManager.getApplyGuildInfos(applyGuildId, 0);
|
||||
if(applyGuildFamilyInfos.size()>=guildSetting.getBeApplyLimit()){
|
||||
MessageUtil.sendErrorResponse(session,0,msgId,"当前公会被申请已达上线,无法继续申请");
|
||||
continue;
|
||||
}
|
||||
GuilidManager.addApplyGuildInfo(guildApply);
|
||||
}
|
||||
MessageUtil.sendMessage(session,1,msgId,null,true);
|
||||
|
@ -362,28 +373,40 @@ public class GuildLogic {
|
|||
return;
|
||||
}
|
||||
try {
|
||||
Map<Integer, GuildApply> applyGuild = GuilidManager.getApplyGuildInfos(guildId, 0);
|
||||
switch (type){
|
||||
case 1: //全部同意
|
||||
GuilidManager.removeApplyGuildInfos(guildId);
|
||||
Map<Integer, Set<Integer>> members = guildInfo.getMembers();
|
||||
int count = 0;
|
||||
for(Set<Integer> memberOfType : members.values()){
|
||||
count+=memberOfType.size();
|
||||
}
|
||||
Map<Integer, GuildApply> applyGuildInfos = GuilidManager.getApplyGuildInfos(guildId, 0);
|
||||
for(Integer addUid : applyGuildInfos.keySet()){
|
||||
for(Integer addUid : applyGuild.keySet()){
|
||||
if(30-count<=0){
|
||||
break;
|
||||
}
|
||||
applyToJoin(guildInfo,addUid,true);
|
||||
count++;
|
||||
}
|
||||
for(Map.Entry<Integer, GuildApply> entry:applyGuild.entrySet()){
|
||||
GuilidManager.removeOneApplyGuildInfos(entry.getValue().getGuildId(),entry.getValue().getId());
|
||||
Map<Integer, GuildApply> applyPersonal = GuilidManager.getApplyGuildInfos(entry.getValue().getId(), 1);
|
||||
for(Map.Entry<Integer, GuildApply> personalEntry:applyPersonal.entrySet()) {
|
||||
GuilidManager.removeOneApplyGuildInfos(personalEntry.getValue().getGuildId(),personalEntry.getValue().getId());
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2: //全部拒绝
|
||||
GuilidManager.removeApplyGuildInfos(guildId);
|
||||
for(Map.Entry<Integer, GuildApply> entry:applyGuild.entrySet()){
|
||||
GuilidManager.removeOneApplyGuildInfos(entry.getValue().getGuildId(),entry.getValue().getId());
|
||||
}
|
||||
break;
|
||||
case 3: //同意一个
|
||||
applyToJoin(guildInfo,applyId,true);
|
||||
Map<Integer, GuildApply> applyPersonal = GuilidManager.getApplyGuildInfos(applyId, 1);
|
||||
for(Map.Entry<Integer, GuildApply> personalEntry:applyPersonal.entrySet()) {
|
||||
GuilidManager.removeOneApplyGuildInfos(personalEntry.getValue().getGuildId(),personalEntry.getValue().getId());
|
||||
}
|
||||
break;
|
||||
case 4: //拒绝一个
|
||||
GuilidManager.removeOneApplyGuildInfos(guildId,applyId);
|
||||
|
@ -408,10 +431,13 @@ public class GuildLogic {
|
|||
if(targetUser.getPlayerInfoManager().getGuildId()!=0){
|
||||
return;
|
||||
}
|
||||
GuilidManager.removeOneApplyGuildInfos(guildInfo.getId(),applyId);
|
||||
if(targetUser.getPlayerInfoManager().getGuildId()!=0){
|
||||
// MessageUtil.sendErrorResponse();
|
||||
return;
|
||||
}
|
||||
guildInfo.addMembers(GlobalsDef.MEMBER,applyId);
|
||||
targetUser.getPlayerInfoManager().setGuildId(guildInfo.getId());
|
||||
GuilidManager.removeMineApplyGuildInfos(guildInfo.getId(),applyId);
|
||||
GuilidManager.removeOneApplyGuildInfos(guildInfo.getId(),applyId);
|
||||
}catch (Exception e){
|
||||
LOGGER.error("the exception={}",e);
|
||||
}finally {
|
||||
|
|
|
@ -333,6 +333,19 @@ public class PlayerLogic {
|
|||
|
||||
}
|
||||
|
||||
public void flushUserdataEvery(User user, PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder) throws Exception {
|
||||
|
||||
//跟新签到天数
|
||||
if (!TimeUtils.isSameMonthFiveWithNow(user.getPlayerInfoManager().getOffLineTime())) {
|
||||
user.getPlayerInfoManager().getPhoneBindInfo().setState(0);
|
||||
}
|
||||
if(null!=fBuilder){
|
||||
PhoneBindInfo phoneBindInfo = user.getPlayerInfoManager().getPhoneBindInfo();
|
||||
fBuilder.setPlayerBindPhone(CommonProto.PlayerBindPhone.newBuilder().setPhoneNum(phoneBindInfo.getPhoneNum()).setState(phoneBindInfo.getState()).build());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void modifyHeadFrame(ISession session, int frameId,MessageTypeProto.MessageType messageType) throws Exception {
|
||||
LOGGER.info("头像框id{}",frameId);
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
|
|
@ -40,7 +40,7 @@ public class RPCServerTask extends Thread{
|
|||
trArgs.processor(processor);
|
||||
TBinaryProtocol.Factory proFactory = new TBinaryProtocol.Factory(true, true);
|
||||
trArgs.protocolFactory(proFactory);
|
||||
trArgs.maxWorkerThreads(4096);
|
||||
trArgs.maxWorkerThreads(16);
|
||||
LOGGER.info("run->RPC services is starting.");
|
||||
final TServer server = new TThreadPoolServer(trArgs);
|
||||
while (true) {
|
||||
|
|
Loading…
Reference in New Issue