示例#1
0
    def onClientPDUReceived(self, pdu: SlowPathPDU):
        self.statCounter.increment(STAT.IO_INPUT_SLOWPATH)
        SlowPathObserver.onPDUReceived(self.clientObserver, pdu)

        if self.state.forwardInput:
            self.server.sendPDU(pdu)

        if not self.state.loggedIn:
            if isinstance(pdu, InputPDU):
                for event in pdu.events:
                    if isinstance(event, KeyboardEvent):
                        self.onScanCode(event.keyCode, event.flags & KeyboardFlag.KBDFLAGS_DOWN == 0, event.flags & KeyboardFlag.KBDFLAGS_EXTENDED != 0)
示例#2
0
    def onServerPDUReceived(self, pdu: SlowPathPDU):
        self.statCounter.increment(STAT.IO_OUTPUT_SLOWPATH)
        SlowPathObserver.onPDUReceived(self.serverObserver, pdu)

        if self.state.forwardOutput:
            self.client.sendPDU(pdu)
示例#3
0
 def onPDUReceived(self, pdu):
     if isinstance(pdu, (ConfirmActivePDU, UpdatePDU, InputPDU)):
         self.recorder.record(pdu, PlayerMessageType.SLOW_PATH_PDU)
     SlowPathObserver.onPDUReceived(self, pdu)
示例#4
0
 def __init__(self, recorder: Recorder):
     SlowPathObserver.__init__(self)
     self.recorder = recorder
示例#5
0
 def __init__(self, log: Logger, layer: Layer, **kwargs):
     MITMChannelObserver.__init__(self, log, layer,
                                  SlowPathObserver(**kwargs))
示例#6
0
    def onServerPDUReceived(self, pdu: SlowPathPDU):
        SlowPathObserver.onPDUReceived(self.serverObserver, pdu)

        if self.state.forwardOutput:
            self.client.sendPDU(pdu)
示例#7
0
    def onClientPDUReceived(self, pdu: SlowPathPDU):
        SlowPathObserver.onPDUReceived(self.clientObserver, pdu)

        if self.state.forwardInput:
            self.server.sendPDU(pdu)
示例#8
0
 def onServerPDUReceived(self, pdu: SlowPathPDU):
     SlowPathObserver.onPDUReceived(self.serverObserver, pdu)
     self.client.sendPDU(pdu)