From 19e0109ec1e936204cb85362d2e3f705b8b9554c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 03 十二月 2020 11:19:38 +0800
Subject: [PATCH] 8585 【主干】【BT】【长尾】【后端】竞技场(封包)
---
ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py | 80 ++++++++++++++++++++++++++++++++++-----
1 files changed, 69 insertions(+), 11 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
index 5cbad3a..a165f35 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
@@ -44,7 +44,7 @@
#import PlayerFamilyStore
import PlayerSocial
import PlayerFamilyParty
-import PlayerSealDemon
+#import PlayerSealDemon
import PlayerBillboard
import PlayerLVAward
import PlayerDuJie
@@ -56,12 +56,14 @@
import GameWorldActionControl
import GameWorldFamilyWar
import PlayerFBHelpBattle
+import GameWorldSkyTower
import GMT_CTG
import PyGameData
import GMShell
import IPY_PlayerDefine
import CrossRealmPK
import AuctionHouse
+import PlayerAssist
import PlayerFB
#---------------------------------------------------------------------
@@ -128,6 +130,7 @@
#玩家队伍初始化
PlayerTeam.OnPlayerLoginRefreshTeam(curPlayer, tick)
PlayerCompensation.NotifyPlayerCompensation(curPlayer)
+ __UpdOnedayJobPlayerLoginoffTime(curPlayer)
if not PlayerControl.GetIsTJG(curPlayer):
# 只有通知逻辑的应该放此处减少IO,如有逻辑处理存储等不可放在此处
@@ -158,7 +161,7 @@
#仙盟宴会
PlayerFamilyParty.OnPlayerLogin(curPlayer)
#封魔坛
- PlayerSealDemon.OnPlayerLogin(curPlayer)
+ #PlayerSealDemon.OnPlayerLogin(curPlayer)
#仙魔之争
PlayerXMZZ.OnXMZZOnLogin(curPlayer)
#等级奖励
@@ -174,20 +177,58 @@
#守卫人皇
PlayerFamilySWRH.OnLogin(curPlayer)
PlayerTalk.LoginChatMi(curPlayer)
- PlayerGeTui.CleanNewGuyCallBackGeTui(curPlayer.GetID())
+ PlayerTalk.NotifyTalkCache(curPlayer)
+ #PlayerGeTui.CleanNewGuyCallBackGeTui(curPlayer.GetID())
#活动
GameWorldActionControl.OnPlayerLogin(curPlayer)
#玩家等级记录
PyGameData.g_todayPlayerLVDict[curPlayer.GetID()] = curPlayer.GetLV()
- #副本助战
- PlayerFBHelpBattle.OnHelpPlayerLogin(curPlayer)
#跨服PK
CrossRealmPK.OnPlayerLogin(curPlayer)
#诛仙BOSS
PlayerZhuXianBoss.OnPlayerLogin(curPlayer)
#骑宠boss状态通知
PlayerHorsePetBoss.OnLogin(curPlayer)
+ #协助
+ PlayerAssist.OnPlayerLogin(curPlayer, False)
+ #天星塔
+ GameWorldSkyTower.OnPlayerLogin(curPlayer)
GMT_CTG.OnPlayerLogin(curPlayer)
+
+ else:
+ #协助
+ PlayerAssist.OnPlayerLogin(curPlayer, True)
+
+ return
+
+def __UpdOnedayJobPlayerLoginoffTime(curPlayer):
+ ## 更新一天内职业对应玩家登录、离线时间
+ job = curPlayer.GetJob()
+ playerID = curPlayer.GetPlayerID()
+ if job not in PyGameData.g_onedayJobPlayerLoginoffTimeDict:
+ PyGameData.g_onedayJobPlayerLoginoffTimeDict[job] = {}
+ playerLoginoffTimeDict = PyGameData.g_onedayJobPlayerLoginoffTimeDict[job]
+ playerLoginoffTimeDict[playerID] = int(time.time())
+ #GameWorld.DebugLog("更新职业对应玩家登录离线时间: %s" % PyGameData.g_onedayJobPlayerLoginoffTimeDict)
+ return
+
+def CheckOnedayJobPlayerLoginoffTimeout():
+ ## 检查一天内职业对应玩家登录、离线时间超时玩家,每小时检查一次
+
+ maxTime = 24 * 3600 # 暂定24小时
+ curTime = int(time.time())
+ #GameWorld.DebugLog("处理24小时内在线的角色职业玩家: curTime=%s,maxTime=%s, %s" % (curTime, maxTime, PyGameData.g_onedayJobPlayerLoginoffTimeDict))
+
+ playerManager = GameWorld.GetPlayerManager()
+ for playerDict in PyGameData.g_onedayJobPlayerLoginoffTimeDict.values():
+ for playerID, loginoffTime in playerDict.items():
+ if playerManager.FindPlayerByID(playerID):
+ #GameWorld.DebugLog(" 在线不处理, playerID=%s" % playerID)
+ continue
+ if curTime - loginoffTime > maxTime:
+ playerDict.pop(playerID)
+ #GameWorld.DebugLog(" 超时玩家,移除! playerID=%s,loginoffTime=%s" % (playerID, loginoffTime))
+ #GameWorld.DebugLog(" 处理完毕,剩余玩家! %s" % PyGameData.g_onedayJobPlayerLoginoffTimeDict)
return
## 增加高手玩家上线广播
@@ -504,13 +545,21 @@
PlayerFamily.PlayerLogoffRefreshFamily(curPlayer, tick)
PlayerFriend.OnPlayerDisconnect(curPlayer, tick)
- PlayerGeTui.NewGuyCallBackGeTui(curPlayer, tick)
+ __UpdOnedayJobPlayerLoginoffTime(curPlayer)
+ #PlayerGeTui.NewGuyCallBackGeTui(curPlayer, tick)
# 设置家族成员离线时间
SetPlayerOfflineTime(curPlayer)
#拍卖行
AuctionHouse.OnPlayerLeaveServer(curPlayer)
+ #协助
+ PlayerAssist.OnLeaveServer(curPlayer)
#------------镖车逻辑
#TruckPlayerDisconnectProcess(curPlayer, tick)
+
+ if not PlayerControl.GetIsTJG(curPlayer):
+ playerID = curPlayer.GetPlayerID()
+ PyGameData.g_unTJLogoffTime[playerID] = int(time.time())
+
return
## 设置玩家离线时间
@@ -518,8 +567,8 @@
# @return None
# @remarks 函数详细说明.
def SetPlayerOfflineTime(curPlayer):
- if PlayerControl.GetIsTJG(curPlayer):
- return
+ #if PlayerControl.GetIsTJG(curPlayer):
+ # return
curPlayerID = curPlayer.GetPlayerID()
curFamily = curPlayer.GetFamily()
@@ -580,6 +629,10 @@
PlayerControl.SetGMForbidenTalk(curPlayer, packValue)
return
+ if packType == ShareDefine.CDBPlayerRefresh_ExAttr17:
+ PlayerControl.SetPlayerAccState(curPlayer, packValue)
+ return
+
if packType == IPY_GameServer.CDBPlayerRefresh_State:
# 脱机在线
PlayerControl.SetIsTJG(curPlayer, packValue)
@@ -601,6 +654,14 @@
if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr2:
#队伍相关相关审核开关状态
PlayerTeam.SetTeamCheckState(curPlayer, packValue)
+ return
+
+ #if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr1:
+ # PlayerControl.SetAssistTagPlayerID(curPlayer, packValue)
+ # return
+
+ if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr3:
+ PlayerControl.SetFBFuncLineID(curPlayer, packValue)
return
#---常规逻辑处理---
@@ -645,9 +706,6 @@
elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr10:
PlayerControl.SetChatBubbleBox(curPlayer, packValue)
-
- elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr11:
- PlayerControl.SetTodayXianyuanCoin(curPlayer, packValue)
elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr13:
PlayerControl.SetPlayerServerGroupID(curPlayer, packValue)
--
Gitblit v1.8.0