hxp
2023-09-20 32f4634e85aa6a476ee6e911cc5a81a64c912bd6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -262,6 +262,40 @@
    
    return
#// A1 20 货币兑换 #tagCMMoneyExchange
#
#struct    tagCMMoneyExchange
#{
#    tagHead         Head;
#    BYTE        SrcMoneyType;    // 源货币类型
#    BYTE        TagMoneyType;    // 目标货币类型
#    DWORD        ExchangeValue;    // 兑换数量(消耗源货币的数量)
#};
def OnMoneyExchange(index, clientData, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    srcMoneyType = clientData.SrcMoneyType
    tagMoneyType = clientData.TagMoneyType
    exchangeValue = clientData.ExchangeValue
    exchangeMoneyInfo = IpyGameDataPY.GetFuncEvalCfg("EqualValueMoney", 1, {})
    if str(srcMoneyType) not in exchangeMoneyInfo:
        return
    exchangeInfo = exchangeMoneyInfo[str(srcMoneyType)]
    if tagMoneyType != exchangeInfo[0]:
        return
    multiple = exchangeInfo[1]
    if exchangeValue <= 0:
        return
    if not PlayerControl.PayMoney(curPlayer, srcMoneyType, exchangeValue, "MoneyExchange"):
        return
    tagMoneyAdd = exchangeValue * multiple
    PlayerControl.GiveMoney(curPlayer, tagMoneyType, tagMoneyAdd, "MoneyExchange")
    GameWorld.Log("货币兑换: srcMoneyType=%s,exchangeValue=%s,tagMoneyType=%s,tagMoneyAdd=%s"
                  % (srcMoneyType, exchangeValue, tagMoneyType, tagMoneyAdd), curPlayer.GetPlayerID())
    return
#// A1 21 תְҵ #tagCMChangeJob
#
#struct    tagCMChangeJob