DGameObject.py 559 B

123456789101112131415
  1. from direct.distributed.DistributedObject import DistributedObject
  2. class DGameObject(DistributedObject):
  3. def __init__(self, cr):
  4. DistributedObject.__init__(self, cr)
  5. def sendGameData(self, data):
  6. """ Method that can be called from the clients with an sendUpdate call """
  7. print(data)
  8. def d_sendGameData(self):
  9. """ A method to send an update message to the server. The d_ stands
  10. for distributed """
  11. # send the message to the server
  12. self.sendUpdate('sendGameData', [('ValueA', 123, 1.25)])