MsgTypesCMU.py 1.1 KB

1234567891011121314151617181920212223242526
  1. """ MsgTypesCMU module: defines the various message type codes as used
  2. by the CMU ServerRepository/ClientRepository code in this directory.
  3. It replaces the MsgTypes module, which is not used by the CMU
  4. implementation. """
  5. from direct.showbase.PythonUtil import invertDictLossless
  6. SET_DOID_RANGE_CMU = 9001
  7. CLIENT_OBJECT_GENERATE_CMU = 9002
  8. OBJECT_GENERATE_CMU = 9003
  9. OBJECT_UPDATE_FIELD_CMU = 9004
  10. OBJECT_DISABLE_CMU = 9005
  11. OBJECT_DELETE_CMU = 9006
  12. REQUEST_GENERATES_CMU = 9007
  13. CLIENT_DISCONNECT_CMU = 9008
  14. CLIENT_SET_INTEREST_CMU = 9009
  15. OBJECT_SET_ZONE_CMU = 9010
  16. CLIENT_HEARTBEAT_CMU = 9011
  17. CLIENT_OBJECT_UPDATE_FIELD_TARGETED_CMU = 9011
  18. CLIENT_OBJECT_UPDATE_FIELD = 120 # Matches MsgTypes.CLIENT_OBJECT_SET_FIELD
  19. MsgName2Id = {name: value for name, value in globals().items() if isinstance(value, int)}
  20. # create id->name table for debugging
  21. MsgId2Names = invertDictLossless(MsgName2Id)