From 4cd9d842ba557df0c1fd0f3ce46fb68ce9ebc42f Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 01 七月 2022 18:01:40 +0800
Subject: [PATCH] 9647 【新后台】【yn_1.0.1】【yn_ver1】新增功能(增加查询历史榜单;查询实时榜单、历史榜单跳转优化)

---
 ServerPython/CoreServerGroup/GameServer/Script/PyDataManager.py |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 52 insertions(+), 7 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/PyDataManager.py b/ServerPython/CoreServerGroup/GameServer/Script/PyDataManager.py
index 7599174..cb3a051 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/PyDataManager.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/PyDataManager.py
@@ -27,12 +27,16 @@
 import AuctionHouse
 import PlayerAssist
 import PyGameDataStruct
+import IpyGameDataPY
+import PlayerCharm
+import PlayerLove
 import CommFunc
+import time
 
 def GetSavePyData():
     pyGameDataMgr = GetPyGameDataManager()
     result = pyGameDataMgr.GetSaveData()
-    GameWorld.DebugLog("GetSavePyData!! id = %s-%s"%(id(pyGameDataMgr), len(result)))
+    GameWorld.Log("GetSavePyData!! id = %s-%s"%(id(pyGameDataMgr), len(result)))
     result = binascii.b2a_hex(result)
     #GameWorld.DebugLog("GetSavePyData!! result = %s-%s"%(result, len(result)))
     # 字节码在C++转化会发生错误must be string without null bytes, not str,但是可以正常保存,错误会在下次调用便宜接口才会触发
@@ -56,6 +60,7 @@
     
     # 保存数据 存数据库和realtimebackup
     def GetSaveData(self):
+        PlayerAssist.RemoveOutofdateAssistThanks()
         savaData = ""
         cntData = ""
         cnt = 0
@@ -65,7 +70,7 @@
             PlayerAssist.OnSaveAssistThanksData(dbData)
             savaData += dbData.getBuffer()
             
-        GameWorld.Log("Save DBAssistThanks count :%s" % cnt)
+        GameWorld.Log("Save DBAssistThanks count :%s len=%s" % (cnt, len(savaData)))
         return CommFunc.WriteDWORD(cntData, cnt) + savaData
     
     # 从数据库载入数据
@@ -104,7 +109,7 @@
             cnt += 1
             savaData += dbData.getBuffer()
             
-        GameWorld.Log("Save DBAssist count :%s" % cnt)
+        GameWorld.Log("Save DBAssist count :%s len=%s" % (cnt, len(savaData)))
         return CommFunc.WriteDWORD(cntData, cnt) + savaData
     
     # 从数据库载入数据
@@ -145,7 +150,7 @@
             cnt += 1
             savaData += dbData.getBuffer()
             
-        GameWorld.Log("Save PlayerViewCachePy count :%s" % cnt)
+        GameWorld.Log("Save PlayerViewCachePy count :%s len=%s" % (cnt, len(savaData)))
         return CommFunc.WriteDWORD(cntData, cnt) + savaData
     
     # 从数据库载入数据
@@ -177,13 +182,21 @@
         cntData = ""
         cnt = 0
         
+        unSaveCnt = 0
+        curTime = int(time.time())
+        vaildSeconds = IpyGameDataPY.GetFuncCfg("AuctionHouse", 1) * 3600 * 24
         for recordDict in [self.myAuctionItemRecordDict, self.myBidItemRecordDict, self.familyAuctionItemRecordDict]:
             for recordList in recordDict.values():
                 for dbData in recordList:
+                    if vaildSeconds:
+                        recordTime = GameWorld.ChangeTimeStrToNum(dbData.RecordTime)
+                        if curTime - recordTime > vaildSeconds:
+                            unSaveCnt += 1
+                            continue
                     cnt += 1
                     savaData += dbData.getBuffer()
                     
-        GameWorld.Log("Save AuctionRecord count :%s" % cnt)
+        GameWorld.Log("Save AuctionRecord count :%s len=%s unSaveCnt=%s" % (cnt, len(savaData), unSaveCnt))
         return CommFunc.WriteDWORD(cntData, cnt) + savaData
     
     # 从数据库载入数据
