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