hxp
8 天以前 b4488bc3020cf5da3bf9fe4a0b27ba59b2d9f8cc
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/OpenServerActivity.py
@@ -16,8 +16,10 @@
#-------------------------------------------------------------------------------
import DBDataMgr
import PlayerMail
import ShareDefine
import GameFuncComm
import IPY_GameWorld
import IpyGameDataPY
import PlayerTreasure
import PlayerBillboard
@@ -25,9 +27,10 @@
import PlayerControl
import NetPackCommon
import ItemControler
import ItemCommon
import GameWorld
import ChConfig
import ObjPool
import math
# 开服冲榜类型对应功能ID
OSAFuncIDDict = {
@@ -107,7 +110,34 @@
## ------------------------------------------- 开服庆典 ---------------------------------------------
def OnPlayerLogin(curPlayer):
    if GetOSACelebrationState(curPlayer) == 3:
        __autoChangeCelebrationPoint(curPlayer)
        return
    SyncOSACelebrationInfo(curPlayer)
    return
def PlayerOnDay(curPlayer):
    if GetOSACelebrationState(curPlayer) == 3:
        __autoChangeCelebrationPoint(curPlayer)
        return
    return
def __autoChangeCelebrationPoint(curPlayer):
    ## 活动结束后自动转换庆典积分
    unUsePoint = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_OSAPoint)
    if unUsePoint <= 0:
        return
    moneyItemID = ItemCommon.GetMoneyItemID(IPY_GameWorld.TYPE_Price_Gold_Money)
    if not moneyItemID:
        return
    playerID = curPlayer.GetPlayerID()
    oneNeedPoint = IpyGameDataPY.GetFuncCfg("OSACelebration", 3) # 多少积分=1元宝
    changeMoney = int(math.ceil(unUsePoint / float(oneNeedPoint)))
    itemList = [[moneyItemID, changeMoney]]
    GameWorld.DebugLog("自动转化未使用的庆典积分: unUsePoint=%s,oneNeedPoint=%s,changeMoney=%s,itemList=%s"
                       % (unUsePoint, oneNeedPoint, changeMoney, itemList), playerID)
    if PlayerControl.PayMoney(curPlayer, ShareDefine.TYPE_Price_OSAPoint, unUsePoint, "SysClear"):
        PlayerMail.SendMailByKey("OSACelebrationPoint", playerID, itemList)
    return
def GetOSACelebrationState(curPlayer):
@@ -162,7 +192,7 @@
    return
def SyncOSACelebrationInfo(curPlayer):
    clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCOSACelebrationInfo)
    clientPack = ChPyNetSendPack.tagSCOSACelebrationInfo()
    clientPack.PointTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSACelebrationPoint)
    clientPack.PointAward = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSACelebrationAward)
    NetPackCommon.SendFakePack(curPlayer, clientPack)