#!/usr/bin/python # -*- coding: utf-8 -*- import time import sys import Command_py.Command_pb2 import random import struct defaultencoding = 'utf-8' if sys.getdefaultencoding() != defaultencoding: reload(sys) sys.setdefaultencoding(defaultencoding) def UnpackData(msgsize, msgNo, msg): try: if msgNo == 157: return[""] print(" Rev : msgsize:{} msgNo:{} msgNoName:{}".format(msgsize, msgNo, NoToCmd(msgNo))) protocol = NoToCmd(msgNo) if protocol == "ClientCmdNone": return [""] else: if CheckCallBackList(protocol): return CallBack(protocol)(msg) else: print("No Protocol Register CallBack!") return [""] except: return [""] def PackData(messages,proname): #print("send Name:{}",proname) messages_len = len(messages) No = CmdToNo(proname) messagespack = struct.pack('