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)
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)
def onPDUReceived(self, pdu): if isinstance(pdu, (ConfirmActivePDU, UpdatePDU, InputPDU)): self.recorder.record(pdu, PlayerMessageType.SLOW_PATH_PDU) SlowPathObserver.onPDUReceived(self, pdu)
def __init__(self, recorder: Recorder): SlowPathObserver.__init__(self) self.recorder = recorder
def __init__(self, log: Logger, layer: Layer, **kwargs): MITMChannelObserver.__init__(self, log, layer, SlowPathObserver(**kwargs))
def onServerPDUReceived(self, pdu: SlowPathPDU): SlowPathObserver.onPDUReceived(self.serverObserver, pdu) if self.state.forwardOutput: self.client.sendPDU(pdu)
def onClientPDUReceived(self, pdu: SlowPathPDU): SlowPathObserver.onPDUReceived(self.clientObserver, pdu) if self.state.forwardInput: self.server.sendPDU(pdu)
def onServerPDUReceived(self, pdu: SlowPathPDU): SlowPathObserver.onPDUReceived(self.serverObserver, pdu) self.client.sendPDU(pdu)