mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
formatting
This commit is contained in:
parent
9774a2282e
commit
728483764d
@ -254,7 +254,6 @@ class ServerRepository:
|
||||
else:
|
||||
self.ZonetoDOIDs[zone] = [doid]
|
||||
self.sendToZoneExcept(zone, datagram, connection)
|
||||
return None
|
||||
|
||||
|
||||
# client wants to update an object, forward message along
|
||||
@ -282,7 +281,6 @@ class ServerRepository:
|
||||
else:
|
||||
self.notify.warning(
|
||||
"Message is not broadcast, p2p, or broadcast+p2p")
|
||||
return None
|
||||
|
||||
# client disables an object, let everyone know who is in
|
||||
# that zone know about it
|
||||
@ -291,7 +289,6 @@ class ServerRepository:
|
||||
# now send disable message to all clients that need to know
|
||||
if doid in self.DOIDtoZones:
|
||||
self.sendToZoneExcept(self.DOIDtoZones[doid], datagram, 0)
|
||||
return None
|
||||
|
||||
# client deletes an object, let everyone who is in zone with
|
||||
# object know about it
|
||||
@ -303,7 +300,6 @@ class ServerRepository:
|
||||
self.ZonetoDOIDs[self.DOIDtoZones[doid]].remove(doid)
|
||||
del self.DOIDtoZones[doid]
|
||||
del self.DOIDtoDClass[doid]
|
||||
return None
|
||||
|
||||
def sendAvatarGenerate(self):
|
||||
datagram = PyDatagram()
|
||||
@ -331,7 +327,6 @@ class ServerRepository:
|
||||
datagram.addUint32(self.DOIDrange)
|
||||
print "Sending DOID range: ",id,self.DOIDrange
|
||||
self.cw.send(datagram, connection)
|
||||
return None
|
||||
|
||||
# a client disconnected from us, we need to update our data, also tell other clients to remove
|
||||
# the disconnected clients objects
|
||||
@ -356,7 +351,6 @@ class ServerRepository:
|
||||
del self.ClientZones[connection]
|
||||
del self.ClientDOIDbase[connection]
|
||||
del self.ClientObjects[connection]
|
||||
return None
|
||||
|
||||
# client told us it's zone(s), store information
|
||||
def handleSetZone(self, dgi, connection):
|
||||
@ -376,7 +370,6 @@ class ServerRepository:
|
||||
datagram.addUint32(ZoneID)
|
||||
self.sendToAll(datagram)
|
||||
print "SENDING REQUEST GENERATES (",ZoneID,") TO ALL"
|
||||
return None
|
||||
|
||||
# client has moved zones, need to update them
|
||||
def handleRemoveZone(self, dgi, connection):
|
||||
@ -392,26 +385,23 @@ class ServerRepository:
|
||||
datagram.addUint16(CLIENT_OBJECT_DELETE)
|
||||
datagram.addUint32(i)
|
||||
self.cw.send(datagram, connection)
|
||||
return None
|
||||
|
||||
# client did not tell us he was leaving but we lost connection to him, so we need to update our data and tell others
|
||||
|
||||
def clientHardDisconnectTask(self, task):
|
||||
for i in self.ClientIP.keys():
|
||||
if (not self.qcr.isConnectionOk(i)):
|
||||
if not self.qcr.isConnectionOk(i):
|
||||
self.handleClientDisconnect(i)
|
||||
return Task.cont
|
||||
|
||||
|
||||
# sends a message to everyone who is in the zone
|
||||
def sendToZoneExcept(self, ZoneID, datagram, connection):
|
||||
if ZoneID in self.ZonesToClients:
|
||||
for conn in self.ZonesToClients[ZoneID]:
|
||||
if (conn != connection): self.cw.send(datagram, conn)
|
||||
return None
|
||||
if (conn != connection):
|
||||
self.cw.send(datagram, conn)
|
||||
|
||||
# sends a message to all connected clients
|
||||
def sendToAll(self, datagram):
|
||||
for client in self.ClientIP.keys():
|
||||
self.cw.send(datagram, client)
|
||||
return None
|
||||
|
Loading…
x
Reference in New Issue
Block a user