Files
panda3d/samples/networking/03-distributed-node/DGameObject.py
Fireclaw 3d8f824081 Add Distributed Network samples
1: Simple client-server connection
2: Client-server connection with timeManager
3: Create distributed objects, sending and receiving messages
4: Distributed model file
5: Simple text chat
6: Simple smooth moving actor
2021-10-28 09:54:17 +02:00

16 lines
559 B
Python

from direct.distributed.DistributedObject import DistributedObject
class DGameObject(DistributedObject):
def __init__(self, cr):
DistributedObject.__init__(self, cr)
def sendGameData(self, data):
""" Method that can be called from the clients with an sendUpdate call """
print(data)
def d_sendGameData(self):
""" A method to send an update message to the server. The d_ stands
for distributed """
# send the message to the server
self.sendUpdate('sendGameData', [('ValueA', 123, 1.25)])