Send back unknown packets to client as text message
This commit is contained in:
parent
30aa2a81c7
commit
92ebbdf64c
@ -210,7 +210,7 @@ class Netserver(asyncio.DatagramProtocol):
|
|||||||
sack_sent = True
|
sack_sent = True
|
||||||
|
|
||||||
if not session.next_send == cframe.NRecv:
|
if not session.next_send == cframe.NRecv:
|
||||||
logger.error("Received CFRAME (%s) does not have same NRcv (%s). One sent packet might have been lost.", cframe.NRecv, session.CFRAME_NRcv)
|
logger.error("Received CFRAME (%s) does not have same NRcv (%s). One sent packet might have been lost.", cframe.NRecv, session.next_send)
|
||||||
if not sack_sent:
|
if not sack_sent:
|
||||||
session.send_cframe_sack()
|
session.send_cframe_sack()
|
||||||
sack_sent = True
|
sack_sent = True
|
||||||
@ -227,7 +227,7 @@ class Netserver(asyncio.DatagramProtocol):
|
|||||||
return
|
return
|
||||||
#logger.debug("Got a CFrame POLL. Replying with a SACK.")
|
#logger.debug("Got a CFrame POLL. Replying with a SACK.")
|
||||||
# must send back a ACK
|
# must send back a ACK
|
||||||
#session.send_cframe_sack()
|
session.send_cframe_sack()
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.error("Should have been a CFRAME but could not parse it")
|
logger.error("Should have been a CFRAME but could not parse it")
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
@ -380,7 +380,8 @@ class Netserver(asyncio.DatagramProtocol):
|
|||||||
player.session.send_gamedata(b'\x2f\x02\x00\x00\xc2\x00\x00\x00\x00\x00\x00\x00\x00\x00', acknow=True) # unknown
|
player.session.send_gamedata(b'\x2f\x02\x00\x00\xc2\x00\x00\x00\x00\x00\x00\x00\x00\x00', acknow=True) # unknown
|
||||||
"""
|
"""
|
||||||
else:
|
else:
|
||||||
logger.debug("OPCODE: %s VALUES: %s", payload[0], payload[1:])
|
logger.debug("OPCODE: %s VALUES: %s", struct.pack("<B", payload[0]).hex(), payload[1:].hex())
|
||||||
|
await self.server.broadcast_message("SENT OPCODE: %s VALUES: %s" % (struct.pack("<B", payload[0]).hex(), payload[1:].hex()))
|
||||||
|
|
||||||
|
|
||||||
def send_packet(self, addr, packet):
|
def send_packet(self, addr, packet):
|
||||||
|
@ -99,6 +99,8 @@ class Server:
|
|||||||
|
|
||||||
async def broadcast_message(self, text):
|
async def broadcast_message(self, text):
|
||||||
for player in self.players:
|
for player in self.players:
|
||||||
|
if player.name == "[Server]":
|
||||||
|
continue
|
||||||
await player.session.send_gamedata(b'\x35\x80\x81'+text.encode("ascii")+b'\x00\x00')
|
await player.session.send_gamedata(b'\x35\x80\x81'+text.encode("ascii")+b'\x00\x00')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user