hxp
2024-12-26 b61d2dfe79f9d3ef67a0561a0b640f888df32a58
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
#!/usr/bin/python
# -*- coding: GBK -*-
#
#
##@package QueryDBLogicResult.py
#
# @todo:GameServerÏòDBÇëÇóµÄ»Ø¸´ÐÅÏ¢
 
import PlayerPackData
import IPY_GameServer
import ChConfig
 
#-------------------------------------------------------------------------
 
# //04 08 GameServerÏòDBÇëÇóµÄ»Ø¸´ÐÅÏ¢ tagDGQueryDBLogicResult
 
# struct tagDGQueryDBLogicResult
# {
#     tagHead    Head;
#     BYTE    Result;            //½á¹û£º1³É¹¦£»0ʧ°Ü
#     DWORD    ID;            //²éѯµÄID
#     BYTE    QueryType;        //²éѯµÄÀàÐÍ
#     DWORD    DataLen;
#     char    Data[DataLen];        //Ô­Ñù·µ»ØµÄ¸½¼ÓÊý¾Ý
#     DWORD    ResultSetLen;
#     char    ResultSet[ResultSetLen];    //½á¹û¼¯
# };
 
## DB·µ»Øµ½GameServerÐÅÏ¢
#  @param None None
#  @return None
def RecvDGDBLogicResult(index, tick):
    dbResultPack = IPY_GameServer.IPY_DGQueryDBLogicResult()
    result = dbResultPack.GetResult()  #½á¹û£º1³É¹¦£¬0ʧ°Ü
    if result == 0:
        return
    queryType = dbResultPack.GetQueryType()
    
    if queryType == ChConfig.gstDBLogic_PlayerPackData:
        mirrorID = dbResultPack.GetID()
        playerData = dbResultPack.GetResultSet()
        msgInfo = eval(dbResultPack.GetData())
        PlayerPackData.OnDBPlayerPackData(mirrorID, playerData, msgInfo)
        
    return