@@ -217,7 +230,7 @@
             cnt += 1
             savaData += dbData.getBuffer()
             
-        GameWorld.Log("Save AuctionAttention count :%s" % cnt)
+        GameWorld.Log("Save AuctionAttention count :%s len=%s" % (cnt, len(savaData)))
         return CommFunc.WriteDWORD(cntData, cnt) + savaData
     
     # 从数据库载入数据
@@ -273,7 +286,7 @@
             cnt += 1
             savaData += dbData.getBuffer()
             
-        GameWorld.Log("Save AuctionItem count :%s" % cnt)
+        GameWorld.Log("Save AuctionItem count :%s len=%s" % (cnt, len(savaData)))
         return CommFunc.WriteDWORD(cntData, cnt) + savaData
     
     # 从数据库载入数据
@@ -297,6 +310,10 @@
 
 class PyGameDataManager(object):
     def __init__(self):
+        self.DBPyCoupleManager = PlayerLove.DBPyCoupleManager()
+        self.DBPyUnNotifyLoveGiftRecManager = PlayerLove.DBPyUnNotifyLoveGiftRecManager()
+        self.DBPyCharmValueRecManager = PlayerCharm.DBPyCharmValueRecManager()
+        self.IntimacyManager = PlayerSocial.IntimacyManager()
         self.CrossPersonalCompensationManager = PlayerCompensation.CrossPersonalCompensationManager()
         self.CrossBillboardManager = CrossBillboard.CrossBillboardManager()
         self.PlayerAssistThanksPyManager = PlayerAssistThanksPyManager()
@@ -322,6 +339,10 @@
 
     def GetSaveData(self):
         buff = ""
+        buff += self.DBPyCoupleManager.GetSaveData()
+        buff += self.DBPyUnNotifyLoveGiftRecManager.GetSaveData()
+        buff += self.DBPyCharmValueRecManager.GetSaveData()
+        buff += self.IntimacyManager.GetSaveData()
         buff += self.CrossPersonalCompensationManager.GetSaveData()
         buff += self.CrossBillboardManager.GetSaveData()
         buff += self.PlayerAssistThanksPyManager.GetSaveData()
@@ -346,6 +367,10 @@
         return buff
     
     def LoadGameData(self, gameBuffer, pos):
+        pos = self.DBPyCoupleManager.LoadPyGameData(gameBuffer, pos, len(gameBuffer))
+        pos = self.DBPyUnNotifyLoveGiftRecManager.LoadPyGameData(gameBuffer, pos, len(gameBuffer))
+        pos = self.DBPyCharmValueRecManager.LoadPyGameData(gameBuffer, pos, len(gameBuffer))
+        pos = self.IntimacyManager.LoadPyGameData(gameBuffer, pos, len(gameBuffer))
         pos = self.CrossPersonalCompensationManager.LoadPyGameData(gameBuffer, pos, len(gameBuffer))
         pos = self.CrossBillboardManager.LoadPyGameData(gameBuffer, pos, len(gameBuffer))
         pos = self.PlayerAssistThanksPyManager.LoadPyGameData(gameBuffer, pos, len(gameBuffer))
@@ -457,6 +482,26 @@
     pyGameDataMgr = GetPyGameDataManager()
     return pyGameDataMgr.familyStoreItemManager
 
+def GetDBPyCoupleManager():
+    # 伴侣管理
+    pyGameDataMgr = GetPyGameDataManager()
+    return pyGameDataMgr.DBPyCoupleManager
+
+def GetDBPyUnNotifyLoveGiftRecManager():
+    # 未通知的赠送礼物记录
+    pyGameDataMgr = GetPyGameDataManager()
+    return pyGameDataMgr.DBPyUnNotifyLoveGiftRecManager
+
+def GetDBPyCharmValueRecManager():
+    # 魅力管理
+    pyGameDataMgr = GetPyGameDataManager()
+    return pyGameDataMgr.DBPyCharmValueRecManager
+
+def GetIntimacyManager():
+    # 亲密管理
+    pyGameDataMgr = GetPyGameDataManager()
+    return pyGameDataMgr.IntimacyManager
+
 # 好友系统
 def GetFriendManager():
     pyGameDataMgr = GetPyGameDataManager()

--
Gitblit v1.8.0