hxp
2025-05-20 19cb460b0381096d917361b4791bc897cf323f21
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
# ÍⲿÏûÏ¢´¦Àí£¬ÈçGMÃüÁ¿ç·þ£¬·ÇÍæ¼Ò·â°ü
#-------------------------------------------------------------------------------
 
from Common import (mylog)
from Protocol import MMORPGPack
from DBCommon import (error, )
from Common import CommFunc
import PyGameData
import GameWorld
 
# C++µ÷ÓàÓ÷â°ü¸ñʽ Í¨Öªmap´¦ÀíDBÊý¾Ý
def RecvPackToMapDB(packBuff):
    pack =  MMORPGPack.MMORPGPacket()
    pack.readData(packBuff)
    if pack is None:
        msg = error.formatMsg('error', error.ERROR_NO_46, 'pack is None')
        mylog.error(msg)
        return False
    if pack.getLength() < 1:
        msg = error.formatMsg('error', error.ERROR_NO_47, 'pack.getLength() < 1 pack head = %s'%pack.getPackHead().outputString())            
        mylog.error(msg)
        return False
 
    #GameWorld.Log("RecvPackToMapDB packlen %s"%len(packBuff))
    PyGameData.g_usrCtrlDB.requestLogicProcess(pack)
 
 
# µØÍ¼×Ô¼ºµ÷Óô¦ÀíDBÊý¾Ý£¬²»Ò»¶¨Òª·ûºÏ·â°ü¸ñʽ£¬PY¸ù¾Ý¹¦ÄÜ×Ô¶¨Òå×é³É·â°ü
def MapCallDB(packBuff, isBuffer = True):
    pack =  MMORPGPack.MMORPGPacket()
    if isBuffer:
        pack.setBuffer(packBuff)    # Ö»ÉèÖÃÊý¾Ý
    else:
        pack.readData(packBuff)     # ÉèÖ÷â°üÍ· ºÍ Êý¾Ý
            
    PyGameData.g_usrCtrlDB.requestLogicProcess(pack)