distributed: Add _getMsgName for verbose logging

This commit is contained in:
Little Cat 2023-01-10 22:45:55 -04:00
parent 39b1d67097
commit b8c2b50c48
No known key found for this signature in database
GPG key ID: 96455BD9C4399BE8

View file

@ -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]