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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package SaveDataConfig
#
# @todo: ´ËÎļþ·ÏÆú
# @author LYG
# @date 2012-10-22 10:00
# @version 1.1
#
# ------------warning: Á÷Ïò¼Ç¼дÈëÎÊÌâ-------------------
#1.²»ÒªÐ´¸÷ÖÖÊý¾Ý¿âµÄ¹Ø¼ü×Ö£¨»áʹÓõ½¶àÖÖÊý¾Ý¿â£©
#2.ÿÈÕдÈë×Ö·û´®Ä¬ÈÏ '0'
#3.ÔÚͬһÖÖÁ÷ÏòÀàÐÍÖУ¬×Ö¶ÎkeyµÄ¸öÊýºÍÖµÀàÐÍҪͳһ£¬Èç
#  a)Ò»¸öдÁË5¸öÔªËØ£¬ÁíÒ»¸öд7¸ö, ÀàËÆitem0,item1,item2£¬»òÕßÒÅ©
#    ÈçÐ踽¼Ó×ֵ䣬ͳһÔÚº¯ÊýÖÐʹÓà'ExDict':'"{'item0':1,...}", È«²¿°üº¬ÔÚÖµÖÐ
#  b)ֵͳһÀàÐÍÈç item:1 ºÍ item:'1', ²»ÄÜ´«²»Í¬µÄ²ÎÊýÀàÐÍ£¬ÕûÊýºÍ×Ö·û´®¶þÑ¡1
#
# ÏêϸÃèÊö: º¯ÊýÃüÃû¹æÔòÒÔDR_¿ªÍ·. Êý¾Ý¼Ç¼DR = data record
# ¾¯¸æ£ºÕâÀïÌáµ½µÄEventShell, ²»ÊÇÖ¸ÈÎÎñʼþ£¬Ö»ÊÇͬÃû¶øÒÑ
 
# @change: "2013-12-26 20:20" Alee ´ËÎļþ·ÏÆú
#------------------------------------------------------------------------------ 
"""Version = 2013-12-26 20:20"""
 
import GameWorld
import datetime
#===============================================================================
##·¢ËÍʼþ¼Ç¼¸øEventShell
# @param eventTypeStr: Ê¼þÀàÐͱêʶ
# @param dataDict: Ê¼þ×Öµä
# @return None
def SendEventPack(eventTypeStr, dataDict):
 
    dataDict["time"] = str(datetime.datetime.today()).split(".")[0]
    
    dataStr = str(dataDict)
    GameWorld.GetGameWorld().EventShell_SendEventEx(eventTypeStr, len(eventTypeStr), dataStr, len(dataStr))
    return
 
 
#GameServer ÏµÄDataRecordPack, GameServerÏÂÓÐÐÂÊý¾ÝÁ÷Ïò,ÔÚÕâÀïÌí¼Ó-----------------------------------
## GameServerϵÄÊý¾Ý
#  @param None
#  @return 
def DR_SendGameServerData():
    sendConfigDict = {}  
 
    #Ñ­»·¼Ç¼
    for dataName, dataDict in sendConfigDict.items():
        SendEventPack(dataName, dataDict)
        
    return
    
 
#MapServer ÏµÄDataRecordPack, MapServerÏÂÓÐÐÂÊý¾ÝÁ÷Ïò,ÔÚÕâÀïÌí¼Ó-----------------------------------
## MapServerϵÄÊý¾Ý
#  @param None
#  @return 
def DR_SendMapServerData():
    
    sendConfigDict = {}
    
    #Ñ­»·¼Ç¼
    for dataName, dataDict in sendConfigDict.items():
        SendEventPack(dataName, dataDict)
        
    return
 
 
 
#â¹ûÊý¾Ý-------------------------------------------------------------------
#OnDay
#Àý×ÓEventShellProxy.GetEventShellProxy().SendEvent(1, "1111\x00111",8)
## OnDayµ÷ÓÃͳ¼ÆÊý¾Ý·¢¸øEventServer
#  @param None
# @return None
#def DR_MGData():
#    
#    job_Count = 4
#    
#    dataDict = {u'LV': 0, u'count': 0, u'SilverSum': 0, u'SilverAve': 0, 'time': '0'}
#    #ͳ¼Æ²»Í¬Ö°ÒµµÄÐÅÏ¢
#    for i in range(job_Count):
#        SendEventPack("SumJobLVInfo_%s"%i, dataDict)
#        
#    return
 
 
## ¼Ç¼Á÷Ïò
#  @param None
#  @return 
def OnDaySaveData():
    
    #DR_SendGameServerData()
    #DR_SendMapServerData()
    #DR_MGData()
    return