From b8c2b50c48a59ee83b057d65f82c44b868637794 Mon Sep 17 00:00:00 2001 From: Little Cat Date: Tue, 10 Jan 2023 22:45:55 -0400 Subject: [PATCH] distributed: Add _getMsgName for verbose logging --- otp/distributed/OTPInternalRepository.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/otp/distributed/OTPInternalRepository.py b/otp/distributed/OTPInternalRepository.py index 6b3fc93..4341a48 100644 --- a/otp/distributed/OTPInternalRepository.py +++ b/otp/distributed/OTPInternalRepository.py @@ -1,6 +1,8 @@ from direct.directnotify import DirectNotifyGlobal from direct.distributed.AstronInternalRepository import AstronInternalRepository from direct.distributed.PyDatagram import * +from direct.distributed.MsgTypes import * +from direct.showbase.PythonUtil import makeList # TODO: Remove Astron dependence. @@ -41,3 +43,7 @@ class OTPInternalRepository(AstronInternalRepository): dg.addUint16(fieldId) self.send(dg) + + def _getMsgName(self, msgId): + # TODO: Remove Astron dependence. + return makeList(MsgId2Names.get(msgId, f'UNKNOWN MESSAGE: {msgId}'))[0]