#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#-------------------------------------------------------------------------------
|
#
|
#-------------------------------------------------------------------------------
|
#
|
##@package Commands.ClearMail
|
#
|
# @todo:Çå³ýËùÓÐδÁìÈ¡Óʼþ
|
# @author hxp
|
# @date 2015-10-26
|
# @version 1.0
|
#
|
# ÏêϸÃèÊö: Çå³ýËùÓÐδÁìÈ¡Óʼþ
|
#
|
#---------------------------------------------------------------------
|
"""Version = 2015-10-26 10:30"""
|
#---------------------------------------------------------------------
|
|
import PlayerCompensation
|
import ChPyNetSendPack
|
import NetPackCommon
|
import GameWorld
|
|
## Ö´ÐÐÂß¼
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param gmList []
|
# @return None
|
def OnExec(curPlayer, gmList):
|
|
curPlayerID = curPlayer.GetPlayerID()
|
mailList = PlayerCompensation.SeekPlayerCompensation(curPlayer)
|
for i, mail in enumerate(mailList):
|
GUID = mail[0]
|
curPersonalCompensation = GameWorld.GetCompensationMgr().FindPersonalCompensation(curPlayerID, GUID)
|
if curPersonalCompensation.PlayerID == curPlayerID:
|
compensationType = PlayerCompensation.Personal_CompensationType
|
else:
|
curEntireRequire = GameWorld.GetCompensationMgr().FindEntireCompensation(GUID)
|
if curEntireRequire.GUID != GUID:
|
continue
|
compensationType = PlayerCompensation.Entire_CompensationType
|
PlayerCompensation.GiveCompensationSuccess(curPlayer, GUID, compensationType, True)
|
|
sendMCPack = ChPyNetSendPack.tagMCGiveCompensationResult()
|
sendMCPack.GUID = GUID
|
sendMCPack.Result = 1
|
NetPackCommon.SendFakePack(curPlayer, sendMCPack)
|
GameWorld.DebugAnswer(curPlayer, 'clearMail i=%s,GUID=%s,Type=%s' % (i, GUID, compensationType))
|
return
|
|
|