mirror of
https://github.com/panda3d/panda3d.git
synced 2026-01-20 06:20:02 -06:00
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
16 lines
559 B
Python
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)])
|