hxp
2025-10-22 1b0fc76fb9556fe8f8344d67af2897230b53edbd
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
81
Èoì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ƒ}x|D]w}|j|ƒ}|s@qntj|jƒƒ}tj||ƒd}|jƒ}||kr‰qnt    |dƒqWdS(NitTimeout(
t    DBDataMgrt
GetMailMgrtGetServerMailGuidst GetServerMailt    GameWorldtChangeTimeStrToNumt GetCreateTimet GetDiff_Dayt GetLimitDayst DelServerMail(RtmailMgrtserverMailGuidstguidtmailObjt
createTimetpassDayst    limitDays((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ƒƒ}tj||ƒd}    |jƒ}
|    |
kr™qDn|j    ||ƒt
j ||dƒt j ||<qDW|sÙq%ntjƒj|ƒ} | r%t| |ƒq%q%WdS(NiR
(R R tGetAllPersonalMailDictR%RRRRRtDelPersonalMailRt
DR_MailDelR#R$R!R&tSync_PlayerMailState( RRtpersonalMailDictR-tmailDicttnotifyGUIDStateRRRRRR((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyRQs&    icCsh|stj}nd|}dtjg|D]}t|ƒ^q,dtƒ}t|||||ƒdS(Ns    <T>%s</T>s%st ensure_ascii(R#tDefaultLackSpaceMailTypetjsontdumpststrtFalsetSendMail(t mailTypeKeyR-titemListt    paramListRttitletpttext((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyt SendMailByKeyqs  
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(t GetMailStateR(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;tpoptGetGUIDRFR#tMailState_UnReadtMailState_ReadtGetMailItemCounttTrueRtDebugLogR0RR1R$R!R&R2tAddPersonalMailRtlent DR_MailSendR(R-R@RBR>RtmailTypetitemIDt    itemCountRtmailMaxtmailCnttmailListt    oneDelCnttisStoptdelCntR5RRR.RRJtGUIDtaddDict((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyR<{sV     .    - 
  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
AddToCheckRMtLimitLVt LimitLVTypet
CheckStateR@RLRNN(RPRQRRR%R R t AddServerMailRZt
SetLimitLVtSetLimitLVTypet SetCheckStateRR tSync_ServerMail(RR@RBR>RRctlimitLVt limitLVTypet
checkStateRdReRRRlt    eventNameRm((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 RRRRRvRR Rw(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(RR!tGetPlayerByIndexRltReqTypet    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\R2(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ƒ}d}|r#yt"|ƒ}Wq#d}q#Xntj#||||t$j%gdtj&ti|d6gd    |ƒs¬q¬q¬q¬Wt'j(||ƒqXWg}xd|D]\}t)|ƒd
krÝ|\}}|j|dƒ}|j|||gƒqŽ|j|ƒqŽW|r
tj*||d ƒnt+||ƒdS( Ns)Óʼþ״̬ÒÑÁìÈ¡»ò²»ÄÜÁìÈ¡! mailState=%s,%ssÓʼþûÓÐÎïÆ·¿ÉÁìÈ¡! %siis     guid=%s,needPackSpaceDict=%stGeRen_chenxin_676165teventtMailGUIDt setAttrDictitMail(,R‹R R tGetPersonalMailGuidsR^RŒR#tMailState_Unknownt MailState_GotRR_R]tranget GetMailItemAtt    GetItemIDtGetCountt    GetIsBindt GetUserDatat GetGameDatatGetItemByTypeIDtChConfigtGetItemPackTypetappendt ItemControlertGetItemNeedPackCounttgetR%t
ItemCommontGetItemPackSpacet PlayerControlt
NotifyCodeR;RRPtevaltGivePlayerItemt IPY_GameWorldtrptItemt ItemGive_MailRtDR_MailGiveSuccessRatNotifyGiveAwardInfoR2(RRR-RtguidListt statItemListt statItemDicttisPackSpaceEnoughR5R.t mailItemCounttneedPackSpaceDictR†tmailItemRdRetisBindtuserDatat curItemDatatpackTypet    needSpaceRER‘t 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]R•RR_R\RRR1R2(    RRtisGMR-RR¯R5R.R³((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyRƒes2          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 IsServerMailtMailListRatCountRR!R–t OnlineCounttOnlineAttIsNormalPlayertCheckPlayerServerMailStateR#R”R$t    MailStateR'R((    RRt
serverMailtpackMailR,t playerManagertiRR.((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyRwŠ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ÂRaRÃR'R((    RRR¯RhRRR.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‹RZR R RŒt
GetLimitLVtGetLimitLVTypetGetLVRtMailState_LimitR[(    RRÉR-RRR.RxRytplayerLV((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¾RFRÈR RaRÃ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("RZR¿t    tagMCMailRltGetTypetTypeRRJRRMtGetTitleRKRatTitleLentGetTextRLtTextLenR R R]R–R—t tagMCMailItemR˜tItemIDR™RÃRštIsBindR›tUserDatat UserDataLentItemsR (RRRÍRR³R†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%ttagMCMailStateRlRÈR RaRÃ(R5R,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"(RR5((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyR2s($RR¤R¦RªRR¿RSR¡R'R#R RžR8RRR    RRRRCRPR<R|R€RŠR…R„R;RƒRwRRÇRR¾R"R2(((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyt<module>sB                                
8                 b%