MsgTypesCMU.py 1.2 KB

1234567891011121314151617181920212223242526272829
  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. MsgName2Id = {
  7. 'SET_DOID_RANGE_CMU' : 9001,
  8. 'CLIENT_OBJECT_GENERATE_CMU' : 9002,
  9. 'OBJECT_GENERATE_CMU' : 9003,
  10. 'OBJECT_UPDATE_FIELD_CMU' : 9004,
  11. 'OBJECT_DISABLE_CMU' : 9005,
  12. 'OBJECT_DELETE_CMU' : 9006,
  13. 'REQUEST_GENERATES_CMU' : 9007,
  14. 'CLIENT_DISCONNECT_CMU' : 9008,
  15. 'CLIENT_SET_INTEREST_CMU' : 9009,
  16. 'OBJECT_SET_ZONE_CMU' : 9010,
  17. 'CLIENT_HEARTBEAT_CMU' : 9011,
  18. 'CLIENT_OBJECT_UPDATE_FIELD_TARGETED_CMU' : 9011,
  19. 'CLIENT_OBJECT_UPDATE_FIELD' : 120, # Matches MsgTypes.CLIENT_OBJECT_SET_FIELD
  20. }
  21. # create id->name table for debugging
  22. MsgId2Names = invertDictLossless(MsgName2Id)
  23. # put msg names in module scope, assigned to msg value
  24. globals().update(MsgName2Id)