From abe9dbc7d8eb82602cc975284a7d2ae8894e4ef9 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 12 十二月 2025 17:35:03 +0800
Subject: [PATCH] 389 流向记录(登录、下线、主线任务、主线关卡、副本、货币、物品)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py
index ca053c1..ec81f6a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTask.py
@@ -21,6 +21,7 @@
 import NetPackCommon
 import PlayerGoldRush
 import ChPyNetSendPack
+import DataRecordPack
 import ItemControler
 import IPY_GameWorld
 import GameFuncComm
@@ -38,11 +39,11 @@
         ipyDataMgr = IpyGameDataPY.IPY_Data()
         for index in xrange(ipyDataMgr.GetTaskCount()):
             ipyData = ipyDataMgr.GetTaskByIndex(index)
-            taskGroup = ipyData.GetTaskGroup()
+            tGroup = ipyData.GetTaskGroup()
             taskID = ipyData.GetTaskID()
-            if taskGroup not in taskIDListDict:
-                taskIDListDict[taskGroup] = []
-            taskIDList = taskIDListDict[taskGroup]
+            if tGroup not in taskIDListDict:
+                taskIDListDict[tGroup] = []
+            taskIDList = taskIDListDict[tGroup]
             if taskID not in taskIDList:
                 taskIDList.append(taskID)
         IpyGameDataPY.SetConfigEx(key, taskIDListDict)
@@ -100,8 +101,9 @@
         
     return
 
-def __giveNewTask(curPlayer, taskGroup=ChConfig.TaskGroup_Main):
+def __giveNewTask(curPlayer, taskGroup=ChConfig.TaskGroup_Main, preTaskID=0):
     ## 给新任务
+    # @param preTaskID: 上一个任务ID
     taskIDList = GetTaskIDList(taskGroup)
     if not taskIDList:
         return
@@ -136,6 +138,12 @@
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskValue % taskGroup, 0)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskState % taskGroup, ChConfig.TaskState_Doing)
     GameWorld.DebugLog("接到新任务: taskGroup=%s,newTaskID=%s" % (taskGroup, newTaskID), playerID)
+    
+    # 额外记录接到任务
+    if taskGroup == ChConfig.TaskGroup_Main:
+        PlayerControl.SetMainTaskID(curPlayer, newTaskID)
+    DataRecordPack.DR_Task(curPlayer, taskGroup, newTaskID, "new", {"preTaskID":preTaskID})
+    
     return SetTaskValue(curPlayer, ipyData, taskValue)
 
 def __GetTaskValue(curPlayer, ipyData):
@@ -347,7 +355,7 @@
         appointInfo[itemID] = appointID
     ItemControler.NotifyGiveAwardInfo(curPlayer, notifyAwardList, "Task", dataEx={"appointInfo":appointInfo})
     
-    if not __giveNewTask(curPlayer, taskGroup):
+    if not __giveNewTask(curPlayer, taskGroup, taskID):
         SyncTaskInfo(curPlayer, [taskGroup])
         
     GameFuncComm.DoFuncOpenLogic(curPlayer)

--
Gitblit v1.8.0