hxp
2025-10-09 960ca463237a899293b2d20dcb94de541c11e237
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
ˆnçhc@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z ddl Z ddl Z d„Zd„Zd„Zdd„Zd„Zgdd    „Zddd
d „Zddd
d
d
d
d „Zd „Zd„Zd„Zd„Zed
d„Zd„Zd„Zd„Zdd„Z d„Z!d„Z"d„Z#dS(iÿÿÿÿNcCst|ƒt|ƒdS(N(tSync_PlayerServerMailtSync_PersonalMail(t    curPlayer((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyt OnPlayerLogin"s
 
cCs*ttjƒƒ}t|ƒt|ƒdS(N(tintttimetDelTimeoutServerMailtDelTimeoutPersonalMail(tcurTime((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pytOnDayEx's
 
cCs˜tjƒ}|jƒ}xy|D]q}|j|ƒ}|s@qntj|jƒƒ}||jƒddd}||krƒqnt|dƒqWdS(NiiitTimeout(    t    DBDataMgrt
GetMailMgrtGetServerMailGuidst GetServerMailt    GameWorldtChangeTimeStrToNumt GetCreateTimet GetLimitDayst DelServerMail(RtmailMgrtserverMailGuidstguidtmailObjt
createTimet    limitTime((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyR-s    tc    CsÊtjd|ƒtjƒ}|j|ƒ}tj|d|ƒ|sJdStjƒ}tit    j
|6ƒ}xW|j ƒD]I\}}|t    j
kršqyn|j |ƒ}|ryt j||ƒqyqyWdS(Nsɾ³ýÈ«·þÓʼþ: %stDelete(RtLogR R RtDataRecordPackt DR_ServerMailtGetPlayerManagert__packMailStateChanget ShareDefinet MailState_DeltitemstFindPlayerByIDt NetPackCommont SendFakePack(    RtdelEventRtplayerStateDictt    playerMgrt
clientPacktplayerIDt    mailStateR((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyR?s  c Cs<tjƒ}|jƒ}x|jƒD]\}}i}xÃ|jƒD]µ\}}tj|jƒƒ}||jƒddd}    ||    kr“qDn|jƒ}
|j    |ƒ} | rÉ|
t
j krÉqDn|j ||ƒt j||dƒt
j||<qDW|s    q%ntjƒj|ƒ} | r%t| |ƒq%q%WdS(NiiiR
(R R tGetAllPersonalMailDictR#RRRRt GetMailStatetGetMailItemCountR!t MailState_GottDelPersonalMailRt
DR_MailDelR"RR$tSync_PlayerMailState( RRtpersonalMailDictR+tmailDicttnotifyGUIDStateRRRRR,t mailItemCountR((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyRPs,    icCsh|stj}nd|}dtjg|D]}t|ƒ^q,dtƒ}t|||||ƒdS(Ns    <T>%s</T>s%st ensure_ascii(R!tDefaultLackSpaceMailTypetjsontdumpststrtFalsetSendMail(t mailTypeKeyR+titemListt    paramListt    limitDaysttitletpttext((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyt SendMailByKeyos  
2ic
Cs°|dkrg}nt|tƒrRg|jƒD]\}}||g^q1}ntjƒ}tjddƒ}    |j|ƒ}
|
|    krù|j    |ƒ} | j
dd„ƒt d|    dƒ} t } d}i}xí|| krÁ| rÁ| rÁ| j dƒ}|s    qÕn|jƒ}|jƒ}|tjksN|tjkrg|j|ƒrgt} |dkrgPqgn|d7}tjd|||| fƒ|j||ƒtj||dƒtj||<qÕW|rùtjƒj|ƒ}|röt||ƒqöqùn|j||||||ƒ}|jƒ}|jƒ}i|d    6|d
6|d 6|d 6|d 6t |ƒd6}tj!|||ƒtjƒj|ƒ}|r¬t"||jƒgƒndS(Nt PersonalMailitkeycSs|jƒ |jƒfS(N(R.R(tm((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyt<lambda>…si
is<ϵͳ×Ô¶¯É¾³ýÓʼþ: playerID=%s,guid=%s,mailState=%s,isStop=%stMaxCountLimiitt
CreateTimetTitletTextt    LimitDaystItemListt ItemListLen(#tNonet
isinstancetdictR#R R t IpyGameDataPYt
GetFuncCfgtGetPersonalMailCounttGetPersonalMailstsorttmaxR=tpoptGetGUIDR.R!tMailState_UnReadtMailState_ReadR/tTrueRtDebugLogR1RR2R"RR$R3tAddPersonalMailRtlent DR_MailSendR(R+RCRER@RBtmailTypetitemIDt    itemCountRtmailMaxtmailCnttmailListt    oneDelCnttisStoptdelCntR6RRR,RRLtGUIDtaddDict((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyR>ysV     .    - 
  c    Cs2|d
krg}nt|tƒrRg|jƒD]\}    }
|    |
g^q1}ntjƒ} | j||||||ƒ} | s†| S| jƒ} | j|ƒ| j    |ƒ| j
|ƒ|sÅdnd}i|d6|d6|d6|d6|d6|d6|d    6}t j | ||ƒ|s.t | jƒƒn| S( sw·¢ËÍÈ«·þÓʼþ
    @param guid: ¿É´«Èë¿Õ£¬Ôòϵͳ×Ô¶¯Éú³Éguid
    @param itemList: ÔªËØÖ§³Ö×Öµä{itemID:itemCount, ...} »òÁбí [itemID, itemCount, ¿ÉÑ¡ÊÇ·ñÅÄÆ·, ÎïÆ·UserData]
    @param limitLV: ÏÞÖÆ¿ÉÁìµÄ×îµÍµÈ¼¶
    @param limitLVType: µÈ¼¶´ïµ½ºóÊÇ·ñ¿ÉÁ죬ĬÈϲ»¿É
    @param checkState: ÊÇ·ñÐèÒªÉóºË£¬Ä¬Èϲ»ÐèÒª
    @return: None - ·¢ËÍʧ°Ü£» mailObj - ³É¹¦·¢Ë͵ÄÓʼþʵÀý
    tAddt
AddToCheckROtLimitLVt LimitLVTypet
CheckStateRCRNRPN(RRRSRTR#R R t AddServerMailR\t
SetLimitLVtSetLimitLVTypet SetCheckStateRRtSync_ServerMail(RRCRER@RBRdtlimitLVt limitLVTypet
checkStateReRfRRRmt    eventNameRn((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyt SendSeverMail±s&         .     cCsxtjƒ}|j|ƒ}|s%dS|s<t|dƒdStjd|ƒ|jdƒtj|dƒt    |ƒdS(NtGMDelsÈ«·þÓʼþÉóºËͨ¹ý: %sitCheckOK(
R R RRRRRwRRRx(RtisOKRR((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pytCheckServerMailResultÎs   
cCsptjƒj|ƒ}|j}|j}|dkrCt||ƒn)|dkr_t||ƒn t||ƒdS(Nii(RRtGetPlayerByIndexRmtReqTypet    doMailDeltdoMailGetAwardt
doMailRead(tindext curPackDatattickRRtreqType((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyt OnRequestMailçs           cCsv|s
dS|jƒ}tjƒ}|j||ƒ}|tjkr^|j||tjƒ}nt|i||6ƒdS(N(    t GetPlayerIDR R tGetPlayerMailStateR!R]tSetPlayerMailStateR^R3(RRR+RR,((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyR†õs  cCsæ|jƒ}tjƒ}|s0|j|ƒ}n    |g}g}i}t}i}xø|D]ð}|j||ƒ}    |    tjksŽ|    tjkr®t    j
d|    |f|ƒqXn|j |ƒ}
|
sÝt    j
d||ƒqXni} x$t |
ƒD]} |j || ƒ} | jƒ}| jƒ}| jƒ}| jƒ}t    jƒj|ƒ}|sYqðntj|ƒ}|r|j||||gƒd}n\||f}||krÂd||<|j|ƒn|||||<tj||||ƒ}| j|dƒ|| |<qðWt    j
d|| fƒxU| jƒD]G\}}|tj|||ƒkr.tj|d|gƒt}Pq.q.W|sƒPn|j ||tjƒ||<x–t |
ƒD]ˆ} |j || ƒ} | jƒ}| jƒ}| jƒ}| jƒ}tj!||||t"j#gdtj$ti|d6gƒs¬q¬q¬q¬Wt%j&||ƒqXWg}xd|D]\}t'|ƒd    kr¨|\}}|j|dƒ}|j|||gƒqY|j|ƒqYW|rÕtj(||d
ƒnt)||ƒdS( Ns)Óʼþ״̬ÒÑÁìÈ¡»ò²»ÄÜÁìÈ¡! mailState=%s,%ssÓʼþûÓÐÎïÆ·¿ÉÁìÈ¡! %siis     guid=%s,needPackSpaceDict=%stGeRen_chenxin_676165teventtMailGUIDitMail(*RŒR R tGetPersonalMailGuidsR_RR!tMailState_UnknownR0RR`R/tranget GetMailItemAtt    GetItemIDtGetCountt    GetIsBindt GetUserDatat GetGameDatatGetItemByTypeIDtChConfigtGetItemPackTypetappendt ItemControlertGetItemNeedPackCounttgetR#t
ItemCommontGetItemPackSpacet PlayerControlt
NotifyCodeR=RŽtGivePlayerItemt IPY_GameWorldtrptItemt ItemGive_MailRtDR_MailGiveSuccessRbtNotifyGiveAwardInfoR3(RRR+RtguidListt statItemListt statItemDicttisPackSpaceEnoughR6R,R7tneedPackSpaceDictR‡tmailItemReRftisBindtuserDatat curItemDatatpackTypet    needSpaceRHt giveItemInfotstatItem((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyR…sŠ                 
 
   c    CsI|r|jƒ}ntjƒ}|s9|j|ƒ}n    |g}i}xä|D]Ü}|j||ƒ}|tjkr|qOn|só|j|ƒ}|rÀ|tjkrÀt    j
d||ƒqOn| ró|tj krót    j
d||ƒqOqón|j ||tjƒ||<|rOt j||dƒqOqOW|rEt||ƒndS(NsÓÐÎïÆ·ÓʼþδÁìÈ¡²»ÄÜɾ³ý! %ssÎÞÎïÆ·Óʼþδ¶Á²»ÄÜɾ³ý! %sR~(RŒR R R“RR!R"R/R0RR`R^RŽRR2R3(    RRtisGMR+RR­R6R,R7((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyR„^s2          c    Cstjƒ}|j|ƒ}|s%dSt|ƒ}tjƒ}d|_|g|_t|jƒ|_    t
j ƒ}xŠt |j ƒƒD]v}|j|ƒ}t
j|ƒs­qƒnt||ƒ}|tjksƒ|tjkràqƒn||_tj||ƒqƒWdS(Ni(R R Rt __packMailObjtChPyNetSendPackt tagMCMailListt IsServerMailtMailListRbtCountRRR•t OnlineCounttOnlineAttIsNormalPlayertCheckPlayerServerMailStateR!R”R"t    MailStateR%R&(    RRt
serverMailtpackMailR*t playerManagertiRR,((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyRxƒs(             c    Cs÷tjƒ}|jƒ}|s"dSg}x~|D]v}|j|ƒ}|sPq/nt||ƒ}|tjks/|tjkrƒq/nt|ƒ}||_    |j
|ƒq/W|s³dSt j ƒ}d|_ ||_t|jƒ|_tj||ƒdS(Ni(R R R RRÄR!R”R"R»RÅRŸR¼R½R¾R¿RbRÀR%R&(    RRR­RiRRR,tmailR*((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyRŸs.                 c    CsÕ| s|jƒrtjS|jƒ}|jƒ}tjƒ}|j||ƒ}|tjkrc|Stj}|jƒ}|j    ƒ}|j
ƒ}||kr¿|s¸|j ||tj ƒStjS|j ||tj ƒS(N(t GetCheckStateR!R”RŒR\R R Rt
GetLimitLVtGetLimitLVTypetGetLVRŽtMailState_LimitR](    RRÆR+RRR,RyRztplayerLV((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyRľs"           cCsÏ|jƒ}tjƒ}|s0|j|ƒ}n|s:dStjƒ}g|_xW|D]O}|j||ƒ}|szqVnt|ƒ}|j    ƒ|_
|jj |ƒqVWt |jƒ|_ tj||ƒdS(N(RŒR R R“R¼R½R¿tGetPersonalMailR»R.RÅRŸRbRÀR%R&(RR­R+RR*RRRÊ((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyRØs$         cCs`|jƒ}tjƒ}||_|jƒ|_|jƒ|_|jƒ|_    |j
ƒ|_ t |j ƒ|_ |jƒ|_t |jƒ|_tjƒ}|j|ƒ}xœt|ƒD]Ž}|j||ƒ}|sÜq¸ntjƒ}|jƒ|_|jƒ|_|jƒ|_|jƒ|_t |jƒ|_|j j!|ƒq¸Wt |j ƒ|_|S(N("R\R¼t    tagMCMailRmtGetTypetTypeRRLRROtGetTitleRMRbtTitleLentGetTextRNtTextLenR R R/R•R–t tagMCMailItemR—tItemIDR˜RÀR™tIsBindRštUserDatat UserDataLentItemsRŸ(RRRÊRR7R‡R²titem((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyR»ðs2        cCsvtjƒ}g|_xH|jƒD]:\}}tjƒ}||_||_|jj|ƒq"Wt|jƒ|_    |S(N(
R¼ttagMCMailStateChangeR¿R#ttagMCMailStateRmRÅRŸRbRÀ(R6R*RR,RÊ((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyR  s              cCs$|s
dStj|t|ƒƒdS(N(R%R&R (RR6((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyR3s($RR£R¥R¨RR¼RUR R%R!R RR:RRR    RRRRFRRR>R}RR‹R†R…R=R„RxRRÄRR»R R3(((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyt<module>sB                               
8                 ]%