hch
2018-08-21 57855272e59c00bc255b296855ef6ef84a8eb617
fix:离线状态机器人上线也是要补偿缺失时间收益
1个文件已修改
20 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTJG.py 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTJG.py
@@ -199,6 +199,9 @@
    if curPlayer.GetIP() != "127.0.0.1":
        return
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_TJGNPC, clientData.NPCID)
    # 先弥补错失的时间
    LoginFixTJG(curPlayer, True)
    GameWorld.DebugLog("%s---OnTJGNPC:%s"%(curPlayer.GetName(),clientData.NPCID))
    return
@@ -805,7 +808,7 @@
# 1. 非脱机死亡,2.存在脱机时间,3.离线时间超过5分钟;则一次补齐 离线时间-5分钟的收益并减少脱机时间
# 按当前经验倍率计算,且不会减buff时间
# 找到对应的NPC,需读取对应挂机表
def LoginFixTJG(curPlayer):
def LoginFixTJG(curPlayer, isTJG=False):
    # 外层需判断是真实玩家登录
    tjgTime = GetTJGTime(curPlayer)     # 秒
    if not tjgTime:
@@ -823,14 +826,17 @@
        return
    times = min(seconds, tjgTime)
    npcID = FindTJGNPC(curPlayer)
    if not npcID:
        return
    if not isTJG:
        # 真实上线
        npcID = FindTJGNPC(curPlayer)
        if not npcID:
            return
        # 此时由服务端重新找一次挂机NPC
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_TJGNPC, npcID)
    
    GameWorld.DebugLog("弥补脱机----npcid  %s-%s"%(npcID, times))
    GameWorld.DebugLog("弥补脱机----npcid  %s-%s"%(curPlayer.NomalDictGetProperty(ChConfig.Def_PlayerKey_TJGNPC), times))
    
    # 此时由服务端重新找一次挂机NPC
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PlayerKey_TJGNPC, npcID)
    
    # 设置脱机登录时的等级, 上线通知清空, 没清空说明多次脱机挂登录 使用旧等级
    notifyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDictType_TJGNotify_LV, 0, ChConfig.Def_PDictType_TJGNotify)