hxp
2025-06-04 75e9958b460bee27afb900975a4e35c4cc02b94f
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
82
83
84
ôé?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,    icCsO|stj}nd|}dtj|dtƒ}t|||||ƒdS(Ns    <T>%s</T>s%st ensure_ascii(R!tDefaultLackSpaceMailTypetjsontdumpstFalsetSendMail(t mailTypeKeyR+titemListt    paramListt    limitDaysttitlettext((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyt SendMailByKeyos  
ic
Css|dkrg}ntjƒ}tjddƒ}|j|ƒ}||kr¼|j|ƒ}    |    jdd„ƒtd|dƒ}
t    } d} i} xí| |
kr„|    r„| r„|    j
dƒ}|sÌq˜n|j ƒ}|j ƒ}|t jks|t jkr*|j|ƒr*t} | dkr*Pq*n| d7} tjd|||| fƒ|j||ƒtj||dƒt j| |<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|ƒ}|rot||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( tNoneR R t IpyGameDataPYt
GetFuncCfgtGetPersonalMailCounttGetPersonalMailstsorttmaxR<tpoptGetGUIDR.R!tMailState_UnReadtMailState_ReadR/tTrueRtDebugLogR1RR2R"RR$R3tAddPersonalMailRtlent DR_MailSendR(R+RBRCR?RAtmailTypeRtmailMaxtmailCnttmailListt    oneDelCnttisStoptdelCntR6RRR,RRJtGUIDtaddDict((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyR=xsR         - 
  c    Csàtjƒ}    |    j||||||ƒ}
|
s4|
S|
jƒ} |
j|ƒ|
j|ƒ|
j|ƒ|ssdnd} i|d6|d6|d6|d6|d6|d6|d    6} tj| | | ƒ|sÜt    |
jƒƒn|
S(
s·¢ËÍÈ«·þÓʼþ
    @param guid: ¿É´«Èë¿Õ£¬Ôòϵͳ×Ô¶¯Éú³Éguid
    @param limitLV: ÏÞÖÆ¿ÉÁìµÄ×îµÍµÈ¼¶
    @param limitLVType: µÈ¼¶´ïµ½ºóÊÇ·ñ¿ÉÁ죬ĬÈϲ»¿É
    @param checkState: ÊÇ·ñÐèÒªÉóºË£¬Ä¬Èϲ»ÐèÒª
    @return: None - ·¢ËÍʧ°Ü£» mailObj - ³É¹¦·¢Ë͵ÄÓʼþʵÀý
    tAddt
AddToCheckRMtLimitLVt LimitLVTypet
CheckStateRBRLRN(
R R t AddServerMailRXt
SetLimitLVtSetLimitLVTypet SetCheckStateRRtSync_ServerMail(RRBRCR?RAR`tlimitLVt limitLVTypet
checkStateRRRgt    eventNameRh((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 RRRRRqRRRr(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(RRtGetPlayerByIndexRgtReqTypet    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!RYtSetPlayerMailStateRZR3(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_MailGiveSuccessR^tNotifyGiveAwardInfoR3(RRR+RtguidListt statItemListt statItemDicttisPackSpaceEnoughR6R,R7tneedPackSpaceDictRtmailItemtitemIDt    itemCounttisBindtuserDatat curItemDatatpackTypet    needSpaceRFt 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ÎÞÎïÆ·Óʼþδ¶Á²»ÄÜɾ³ý! %sRx(R†R R RR‡R!R"R/R0RR\RZRˆRR2R3(    RRtisGMR+RR§R6R,R7((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyR~Vs2          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 IsServerMailtMailListR^tCountRRRt OnlineCounttOnlineAttIsNormalPlayertCheckPlayerServerMailStateR!RŽR"t    MailStateR%R&(    RRt
serverMailtpackMailR*t playerManagertiRR,((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyRr{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»R^R¼R%R&(    RRR§RcRRR,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†RXR R R‡t
GetLimitLVtGetLimitLVTypetGetLVRˆtMailState_LimitRY(    RRÂR+RRR,RsRttplayerLV((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™R^R¼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("RXR¸t    tagMCMailRgtGetTypetTypeRRJRRMtGetTitleRKR^tTitleLentGetTextRLtTextLenR 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#ttagMCMailStateRgRÁR™R^R¼(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¸RQRšR%R!R R—R:RRR    RRRRDRPR=RwR{R…R€RR<R~RrRRÀRR·R R3(((siD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerMail.pyt<module>sB                                   6                 ]%