hxp
7 天以前 8a132929e7184bc274b742d3e25b93782c65e9ef
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
from Protocol import SendPackProtocol
from Common import mylog
from DBCommon import CommonDefine
import NetPackCommon
from Commands import GMCommon
DBConfig = __import__('Config.DBConfig')
import json
################################################################## 
                ####### ÌṩµÄ½Ó¿Ú ######
 
    
#»Ø¸´¸øServersRoute->GM¹¤¾ß ÃüÁîÖ´Ðнá¹û°ü
def SendToGMToolCommandResult(orderID, resultMsg, UserData = ''):
    if isinstance(resultMsg, unicode):
        #Ö±½Ó´ÓÊý¾Ý¿âδ½øÐÐת»¯µÄ»°ÊÇunicode
        resultMsg = resultMsg.encode(DBConfig.encoding)
        
    recvPack = SendPackProtocol.tagGMCommandResult()
    recvPack.Type = CommonDefine.gstGMToolCommandResult 
    recvPack.OrderLen = len(orderID)
    recvPack.OrderId = orderID
    recvPack.ResultLen     = len(resultMsg)
    recvPack.Result        = resultMsg
    recvPack.UserDataLen   = len(UserData)
    recvPack.UserData      = UserData
 
    NetPackCommon.SendPyPackToServersRoute(recvPack.GetBuffer(), recvPack.GetLength())
    mylog.info('ProjSpecialProcess SendToGMToolCommandResult OrderId = %s'%orderID) 
 
 
 
      
##################################################################