From 77b0f4f5acec30f9be8c7eeadfc25d9641ca26f3 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 26 五月 2025 11:46:13 +0800
Subject: [PATCH] 16 卡牌服务端(删除脱机挂)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnlinePrize.py | 7
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRecover.py | 4
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py | 1
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py | 331 ----------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 228 ------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossPlayerData.py | 3
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py | 1
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActHorsePetFeast.py | 3
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/GMShell.py | 6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 11
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py | 14
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py | 7
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py | 4
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py | 4
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py | 5
/dev/null | 1069 --------------------------------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py | 8
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini | 29
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py | 14
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py | 181 -----
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py | 2
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGameWallow.py | 8
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/NormalNPC_Attack_Player.py | 5
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameFuncComm.py | 2
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py | 4
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 22
26 files changed, 16 insertions(+), 1,957 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
index 4c272c7..db15898 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -1451,35 +1451,6 @@
PacketSubCMD_1=0x0C
PacketCallFunc_1=OnDice
-;玩家脱机挂
-[PlayerTJG]
-ScriptName = Player\PlayerTJG.py
-Writer = alee
-Releaser = alee
-RegType = 0
-RegisterPackCount = 5
-
-PacketCMD_1 = 0xB2
-PacketSubCMD_1 = 0x01
-PacketCallFunc_1 = OnTJGState
-
-PacketCMD_2 = 0xB2
-PacketSubCMD_2 = 0x02
-PacketCallFunc_2 = OnSightZoom
-
-PacketCMD_3 = 0xB2
-PacketSubCMD_3 = 0x03
-PacketCallFunc_3 = OnTJGNPC
-
-PacketCMD_4 = 0xB2
-PacketSubCMD_4 = 0x04
-PacketCallFunc_4 = OnTJGSystemSet
-
-PacketCMD_5 = 0xB4
-PacketSubCMD_5 = 0x0A
-PacketCallFunc_5 = TJGNotifyDead
-
-
;仙魔之争
[GameLogic_XMZZ]
ScriptName = GameWorldLogic\FBProcess\GameLogic_XMZZ.py
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/NormalNPC_Attack_Player.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/NormalNPC_Attack_Player.py
index c24f3bd..b6f1fc3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/NormalNPC_Attack_Player.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/NormalNPC_Attack_Player.py
@@ -26,7 +26,6 @@
import GameObj
import NPCCommon
import ChNPC
-import PlayerTJG
#---------------------------------------------------------------------
#---------------------------------------------------------------------
@@ -40,10 +39,6 @@
# @remarks 函数详细说明.
def GetCanAttack(curNormalNPC, curTagPlayer, skill, tick):
if not AttackCommon.CheckNPCCanAttackTag(curNormalNPC, curTagPlayer, skill):
- return False
-
- if PlayerTJG.GetIsTJG(curTagPlayer):
- # 脱机挂玩家
return False
return True
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 8272077..20082c5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -513,7 +513,6 @@
Def_Effect_UseItemGiveZhenQi = 205 #使用道具给予真气
Def_Effect_ItemGiveFamilyActivity = 208 #使用道具给予仙盟活跃令
Def_Effect_ItemGiveFamilyContribution = 209 #使用道具给予仙盟贡献
-Def_Effect_TJGAddTime = 210 #增加脱机挂时间
Def_Effect_ItemAddExp = 213 #给经验道具
Def_Effect_ItemAddLV = 214 #直接升级道具
Def_Effect_ItemAddExpByLV = 215 #给经验道具 XX级前,所加经验随等级增加而增加,XX级后按XX级算
@@ -803,7 +802,6 @@
Def_SkillID_ReviveTired = 20030 # 复活疲劳 SkillID
Def_SkillID_SkillReBorn = -1 # 技能复活ID
Def_SkillID_LimitSuperBuff = 10000 # 有限无敌BUFF SkillID
-Def_SkillID_TJGSuperBuff = 20039 # 脱机挂死亡复活保护
Def_SkillID_Somersault = 190 # 翻滚快速闪避
Def_SkillID_DoubleExp = -1 # 双倍经验系统中的双倍经验ID
Def_SkillID_Justice = 11504 # 正义阵营
@@ -842,8 +840,6 @@
# 切地图需清除的buff
ClearBuffOnMapChangeList = [Def_SkillID_DropOwnerBuff, Def_SkillID_FamilyWar_CWinBuff,
Def_SkillID_FamilyWar_JoinBuff, Def_SkillID_FamilyWar_RandBuffAttr]
-# 脱机挂状态下不刷新buff时间的
-TJGStateNotRefreshTimeBuff = [Def_SkillID_Red]
#技能ID对应的区域类型
Def_AreaType_SkillID_Safe = 20011 # 安全区
@@ -887,7 +883,6 @@
Def_HurtType_FuhaoHit, # 富豪一击
) = range(21, 25)
-Def_EquipItemType_TJGAutoEat = xrange(Def_ItemType_retWeapon, Def_ItemType_retGlove + 1)
#装备类型
Def_EquipItemType = range(Def_ItemType_retWeapon, Def_ItemType_DogzEquipScute + 1)
@@ -3233,8 +3228,6 @@
Def_PlayerKey_MoreHurtValue = "MoreHurtValue" # 额外的伤害值,一般用于不走公式
Def_PlayerKey_BloodShiledHurt = "BSHurt" # 伤害值用于血盾抵消
Def_PlayerKey_BloodShiledHurtEx = "BSHurtEx" # 伤害值用于血盾抵消
-Def_PlayerKey_TJGPackFullAfterEat = "TJGFullEat" # 脱机挂吞噬后背包依然满的情况
-Def_PlayerKey_TJGStartTime = "TJGStartTime" # 脱机挂结算时间起点
Def_PlayerKey_EquipTime = "EquipTime" # 时效装备
Def_PlayerKey_PowerPartTime = "PowerPartTime" # 蓄力每次消耗时间,因攻速改变
Def_PlayerKey_PowerPartCount = "PowerPartCount" # 蓄力技能能量次数
@@ -3516,7 +3509,6 @@
Def_QuDao_DoubleBillCount = "qddbCount" # 渠道返利的仙玉领取次数 日期+次数组合数字
Def_PDict_GeTuiSet = "GetuiSet" # 推送提醒的设置
Def_PDict_NoGeTuiTime = "NoGetuiTime" # 推送提醒免打扰时间,将字符串组合数字
-Def_PlayerKey_TJGNPC = "TJGNPC" # 脱机挂机NPC点
Def_PDict_OnHour = "OnHour"
Def_PDict_OnDay = "OnDay" # 0点过天
Def_PDict_OnWeek = "OnWeek" # 0点过周
@@ -3738,7 +3730,6 @@
Def_PDict_MoneyMinus = "MoneyMinus_%s" # 货币对应负值, 参数[货币类型]
Def_PDict_Currency = "PlayerCurrency_%s" # 自定义货币类型, 参数[自定义货币类型]
Def_PDict_UseMoneyTotal = "UseMoneyTotal_%s" # 累计消耗货币, 参数[货币类型]
-Def_PDict_TJGSet = "TJGSet" # 脱机挂系统设定
Def_PDict_TJGDeadTime = "TJGDeadTime" # 脱机被杀时间
Def_PDict_TJGDeadPayTime = "TJGDeadPayTime" # 脱机被杀后可补偿的时间
Def_PDict_TJGDeadExp = "TJGDeadExp" # 脱机被杀经验
@@ -4455,19 +4446,6 @@
# 我要太极
Def_PDict_Dice_Result = "DiceResult" # 我要太极结果
Def_PDict_Dice_FreeChangeCnt = "DiceFreeChangeCnt" # 我要太极免费改投次数
-
-# 脱机挂类型通知结果
-Def_PDictType_TJGNotify_Exp1 = "TJGNExp1" #经验
-Def_PDictType_TJGNotify_Exp2 = "TJGNExp2" #超过E部分
-Def_PDictType_TJGNotify_Time = "TJGNTime" #使用时间
-Def_PDictType_TJGNotify_EatPurple = "TJGNEatP" #吞噬的紫装数量
-Def_PDictType_TJGNotify_GiveCnt = "TJGNGiveCnt" #吞噬获得的炼丹材料数量
-Def_PDictType_TJGNotify_Purple = "TJGNPurple" #获得紫装数量
-Def_PDictType_TJGNotify_Orange = "TJGNOrg" #获得橙装数量
-Def_PDictType_TJGNotify_LV = "TJGLV" #脱机前的等级
-Def_PDictType_TJGNotify_ItemID = "TJGItemID_%s" #脱机挂指定物品掉落显示
-
-Def_PDictType_TJGOnDayEx = "TJGOnDayEx" #是否脱机挂中过天(5点)真实登录后重置
# 挂机收益
Def_PDict_GuajiCalcTime = "GuajiCalcTime" # 上次统计收益时间戳
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index 09a8e73..012c6e3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -20911,289 +20911,6 @@
#------------------------------------------------------
-#B2 01 脱机挂状态 # tagCMLoginState
-
-class tagCMLoginState(Structure):
- _pack_ = 1
- _fields_ = [
- ("Cmd", c_ubyte),
- ("SubCmd", c_ubyte),
- ("State", c_ubyte), # 0正常登录,1脱机登录,2脱机登录死亡
- ]
-
- def __init__(self):
- self.Clear()
- self.Cmd = 0xB2
- self.SubCmd = 0x01
- return
-
- def ReadData(self, stringData, _pos=0, _len=0):
- self.Clear()
- memmove(addressof(self), stringData[_pos:], self.GetLength())
- return _pos + self.GetLength()
-
- def Clear(self):
- self.Cmd = 0xB2
- self.SubCmd = 0x01
- self.State = 0
- return
-
- def GetLength(self):
- return sizeof(tagCMLoginState)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''//B2 01 脱机挂状态 // tagCMLoginState:
- Cmd:%s,
- SubCmd:%s,
- State:%d
- '''\
- %(
- self.Cmd,
- self.SubCmd,
- self.State
- )
- return DumpString
-
-
-m_NAtagCMLoginState=tagCMLoginState()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMLoginState.Cmd,m_NAtagCMLoginState.SubCmd))] = m_NAtagCMLoginState
-
-
-#------------------------------------------------------
-#B2 05 推送提醒设置 #tagCMPushNotificationsSetting
-
-class tagCMPushNotificationsSetting(Structure):
- Head = tagHead()
- OnoffBit = 0 #(DWORD OnoffBit)// 按位约定开关
- TimeLen = 0 #(BYTE TimeLen)
- TimeStr = "" #(String TimeStr)// 时间字符串 01:02-05:00
- data = None
-
- def __init__(self):
- self.Clear()
- self.Head.Cmd = 0xB2
- self.Head.SubCmd = 0x05
- return
-
- def ReadData(self, _lpData, _pos=0, _Len=0):
- self.Clear()
- _pos = self.Head.ReadData(_lpData, _pos)
- self.OnoffBit,_pos = CommFunc.ReadDWORD(_lpData, _pos)
- self.TimeLen,_pos = CommFunc.ReadBYTE(_lpData, _pos)
- self.TimeStr,_pos = CommFunc.ReadString(_lpData, _pos,self.TimeLen)
- return _pos
-
- def Clear(self):
- self.Head = tagHead()
- self.Head.Clear()
- self.Head.Cmd = 0xB2
- self.Head.SubCmd = 0x05
- self.OnoffBit = 0
- self.TimeLen = 0
- self.TimeStr = ""
- return
-
- def GetLength(self):
- length = 0
- length += self.Head.GetLength()
- length += 4
- length += 1
- length += len(self.TimeStr)
-
- return length
-
- def GetBuffer(self):
- data = ''
- data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
- data = CommFunc.WriteDWORD(data, self.OnoffBit)
- data = CommFunc.WriteBYTE(data, self.TimeLen)
- data = CommFunc.WriteString(data, self.TimeLen, self.TimeStr)
- return data
-
- def OutputString(self):
- DumpString = '''
- Head:%s,
- OnoffBit:%d,
- TimeLen:%d,
- TimeStr:%s
- '''\
- %(
- self.Head.OutputString(),
- self.OnoffBit,
- self.TimeLen,
- self.TimeStr
- )
- return DumpString
-
-
-m_NAtagCMPushNotificationsSetting=tagCMPushNotificationsSetting()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMPushNotificationsSetting.Head.Cmd,m_NAtagCMPushNotificationsSetting.Head.SubCmd))] = m_NAtagCMPushNotificationsSetting
-
-
-#------------------------------------------------------
-#B2 02 视野缩放 #tagCMSightZoom
-
-class tagCMSightZoom(Structure):
- _pack_ = 1
- _fields_ = [
- ("Cmd", c_ubyte),
- ("SubCmd", c_ubyte),
- ("Sight", c_ubyte), # 视野缩放,用于脱机挂不超过最大视野,空闲状态为0,被玩家攻击恢复视野
- ]
-
- def __init__(self):
- self.Clear()
- self.Cmd = 0xB2
- self.SubCmd = 0x02
- return
-
- def ReadData(self, stringData, _pos=0, _len=0):
- self.Clear()
- memmove(addressof(self), stringData[_pos:], self.GetLength())
- return _pos + self.GetLength()
-
- def Clear(self):
- self.Cmd = 0xB2
- self.SubCmd = 0x02
- self.Sight = 0
- return
-
- def GetLength(self):
- return sizeof(tagCMSightZoom)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''//B2 02 视野缩放 //tagCMSightZoom:
- Cmd:%s,
- SubCmd:%s,
- Sight:%d
- '''\
- %(
- self.Cmd,
- self.SubCmd,
- self.Sight
- )
- return DumpString
-
-
-m_NAtagCMSightZoom=tagCMSightZoom()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMSightZoom.Cmd,m_NAtagCMSightZoom.SubCmd))] = m_NAtagCMSightZoom
-
-
-#------------------------------------------------------
-#B2 04 系统设置 #tagCMSystem
-
-class tagCMSystem(Structure):
- _pack_ = 1
- _fields_ = [
- ("Cmd", c_ubyte),
- ("SubCmd", c_ubyte),
- ("AutoEat", c_ubyte), # 自动吞噬
- ("AutoReborn", c_ubyte), #自动买活
- ]
-
- def __init__(self):
- self.Clear()
- self.Cmd = 0xB2
- self.SubCmd = 0x04
- return
-
- def ReadData(self, stringData, _pos=0, _len=0):
- self.Clear()
- memmove(addressof(self), stringData[_pos:], self.GetLength())
- return _pos + self.GetLength()
-
- def Clear(self):
- self.Cmd = 0xB2
- self.SubCmd = 0x04
- self.AutoEat = 0
- self.AutoReborn = 0
- return
-
- def GetLength(self):
- return sizeof(tagCMSystem)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''//B2 04 系统设置 //tagCMSystem:
- Cmd:%s,
- SubCmd:%s,
- AutoEat:%d,
- AutoReborn:%d
- '''\
- %(
- self.Cmd,
- self.SubCmd,
- self.AutoEat,
- self.AutoReborn
- )
- return DumpString
-
-
-m_NAtagCMSystem=tagCMSystem()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMSystem.Cmd,m_NAtagCMSystem.SubCmd))] = m_NAtagCMSystem
-
-
-#------------------------------------------------------
-#B2 03 设置脱机挂NPC # tagCMTJGnpc
-
-class tagCMTJGnpc(Structure):
- _pack_ = 1
- _fields_ = [
- ("Cmd", c_ubyte),
- ("SubCmd", c_ubyte),
- ("NPCID", c_int), # 脱机挂点
- ]
-
- def __init__(self):
- self.Clear()
- self.Cmd = 0xB2
- self.SubCmd = 0x03
- return
-
- def ReadData(self, stringData, _pos=0, _len=0):
- self.Clear()
- memmove(addressof(self), stringData[_pos:], self.GetLength())
- return _pos + self.GetLength()
-
- def Clear(self):
- self.Cmd = 0xB2
- self.SubCmd = 0x03
- self.NPCID = 0
- return
-
- def GetLength(self):
- return sizeof(tagCMTJGnpc)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''//B2 03 设置脱机挂NPC // tagCMTJGnpc:
- Cmd:%s,
- SubCmd:%s,
- NPCID:%d
- '''\
- %(
- self.Cmd,
- self.SubCmd,
- self.NPCID
- )
- return DumpString
-
-
-m_NAtagCMTJGnpc=tagCMTJGnpc()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMTJGnpc.Cmd,m_NAtagCMTJGnpc.SubCmd))] = m_NAtagCMTJGnpc
-
-
-#------------------------------------------------------
# B3 17 情戒解锁 #tagCMLoveRingUnlock
class tagCMLoveRingUnlock(Structure):
@@ -22536,54 +22253,6 @@
m_NAtagCMSuperAtk=tagCMSuperAtk()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMSuperAtk.Head.Cmd,m_NAtagCMSuperAtk.Head.SubCmd))] = m_NAtagCMSuperAtk
-
-
-#------------------------------------------------------
-#B4 0A 脱机挂死亡 # tagCMTJGDead
-
-class tagCMTJGDead(Structure):
- _pack_ = 1
- _fields_ = [
- ("Cmd", c_ubyte),
- ("SubCmd", c_ubyte),
- ]
-
- def __init__(self):
- self.Clear()
- self.Cmd = 0xB4
- self.SubCmd = 0x0A
- return
-
- def ReadData(self, stringData, _pos=0, _len=0):
- self.Clear()
- memmove(addressof(self), stringData[_pos:], self.GetLength())
- return _pos + self.GetLength()
-
- def Clear(self):
- self.Cmd = 0xB4
- self.SubCmd = 0x0A
- return
-
- def GetLength(self):
- return sizeof(tagCMTJGDead)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''//B4 0A 脱机挂死亡 // tagCMTJGDead:
- Cmd:%s,
- SubCmd:%s
- '''\
- %(
- self.Cmd,
- self.SubCmd
- )
- return DumpString
-
-
-m_NAtagCMTJGDead=tagCMTJGDead()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMTJGDead.Cmd,m_NAtagCMTJGDead.SubCmd))] = m_NAtagCMTJGDead
#------------------------------------------------------
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index cabf022..2871862 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -60090,234 +60090,6 @@
#------------------------------------------------------
-#B4 10 脱机挂被杀后离线找回 # tagMCTJGDeadPay
-
-class tagMCTJGDeadPay(Structure):
- _pack_ = 1
- _fields_ = [
- ("Cmd", c_ubyte),
- ("SubCmd", c_ubyte),
- ("Times", c_int), # 可找回时间
- ("DeadTime", c_int), # 死亡时间
- ("Exp", c_int), # 经验
- ("Exp1", c_int), # 经验 亿
- ]
-
- def __init__(self):
- self.Clear()
- self.Cmd = 0xB4
- self.SubCmd = 0x10
- return
-
- def ReadData(self, stringData, _pos=0, _len=0):
- self.Clear()
- memmove(addressof(self), stringData[_pos:], self.GetLength())
- return _pos + self.GetLength()
-
- def Clear(self):
- self.Cmd = 0xB4
- self.SubCmd = 0x10
- self.Times = 0
- self.DeadTime = 0
- self.Exp = 0
- self.Exp1 = 0
- return
-
- def GetLength(self):
- return sizeof(tagMCTJGDeadPay)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''//B4 10 脱机挂被杀后离线找回 // tagMCTJGDeadPay:
- Cmd:%s,
- SubCmd:%s,
- Times:%d,
- DeadTime:%d,
- Exp:%d,
- Exp1:%d
- '''\
- %(
- self.Cmd,
- self.SubCmd,
- self.Times,
- self.DeadTime,
- self.Exp,
- self.Exp1
- )
- return DumpString
-
-
-m_NAtagMCTJGDeadPay=tagMCTJGDeadPay()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTJGDeadPay.Cmd,m_NAtagMCTJGDeadPay.SubCmd))] = m_NAtagMCTJGDeadPay
-
-
-#------------------------------------------------------
-#B4 09 通知脱机挂结果 #tagMCTJGInfo
-
-class tagMCTJGItems(Structure):
- _pack_ = 1
- _fields_ = [
- ("ItemID", c_int),
- ("Count", c_ushort),
- ]
-
- def __init__(self):
- self.Clear()
- return
-
- def ReadData(self, stringData, _pos=0, _len=0):
- self.Clear()
- memmove(addressof(self), stringData[_pos:], self.GetLength())
- return _pos + self.GetLength()
-
- def Clear(self):
- self.ItemID = 0
- self.Count = 0
- return
-
- def GetLength(self):
- return sizeof(tagMCTJGItems)
-
- def GetBuffer(self):
- return string_at(addressof(self), self.GetLength())
-
- def OutputString(self):
- DumpString = '''//B4 09 通知脱机挂结果 //tagMCTJGInfo:
- ItemID:%d,
- Count:%d
- '''\
- %(
- self.ItemID,
- self.Count
- )
- return DumpString
-
-
-class tagMCTJGInfo(Structure):
- Head = tagHead()
- Exp1 = 0 #(DWORD Exp1)// 经验
- Exp2 = 0 #(DWORD Exp2)// 超亿经验
- Times = 0 #(DWORD Times)// 使用时间秒
- PurpleEquip = 0 #(WORD PurpleEquip)// 产出紫装数量
- OrangeEquip = 0 #(WORD OrangeEquip)// 产出橙装数量
- EatPurpleEquip = 0 #(WORD EatPurpleEquip)// 吞噬紫装数量
- BeforeLV = 0 #(WORD BeforeLV)//脱机前记录的等级
- GiveCnt = 0 #(WORD GiveCnt)//获得炼丹材料数量
- Cnt = 0 #(BYTE Cnt)//物品类别数量
- Items = list() #(vector<tagMCTJGItems> Items)
- data = None
-
- def __init__(self):
- self.Clear()
- self.Head.Cmd = 0xB4
- self.Head.SubCmd = 0x09
- return
-
- def ReadData(self, _lpData, _pos=0, _Len=0):
- self.Clear()
- _pos = self.Head.ReadData(_lpData, _pos)
- self.Exp1,_pos = CommFunc.ReadDWORD(_lpData, _pos)
- self.Exp2,_pos = CommFunc.ReadDWORD(_lpData, _pos)
- self.Times,_pos = CommFunc.ReadDWORD(_lpData, _pos)
- self.PurpleEquip,_pos = CommFunc.ReadWORD(_lpData, _pos)
- self.OrangeEquip,_pos = CommFunc.ReadWORD(_lpData, _pos)
- self.EatPurpleEquip,_pos = CommFunc.ReadWORD(_lpData, _pos)
- self.BeforeLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
- self.GiveCnt,_pos = CommFunc.ReadWORD(_lpData, _pos)
- self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
- for i in range(self.Cnt):
- temItems = tagMCTJGItems()
- _pos = temItems.ReadData(_lpData, _pos)
- self.Items.append(temItems)
- return _pos
-
- def Clear(self):
- self.Head = tagHead()
- self.Head.Clear()
- self.Head.Cmd = 0xB4
- self.Head.SubCmd = 0x09
- self.Exp1 = 0
- self.Exp2 = 0
- self.Times = 0
- self.PurpleEquip = 0
- self.OrangeEquip = 0
- self.EatPurpleEquip = 0
- self.BeforeLV = 0
- self.GiveCnt = 0
- self.Cnt = 0
- self.Items = list()
- return
-
- def GetLength(self):
- length = 0
- length += self.Head.GetLength()
- length += 4
- length += 4
- length += 4
- length += 2
- length += 2
- length += 2
- length += 2
- length += 2
- length += 1
- for i in range(self.Cnt):
- length += self.Items[i].GetLength()
-
- return length
-
- def GetBuffer(self):
- data = ''
- data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
- data = CommFunc.WriteDWORD(data, self.Exp1)
- data = CommFunc.WriteDWORD(data, self.Exp2)
- data = CommFunc.WriteDWORD(data, self.Times)
- data = CommFunc.WriteWORD(data, self.PurpleEquip)
- data = CommFunc.WriteWORD(data, self.OrangeEquip)
- data = CommFunc.WriteWORD(data, self.EatPurpleEquip)
- data = CommFunc.WriteWORD(data, self.BeforeLV)
- data = CommFunc.WriteWORD(data, self.GiveCnt)
- data = CommFunc.WriteBYTE(data, self.Cnt)
- for i in range(self.Cnt):
- data = CommFunc.WriteString(data, self.Items[i].GetLength(), self.Items[i].GetBuffer())
- return data
-
- def OutputString(self):
- DumpString = '''
- Head:%s,
- Exp1:%d,
- Exp2:%d,
- Times:%d,
- PurpleEquip:%d,
- OrangeEquip:%d,
- EatPurpleEquip:%d,
- BeforeLV:%d,
- GiveCnt:%d,
- Cnt:%d,
- Items:%s
- '''\
- %(
- self.Head.OutputString(),
- self.Exp1,
- self.Exp2,
- self.Times,
- self.PurpleEquip,
- self.OrangeEquip,
- self.EatPurpleEquip,
- self.BeforeLV,
- self.GiveCnt,
- self.Cnt,
- "..."
- )
- return DumpString
-
-
-m_NAtagMCTJGInfo=tagMCTJGInfo()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTJGInfo.Head.Cmd,m_NAtagMCTJGInfo.Head.SubCmd))] = m_NAtagMCTJGInfo
-
-
-#------------------------------------------------------
# B4 20 回合制战斗状态 #tagMCTurnFightState
class tagMCTurnFightState(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py
index 6fdfaca..3396ab3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py
@@ -41,7 +41,6 @@
import GameWorld
import ChConfig
import CommFunc
-import PlayerTJG
import datetime
import random
@@ -601,14 +600,11 @@
# 离线数据
def WriteEvent_session(curPlayer):
seconds = 0
- if PlayerTJG.GetIsTJG(curPlayer):
- return
- else:
- logoffTimeStr = curPlayer.GetLogoffTime().strip()
- loginTimeStr = curPlayer.GetLoginTime().strip()
- if logoffTimeStr and loginTimeStr:
- passTimes = GameWorld.GetDateTimeByStr(logoffTimeStr) - GameWorld.GetDateTimeByStr(loginTimeStr)
- seconds = passTimes.seconds
+ logoffTimeStr = curPlayer.GetLogoffTime().strip()
+ loginTimeStr = curPlayer.GetLoginTime().strip()
+ if logoffTimeStr and loginTimeStr:
+ passTimes = GameWorld.GetDateTimeByStr(logoffTimeStr) - GameWorld.GetDateTimeByStr(loginTimeStr)
+ seconds = passTimes.seconds
EventReport(ShareDefine.Def_UserAction_Session, "OnlineTime=%s&SessionID=%s"%(seconds, GameWorld.GetSessionID(curPlayer)), curPlayer)
#===========================================================================
# sessionEvent = session()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetTJG.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetTJG.py
deleted file mode 100644
index 4ad797b..0000000
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetTJG.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/python
-# -*- coding: GBK -*-
-#
-# @todo:
-#
-# @author: Alee
-# @date 2018-1-6 下午02:27:07
-# @version 1.0
-#
-# @note:
-#
-#---------------------------------------------------------------------
-import GameWorld
-import PlayerTJG
-import ChConfig
-import PlayerControl
-
-#---------------------------------------------------------------------
-#逻辑实现
-## GM命令执行入口
-# @param curPlayer 当前玩家
-# @param msgList 参数列表 [npcID]
-# @return None
-# @remarks 函数详细说明. 参数1 脱机挂状态 参数2 脱机挂NPC 参数3 指定玩家脱机挂
-def OnExec(curPlayer, msgList):
- if not msgList:
- GameWorld.DebugAnswer(curPlayer, "SetTJG 状态 npcID 可选指定玩家ID")
- GameWorld.DebugAnswer(curPlayer, "状态: 0-非脱机, 1-脱机, 2-脱机被击杀")
- return
-
- if len(msgList) == 3:
- tagPlayerID = msgList[2]
- curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(tagPlayerID)
- if not curPlayer:
- GameWorld.DebugAnswer(curPlayer, "找不到指定玩家,(%s)" % tagPlayerID)
- return
-
- state = msgList[0]
- if state == 1:
- tick = GameWorld.GetGameWorld().GetTick()
- curPlayer.SetDict(ChConfig.Def_PlayerKey_TJGStartTime, tick)
- if not PlayerTJG.GetTJGTime(curPlayer):
- PlayerTJG.SetTJGTime(curPlayer, 3600)
-
- tjgNPCID = msgList[1] if len(msgList) > 1 else 0
- curPlayer.SetState(state)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_TJGNPC, tjgNPCID)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGNotify_LV, curPlayer.GetLV(), ChConfig.Def_PDictType_TJGNotify)
- GameWorld.DebugAnswer(curPlayer, "设置脱机状态:%s,npcID=%s" % (state, tjgNPCID))
- if state == 2:
- curPlayer.Kick(0)
- return
-
-
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/TJGResult.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/TJGResult.py
deleted file mode 100644
index e1cdc64..0000000
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/TJGResult.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/python
-# -*- coding: GBK -*-
-#
-# @todo:
-#
-# @author: Alee
-# @date 2018-1-6 下午02:27:07
-# @version 1.0
-#
-# @note:
-#
-#---------------------------------------------------------------------
-
-import ChConfig
-import GameWorld
-#---------------------------------------------------------------------
-#逻辑实现
-## GM命令执行入口
-# @param curPlayer 当前玩家
-# @param msgList 参数列表 [npcID]
-# @return None
-# @remarks 函数详细说明. 参数1 脱机挂状态 参数2 脱机挂NPC 参数3 指定玩家脱机挂
-def OnExec(curPlayer, msgList):
- GameWorld.DebugAnswer(curPlayer, "经验:%s-%s 脱机时间:%s 紫装:%s 橙装:%s 吞噬:%s"%(
- curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Exp1, 0, ChConfig.Def_PDictType_TJGNotify),
- curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Exp2, 0, ChConfig.Def_PDictType_TJGNotify),
- curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Time, 0, ChConfig.Def_PDictType_TJGNotify),
- curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Purple, 0, ChConfig.Def_PDictType_TJGNotify),
- curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Orange, 0, ChConfig.Def_PDictType_TJGNotify),
- curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_EatPurple, 0, ChConfig.Def_PDictType_TJGNotify)))
- return
-
-
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/GMShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/GMShell.py
index d4a30f2..cb412c8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/GMShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/GMShell.py
@@ -28,7 +28,6 @@
import PlayerControl
import ReadChConfig
import traceback
-import PlayerTJG
import FBLogic
import GameObj
#---------------------------------------------------------------------
@@ -179,10 +178,7 @@
if value == None:
GameWorld.DebugAnswer(curPlayer, "参数错误, 必须为纯数字!")
return
- if callFunName == "SetHappyPoint":
- PlayerTJG.SetTJGTime(curPlayer, value)
- else:
- callObj(value)
+ callObj(value)
else:
GameWorld.DebugAnswer(curPlayer, "不支持该命令!curPlayer.%s" % callFunName)
return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py
index 0128901..ae8e33a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorld.py
@@ -609,8 +609,6 @@
return False
#if not curPlayer.GetInitOK():
# return False
- #if IsTJGPlayer(curPlayer):
- # return False
if IsMirrorPlayer(curPlayer):
return False
return True
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py
index 6a7a154..3b8aecd 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py
@@ -27,7 +27,6 @@
import SkillCommon
import PyGameData
import BuffSkill
-import PlayerTJG
import NPCCommon
import ChConfig
import GameObj
@@ -606,9 +605,6 @@
def __DoCheckHorsePetRobBossKillCntBuff(curPlayer, tick):
familyID = curPlayer.GetFamilyID()
if not familyID:
- return
-
- if PlayerTJG.GetIsTJG(curPlayer):
return
killCount = PyGameData.g_familyKillHorsePetRobBossCntDict.get(familyID, 0)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py
index 054bc14..cf87e7b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChItem.py
@@ -723,7 +723,6 @@
ChConfig.Def_Effect_Face:"Item_Face",
ChConfig.Def_Effect_FacePic:"Item_Face",
ChConfig.Def_Effect_ItemAddLV:"Item_AddLV", #升级道具
- ChConfig.Def_Effect_TJGAddTime:"Item_TJGAddTime", #增加脱机挂时间
ChConfig.Def_Effect_GuajiAward:"Item_GuajiAward", #直接给挂机收益
ChConfig.Def_Effect_CleanGuilt:"Item_CleanGuilt", # 洗红名
ChConfig.Def_Effect_PrizeCoin:"Item_PrizeCoin", # 奖励充值点券
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_TJGAddTime.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_TJGAddTime.py
deleted file mode 100644
index 3fa63b9..0000000
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_TJGAddTime.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/python
-# -*- coding: GBK -*-
-#
-# @todo: 增加脱机挂时间
-#
-# @author: Alee
-# @date 2018-1-3 下午09:58:45
-# @version 1.0
-#
-# @note:
-#
-#---------------------------------------------------------------------
-import PlayerControl
-import ItemCommon
-import PlayerTJG
-
-def BatchUseItem(curPlayer, curRoleItem, tick, useCnt, exData):
- addTime = curRoleItem.GetEffectByIndex(0).GetEffectValue(0)*useCnt
- PlayerTJG.AddTJGTime(curPlayer, addTime)
- PlayerControl.NotifyCode(curPlayer, 'UseItem2', [curRoleItem.GetItemTypeID(), addTime/3600])
- ItemCommon.DelItem(curPlayer, curRoleItem, useCnt, True, "TJGAddTime")
- return True, useCnt
-
-
-def UseItem(curPlayer, curRoleItem, tick):
- BatchUseItem(curPlayer, curRoleItem, tick, 1, 0)
- return True
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
index 44004d6..89c5afb 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -765,187 +765,6 @@
return
return ipyDrop
-def GetNPCDropInfoTJG(dropPlayer, mapID, npcID, killCount):
- '''脱机挂杀怪掉落专用函数
- 只算: 1.饼图装备掉落 + 2.指定物品ID掉落 + 3.金币掉落
- '''
- ipyDrop = GetNPCDropIpyData(npcID)
- if not ipyDrop:
- return
-
- realmNPCIpyData = None
- realmMapIDList = IpyGameDataPY.GetFuncEvalCfg("RealmDifficulty", 1)
- realmDifficulty = PlayerControl.GetRealmDifficulty(dropPlayer)
- if mapID in realmMapIDList and realmDifficulty:
- realmLV = PlayerControl.GetDifficultyRealmLV(realmDifficulty)
- realmNPCIpyData = IpyGameDataPY.GetIpyGameDataNotLog("NPCRealmStrengthen", npcID, realmLV)
- #if realmNPCIpyData:
- # maxDropLV = realmNPCIpyData.GetMaxDrapLV()
-
- #脱机暂不限制最大等级掉落
- #playerLV = dropPlayer.GetLV()
- #maxDropLV = ipyDrop.GetMaxDropLV()
- #if maxDropLV and playerLV > maxDropLV:
- # GameWorld.DebugLog("超过最大可掉落等级,不掉落物品!npcID=%s,playerLV(%s) > maxDropLV(%s)" % (npcID, playerLV, maxDropLV))
- # return
-
- playerID = dropPlayer.GetPlayerID()
- npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
- if not npcData:
- return
-
- dropIDList = [] # 掉落的ID列表
- itemJobList = [dropPlayer.GetJob()] if ipyDrop.GetIsDropJobSelf() else IpyGameDataPY.GetFuncEvalCfg("OpenJob", 1) # 掉落装备职业列表
-
- equipDropRatePlus = PlayerControl.GetDropEquipPer(dropPlayer)
- equipDropDoCountPlus = PlayerControl.GetDropEquipDoCount(dropPlayer)
-
- dropRatePlusValue = ipyDrop.GetCanDropRatePlus()
- if not dropRatePlusValue & pow(2, 0):
- equipDropRatePlus = 0
-
- if not dropRatePlusValue & pow(2, 1):
- equipDropDoCountPlus = 0
-
- doCountAdd = 0
- doCountRate = ChConfig.Def_MaxRateValue
-
- GameWorld.DebugLog("脱机挂杀怪掉落: npcID=%s,killCount=%s,itemJobList=%s,dropRatePlusValue=%s,equipDropRatePlus=%s,equipDropDoCountPlus=%s"
- % (npcID, killCount, itemJobList, dropRatePlusValue, equipDropRatePlus, equipDropDoCountPlus), playerID)
-
- dropEquipInfoList = [] # [(阶,颜色, 件数), ...]
- # 1.装备只算饼图概率
- pieRateDoCnt = ipyDrop.GetPieRateDoCnt()
- if pieRateDoCnt and ipyDrop.GetPieRateDrop():
- pieRateDoCnt = __GetNPCDropDoCountChange(pieRateDoCnt, doCountRate + equipDropDoCountPlus, doCountAdd)
- pieRateDoCnt *= killCount
- pieRateDropList = ipyDrop.GetPieRateDrop() # [(概率,0),(概率,(阶,颜色)),...]
- if equipDropRatePlus:
- dropRateList = GameWorld.GetPlusPieList(pieRateDropList, equipDropRatePlus)
- GameWorld.DebugLog(" 装备配置饼图: %s,equipDropRatePlus=%s" % (pieRateDropList, equipDropRatePlus), playerID)
- else:
- dropRateList = pieRateDropList
- preRate = 0
- maxRate = dropRateList[-1][0]
- GameWorld.DebugLog(" 装备掉落饼图: %s,maxRate=%s" % (dropRateList, maxRate), playerID)
- for rateInfo in dropRateList:
- rate, equipInfo = rateInfo
- curRate = rate - preRate
- if not curRate:
- break
- preRate = rate
- if not equipInfo:
- continue
- classLV, color = equipInfo
- totalRate = curRate * pieRateDoCnt # 总概率
- dropCount = totalRate / maxRate # 可掉落件数
- rateEx = totalRate % maxRate # 剩余概率
- if GameWorld.CanHappen(rateEx, maxRate):
- dropCount += 1
- GameWorld.DebugLog(" 装备掉率: curRate=%s,totalRate=%s,rateEx=%s,dropCount=%s,classLV=%s,color=%s"
- % (curRate, totalRate, rateEx, dropCount, classLV, color), playerID)
- if not dropCount:
- continue
- dropEquipInfoList.append([classLV, color, dropCount])
- GameWorld.DebugLog(" 装备掉落结果: killCount=%s,[阶,颜色,件数]=%s" % (killCount, dropEquipInfoList), playerID)
-
- colorSuitRateDict = ipyDrop.GetEquipColorSuitInfo() # 装备颜色对应套装概率 {颜色:套装概率, ...}
- colorSuitPlaceKeyInfoDict = ipyDrop.GetEquipPartKeyRateInfo() # 装备部位集合信息 {(颜色,是否套装):部位集合key, ...}
- dropEquipIDDict = {}
- for classLV, color, dropCount in dropEquipInfoList:
- if realmNPCIpyData:
- classLV = realmNPCIpyData.GetEquipClassLV()
- GameWorld.DebugLog(" 脱机掉落对应难度境界装备: classLV=%s" % classLV, playerID)
- suitCountDict = {} # {套装:件数, ...}
- if color in colorSuitRateDict:
- suitRate = colorSuitRateDict[color]
- for _ in xrange(dropCount):
- isSuit = GameWorld.CanHappen(suitRate, maxRate=Def_NPCMaxDropRate)
- suitCountDict[isSuit] = suitCountDict.get(isSuit, 0) + 1
- else:
- suitCountDict[0] = dropCount
-
- for isSuit, curDropCount in suitCountDict.items():
- colorSuitKey = (color, isSuit)
- if colorSuitKey not in colorSuitPlaceKeyInfoDict:
- GameWorld.ErrLog("未配置颜色是否套装对应部位集合key! npcID=%s,color=%s,isSuit=%s" % (npcID, color, isSuit))
- continue
- placeKey = colorSuitPlaceKeyInfoDict[colorSuitKey]
- placeList = GetEquipPlaceByPlaceKey(placeKey)
- if not placeList:
- GameWorld.ErrLog("部位集合key不存在!npcID=%s,placeKey=%s" % (npcID, placeKey))
- continue
- randEquipIDList = __GetEquipIDList(npcID, classLV, color, isSuit, placeList, itemJobList)
- if not randEquipIDList:
- continue
- for _ in xrange(curDropCount):
- randItemID = random.choice(randEquipIDList)
- dropIDList.append(randItemID)
- dropEquipIDDict[randItemID] = [color, placeKey]
- GameWorld.DebugLog(" 掉落装备: npcID=%s,itemID=%s,classLV=%s,color=%s,isSuit=%s,placeKey=%s,itemJobList=%s,randEquipIDList=%s"
- % (npcID, randItemID, classLV, color, isSuit, placeKey, itemJobList, randEquipIDList), playerID)
-
- # 2. 指定物品ID库
- itemIDDropRateDict = ipyDrop.GetItemIDDropRate() # {物品ID:概率, ...}
- itemIDDropMaxCntDict = ipyDrop.GetItemIDMaxDropCount() # {物品ID:最大掉落个数,...}
- for itemID, dropRate in itemIDDropRateDict.items():
-
- if not dropRate:
- continue
-
- doCnt = itemIDDropMaxCntDict.get(itemID, 1) # 默认1个
- doCnt = __GetNPCDropDoCountChange(doCnt, doCountRate, doCountAdd)
- doCnt *= killCount
-
- totalRate = dropRate * doCnt
- dropCount = totalRate / Def_NPCMaxDropRate # 可掉落件数
- rateEx = totalRate % Def_NPCMaxDropRate # 剩余概率
- if GameWorld.CanHappen(rateEx, Def_NPCMaxDropRate):
- dropCount += 1
- dropIDList += [itemID] * dropCount
- GameWorld.DebugLog(" 指定物品掉落: itemID=%s,dropRate=%s,doCnt=%s,totalRate=%s,dropCount=%s"
- % (itemID, dropRate, doCnt, totalRate, dropCount), playerID)
-
- # 检查掉落互斥ID组
- dropIDList = __RemoveMutexDropID(dropIDList, IpyGameDataPY.GetFuncCfg("MutexDrop", 1))
-
- # 掉落金币
- dropMoneyDoCnt = ipyDrop.GetDropMoneyDoCnt()
- dropMoneyRate = ipyDrop.GetDropMoneyRate()
- moneyTotalRate = dropMoneyRate * dropMoneyDoCnt * killCount
- dropMoneyCnt = moneyTotalRate / ChConfig.Def_NPCMapDropRate
- if GameWorld.CanHappen(moneyTotalRate % ChConfig.Def_NPCMapDropRate, ChConfig.Def_NPCMapDropRate):
- dropMoneyCnt += 1
- dropMoney = 0
- if dropMoneyCnt:
- dropMoney = __GetDropMoneyValue(dropPlayer, ipyDrop, realmNPCIpyData) * dropMoneyCnt
- GameWorld.DebugLog(" 金币掉率: dropMoneyRate=%s,moneyTotalRate=%s,dropMoneyCnt=%s,dropMoney=%s"
- % (dropMoneyRate, moneyTotalRate, dropMoneyCnt, dropMoney), playerID)
- dropIDCountDict = {}
- for dropID in dropIDList:
- dropIDCountDict[dropID] = dropIDCountDict.get(dropID, 0) + 1
-
- # 集字掉落
- dropWordsCountDict = PlayerActCollectWords.OnGetDropWordsItemDict(dropPlayer, npcData, killCount)
- for dropID, dropCount in dropWordsCountDict.items():
- dropIDCountDict[dropID] = dropIDCountDict.get(dropID, 0) + dropCount
-
- # 垃圾分类
- giveGarbageItemList = PlayerActGarbageSorting.AddActGarbageTaskProgress(dropPlayer, ChConfig.Def_GarbageTask_KillNPC, killCount, isTJG=True)
- for dropID, dropCount, _ in giveGarbageItemList:
- dropIDCountDict[dropID] = dropIDCountDict.get(dropID, 0) + dropCount
-
- auctionIDList = []
- if ipyDrop.GetAucionItemCanSell():
- for dropID in dropIDCountDict.keys():
- if IpyGameDataPY.GetIpyGameDataNotLog("AuctionItem", dropID):
- auctionIDList.append(dropID)
-
- if dropIDCountDict:
- GameWorld.DebugLog(" 最终掉落: npcID=%s,killCount=%s,dropIDCountDict=%s,auctionIDList=%s,dropMoney=%s"
- % (npcID, killCount, dropIDCountDict, auctionIDList, dropMoney), playerID)
- return dropIDCountDict, auctionIDList, dropMoney
-
def GetNPCDropInfo(dropPlayer, mapID, npcID, ownerPlayerList=[], ipyDrop=None, isSingle=True, isKillCountDrop=True, curGrade=0):
'''获取NPC掉落信息, 击杀及扫荡通用,调用该函数获得掉落信息,然后再看掉落地板上还是直接放入背包
@param dropPlayer: 用于判断调用相关用的玩家示例,该玩家并不一定是击杀者,只是按一定规则设定的掉落判断依据的玩家
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index aec60d7..706101a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -100,7 +100,6 @@
import PassiveBuffEffMng
import PlayerDiceEx
import QuestCommon
-import PlayerTJG
import GameLogic_XMZZ
import PlayerFlashSale
import PlayerFlashGiftbag
@@ -838,8 +837,6 @@
PlayerEquipDecompose.PlayerLogin(curPlayer)
#防沉迷
PlayerGameWallow.DoLogic_CheckWallow(curPlayer, tick)
- # 通知脱机挂信息
- #PlayerTJG.NotifyTJGInfo(curPlayer)
# 协助
PlayerAssist.OnPlayerLogin(curPlayer)
# 极品白拿
@@ -957,10 +954,7 @@
curPlayer.SetState(0) # 脱机挂恢复为正常上线
curPlayer.SetCountryLastWeekHornor(0) # 通知数据库是否保存还是下线,做一次恢复,1为保存 0为正常下线
- #tjgTime = PlayerTJG.GetTJGTime(curPlayer)
- #if tjgTime:
- # PlayerControl.SendGameServerRefreshState(curPlayer, IPY_GameWorld.CDBPlayerRefresh_HappyPoint, tjgTime)
-
+
PlayerControl.DoGMForbidenTalkOnLogin(curPlayer)
DataRecordPack.DR_PlayerLogin(curPlayer) # 放最后,记录等级、经验等信息
return
@@ -1271,7 +1265,6 @@
#---等级限制---
if GameWorld.IsCrossServer():
return
- #PlayerTJG.TJGDeadOffline(curPlayer)
#===============================================================================
# #---等级限制---
@@ -3157,8 +3150,6 @@
#下线召回宠物
PetControl.ReCallFightPet(curPlayer)
-
- #PlayerTJG.CalcPlayerTJG(curPlayer, tick)
#离线session
EventReport.WriteEvent_session(curPlayer)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossPlayerData.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossPlayerData.py
index 91d42f1..a78b1b6 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossPlayerData.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/CrossPlayerData.py
@@ -67,8 +67,7 @@
# 发送主服玩家数据给跨服
def SendMergeData_Buff(curPlayer, buffID, plusValueList):
- if buffID in [ChConfig.Def_SkillID_LimitSuperBuff,
- ChConfig.Def_SkillID_TJGSuperBuff]:
+ if buffID in [ChConfig.Def_SkillID_LimitSuperBuff]:
# 不需要处理的buff
return
if curPlayer.GetGameObjType() != IPY_GameWorld.gotPlayer:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameFuncComm.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameFuncComm.py
index e8e9e66..ec2fd78 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameFuncComm.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameFuncComm.py
@@ -52,7 +52,6 @@
import PlayerArena
import PlayerFaQi
import PlayerGuaji
-import PlayerTJG
import EventShell
@@ -73,7 +72,6 @@
ShareDefine.GameFuncID_OSSail:lambda curObj:FunctionNPCCommon.OSSaleOpenMail(curObj),
ShareDefine.GameFuncID_AddPoint:lambda curObj:PlayerControl.DoAddPointOpen(curObj),
ShareDefine.GameFuncID_Talent:lambda curObj:PlayerGreatMaster.DoTalentOpen(curObj),
- #ShareDefine.GameFuncID_TJG:lambda curObj:PlayerTJG.DoTJGOpen(curObj),
ShareDefine.GameFuncID_Arena:lambda curObj:PlayerArena.DoArenaOpen(curObj),
ShareDefine.GameFuncID_FaQi:lambda curObj:PlayerFaQi.DoFaQiOpen(curObj),
ShareDefine.GameFuncID_LianTi:lambda curObj:PlayerLianTi.DoLianTiOpen(curObj),
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActHorsePetFeast.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActHorsePetFeast.py
index 793738c..67fc970 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActHorsePetFeast.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActHorsePetFeast.py
@@ -16,7 +16,6 @@
#-------------------------------------------------------------------------------
import ChConfig
-import PlayerTJG
import ShareDefine
import IpyGameDataPY
import ChPyNetSendPack
@@ -106,7 +105,7 @@
continue
playerID = hurtObj.GetValueID()
hurtPlayer = copyPlayerManager.FindPlayerByID(playerID)
- if not hurtPlayer or PlayerTJG.GetIsTJG(hurtPlayer):
+ if not hurtPlayer:
continue
if curNPC and not hurtPlayer.CanSeeOther(curNPC):
GameWorld.Log(" 伤血玩家不在boss视野内,无法获得奖励!playerPos(%s,%s), npcPos(%s,%s)"
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
index 9214f85..843d5e9 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
@@ -29,7 +29,6 @@
import PyGameData
import GameFuncComm
import EventShell
-import PlayerTJG
import PlayerPet
import PlayerVip
import datetime
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index 761ae6c..d913b48 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -77,7 +77,6 @@
import GameLogic_SealDemon
import GameLogic_ZhuXianBoss
import GameLogic_CrossDemonKing
-import PlayerTJG
import PlayerVip
import PlayerRefineStove
import PlayerFamilyTech
@@ -1990,11 +1989,6 @@
GameWorld.Log("玩家已经死亡, 无法进入副本!")
return ShareDefine.EntFBAskRet_Dead
- if PlayerTJG.GetIsTJG(curPlayer):
- if isNotify:
- NotifyCode(curPlayer, "SingleEnterDefaul", [mapID])
- return ShareDefine.EntFBAskRet_TJG
-
## 队伍检查的情况,队长不处理,只处理队员
if isTeamAsk and curPlayer.GetTeamLV() != IPY_GameWorld.tmlLeader:
# 后端只做boss状态下,被动进入副本限制,防止打boss中被拉进去副本
@@ -2356,9 +2350,6 @@
特殊boss分流:
@param bossID: 分流bossID
'''
- if PlayerTJG.GetIsTJG(curPlayer):
- GameWorld.DebugLog("脱机的玩家不处理分流!", curPlayer.GetPlayerID())
- return tagLineID
if GameWorld.IsCrossServer():
return tagLineID
# 非常规地图之间的切换不处理
@@ -3796,8 +3787,6 @@
## 刷新红名对应PKValue
curPKValue = curPlayer.GetPKValue()
if not curPKValue:
- return
- if PlayerTJG.GetIsTJG(curPlayer):
return
redBuff = SkillCommon.FindBuffByID(curPlayer, ChConfig.Def_SkillID_Red)[0]
if not redBuff:
@@ -5725,7 +5714,6 @@
#通知死亡
DoPlayerDead(curPlayer)
- #PlayerTJG.PlayerTJGReborn(curPlayer, tick)
GameObj.ClearPyPlayerState(curPlayer)
MirrorAttack.OnPlayerDead(curPlayer)
@@ -6249,7 +6237,7 @@
fightExpRate += PlayerGoldInvest.GetAddFightExpRate(curPlayer)
actExpRateInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_ExpRate, {})# 多倍经验活动加成
- if not PlayerTJG.GetIsTJG(curPlayer) and actExpRateInfo.get(ShareDefine.ActKey_State):
+ if actExpRateInfo.get(ShareDefine.ActKey_State):
actExpIpyData = IpyGameDataPY.GetIpyGameData("ActExpRate", actExpRateInfo.get(ShareDefine.ActKey_CfgID))
if actExpIpyData and curPlayer.GetLV() >= actExpIpyData.GetLVLimit():
fightExpRate += actExpIpyData.GetAddExpRate()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGameWallow.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGameWallow.py
index 4f4b5d4..2ed0d0e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGameWallow.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGameWallow.py
@@ -16,10 +16,8 @@
import ChConfig
import GameWorld
-import IPY_GameWorld
import ReadChConfig
import PlayerControl
-import PlayerTJG
import ChPyNetSendPack
import NetPackCommon
#------------------------------------------------------------------------------
@@ -132,10 +130,6 @@
offMin = PlayerControl.GetPlayerLeaveServerMinute(curPlayer)
noteOffMin = offMin + curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_Wallow_OfflineTime)
- #脱机挂时间,脱机挂时间清除必须在这之后
- tjgtime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Time, 0, ChConfig.Def_PDictType_TJGNotify)/60
- noteOffMin += tjgtime
-
if noteOffMin < Def_Wallow_Offline_HealthTime:
#未达到健康离线,记录时间,退出
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_Wallow_OfflineTime, noteOffMin)
@@ -214,8 +208,6 @@
# @param tick 时间戳
# @return none
def DoLogic_WallowOnlineTime(curPlayer, tick):
- if PlayerTJG.GetIsTJG(curPlayer):
- return
if not GetIsWallowRole(curPlayer):
return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py
index 7891538..b0d20d0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py
@@ -43,10 +43,8 @@
import ShareDefine
import DataRecordPack
import ChPyNetSendPack
-import PlayerFamilyRedPacket
import NetPackCommon
import IpyGameDataPY
-import PlayerTJG
import CommFunc
import ChEquip
@@ -68,8 +66,6 @@
def UpdateFirstGoldTime(curPlayer):
#更新首充提示剩余时间
- if PlayerTJG.GetIsTJG(curPlayer):
- return
remainTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstGoldRemainTime)
if not remainTime:
return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnlinePrize.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnlinePrize.py
index 456dce7..9545fbf 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnlinePrize.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnlinePrize.py
@@ -22,7 +22,6 @@
import NetPackCommon
import PlayerControl
import IpyGameDataPY
-import PlayerTJG
import time
@@ -102,8 +101,6 @@
# @param notify 是否通知客户端
# @return None
def CalcOnlineTime(curPlayer):
- if PlayerTJG.GetIsTJG(curPlayer):
- return 0
onlineTime = GetOnlineTime(curPlayer)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DayOnlineTime, onlineTime)
SetStartCalcOnlineTick(curPlayer, 0)
@@ -153,9 +150,7 @@
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DayOnlineTime, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnlinePrizeNote, 0) # 重置每日在线奖励
-
- if PlayerTJG.GetIsTJG(curPlayer):
- return
+
SetStartCalcOnlineTick(curPlayer)
SendOnlinePrizeInfo(curPlayer)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRecover.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRecover.py
index 3ae1fd5..1fd51e1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRecover.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerRecover.py
@@ -30,7 +30,6 @@
import IpyGameDataPY
import FBCommon
import GameFuncComm
-import PlayerTJG
import PlayerActivity
import PlayerSuccess
import PyGameData
@@ -304,9 +303,6 @@
else:
for itemID, itemCnt in totalItemDict.items():
ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere])
- #if Def_TJGRecoverID in recoverCntDict:
- # #脱机挂经验找回后重置
- # PlayerTJG.ResetTJGDeadInfo(curPlayer)
if Def_QueenRelics in recoverCntDict:
PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_QueenRelicsEx, recoverCntDict[Def_QueenRelics])
DataRecordPack.DR_PlayerRecover(curPlayer, recoverWay, recoverCntDict, totalExp, totalMoney, totalSP, totalItemDict)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
index 65509d3..80b6b6f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
@@ -45,7 +45,6 @@
import PetControl
import ItemControler
import PlayerGuaji
-import PlayerTJG
import AICommon
import PlayerSuccess
import CrossPlayerData
@@ -58,8 +57,6 @@
import PlayerFlashSale
import PlayerChatBox
import PlayerFace
-import PlayerWing
-import ChEquip
import PlayerYinji
import PlayerActivity
import PlayerBackup
@@ -1274,8 +1271,6 @@
#副本相关时间处理
PlayerFB.DoPlayerFBTimeProcess(curPlayer, tick)
- #脱机计算
- #PlayerTJG.ProcessPlayerTJG(curPlayer, tick)
#挂机收益
PlayerGuaji.ProcessGuaji(curPlayer)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTJG.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTJG.py
deleted file mode 100644
index bd2e468..0000000
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTJG.py
+++ /dev/null
@@ -1,1069 +0,0 @@
-#!/usr/bin/python
-# -*- coding: GBK -*-
-#
-# @todo: 脱机挂
-#
-# @author: Alee
-# @date 2017-12-28 下午05:43:24
-# @version 1.0
-#
-# @note:
-#
- # 1.获取脱机挂玩家数据--GameLog
- # 正常号下线超过3分钟,有脱机挂时间并且脱机挂状态非2的情况
- # 1为脱机挂时异常掉线,应可立即脱机重连,目前都按断线3分钟后重连
- # 2为脱机挂的时候被人杀死,等待玩家主动登陆后重新下线触发逻辑
- # 2.初始化脱机挂玩家的robot加入mgr
- # 3.模拟token登录--InterfaceData
- # 4.登录后在0107loadmapok包前发送脱机登录消息,用于区分玩家真实登录
- # 5.脱机挂玩家防沉迷逻辑修正,根据4条件
- # 6.在线人数区分脱机挂玩家
- # 7.03 10 退出副本#tagCExitFB到对应挂机点
- # 8.利用CountryLastWeekHornor字段控制保存数据是否是真实下线
-#---------------------------------------------------------------------
-
-import GameWorld
-import ChConfig
-import PlayerControl
-import IPY_GameWorld
-import FunctionNPCCommon
-import NPCCommon
-import ItemControler
-import FBCommon
-import ItemCommon
-import ShareDefine
-import PlayerEquipDecompose
-import GameFuncComm
-import time
-import NetPackCommon
-import ChPyNetSendPack
-import ChPlayer
-import SkillCommon
-import PlayerBillboard
-import PlayerActivity
-import PlayerSuccess
-import EventShell
-import PlayerVip
-import IpyGameDataPY
-import math
-import PassiveBuffEffMng
-import PlayerPet
-import ChEquip
-import QuestCommon
-import random
-import GameObj
-
-Def_EatSpace = 5 # 低于X格自动吞噬
-
-
-def DoTJGOpen(curPlayer):
- ##脱机挂功能开启 赠送脱机时间
- addTime = IpyGameDataPY.GetFuncCfg('TJGGiftTime')
- AddTJGTime(curPlayer, addTime)
- GameWorld.DebugLog('脱机挂功能开启 赠送脱机时间 %s'%addTime, curPlayer.GetID())
- return
-
-#===============================================================================
-# //B2 01 脱机挂状态 # tagCMLoginState
-# struct tagCMLoginState
-# {
-# tagHead Head;
-# BYTE State; // 0正常登录,1脱机登录,2脱机登录死亡
-# };
-#===============================================================================
-def OnTJGState(index, clientData, tick):
- curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
- if curPlayer.GetIP() != "127.0.0.1":
- return
- curPlayer.SetState(clientData.State)
-
- # 设置脱机登录时的等级, 上线通知清空, 没清空说明多次脱机挂登录 使用旧等级
- notifyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_LV, 0, ChConfig.Def_PDictType_TJGNotify)
- if not notifyLV:
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGNotify_LV, curPlayer.GetLV(), ChConfig.Def_PDictType_TJGNotify)
-
- # 上线切优先级高的守护
- ChangeGuard(curPlayer, tick)
- GameWorld.DebugLog("OnTJGState:%s"%clientData.State)
- return
-
-
-# 切换守护
-def ChangeGuard(curPlayer, tick):
- return #新版本不需要切换
-# # 检查过背包中无守护则不再执行
-# if curPlayer.GetDictByKey("AutoCGuardID") == 1:
-# return
-#
-# curGuardID = 0 # 装备的守护ID
-# itemIDList = IpyGameDataPY.GetFuncEvalCfg('AutoUseGuardian', 1)
-# guardItem = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip).GetAt(ShareDefine.retGuard1)
-# # 1。 守护存在,判断是否最优先守护
-# if ItemCommon.CheckItemCanUse(guardItem) and ItemCommon.CheckItemCanUseByExpireTime(guardItem):
-# curGuardID = guardItem.GetItemTypeID()
-# if curGuardID == itemIDList[0]:
-# # 最高优先级
-# return
-# if curPlayer.GetDictByKey("AutoCGuardID") == 2:
-# # 当前背包最高
-# return
-#
-#
-# findItemList = []
-# curPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
-#
-# # 找到背包中优先级最高的守护物品
-# for i in range(0, curPack.GetCount()):
-# item = curPack.GetAt(i)
-#
-# if not ItemCommon.CheckItemCanUse(item):
-# continue
-#
-# if item.GetItemTypeID() not in itemIDList:
-# continue
-#
-# if not ItemCommon.CheckItemCanUseByExpireTime(item):
-# # 背包有不过期的物品
-# continue
-#
-# findItemList.append(item)
-#
-# if not findItemList:
-# curPlayer.SetDict("AutoCGuardID", 1) # 设置无可替换的标志
-# return
-#
-# findItemList.sort(cmp=SortGuard)
-# if curGuardID in itemIDList and itemIDList.index(curGuardID) <= itemIDList.index(findItemList[0].GetItemTypeID()):
-# # 当前装备最高,减少遍历
-# curPlayer.SetDict("AutoCGuardID", 2)
-# return
-#
-#
-# #---执行玩家换装逻辑---
-# ChEquip.DoPlayerEquipItem(curPlayer, findItemList[0], ItemCommon.GetEquipPackIndex(findItemList[0]), tick)
-# curPlayer.SetDict("AutoCGuardID", 0)
- return
-
-
-# 优先级高的 时效长的排前面
-def SortGuard(item1, item2):
- itemIDList = IpyGameDataPY.GetFuncEvalCfg('AutoUseGuardian', 1)
- itemID1 = item1.GetItemTypeID()
- itemID2 = item2.GetItemTypeID()
-
- # 未使用时间为0, 创角时间越大说明使用的时间越少
- itemTime1 = 2000000000 if not item1.GetUserAttr(ShareDefine.Def_IudetCreateTime) else item1.GetUserAttr(ShareDefine.Def_IudetCreateTime)
- itemTime2 = 2000000000 if not item2.GetUserAttr(ShareDefine.Def_IudetCreateTime) else item2.GetUserAttr(ShareDefine.Def_IudetCreateTime)
- if itemID1 == itemID2:
- return cmp(itemTime2, itemTime1)
-
- return cmp(itemIDList.index(itemID1), itemIDList.index(itemID2))
-
-#===============================================================================
-# //B2 02 视野缩放 #tagCMSightZoom
-# struct tagCMSightZoom
-# {
-# tagHead Head;
-# BYTE Sight; // 视野缩放,用于脱机挂不超过最大视野,空闲状态为0,被玩家攻击恢复视野
-# };
-#===============================================================================
-def OnSightZoom(index, clientData, tick):
- curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
- if curPlayer.GetIP() != "127.0.0.1":
- return
- curPlayer.SetSight(min(ChConfig.Def_PlayerSight_Default, clientData.Sight))
- GameWorld.DebugLog("OnSightZoom:%s"%clientData.Sight)
-
- return
-
-# 需要处理的点,防沉迷
-def GetIsTJG(curPlayer):
- if curPlayer.GetState() > 0:
- return True
- return False
-
-
-#===============================================================================
-# //B2 03 设置脱机挂NPC # tagCMTJGnpc
-#
-# struct tagCMTJGnpc
-# {
-# tagHead Head;
-# DWORD NPCID; // 脱机挂点
-# };
-#===============================================================================
-def OnTJGNPC(index, clientData, tick):
- curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
- if curPlayer.GetIP() != "127.0.0.1":
- return
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_TJGNPC, clientData.NPCID)
-
- GameWorld.DebugLog("%s---OnTJGNPC:%s"%(curPlayer.GetName(),clientData.NPCID))
- return
-
-
-#===============================================================================
-# Def_PDictType_TJGNotify
-# # 脱机挂类型通知结果
-# Def_PDictType_TJGNotify_Exp1 = "TJGNExp1" #经验
-# Def_PDictType_TJGNotify_Exp2 = "TJGNExp2" #超过E部分
-# Def_PDictType_TJGNotify_Time = "TJGNTime" #使用时间
-# Def_PDictType_TJGNotify_EatPurple = "TJGNEatP" #吞噬的紫装数量
-# Def_PDictType_TJGNotify_Purple = "TJGNPurple" #获得紫装数量
-# Def_PDictType_TJGNotify_Orange = "TJGNOrg" #获得橙装数量
-#===============================================================================
-
-def NoteTJGExp(curPlayer, exp):
- notifyTime1 = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Exp1, 0, ChConfig.Def_PDictType_TJGNotify)
- notifyTime2 = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Exp2, 0, ChConfig.Def_PDictType_TJGNotify)
-
- totalExp = notifyTime2 * ChConfig.Def_PerPointValue + notifyTime1 + exp
-
- curExp = totalExp % ChConfig.Def_PerPointValue
- expPoint = totalExp / ChConfig.Def_PerPointValue
-
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGNotify_Exp1, curExp,
- ChConfig.Def_PDictType_TJGNotify)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGNotify_Exp2, expPoint,
- ChConfig.Def_PDictType_TJGNotify)
- return
-
-def NoteTJGTime(curPlayer, times):
- notifyTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Time, 0, ChConfig.Def_PDictType_TJGNotify)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGNotify_Time,
- notifyTime+times, ChConfig.Def_PDictType_TJGNotify)
-
-def NoteEquip(curPlayer, itemColor):
- if itemColor == ShareDefine.Def_Item_Color_Purple:
- count = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Purple, 0, ChConfig.Def_PDictType_TJGNotify)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGNotify_Purple,
- count+1, ChConfig.Def_PDictType_TJGNotify)
- elif itemColor == ShareDefine.Def_Item_Color_Orange:
- count = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Orange, 0, ChConfig.Def_PDictType_TJGNotify)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGNotify_Orange,
- count+1, ChConfig.Def_PDictType_TJGNotify)
-
-def NoteItem(curPlayer, itemID, noteCount=1):
- itemIDList = IpyGameDataPY.GetFuncEvalCfg('OfflinePostItem', 1)
- if itemID not in itemIDList:
- return
- count = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_ItemID%itemID, 0, ChConfig.Def_PDictType_TJGNotify)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGNotify_ItemID%itemID,
- count+noteCount, ChConfig.Def_PDictType_TJGNotify)
-
-
-
-def NoteEatEquip(curPlayer, value, giveCnt):
- count = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_EatPurple, 0, ChConfig.Def_PDictType_TJGNotify)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGNotify_EatPurple,
- count+value, ChConfig.Def_PDictType_TJGNotify)
-
- count = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_GiveCnt, 0, ChConfig.Def_PDictType_TJGNotify)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGNotify_GiveCnt,
- count+giveCnt, ChConfig.Def_PDictType_TJGNotify)
-# 定时计算脱机挂
-def ProcessPlayerTJG(curPlayer, tick):
- if not GetIsTJG(curPlayer):
- return
-
- if GetTJGTime(curPlayer) == 0:
- return
-
- if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TJGStartTime) == 0:
- curPlayer.SetDict(ChConfig.Def_PlayerKey_TJGStartTime, tick)
- return
-
-
- calcTimes = IpyGameDataPY.GetFuncCfg('TJG', 2)
- passTimes = tick - curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TJGStartTime)
- if passTimes < calcTimes*1000:
- return
-
- #优先执行换守护
- ChangeGuard(curPlayer, tick)
- times, finalAddExp = CalcPlayerTJG(curPlayer, tick)
-
- return
-
-def GetTJGTime(curPlayer): return curPlayer.GetHappyPoint()
-def SetTJGTime(curPlayer, tjgTime):
- tjgTime = max(tjgTime, 0)
- curPlayer.SetHappyPoint(tjgTime)
- PlayerControl.SendGameServerRefreshState(curPlayer, IPY_GameWorld.CDBPlayerRefresh_HappyPoint, tjgTime)
- return
-def AddTJGTime(curPlayer, addTime):
- maxTime = IpyGameDataPY.GetFuncCfg('TJG', 3)
- SetTJGTime(curPlayer, min(GetTJGTime(curPlayer) + addTime, maxTime))
- return
-
-def CalcTJGExp(curPlayer, times, npcData, realmNPCIpyData):
- lvIpyData = PlayerControl.GetPlayerLVIpyData(curPlayer.GetLV())
- if not lvIpyData:
- return 0
- reExp = lvIpyData.GetReExp()
- attackEff = lvIpyData.GetAttackEff()
-
- aMinAtk = curPlayer.GetMinAtk() # 攻击方最小攻击
- aMaxAtk = curPlayer.GetMaxAtk() # 攻击方最大攻击
- aSuperHitRate = curPlayer.GetSuperHitRate() # 暴击率
- aSuperHit = curPlayer.GetSuperHit() # 暴击伤害固定值
- aIceAtk = curPlayer.GetIceAtk() # 真实伤害
- aDamagePVE = PlayerControl.GetDamagePVE(curPlayer) # PVE固定伤害
- aSkillAtkRate = curPlayer.GetSkillAtkRate() # 技能攻击力加成
- petMinAtk = PlayerControl.GetPetMinAtk(curPlayer) #灵宠最小攻击
- petMaxAtk = PlayerControl.GetPetMaxAtk(curPlayer) #灵宠最大攻击
- petDamPer = GameObj.GetPetDamPer(curPlayer) #灵宠增加伤害
- atkSpeed = PlayerControl.GetAtkSpeed(curPlayer) # 攻击速度
- aIgnoreDefRate = curPlayer.GetIgnoreDefRate() # 无视防御比率
- aLuckyHit = curPlayer.GetLuckyHitVal() # 会心一击固定值
- aLuckyHitRate = curPlayer.GetLuckyHitRate() # 会心一击概率
- aBleedDamage = PlayerControl.GetBleedDamage(curPlayer) # 流血伤害 万分率
- aFinalHurt = PlayerControl.GetFinalHurt(curPlayer) # 最终固定伤害
- aFinalHurtPer = PlayerControl.GetFinalHurtPer(curPlayer) # 最终伤害加成万分率
- aFightPower = PlayerControl.GetFightPower(curPlayer) # 战力
- aReFightPower = lvIpyData.GetReFightPower() # 等级表对应的战力
- aNPCHurtAddPer = PlayerControl.GetNPCHurtAddPer(curPlayer) #PVE 伤害加成万分率
-
- npcID = npcData.GetNPCID()
- if realmNPCIpyData:
- attrDict = NPCCommon.GetNPCStrengthenAttrDict(npcID, realmNPCIpyData.GetLV())
- npcExp = realmNPCIpyData.GetExp()
- npcMaxHP = attrDict.get("MaxHP", GameObj.GetHP(npcData))
- npcCommendFightPower = realmNPCIpyData.GetFireDef()
- GameWorld.DebugLog("CalcTJGExp realmNPC npcID=%s,npcExp=%s,npcMaxHP=%s,npcCommendFightPower=%s" % (npcID, npcExp, npcMaxHP, npcCommendFightPower))
- else:
- npcExp = npcData.GetExp()
- npcMaxHP = GameObj.GetHP(npcData)
- npcCommendFightPower = NPCCommon.GetCommendFightPower(npcData)
- GameWorld.DebugLog("CalcTJGExp npcID=%s,npcExp=%s,npcMaxHP=%s,npcCommendFightPower=%s" % (npcID, npcExp, npcMaxHP, npcCommendFightPower))
-
- petSkillLV = 1
- petSkillPer = 10000
-
- # 初始化10个为0 使用,避免没有配表导致报错
- for i in range(10):
- locals()["PetSkill%s"%(i+1)] = 0
-
- curPet = curPlayer.GetPetMgr().GetFightPet()
- if curPet:
- curSkill = curPet.GetSkillManager().FindSkillBySkillTypeID(48500) # 写死要这个技能的等级
- if curSkill:
- petSkillLV = curSkill.GetSkillLV()
- petSkillPer = max(curSkill.GetEffect(0).GetEffectValue(0), 10000)
-
- # 宠物被动技能
- petSkillList = IpyGameDataPY.GetFuncEvalCfg('TJG', 5)
- petLearnSkillList, petPassiveSkillList = PlayerPet.GetPetLearnSkill(curPlayer)
- for i in range(len(petSkillList)):
- locals()["PetSkill%s"%(i+1)] = 1 if petSkillList[i] in petLearnSkillList else 0
-
-
- # 初始化10个为0 使用,避免没有配表导致报错
- for i in range(10):
- locals()["skill%s"%(i+1)] = 0
-
- skillDict = IpyGameDataPY.GetFuncEvalCfg('TJG', 4)
- skills = skillDict.get(curPlayer.GetJob(), [])
- for i in range(len(skills)):
- locals()["skill%s"%(i+1)] = 1 if skills[i] in PassiveBuffEffMng.FindUsePassiveSkills(curPlayer) else 0
-
- if GameWorld.GetGameWorld().GetDebugLevel():
- GameWorld.DebugLog("""CalcTJGExp--%s-%s-%s-%s-reExp:%s, attackEff:%s, aMinAtk:%s, aMaxAtk:%s, aSuperHitRate:%s, aSuperHit:%s,
- aNPCHurtAddPer:%s, aFinalHurtPer:%s,
- aIceAtk:%s, aDamagePVE:%s, aSkillAtkRate:%s, petMinAtk:%s, petMaxAtk:%s, petDamPer:%s, atkSpeed:%s,
- aIgnoreDefRate:%s, aLuckyHit:%s, aLuckyHitRate:%s, aBleedDamage:%s, aFinalHurt:%s, npcExp:%s, npcMaxHP:%s, npcCommendFightPower:%s,
- petSkillLV:%s, petSkillPer:%s, skill:%s, petSkill:%s"""%(curPlayer.GetID(), curPlayer.GetLV(), times, npcID,
- reExp, attackEff, aMinAtk, aMaxAtk, aSuperHitRate, aSuperHit, aNPCHurtAddPer, aFinalHurtPer,
- aIceAtk, aDamagePVE, aSkillAtkRate, petMinAtk, petMaxAtk, petDamPer,
- atkSpeed, aIgnoreDefRate, aLuckyHit, aLuckyHitRate, aBleedDamage, aFinalHurt, npcExp, npcMaxHP, npcCommendFightPower, petSkillLV,
- petSkillPer, eval("[" +", ".join(["skill%s"%i for i in range(1, 11)]) + "]"),
- eval("[" +", ".join(["PetSkill%s"%i for i in range(1, 10)]) + "]")))
-
- # 1. 经验
- exp = eval(IpyGameDataPY.GetFuncCompileCfg('TJG', 1))
- GameWorld.DebugLog("最终经验:%s"%exp)
- return exp
-
-# 脱机计算 返回这次计算的时间和经验
-def CalcPlayerTJG(curPlayer, tick):
- if not GetIsTJG(curPlayer):
- return 0, 0
-
- if GetTJGTime(curPlayer) == 0:
- return 0, 0
-
- if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TJGStartTime) == 0:
- curPlayer.SetDict(ChConfig.Def_PlayerKey_TJGStartTime, tick)
- return 0, 0
-
- tjgTime = GetTJGTime(curPlayer)
- passTimes = tick - curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TJGStartTime)
- curPlayer.SetDict(ChConfig.Def_PlayerKey_TJGStartTime, tick)
- times = min(passTimes/1000, tjgTime)
-
- # 记录秒单位
- NoteTJGTime(curPlayer, times)
- SetTJGTime(curPlayer, max(tjgTime - times, 0))
-
- finalAddExp = OnTJGKillNPCByTimes(curPlayer, times)
-
-# 改脱机挂机器人退出队伍主动断开
-# if GetTJGTime(curPlayer) == 0:
-# # 脱机挂时间用完了,退出队伍
-# curPlayer.Kick(IPY_GameWorld.disTimeError)
- return times, finalAddExp
-
-def OnTJGKillNPCByTimes(curPlayer, times):
- '''根据脱机时长计算击杀NPC相关奖励信息
- '''
- finalAddExp = 0
- npcID = curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_TJGNPC)
- if not npcID:
- return finalAddExp
-
- npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
- if not npcData:
- return finalAddExp
-
- realmLV = PlayerControl.GetDifficultyRealmLV(PlayerControl.GetRealmDifficulty(curPlayer))
- realmNPCIpyData = IpyGameDataPY.GetIpyGameDataNotLog("NPCRealmStrengthen", npcID, realmLV)
- if realmNPCIpyData:
- mDef = realmNPCIpyData.GetMDef()
- npcLV = realmNPCIpyData.GetLV()
- sp = realmNPCIpyData.GetSP()
- GameWorld.DebugLog("OnTJGKillNPCByTimes npcID=%s,npcLV=%s,mDef=%s,sp=%s,realmLV=%s" % (npcID, npcLV, mDef, sp, realmLV))
- else:
- mDef = npcData.GetMDef()
- npcLV = npcData.GetLV()
- sp = npcData.GetSP()
- GameWorld.DebugLog("OnTJGKillNPCByTimes npcID=%s,npcLV=%s,mDef=%s,sp=%s" % (npcID, npcLV, mDef, sp))
-
- # 1. 经验
- exp = CalcTJGExp(curPlayer, times, npcData, realmNPCIpyData)
- playerControl = PlayerControl.PlayerControl(curPlayer)
- if exp > 0:
- finalAddExp = playerControl.AddExp(exp, ShareDefine.Def_ViewExpType_KillNPC)
- NoteTJGExp(curPlayer, finalAddExp)
-
- #GameWorld.DebugLog("PlayrTJG---%s----exp %s %s"%(curPlayer.GetID(), exp,
- #[times, reExp, attackEff, IpyGameDataPY.GetFuncCfg('TJG', 1)]))
-
-
- # GetMDef 用于 NPC被击杀时间效率 毫秒
- if mDef == 0:
- return finalAddExp
-
- killCnt = times*1000/mDef
- if not killCnt:
- return finalAddExp
-
- #GameWorld.DebugLog("TJGKillNPC, npcID=%s,times=%s,killCnt=%s" % (npcID, times, killCnt), curPlayer.GetPlayerID())
-
- # 2.物品
- OnTJGDropItems(curPlayer, npcID, killCnt)
- #任务道具
- OnTJGDropTaskItems(curPlayer, npcLV, killCnt)
- # VIP杀怪加攻
- PlayerVip.DoAddVIPKillLVExp(curPlayer, npcLV, killCnt)
-
- # SP值
- PlayerControl.AddZhenQiByKillNPC(curPlayer, sp, killCnt)
-
- # 击杀特定NPC成就
- PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillSpecificNPC, killCnt, [npcID])
- # 日常活动
- if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGOnDayEx):
- if npcLV>=curPlayer.GetLV() - IpyGameDataPY.GetFuncCfg('DailyQuestKillMonster'):
- PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_KillNPC, killCnt)
- # 击杀任务怪, 杀怪日常已经没有了,暂时屏蔽
- #for _ in xrange(killCnt):
- # EventShell.Event_OnKillByID(curPlayer, npcID)
- return finalAddExp
-
-# 脱机挂掉落物品处理
-def OnTJGDropItems(curPlayer, npcID, killCnt):
- if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TJGPackFullAfterEat):
- # 满了不再给物品
- return
-
- dropIDCountDict, auctionIDList, money = {}, [], 0
- dropRet = NPCCommon.GetNPCDropInfoTJG(curPlayer, curPlayer.GetMapID(), npcID, killCnt)
- if dropRet:
- dropIDCountDict, auctionIDList, money = dropRet
-
- # 1. 装备只能分解 2.放入背包 3.满则不继续给物品
- for itemID, dropCount in dropIDCountDict.items():
- if not ItemCommon.CheckPackHasSpace(curPlayer, IPY_GameWorld.rptItem):
- break
-
- curItemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
- if not curItemData:
- continue
-
- isAuctionItem = itemID in auctionIDList
- itemControl = ItemControler.PlayerItemControler(curPlayer)
-
- ## 装备物品 白蓝直接换算铜钱
- #=======================================================================
- # if curItemData.GetType() in ChConfig.Def_EquipItemType_TJGAutoEat:
- # if curItemData.GetItemColor() in [ShareDefine.Def_Item_Color_White, ShareDefine.Def_Item_Color_Blue]:
- # money += curItemData.GetSilverPrice() * dropCount
- # continue
- #=======================================================================
-
- ## 装备一件件给
- if ItemCommon.GetIsEquip(curItemData):
- for _ in xrange(dropCount):
- curItem = ItemControler.GetOutPutItemObj(itemID, 1, isAuctionItem, curPlayer=curPlayer)
- if not curItem:
- continue
- if not itemControl.PutInItem(IPY_GameWorld.rptItem, curItem, event=[ChConfig.ItemGive_TJGDropItem, False, {}]):
- curItem.Clear()
- break
- #记录紫橙装数量用于通知
- NoteEquip(curPlayer, curItemData.GetItemColor())
- else:
- curItem = ItemControler.GetOutPutItemObj(itemID, dropCount, isAuctionItem, curPlayer=curPlayer)
- if not curItem:
- continue
-
- if not itemControl.PutInItem(IPY_GameWorld.rptItem, curItem, event=[ChConfig.ItemGive_TJGDropItem, False, {}]):
- curItem.Clear()
- break
- # 补充记录指定物品
- NoteItem(curPlayer, itemID, dropCount)
-
- # 10000次计算消耗近1秒, 背包空格不足退出亦不消耗
- # GameWorld.DebugLog("===== usetime %s-%s"%(a - time.time(), killCnt))
- PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, money, ChConfig.Def_GiveMoney_Pickup)
-
- if not CanEatItemsOper(curPlayer):
- CheckPackFull(curPlayer)
- return
-
- # -----小于5格子,遍历吞噬装备
- packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, Def_EatSpace)
- if packSpace >= 5:
- return
-
- #===========================================================================
- # equipScores = {}
- # equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
- # for i in ChConfig.EquipPlace_Base:
- # equipItem = equipPack.GetAt(ItemCommon.GetEquipPackIndex(i))
- # if not equipItem or equipItem.IsEmpty():
- # continue
- # equipScores[equipItem.GetType()] = ItemCommon.GetEquipGearScore(equipItem)
- #===========================================================================
-
- #GameWorld.DebugLog("equipScores----%s"%equipScores)
-
- eatIndexList = []
- eatItemIDList = []
- itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
- for i in range(0, itemPack.GetCount()):
- curItem = itemPack.GetAt(i)
- if not curItem or curItem.IsEmpty():
- continue
-
- ## 低评分紫装或非本职业
- if curItem.GetItemColor() > ShareDefine.Def_Item_Color_Purple:
- continue
-
- if curItem.GetType() not in ChConfig.Def_EquipItemType_TJGAutoEat:
- continue
-
- # 本职业需要判断评分高低
- #=======================================================================
- # if ItemCommon.CheckJob(curPlayer, curItem):
- # if curItem.GetType() not in equipScores:
- # # 没有评分说明装备位还是空的 不能吞噬
- # continue
- # if ItemCommon.GetEquipGearScore(curItem) > equipScores[curItem.GetType()]:
- # continue
- #=======================================================================
-
- eatIndexList.append(i)
- eatItemIDList.append(curItem.GetItemTypeID())
- #GameWorld.DebugLog("eatIndexList-----------%s"%len(eatIndexList))
- eatCount, giveCnt = PlayerEquipDecompose.EatItems(curPlayer, eatIndexList, eatItemIDList)
- NoteEatEquip(curPlayer, eatCount, giveCnt)
- CheckPackFull(curPlayer)
-
-def OnTJGDropTaskItems(curPlayer, npclv, killCnt):
- #掉落任务道具
- if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TJGPackFullAfterEat):
- # 满了不再给物品
- return
- dropTaskItemDict = IpyGameDataPY.GetFuncEvalCfg('TJDropTaskItem', 1, {})
- for missionID, dropInfo in dropTaskItemDict.items():
- if not curPlayer.FindMission(missionID):
- continue
- npclvLimit, itemID, needItemCnt, itemCntFormula = dropInfo
- if npclv < npclvLimit:
- continue
- haveCnt = ItemControler.FindPlayerItemCountByItemID(curPlayer, IPY_GameWorld.rptItem, itemID)
- giveItemCnt = min(needItemCnt-haveCnt, eval(itemCntFormula))
- if giveItemCnt <= 0:
- continue
- packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, 1)
- if packSpace < 1:
- #GameWorld.Log('脱机挂掉落任务道具背包不足! missionID=%s,itemID=%s,giveItemCnt=%s'%(missionID, itemID, giveItemCnt))
- continue
- ItemControler.GivePlayerItem(curPlayer, itemID, giveItemCnt, 0, [IPY_GameWorld.rptItem])
- return
-
-def CheckPackFull(curPlayer):
- if not ItemCommon.CheckPackHasSpace(curPlayer, IPY_GameWorld.rptItem):
- curPlayer.SetDict(ChConfig.Def_PlayerKey_TJGPackFullAfterEat, 1)
-
-# 可执行吞噬操作
-def CanEatItemsOper(curPlayer):
- # 遍历吞噬
- if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_EquipDecompose):
- GameWorld.DebugLog(' 宠物功能未开启')
- return False
-
- return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TJGSet)&1
-
-def CanHealthReborn(curPlayer):
-
- if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TJGSet)&2:
- return False
-
- rebornCfg = IpyGameDataPY.GetFuncEvalCfg('RebornArguments', 1)
- moneyPrice = rebornCfg[2]
- #异常
- if not moneyPrice:
- return False
- costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, moneyPrice)
- if not costMoneyList:
- return False
- return True
-#===============================================================================
-# //B2 04 系统设置 #tagCMSystem
-#
-# struct tagCMSystem
-# {
-# tagHead Head;
-# BYTE AutoEat; // 自动吞噬
-# BYTE AutoReborn; //自动买活
-# };
-#===============================================================================
-def OnTJGSystemSet(index, clientData, tick):
- curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
- # 按位处理
- autoEat = 1 if clientData.AutoEat else 0
- autoReborn = 2 if clientData.AutoReborn else 0
-
- tjgSet = autoEat + autoReborn
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TJGSet, tjgSet)
- return
-
-
-#===============================================================================
-# //B4 09 通知脱机挂结果 #tagMCTJGInfo
-#
-# struct tagMCTJGInfo
-# {
-# tagHead Head;
-# DWORD Exp1; // 经验
-# DWORD Exp2; // 超亿经验
-# DWORD Times; // 使用时间秒
-# WORD PurpleEquip; // 产出紫装数量
-# WORD OrangeEquip; // 产出橙装数量
-# WORD EatPurpleEquip; // 吞噬紫装数量
-#
-# };
-#===============================================================================
-
-
-# 玩家真实上线通知
-def NotifyTJGInfo(curPlayer):
-
- if curPlayer.GetIP() == "127.0.0.1":
- LoginFixTJG(curPlayer, True)
- return
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGOnDayEx, 0)
-
- # 脱机挂没有运作情况下 弥补收益
- LoginFixTJG(curPlayer)
-
- times = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Time, 0, ChConfig.Def_PDictType_TJGNotify)
- if times == 0:
- return
-
- npcID = curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_TJGNPC)
- if not npcID:
- return
-
- npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
- if not npcData:
- return
-
- #脱机效率榜 一分钟经验
- #minuteExp = CalcTJGExp(curPlayer, 60, npcData)
- #exp_rate = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TotalExpRate)
- #addExp = int(minuteExp * exp_rate / float(ChConfig.Def_MaxRateValue))
- #GameWorld.DebugLog(' 脱机效率榜 minuteExp=%s,exp_rate=%s,addExp=%s'%(minuteExp, exp_rate, addExp))
- #PlayerBillboard.UpdateTJGBillboard(curPlayer, addExp)
-
- #脱机榜改为平均效率
- exp1 = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Exp1, 0, ChConfig.Def_PDictType_TJGNotify)
- exp2 = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Exp2, 0, ChConfig.Def_PDictType_TJGNotify)
- totalExp = exp2 * ChConfig.Def_PerPointValue + exp1
- aveMinuteExp = int(totalExp * 1.0 / max(1, times / 60)) # 平均每分钟经验
- GameWorld.DebugLog(' 脱机效率榜 aveMinuteExp=%s, totalExp=%s,times=%s' % (aveMinuteExp, totalExp, times))
- #PlayerBillboard.UpdateTJGBillboard(curPlayer, aveMinuteExp)
-
- sendPack = ChPyNetSendPack.tagMCTJGInfo()
- sendPack.Clear()
- sendPack.Exp1 = exp1
- sendPack.Exp2 = exp2
- sendPack.Times = times
- sendPack.PurpleEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Purple, 0, ChConfig.Def_PDictType_TJGNotify)
- sendPack.OrangeEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Orange, 0, ChConfig.Def_PDictType_TJGNotify)
- sendPack.EatPurpleEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_EatPurple, 0, ChConfig.Def_PDictType_TJGNotify)
- sendPack.GiveCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_GiveCnt, 0, ChConfig.Def_PDictType_TJGNotify)
- sendPack.BeforeLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_LV, 0, ChConfig.Def_PDictType_TJGNotify)
- sendPack.Items = []
- itemIDList = IpyGameDataPY.GetFuncEvalCfg('OfflinePostItem', 1)
- for itemID in itemIDList:
- count = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_ItemID%itemID, 0, ChConfig.Def_PDictType_TJGNotify)
- if count == 0:
- continue
- itemInfo = ChPyNetSendPack.tagMCTJGItems()
- itemInfo.ItemID = itemID
- itemInfo.Count = count
- sendPack.Items.append(itemInfo)
- sendPack.Cnt = len(sendPack.Items)
-
- NetPackCommon.SendFakePack(curPlayer, sendPack)
-
- curPlayer.ClearNomalDict(ChConfig.Def_PDictType_TJGNotify)
- return
-
-
-def PlayerTJGReborn(curPlayer, tick):
- # 此处不能直接处理死亡后下线或者直接复活的逻辑,
- # 不然会导致外层可能在处理循环逻辑中报错,如在ProcessPlayerState正在处理buff逻辑时死亡
- # 改成在收到封包 //B4 0A 脱机挂死亡 # tagCMTJGDead 后处理
- if not GetIsTJG(curPlayer):
- return
-
- if CanHealthReborn(curPlayer):
- pass
- #ChPlayer.PlayerRebornByType(curPlayer, ChConfig.rebornType_Health, tick)
- # 给个30分无敌buff下线消失
- #SkillCommon.AddBuffBySkillType_NoRefurbish(curPlayer, ChConfig.Def_SkillID_TJGSuperBuff, tick)
- else:
- ChPlayer.PlayerRebornByType(curPlayer, ChConfig.rebornType_City, tick)
- curPlayer.SetState(2) # 脱机挂死亡
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TJGDeadTime, int(time.time()))
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TJGDeadExp, 0)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TJGDeadExp1, 0)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TJGDeadPayTime, 0)
- #curPlayer.Kick(IPY_GameWorld.disTimeError) # 随便记录一个死亡
-
-
-# 脱机挂被杀后离线找回
-def TJGDeadOffline(curPlayer):
- if curPlayer.GetState() != 2:
- times = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TJGDeadPayTime)
- if times == 0:
- return
-
- # 未找回再次通知
- sendPack = ChPyNetSendPack.tagMCTJGDeadPay()
- sendPack.Clear()
- sendPack.Times = times
- sendPack.Exp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TJGDeadExp)
- sendPack.Exp1 = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TJGDeadExp1)
- sendPack.DeadTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TJGDeadTime)
- NetPackCommon.SendFakePack(curPlayer, sendPack)
- return
-
- # 脱机挂期间被杀,可领取脱机挂时间范围的离线经验
- times = max(min(PlayerControl.GetPlayerLeaveServerSecond(curPlayer), GetTJGTime(curPlayer)), 0)
-
- npcID = curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_TJGNPC)
- if not npcID:
- return
-
- npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
- if not npcData:
- return
-
- realmLV = PlayerControl.GetDifficultyRealmLV(PlayerControl.GetRealmDifficulty(curPlayer))
- realmNPCIpyData = IpyGameDataPY.GetIpyGameDataNotLog("NPCRealmStrengthen", npcID, realmLV)
-
- # 1. 经验
- exp = CalcTJGExp(curPlayer, times, npcData, realmNPCIpyData)
- expRate = PlayerControl.GetLimitExpRate(curPlayer, ChConfig.ExpRateLimitType_Recover)
- exp = int(exp * expRate / float(ChConfig.Def_MaxRateValue))
- # 通知脱机挂被杀是的时间 和 被杀后的脱机挂时间可获得的经验
- curExp = exp % ChConfig.Def_PerPointValue
- expPoint = exp / ChConfig.Def_PerPointValue
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TJGDeadExp, curExp)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TJGDeadExp1, expPoint)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TJGDeadPayTime, times)
-
- sendPack = ChPyNetSendPack.tagMCTJGDeadPay()
- sendPack.Clear()
- sendPack.Times = times
- sendPack.Exp = curExp
- sendPack.Exp1 = expPoint
- sendPack.DeadTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TJGDeadTime)
- NetPackCommon.SendFakePack(curPlayer, sendPack)
-
-
-# 过天清理
-def TJGOnDay(curPlayer, onEventType):
- if onEventType == ShareDefine.Def_OnEventType:
- times = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TJGDeadPayTime)
- if times == 0:
- return
-
- ResetTJGDeadInfo(curPlayer)
- elif onEventType == ShareDefine.Def_OnEventTypeEx:
- if GetIsTJG(curPlayer):
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGOnDayEx, 1)
- return
-
-def ResetTJGDeadInfo(curPlayer):
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TJGDeadExp, 0)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TJGDeadExp1, 0)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TJGDeadPayTime, 0)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TJGDeadTime, 0)
-
- sendPack = ChPyNetSendPack.tagMCTJGDeadPay()
- sendPack.Clear()
- sendPack.Times = 0
- sendPack.Exp = 0
- sendPack.Exp1 = 0
- sendPack.DeadTime = 0
- NetPackCommon.SendFakePack(curPlayer, sendPack)
- return
-
-
-#===============================================================================
-# //B4 0A 脱机挂死亡 # tagCMTJGDead
-#
-# struct tagCMTJGDead
-# {
-# tagHead Head;
-# };
-#===============================================================================
-# 特殊说明PlayerTJGReborn 此处不能直接处理死亡后下线或者直接复活的逻辑,
-# 不然会导致外层可能在处理循环逻辑中报错,如在ProcessPlayerState正在处理buff逻辑时死亡
-# 改成在收到封包 //B4 0A 脱机挂死亡 # tagCMTJGDead 后处理
-def TJGNotifyDead(index, clientPack, tick):
-
- curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
- if not GetIsTJG(curPlayer):
- return
- if CanHealthReborn(curPlayer):
- ChPlayer.PlayerRebornByType(curPlayer, ChConfig.rebornType_Health, tick)
- # 给个30分无敌buff下线消失
- SkillCommon.AddBuffBySkillType_NoRefurbish(curPlayer, ChConfig.Def_SkillID_TJGSuperBuff, tick)
- else:
- ChPlayer.PlayerRebornByType(curPlayer, ChConfig.rebornType_City, tick)
- curPlayer.Kick(IPY_GameWorld.disMapCopyFull) # 随便记录一个死亡
- return
-
-
-def TJGGM(curPlayer, times):
- # 真实上线
- npcID = FindTJGNPC(curPlayer)
- if not npcID:
- return
-
- # 此时由服务端重新找一次挂机NPC
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_TJGNPC, npcID)
-
- GameWorld.DebugAnswer(curPlayer, "GM模拟脱机产出,npcid:%s, 时间秒:%s, 经验倍率:%s"%(
- curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_TJGNPC), times,
- curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TotalExpRate)))
-
-
- # 设置脱机登录时的等级, 上线通知清空, 没清空说明多次脱机挂登录 使用旧等级
- notifyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_LV, 0, ChConfig.Def_PDictType_TJGNotify)
- if not notifyLV:
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGNotify_LV, curPlayer.GetLV(), ChConfig.Def_PDictType_TJGNotify)
-
-
- # 记录秒单位
- NoteTJGTime(curPlayer, times)
- OnTJGKillNPCByTimes(curPlayer, times)
-
- sendPack = ChPyNetSendPack.tagMCTJGInfo()
- sendPack.Clear()
- sendPack.Exp1 = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Exp1, 0, ChConfig.Def_PDictType_TJGNotify)
- sendPack.Exp2 = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Exp2, 0, ChConfig.Def_PDictType_TJGNotify)
- sendPack.Times = times
- sendPack.PurpleEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Purple, 0, ChConfig.Def_PDictType_TJGNotify)
- sendPack.OrangeEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_Orange, 0, ChConfig.Def_PDictType_TJGNotify)
- sendPack.EatPurpleEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_EatPurple, 0, ChConfig.Def_PDictType_TJGNotify)
- sendPack.GiveCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_GiveCnt, 0, ChConfig.Def_PDictType_TJGNotify)
- sendPack.BeforeLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_LV, 0, ChConfig.Def_PDictType_TJGNotify)
- sendPack.Items = []
- itemIDList = IpyGameDataPY.GetFuncEvalCfg('OfflinePostItem', 1)
- for itemID in itemIDList:
- count = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_ItemID%itemID, 0, ChConfig.Def_PDictType_TJGNotify)
- if count == 0:
- continue
- itemInfo = ChPyNetSendPack.tagMCTJGItems()
- itemInfo.ItemID = itemID
- itemInfo.Count = count
- sendPack.Items.append(itemInfo)
- sendPack.Cnt = len(sendPack.Items)
-
- NetPackCommon.SendFakePack(curPlayer, sendPack)
-
- curPlayer.ClearNomalDict(ChConfig.Def_PDictType_TJGNotify)
-
-
-
-# 上线检查脱机时间是否正常运行, 弥补对应缺失时间,如维护2小时缺失的脱机挂收益
-# 1. 非脱机死亡,2.存在脱机时间,3.离线时间超过5分钟;则一次补齐 离线时间-5分钟的收益并减少脱机时间
-# 按当前经验倍率计算,且不会减buff时间
-# 找到对应的NPC,需读取对应挂机表
-def LoginFixTJG(curPlayer, isTJG=False):
- # 外层需判断是真实玩家登录
- tjgTime = GetTJGTime(curPlayer) # 秒
- if not tjgTime:
- return
-
- if curPlayer.GetState() == 2:
- # 玩家脱机死亡不处理
- GameWorld.DebugLog("脱机死亡玩家不做时差补偿。")
- return
-
-
- # 超过5分钟部分补偿
- seconds = PlayerControl.GetPlayerLeaveServerSecond(curPlayer) - IpyGameDataPY.GetFuncCfg('AutoUseGuardian', 2)
- if seconds <= 0:
- return
- times = min(seconds, tjgTime)
-
- if not isTJG:
- # 真实上线
- npcID = FindTJGNPC(curPlayer)
- if not npcID:
- return
-
- # 此时由服务端重新找一次挂机NPC
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_TJGNPC, npcID)
-
- GameWorld.DebugLog("弥补脱机----playerID:%s ,npcid %s-%s-%s"%(curPlayer.GetID(),
- curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_TJGNPC), times,
- curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TotalExpRate)))
-
-
- # 设置脱机登录时的等级, 上线通知清空, 没清空说明多次脱机挂登录 使用旧等级
- notifyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_LV, 0, ChConfig.Def_PDictType_TJGNotify)
- if not notifyLV:
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDictType_TJGNotify_LV, curPlayer.GetLV(), ChConfig.Def_PDictType_TJGNotify)
-
-
- # 记录秒单位
- NoteTJGTime(curPlayer, times)
- SetTJGTime(curPlayer, max(tjgTime - times, 0))
-
- OnTJGKillNPCByTimes(curPlayer, times)
-
- return
-
-
-def FindTJGNPC(curPlayer):
- # 1.找到对应等级点,判断任务是否完成,与策划约定挂机地图ID10000开头
- # 3.找到可以进入的野外地图后,根据等级防御在此地图挂机
-
- missionMapStep = GetMissionMapStep(curPlayer)
-
- ipyDataMgr = IpyGameDataPY.IPY_Data()
-
- maxMapID = 0 # 高级地图按表顺序行排
- # ---找到可以挂机的最高级地图---
- for i in xrange(ipyDataMgr.GetMapEventPointCount()):
- mapInfo = ipyDataMgr.GetMapEventPointByIndex(i)
- mapID = mapInfo.GetMapID()
- if mapID/10000 != 1:
- # 非野外地图
- continue
-
- # ---判断地图表的任务和等级限制---
- mapData = GameWorld.GetGameData().GetChinMap().GetMapByID(mapID)
- if not mapData:
- continue
- enterLV = mapData.GetLV()
-
- if curPlayer.GetLV() < enterLV:
- continue
- openMapStep = mapData.GetTreasureID() #需要完成的主线任务ID
- if missionMapStep < openMapStep:
- continue
-
- maxMapID = mapID
-
- GameWorld.DebugLog("FindTJGNPC maxMapID=%s" % maxMapID)
- if not maxMapID:
- return 0
-
- # ---找到挂机等级点---
- lv = curPlayer.GetLV()
- myPoint = None
-
- # 注: NPCRealmStrengthen MapEventPoint 这两张配置表需要确保相关共用字段命名一样
- realmMapIDList = IpyGameDataPY.GetFuncEvalCfg("RealmDifficulty", 1)
- realmDifficulty = PlayerControl.GetRealmDifficulty(curPlayer)
- if maxMapID in realmMapIDList and realmDifficulty:
- realmLV = PlayerControl.GetDifficultyRealmLV(realmDifficulty)
- mapList = IpyGameDataPY.GetIpyGameDataByCondition("NPCRealmStrengthen", {"MapID":maxMapID, "RealmDifficulty":realmLV}, True)
- else:
- mapList = IpyGameDataPY.GetIpyGameDataByCondition("MapEventPoint", {"MapID":maxMapID}, True)
-
- mapEffList = [] # 有效挂机点,同地图中存在不需要挂机的NPC点
- for mapInfo in mapList:
- if mapInfo.GetLowLV() == 0:
- continue
-
- mapEffList.append(mapInfo)
-
- if lv >= mapInfo.GetLowLV():
- if myPoint and myPoint.GetLowLV() >= mapInfo.GetLowLV():
- continue
- myPoint = mapInfo
-
- if not mapEffList:
- return 0
-
- # ---根据防御上下调整
- if not myPoint:
- # 寻找异常取最低点
- return mapEffList[0].GetNPCID()
-
- pointLen = len(mapEffList)
- defense = curPlayer.GetDef()
- pIndex = mapEffList.index(myPoint)
- if defense >= mapEffList[min(pointLen-1, pIndex+1)].GetDefense():
- # 高一级
- return mapEffList[min(pointLen-1, pIndex+1)].GetNPCID()
-
- if defense < myPoint.GetDefense():
- # 低一级
- return mapEffList[max(0, pIndex-1)].GetNPCID()
-
- return myPoint.GetNPCID()
-
-
-
-
-def GetMissionMapStep(curPlayer):
- # 主线任务完成时会设置标志可进地图标志
- mission_1 = QuestCommon.GetCommonMission(curPlayer)
- if not mission_1:
- return 0
- return mission_1.GetProperty("OpenMap")
-
-
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py
index cd5d600..01a1dc0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCache.py
@@ -160,7 +160,7 @@
lastUpdTick = curPlayer.GetDictByKey(Key_UpdViewCacheTick)
tick = GameWorld.GetGameWorld().GetTick()
if lastUpdTick and tick - lastUpdTick < 60000:
- GameWorld.DebugLog("1分钟内只更新一次玩家缓存", playerID)
+ #GameWorld.DebugLog("1分钟内只更新一次玩家缓存", playerID)
return
curPlayer.SetDict(Key_UpdViewCacheTick, tick)
return UpdPlayerViewCache(curPlayer)
@@ -180,7 +180,7 @@
tick = GameWorld.GetGameWorld().GetTick()
curPlayer.SetDict(Key_UpdViewCacheTick, tick)
- GameWorld.DebugLog("更新玩家查看缓存数据! isOffline=%s" % isOffline, playerID)
+ #GameWorld.DebugLog("更新玩家查看缓存数据! isOffline=%s" % isOffline, playerID)
curCache.SetAccID(curPlayer.GetAccID())
curCache.SetPlayerName(curPlayer.GetPlayerName())
curCache.SetLV(curPlayer.GetLV())
@@ -219,11 +219,10 @@
def UpdPlayerViewCacheByDB(playerID):
'''更新玩家查看缓存数据,直接从db数据更新,仅更新dbPlayer表有的属性,
'''
- GameWorld.DebugLog("UpdPlayerViewCacheByDB", playerID)
curCache = None
dbPlayer = PyMongoMain.GetUserCtrlDB().findDBPlayer(playerID)
if not dbPlayer:
- GameWorld.DebugLog("1111111111111111", playerID)
+ GameWorld.ErrLog("UpdPlayerViewCacheByDB找不到玩家!", playerID)
return curCache
viewCacheMgr = DBDataMgr.GetPlayerViewCacheMgr()
curCache = viewCacheMgr.GetPlayerViewCache(playerID)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py
index a500a86..40cb8db 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/LogicProcess/UserCtrlDB.py
@@ -411,7 +411,7 @@
if resultSet and resultSet.count():
for resultDict in resultSet:
PyGameData.g_dbPlayerIDMap[resultDict["PlayerID"]] = resultDict["AccID"]
- GameWorld.Log("启动服务器加载DBPlayer玩家账号ID对应关系! %s, %s" % (len(PyGameData.g_dbPlayerIDMap), PyGameData.g_dbPlayerIDMap))
+ GameWorld.Log("启动服务器加载DBPlayer玩家账号ID对应关系! %s" % (len(PyGameData.g_dbPlayerIDMap)))
return
def findDBPlayer(self, playerID):
@@ -2431,7 +2431,7 @@
mylog.debug('insert role ok!accid = %s, PlayerName = %s'%(createPlayer.AccID, createPlayer.PlayerName))
PyGameData.g_dbPlayerIDMap[newPlayerID] = createPlayer.AccID
- mylog.debug('PyGameData.g_dbPlayerIDMap = %s, %s'%(len(PyGameData.g_dbPlayerIDMap), PyGameData.g_dbPlayerIDMap))
+ mylog.debug('PyGameData.g_dbPlayerIDMap = %s'%(len(PyGameData.g_dbPlayerIDMap)))
#构造其他角色初始数据
itemData = ''
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
index 639f63e..cb6496f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
@@ -21,7 +21,6 @@
import SkillShell
import PassiveBuffEffMng
import ChNetSendPack
-import PlayerTJG
import OperControlManager
import GameObj
import CrossPlayerData
@@ -654,7 +653,6 @@
beforeHP = GameObj.GetHP(curObj)
index = 0
- isPlayerTJG = (curObj.GetGameObjType() == IPY_GameWorld.gotPlayer and PlayerTJG.GetIsTJG(curObj))
skillIDListInDelBuff = [] # buff消失中需要处理添加buff,外层处理避免错乱
@@ -669,12 +667,6 @@
#填表,持续时间为0的Buff为永久Buff
if not curSkill.GetLastTime() and not curBuffRemainTime:
index += 1
- continue
-
- if isPlayerTJG and curSkill.GetSkillTypeID() in ChConfig.TJGStateNotRefreshTimeBuff:
- curBuff.SetCalcStartTick( tick )
- index += 1
- #GameWorld.DebugLog("脱机挂状态下不刷新buff时间: skillTypeID=%s" % curSkill.GetSkillTypeID())
continue
remainTime = curBuffRemainTime - ( tick - curBuff.GetCalcStartTick() )
--
Gitblit v1.8.0