예제 #1
0
    def protocol_state_E2(self, value, param1, param2, is_last_package):
        print("[*]Protocol State E2:Value={0},Param1={1},Param2={2}".format(
            value, param1, param2))

        sendCTUnit = FBot.make_package(1105, "自定义协议哦", "是的", "没错")
        retCTUnitArray = [sendCTUnit]
        return retCTUnitArray
예제 #2
0
    def protocol_state_C2(self, value, param1, param2, is_last_package):
        print("[*]Protocol State C2:Value={0},Param1={1},Param2={2}".format(
            value, param1, param2))

        strNowTime = time.strftime("%y-%m-%d %H:%M:%S", time.localtime())
        sendCTUnit = FBot.make_package(
            1103, "", "", "插件2模块计算结果为:{0} [{1}]".format(value, strNowTime))
        retCTUnitArray = [sendCTUnit]
        return retCTUnitArray
예제 #3
0
파일: brain_side.py 프로젝트: afcentry/Test
def listen_request_exec_callback(peerName, value, param1, param2,
                                 is_last_package):
    print(
        "[*]Listen Request Exec Callback:PeerName={0},Value={1},Param1={2},Param2={3}"
        .format(peerName, value, param1, param2))
    sendCTUnit = FBot.make_package(OP_ACTION_BRAIN_SUB_CMD_REPLY_REQUEST_EXEC,
                                   "Do Add Task", "100", "200")
    retCTUnitArray = [sendCTUnit]
    return retCTUnitArray
예제 #4
0
def connect_request_exec_callback(value, param1, param2, is_last_package):
    print("[*]Connect Request Callback:Value={0},Param1={1},Param2={2}".format(
        value, param1, param2))
    if "Add" in value:
        c = int(param1) + int(param2)
    else:
        c = -99999
    strNowTime = time.strftime("%y-%m-%d %H:%M:%S", time.localtime())
    sendCTUnit = FBot.make_package(OP_ACTION_BRAIN_SUB_CMD_REPLY_EXEC_RESULT,
                                   "", "",
                                   "插件模块计算结果为:{0} [{1}]".format(c, strNowTime))
    retCTUnitArray = [sendCTUnit]
    return retCTUnitArray
예제 #5
0
파일: brain_side.py 프로젝트: afcentry/Test
def protocol_state_B(peerName, value, param1, param2, is_last_package):
    '''
    回调处理函数
    :param peerName: 回调任务远端节点名称
    :param value: 参数Value,内容由用户根据协议自定义
    :param param1: 参数Value,内容由用户根据协议自定义
    :param param2: 参数Value,内容由用户根据协议自定义
    :param is_last_package: 是否是最后一个数据包(处理的数据包可能是一批,也可能是单个)
    :return: 处理完成后需要发送应答的数据包或数据包List集合
    '''
    #print("[*]Protocol State B:PeerName={0},Value={1},Param1={2},Param2={3}".format(peerName, value,param1, param2))
    sendCTUnit = FBot.make_package(902, str(time.time()), "", "")
    retCTUnitArray = [sendCTUnit]
    return retCTUnitArray
예제 #6
0
파일: brain_side.py 프로젝트: afcentry/Test
def protocol_state_E2(peerName, value, param1, param2, is_last_package):
    print("[*]Protocol State E2:PeerName={0},Value={1},Param1={2},Param2={3}".
          format(peerName, value, param1, param2))
    sendCTUnit = FBot.make_package(1106, "", "", "")
    retCTUnitArray = [sendCTUnit]
    return retCTUnitArray
예제 #7
0
 def protocol_state_B2(self, peerName, value, param1, param2, is_last_package):
     # print("[*]Protocol State B2:PeerName={0},Value={1},Param1={2},Param2={3}".format(peerName, value,param1, param2))
     sendCTUnit = FBot.make_package(1102, str(time.time()), "", "")
     retCTUnitArray = [sendCTUnit]
     return retCTUnitArray
예제 #8
0
    def protocol_state_A2(self, value, param1, param2, is_last_package):
        # print("[*]Protocol State A2:Value={0},Param1={1},Param2={2}".format(value,param1,param2))

        sendCTUnit = FBot.make_package(1101, "", "", "")
        retCTUnitArray = [sendCTUnit]
        return retCTUnitArray