From b69fe56d5ebb784c4430cb5e86f460efafa1b30a Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 28 三月 2019 16:57:29 +0800
Subject: [PATCH] 6373 【后端】【2.0】删除无用功能代码、封包、配置(生产系统)
---
/dev/null | 483 ------------------------------------------------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script.ini | 16 -
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 2
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py | 29 --
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py | 9
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 11 -
6 files changed, 0 insertions(+), 550 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script.ini b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script.ini
index b6a252c..b5ccd8f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script.ini
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script.ini
@@ -1206,22 +1206,6 @@
PacketSubCMD_2=0x30
PacketCallFunc_2=UpdateFineSoulSlot
-;生产系统
-[PlayerProduce]
-ScriptName = Player\PlayerProduce.py
-Writer = chenxuewei
-Releaser = chenxuewei
-RegType = 0
-RegisterPackCount = 2
-
-PacketCMD_1=0x03
-PacketSubCMD_1=0x32
-PacketCallFunc_1=ProductionActive
-
-PacketCMD_2=0x03
-PacketSubCMD_2=0x33
-PacketCallFunc_2=StartProduce
-
;答题
[Exam]
ScriptName = Player\PlayerExam.py
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index ec1cd76..d2d9578 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -730,12 +730,6 @@
# 脱机挂状态下不刷新buff时间的
TJGStateNotRefreshTimeBuff = [Def_SkillID_Red]
-#===============================================================================
-# 生产相关技能ID在下面配置
-# Def_SkillID_Produce
-# Def_ProduceBuffID
-#===============================================================================
-
#技能ID对应的区域类型
Def_AreaType_SkillID_Safe = 20011 # 安全区
Def_AreaType_SkillID_FreePK = 20010 # pk区
@@ -1603,11 +1597,6 @@
) = range(4, 4 + 2)
#---玩家生产系统-------------------------------------------
-Def_ProduceLVMin = 5 # 生产材料采集玩家最小等级
-Def_SkillID_Produce = 20018 # 生产技能ID
-Def_ProduceBuffID = 20021 # 进入生产采集状态添加的buffID
-#生产采集进度条时间为10秒
-Def_ProducePortalTime = 10000
#生产采集状态枚举值
[
Def_EndProduction, # 退出生产采集状态 0
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 9796fcd..0341b26 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -489,8 +489,6 @@
#通知玩家技能信息
__Sync_ClientSkill(curPlayer)
- #清除生产采集Buff
- #PlayerControl.DelProduceBuff(curPlayer, tick)
#清除国家答题Buff
#PlayerExam.DoLogic_ExitExam(curPlayer, tick, needRefresh = False)
#清除VIPbuff
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 8f33bb6..ddc9484 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -5375,35 +5375,6 @@
if BuffSkill.DelBuffBySkillID(curPlayer, ChConfig.Def_SkillID_LimitSuperBuff, tick):
PlayerControl(curPlayer).RefreshPlayerAttrByBuff()
-
-#---------------------------------------------------------------------
-##清除生产采集BUF
-# @param curPlayer 玩家实例
-# @param tick 时间戳
-# @param isLeaveServer 玩家是否离开服务器
-# @return 返回值无意义
-# @remarks 清除生产采集BUF
-def DelProduceBuff(curPlayer, tick, isLeaveServer=False):
-
- if not isLeaveServer:
- if curPlayer.GetPlayerAction() != IPY_GameWorld.paProduce:
- #玩家当前状态不在生产采集,不处理
- return
-
- #清除生产buff(ID20021)
- BuffSkill.DelBuffBySkillID(curPlayer, ChConfig.Def_ProduceBuffID, tick)
-
- #清除活动无敌Buff
- BuffSkill.DelBuffBySkillID(curPlayer, ChConfig.Def_SkillID_ActionWuDi, tick)
-
- if not isLeaveServer:
- #设置玩家空闲状态
- ChangePlayerAction(curPlayer, IPY_GameWorld.paNull)
- #通知客户端
- curPlayer.Notify_ProductionState(ChConfig.Def_EndProduction)
-
- #PlayerControl(curPlayer).RefreshAllState()
- return
#---------------------------------------------------------------------
##特殊状态处理
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerProduce.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerProduce.py
deleted file mode 100644
index 3616f74..0000000
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerProduce.py
+++ /dev/null
@@ -1,483 +0,0 @@
-#!/usr/bin/python
-#-*- coding: GBK -*-
-#----------------------------------------------------------------------------------------------------
-#
-#----------------------------------------------------------------------------------------------------
-#
-##@package PlayerProduce
-# @todo: 玩家生产系统
-#
-# @author chenxuewei
-# @date 2011-03-18 15:00
-# @version 1.7
-#@note: 玩家生产系统
-#
-# @change: "2013-06-13 15:30" wdb 去除分类,增加手续费概率
-# @change: "2014-08-12 11:00" xmnathan 修改合成提示
-# @change: "2014-10-27 18:00" xmnathan 合成允许自动钻石购买,配置
-# @change: "2014-10-28 11:34" xmnathan 增加合成成功后全服广播配置
-# @change: "2014-12-05 20:30" hxp 合成目标物支持饼图随机给物品
-# @change: "2015-01-14 12:30" hxp 增加自动购买消耗流向
-# @change: "2016-10-08 18:00" hxp 自动购买物品价格统一取商城物品价格
-#------------------------------------------------------------------------------
-"""Version = 2016-10-08 18:00"""
-#---------------------------------------------------------------------
-#导入
-import GameWorld
-import IPY_GameWorld
-import ChConfig
-import ReadChConfig
-import PetControl
-import GameMap
-import PlayerControl
-import ShareDefine
-import ItemControler
-import BuffSkill
-import random
-import ItemCommon
-import SkillCommon
-import DataRecordPack
-import PlayerSuperMarket
-#---------------------------------------------------------------------
-#全局
-#---------------------------------------------------------------------
-#逻辑实现
-
-
-#{地图id:[[概率,材料id,数量,是否绑定], [概率,材料id,数量,是否绑定], [概率,材料id,数量,是否绑定]……]}
-Def_PlayerProduceResultDic = ReadChConfig.GetEvalChConfig('PlayerProduceResult')
-
-#===================================================================================================
-# //03 32 生产系统开关#tagCProductionActive
-# tagProductionActive * GettagCProductionActive();
-#
-# class IPY_CProductionActive
-# {
-# public:
-#
-# //开1关0状态
-# BYTE GetState();
-# };
-#===================================================================================================
-## 客户端封包响应
-# @param index 玩家索引
-# @param tick 时间戳
-# @return 返回值无意义
-# @remarks 客户端封包响应 //03 32 生产系统开关#tagCProductionActive
-def ProductionActive(index, tick):
-
- curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
- pack = IPY_GameWorld.IPY_CProductionActive()
-
- curProduction = pack.GetState() # //开1关0状态
-
- if curProduction:
- #开启采集
-
- if not __IsCanProduce(curPlayer):
- #不可采集生产,跳出
- return
-
- #通知开始采集生产
- PlayerControl.Sync_PrepareBegin(curPlayer, ChConfig.Def_ProducePortalTime, ShareDefine.Def_PstProduce)
-
- else:
- #关闭采集
-
- #清除生产采集BUF
- PlayerControl.DelProduceBuff(curPlayer, tick)
-
- return
-
-
-## 玩家采集生产准备完毕
-# @param curPlayer:当前玩家对象
-# @param tick 时间戳
-# @return None
-# @remarks 玩家采集生产准备完毕
-def OnProduceEnd(curPlayer, tick):
-
- #获得1格范围内的player对象列表
- findPlayerObjList = GameMap.GetAreaGameObjByType(curPlayer.GetPosX(), curPlayer.GetPosY(), \
- ChConfig.Def_Matrix_One, [IPY_GameWorld.gotPlayer])
-
- for curPlayerObj in findPlayerObjList:
- #获取玩家实例
- findPlayer = GameWorld.GetObj(curPlayerObj.GetID(), curPlayerObj.GetGameObjType())
-
- if not findPlayer:
- continue
-
- if findPlayer.GetPlayerAction() == IPY_GameWorld.paProduce:
- #该玩家正在采集生产中
-
- #附近已经有玩家在采集了,请另寻地点!
- PlayerControl.NotifyCode(curPlayer, "Collect_lhs_161795")
- #通知客户端(将进度条界面关闭)
- curPlayer.Sync_PrepareEnd()
- return
-
- #召唤回出战的宠物
- PetControl.ReCallFightPet(curPlayer)
-
- #2011-04-07-chenxuewei-添加两个buff,第一个Buff不刷新属性,第二个再刷
- #添加生产buff(ID20021)
- SkillCommon.AddBuffBySkillType_NoRefurbish(curPlayer, ChConfig.Def_ProduceBuffID, tick)
- #给玩家加活动无敌Buff
- SkillCommon.AddBuffBySkillType(curPlayer, ChConfig.Def_SkillID_ActionWuDi, tick)
-
-# curSkill = GameWorld.GetGameData().GetSkillBySkillID(ChConfig.Def_ProduceBuffID)
-#
-# if not curSkill:
-# GameWorld.ErrLog("没有找到生产采集buff,skillTypeID = %s"%ChConfig.Def_ProduceBuffID)
-# return
-#
-# BuffSkill.DoAddBuff(curPlayer, IPY_GameWorld.bfActionBuff, curSkill, tick)
-
- #设置当前进入生产采集状态的tick
- curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_Produce, tick)
- #设置玩家进入生产采集状态
- PlayerControl.ChangePlayerAction(curPlayer, IPY_GameWorld.paProduce)
- #通知客户端
- curPlayer.Notify_ProductionState(ChConfig.Def_EnterProduction)
- #通过打造回应封包通知采集生产进行中
- curProduceState = 0 # 当前采集状态为开始采集生产进行中
- curPlayer.Sync_MakeItemAnswer(ShareDefine.Def_mitProduceResult, curProduceState)
- return
-
-
-##循环处理采集生产时间
-# @param curPlayer 玩家实例
-# @param tick 时间戳
-# @return None
-# @remarks 循环处理采集生产时间
-def PlayerProduceTime(curPlayer, tick):
-
- if curPlayer.GetPlayerAction() != IPY_GameWorld.paProduce:
- #玩家当前状态不在生产采集,不处理
- return
-
- #10秒处理一次采集生产时间
- lastTick = curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_Produce)
-
- pastTick = tick - lastTick
-
- if pastTick < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_Produce]:
- #没有到刷新间隔
- return
-
- curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_Produce, tick)
-
- #采集生产逻辑处理
- isSucceed = DoLogic_ProduceResult(curPlayer)
- #通过打造回应封包通知采集生产进行中(时机为客户端拉采集进行中的进度条)
- curPlayer.Sync_MakeItemAnswer(ShareDefine.Def_mitProduceResult, isSucceed) # 参数为上一次采集是否成功
- return
-
-
-##采集生产结果
-# @param curPlayer 玩家实例
-# @return 采集是否成功
-# @remarks 按策划配置的几率判定是否给玩家物品
-def DoLogic_ProduceResult(curPlayer):
- #防沉迷
- if curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_Wallow_LV) > ChConfig.Def_GameWallow_LV_First:
- PlayerControl.NotifyCode(curPlayer, "AvoidSink09")
- return False
-
- mapID = curPlayer.GetMapID()
-
- if mapID not in Def_PlayerProduceResultDic.keys():
- GameWorld.ErrLog("error: PlayerProduceResult.txt配置错误,PlayerProduceResult(%s) cannot find \
- mapID(%s)"%(Def_PlayerProduceResultDic, mapID))
- return False
-
- produceResultList = Def_PlayerProduceResultDic[mapID]
-
- ranCnt = random.randint(0, 10000) # 随机值
- produceID = 0 # 采集材料ID
- produceCnt = 0 # 采集材料数量
- produceIsBind = 0 # 采集材料是否绑定
-
- for infoList in produceResultList:
-
- if len(infoList) < 4:
- GameWorld.ErrLog("error:PlayerProduceResult.txt配置错误,len(infoList) < 2 (%s)"%produceResultList)
- continue
-
- if ranCnt <= infoList[0]:
- produceID = infoList[1]
- produceCnt = infoList[2]
- produceIsBind = infoList[3]
- break
-
- if produceID <= 0 or produceCnt <= 0:
- #采集失败!
- PlayerControl.NotifyCode(curPlayer, "GeRen_lhs_20296")
- return False
-
- #给玩家物品
- if not ItemControler.GivePlayerItem(curPlayer, produceID, produceCnt, 0, [IPY_GameWorld.rptItem]):
- #背包空间不足!
- PlayerControl.NotifyCode(curPlayer, "Collect_lhs_31379")
- return False
-
- #采集成功!
- #curPlayer.Sync_GetItemView(produceID, produceCnt)
- #PlayerControl.NotifyCode(curPlayer, "GeRen_lhs_827276")
- #PlayerControl.NotifyCode(curPlayer, "ObtainRes01", [produceID, produceCnt])
- return True
-
-##判断玩家是否可以采集生产
-# @param curPlayer 玩家实例
-# @return 玩家是否可以生产
-# @remarks 判断玩家是否可以采集生产
-def __IsCanProduce(curPlayer):
- if curPlayer.GetLV() < ChConfig.Def_ProduceLVMin:
- #等级不足{%S1%}级,不能采集!
- PlayerControl.NotifyCode(curPlayer, "Collect_lhs_287294", [ChConfig.Def_ProduceLVMin])
- return False
-
- if not curPlayer.GetMapBuff().FindBuff(ChConfig.Def_SkillID_Produce):
- #当前区域无法进行采集!
- PlayerControl.NotifyCode(curPlayer, "Collect_lhs_0")
- return False
-
- if curPlayer.IsMoving():
- #移动中不能采集!
- PlayerControl.NotifyCode(curPlayer, "Collect_lhs_474794")
- return False
-
- if curPlayer.GetHP() <= 0:
- #角色死亡不能采集!
- PlayerControl.NotifyCode(curPlayer, "Collect_lhs_70569")
- return False
-
- curPlayerState = curPlayer.GetPlayerAction()
-
- if curPlayerState == IPY_GameWorld.paAttack or curPlayer.IsBattleState():
- #战斗中不能采集!
- PlayerControl.NotifyCode(curPlayer, "Collect_lhs_840854")
- return False
-
- if curPlayerState == IPY_GameWorld.paTrade:
- #交易中不能采集!
- PlayerControl.NotifyCode(curPlayer, "Collect_lhs_59724")
- return False
-
- if curPlayerState == IPY_GameWorld.paSit:
- #调息中不能采集!
- PlayerControl.NotifyCode(curPlayer, "Collect_lhs_293296")
- return False
-
- #有交通工具不让采集
- if curPlayer.GetPlayerVehicle() != IPY_GameWorld.pvNull:
- PlayerControl.NotifyCode(curPlayer, "Collect_max_dante_0")
- return False
-
- if PlayerControl.IsPlanStateNull(curPlayer):
- #空闲状态,可采集
- return True
-
- #您当前所处的状态不能采集!
- PlayerControl.NotifyCode(curPlayer, "Collect_lhs_917284")
- return False
-
-
-#===================================================================================================
-# //03 33 开始制造生产物品#tagCStartProduce
-# tagCStartProduce * GettagCStartProduce();
-#
-# class IPY_CStartProduce
-# {
-# public:
-#
-# //类型
-# int GetType();
-# //物品ID
-# int GetItemID();
-# //制造数量
-# int GetCount();
-# };
-#===================================================================================================
-## 客户端封包响应
-# @param index 玩家索引
-# @param tick 时间戳
-# @return 返回值无意义
-# @remarks 客户端封包响应 //03 33 开始制造生产物品#tagCStartProduce
-def StartProduce(index, tick):
- GameWorld.GetPsycoFunc(__Func_StartProduce)(index, tick)
- return
-
-
-## 客户端封包响应
-# @param index 玩家索引
-# @param tick 时间戳
-# @return 返回值无意义
-# @remarks 客户端封包响应 //03 33 开始制造生产物品#tagCStartProduce
-def __Func_StartProduce(index, tick):
- curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
-
- if not GameWorld.SetPlayerTickTime(curPlayer, ChConfig.TYPE_Player_Tick_ProduceMakeItemTime, tick):
- #间隔未到
- return
-
- #---处理封包---
- pack = IPY_GameWorld.IPY_CStartProduce()
-# curProduceType = pack.GetType() # 类型(与客户端约定0:材料加工;1:丹药合成)
- curProduceItemID = pack.GetItemID() # 物品ID
- curProduceCnt = pack.GetCount() # 制造数量
- useBind = pack.GetUseBind() # 是否使用绑定
- autoBuy = pack.GetAutoBuy() #是否自动购买材料
- if useBind not in [0, 1]:
- return
-
- #{合成后的物品id:[[所需材料id,数量], [所需材料id,数量], [所需材料id,数量]......]}
- composeDic = ReadChConfig.GetEvalChConfig('ProduceCompose')
- if curProduceItemID not in composeDic:
- return
-
- DoLogic_Produce(curPlayer, curProduceItemID, curProduceCnt, composeDic[curProduceItemID], useBind, autoBuy)
- return
-
-
-## 执行材料加工逻辑
-# @param curPlayer:玩家实例
-# @param curProduceItemID:合成后的物品ID
-# @param curProduceCnt:合成物品的数量
-# @param configInfo:合成需求信息列表
-# @param useBind 是否使用绑定
-# @param autoBuy 是否自动购买
-# @return
-def DoLogic_Produce(curPlayer, curProduceItemID, curProduceCnt, configInfo, useBind, autoBuy):
- itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
-
- #(手续费, 概率, [[所需材料id,数量,自动购买价格], [所需材料id,数量,自动购买价格]...],"全服提示",随机饼图物品列表)
- needMoney, successRate, needStuffList, notifyMark, randomItemList = configInfo
- needMoney, moneyType = needMoney*curProduceCnt, IPY_GameWorld.TYPE_Price_Silver_Money
-
- if needMoney > 0 and not PlayerControl.HaveMoney(curPlayer, moneyType, needMoney):
- return
-
- hasEnough, reduceItemList, isBind, autoBuyMoney, eventItemID, eventLackCnt = \
- __ParseStuff(curPlayer, itemPack, curProduceItemID, curProduceCnt, needStuffList, useBind)
- if not hasEnough:
- if not autoBuy:
- #对不起,您的材料不足,操作无效!
- PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_481766")
- return
- else:
- if autoBuyMoney <= 0 or \
- not PlayerControl.HaveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, autoBuyMoney):
- PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_481766")
- return
-
- if autoBuyMoney > 0:
- PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, autoBuyMoney, ChConfig.Def_Cost_BuyStoreItem,
- {"ProduceItemID":curProduceItemID, ChConfig.Def_Cost_Reason_SonKey:eventItemID}, eventLackCnt)
-
- result = 0
- notifyItemID = curProduceItemID
- # 不判断概率,或概率成功
- if successRate <= 0 or GameWorld.CanHappen(successRate, ShareDefine.Def_MaxRateValue):
- proIemCntDict = {}
- # 如果有随机合成物品饼图概率列表
- if randomItemList:
- # 先随机出所有的物品结果,减少生产次数及发包次数
- for i in range(curProduceCnt):
- randItemID = GameWorld.GetResultByRandomList(randomItemList, curProduceItemID)
- proIemCntDict[randItemID] = proIemCntDict.get(randItemID, 0) + 1
- else:
- proIemCntDict[curProduceItemID] = curProduceCnt
-
- for proItemID, proCnt in proIemCntDict.items():
- # 给合成物品不成功
- if not ItemControler.GivePlayerItem(curPlayer, proItemID, proCnt, 0, [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere]):
- #背包空间不足!
- PlayerControl.NotifyCode(curPlayer, "Collect_lhs_31379")
- break
-
- result = 1
- notifyItemID = proItemID
- #你获得xx物品xx个!
- #PlayerControl.NotifyCode(curPlayer, "ObtainRes01", [proItemID, proCnt])
-
- if needMoney > 0:
- PlayerControl.PayMoney(curPlayer, moneyType, needMoney, ChConfig.Def_Cost_ItemProduce,
- {ChConfig.Def_Cost_Reason_SonKey:curProduceItemID})
-
- # 扣除材料
- for stuffList in reduceItemList:
- ItemCommon.ReduceItem(curPlayer, itemPack, stuffList[0], stuffList[1], isBind)
-
- curPlayer.Sync_MakeItemAnswer(ShareDefine.Def_mitMaterialCompound, result)
-
- #按配置发送全服提示信息 参数 玩家名 合成后物品ID
- if notifyMark:
- PlayerControl.WorldNotify(0, notifyMark, [curPlayer.GetPlayerName(), str(notifyItemID)])
- return
-
-
-## 解析材料加工
-# @param curPlayer:玩家实例
-# @param itemPack:物品背包
-# @param curProduceItemID:合成后的物品ID
-# @param curProduceCnt:合成物品的数量
-# @param needStuffInfoList:合成所需材料的信息列表
-# @param useBind 是否使用绑定
-# @return (是否有足够的材料加工, 材料加工物品信息列表)
-# @remarks 解析材料加工
-def __ParseStuff(curPlayer, itemPack, curProduceItemID, curProduceCnt, needStuffInfoList, useBind):
- isEnough = True # 是否有足够的材料
- stuffList = []
- isBind = False
- autoBuyMoney = 0
- eventItemID = 0
- eventLackCnt = 0
-
- #取得绑定标识
- useBindMark = ItemCommon.UseStuffMode_NoBind
- if useBind == 1:
- useBindMark = ItemCommon.UseStuffMode_All
-
- for stuffInfoList in needStuffInfoList:
-
- if len(stuffInfoList) < 3:
- GameWorld.ErrLog("error: curProduceItemID(%s):len(stuffInfoList)< 2 ,\
- %s"%(curProduceItemID, needStuffInfoList))
- isEnough = False
- stuffList = []
- autoBuyMoney = 0
- break
-
- needStuffID = stuffInfoList[0]
- needStuffCnt = stuffInfoList[1] * curProduceCnt
- stuffPrice = PlayerSuperMarket.GetStoreItemPrice(needStuffID, IPY_GameWorld.TYPE_Price_Gold_Money)
-
- hasEnough, useItemList, tmpBind, lackCnt = ItemCommon.GetItem_FromPack_ByID_ExEx(needStuffID, itemPack, \
- needStuffCnt, useBindMark)
- if not hasEnough:
- if stuffPrice <= 0:
- #材料不足且不允许自动购买
- isEnough = False
- stuffList = []
- autoBuyMoney = 0
- break
- else:
- #材料不足并且有自动购买价格
- isEnough = False
- autoBuyMoney = autoBuyMoney + stuffPrice*lackCnt
- eventItemID = needStuffID
- eventLackCnt = lackCnt
-
-
- #如果有一种材料是绑定的则合出来的结果就是绑定
- if not isBind and tmpBind:
- isBind = True
-
- stuffList.append([useItemList, needStuffCnt])
-
- return (isEnough, stuffList, isBind, autoBuyMoney, eventItemID, eventLackCnt)
-
-
-
\ No newline at end of file
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 00d8e46..81a9ade 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
@@ -31,13 +31,9 @@
import ItemCommon
import OperControlManager
import ShareDefine
-import PlayerProduce
import PlayerAutoCheckOnline
import PlayerGameWallow
import ReadChConfig
-import ChPyNetSendPack
-import NetPackCommon
-import DataRecordPack
import PlayerViewCacheTube
import PlayerDienstgrad
import PlayerVip
@@ -565,11 +561,6 @@
elif prepareState == IPY_GameWorld.pstMissionCollecting:
#任务采集
PlayerMissionCollect.EndMissionCollect(curPlayer, tick)
-
- elif prepareState == ShareDefine.Def_PstProduce:
- #生产采集(进入生产采集状态,不再重置玩家状态)
- PlayerProduce.OnProduceEnd(curPlayer, tick)
- return
elif prepareState == ShareDefine.Def_PstTrans:
--
Gitblit v1.8.0