mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
*** empty log message ***
This commit is contained in:
parent
1f23a24db3
commit
1d934cb314
@ -632,6 +632,24 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
|
|||||||
currentLoginStateName +
|
currentLoginStateName +
|
||||||
" game state: " +
|
" game state: " +
|
||||||
currentGameStateName)
|
currentGameStateName)
|
||||||
|
else:
|
||||||
|
currentLoginState = self.loginFSM.getCurrentState()
|
||||||
|
if currentLoginState:
|
||||||
|
currentLoginStateName = currentLoginState.getName()
|
||||||
|
else:
|
||||||
|
currentLoginStateName = "None"
|
||||||
|
currentGameState = self.gameFSM.getCurrentState()
|
||||||
|
if currentGameState:
|
||||||
|
currentGameStateName = currentGameState.getName()
|
||||||
|
else:
|
||||||
|
currentGameStateName = "None"
|
||||||
|
ClientRepository.notify.warning(
|
||||||
|
"Ignoring unexpected message type: " +
|
||||||
|
str(msgType) +
|
||||||
|
" login state: " +
|
||||||
|
currentLoginStateName +
|
||||||
|
" game state: " +
|
||||||
|
currentGameStateName)
|
||||||
|
|
||||||
|
|
||||||
def createWithRequired(self, className, zoneId = 0, optionalFields=None):
|
def createWithRequired(self, className, zoneId = 0, optionalFields=None):
|
||||||
@ -772,7 +790,6 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
|
|||||||
|
|
||||||
msgType = self.getMsgType()
|
msgType = self.getMsgType()
|
||||||
|
|
||||||
|
|
||||||
if not wantOtpServer:
|
if not wantOtpServer:
|
||||||
if msgType == CLIENT_DONE_SET_ZONE_RESP:
|
if msgType == CLIENT_DONE_SET_ZONE_RESP:
|
||||||
self.handleSetZoneDone()
|
self.handleSetZoneDone()
|
||||||
|
@ -15,6 +15,7 @@ from direct.showbase import DirectObject
|
|||||||
from PyDatagram import PyDatagram
|
from PyDatagram import PyDatagram
|
||||||
#from PyDatagramIterator import PyDatagramIterator
|
#from PyDatagramIterator import PyDatagramIterator
|
||||||
|
|
||||||
|
|
||||||
class DoInterestManager(DirectObject.DirectObject):
|
class DoInterestManager(DirectObject.DirectObject):
|
||||||
"""
|
"""
|
||||||
Top level Interest Manager
|
Top level Interest Manager
|
||||||
@ -22,23 +23,26 @@ class DoInterestManager(DirectObject.DirectObject):
|
|||||||
if __debug__:
|
if __debug__:
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory("DoInterestManager")
|
notify = DirectNotifyGlobal.directNotify.newCategory("DoInterestManager")
|
||||||
|
|
||||||
|
|
||||||
|
_interestIdAssign = 1;
|
||||||
|
_interestIdScopes = 100;
|
||||||
|
_interests = {}
|
||||||
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
assert self.notify.debugCall()
|
assert self.notify.debugCall()
|
||||||
DirectObject.DirectObject.__init__(self)
|
DirectObject.DirectObject.__init__(self)
|
||||||
self._interestIdAssign = 1
|
|
||||||
self._interestIdScopes = 100;
|
|
||||||
self._interests = {}
|
|
||||||
|
|
||||||
def addInterest(self, parentId, zoneIdList, description, event=None):
|
def addInterest(self, parentId, zoneIdList, description, event=None):
|
||||||
"""
|
"""
|
||||||
Look into a zone.
|
Look into a zone.
|
||||||
"""
|
"""
|
||||||
assert self.notify.debugCall()
|
assert self.notify.debugCall()
|
||||||
self._interestIdAssign += 1
|
DoInterestManager._interestIdAssign += 1
|
||||||
self._interestIdScopes += 1
|
DoInterestManager._interestIdScopes += 1
|
||||||
contextId = self._interestIdAssign
|
contextId = DoInterestManager._interestIdAssign
|
||||||
scopeId = self._interestIdScopes
|
scopeId = DoInterestManager._interestIdScopes
|
||||||
self._interests[contextId] = [description, scopeId, event, "Active"]
|
DoInterestManager._interests[contextId] = [description, scopeId, event, "Active"]
|
||||||
self._sendAddInterest(contextId, scopeId, parentId, zoneIdList)
|
self._sendAddInterest(contextId, scopeId, parentId, zoneIdList)
|
||||||
assert self.printInterests()
|
assert self.printInterests()
|
||||||
return contextId
|
return contextId
|
||||||
@ -49,18 +53,18 @@ class DoInterestManager(DirectObject.DirectObject):
|
|||||||
"""
|
"""
|
||||||
assert self.notify.debugCall()
|
assert self.notify.debugCall()
|
||||||
answer = 0
|
answer = 0
|
||||||
if self._interests.has_key(contextId):
|
if DoInterestManager._interests.has_key(contextId):
|
||||||
if event is not None:
|
if event is not None:
|
||||||
self._interestIdScopes += 1
|
DoInterestManager._interestIdScopes += 1
|
||||||
self._interests[contextId][3] = "PendingDel"
|
DoInterestManager._interests[contextId][3] = "PendingDel"
|
||||||
self._interests[contextId][2] = event
|
DoInterestManager._interests[contextId][2] = event
|
||||||
self._interests[contextId][1] = self._interestIdScopes
|
DoInterestManager._interests[contextId][1] = DoInterestManager._interestIdScopes
|
||||||
self._sendRemoveInterest(contextId)
|
self._sendRemoveInterest(contextId)
|
||||||
else:
|
else:
|
||||||
self._interests[contextId][2] = None
|
DoInterestManager._interests[contextId][2] = None
|
||||||
self._interests[contextId][1] = 0
|
DoInterestManager._interests[contextId][1] = 0
|
||||||
self._sendRemoveInterest(contextId)
|
self._sendRemoveInterest(contextId)
|
||||||
del self._interests[contextId]
|
del DoInterestManager._interests[contextId]
|
||||||
answer = 1
|
answer = 1
|
||||||
else:
|
else:
|
||||||
self.notify.warning("removeInterest: contextId not found: %s" % (contextId))
|
self.notify.warning("removeInterest: contextId not found: %s" % (contextId))
|
||||||
@ -73,14 +77,14 @@ class DoInterestManager(DirectObject.DirectObject):
|
|||||||
"""
|
"""
|
||||||
assert self.notify.debugCall()
|
assert self.notify.debugCall()
|
||||||
answer = 0
|
answer = 0
|
||||||
if self._interests.has_key(contextId):
|
if DoInterestManager._interests.has_key(contextId):
|
||||||
self._interestIdScopes += 1
|
DoInterestManager._interestIdScopes += 1
|
||||||
if description is not None:
|
if description is not None:
|
||||||
self._interests[contextId][0] = description
|
DoInterestManager._interests[contextId][0] = description
|
||||||
|
|
||||||
self._interests[contextId][1] = self._interestIdScopes;
|
DoInterestManager._interests[contextId][1] = DoInterestManager._interestIdScopes;
|
||||||
self._interests[contextId][2] = event;
|
DoInterestManager._interests[contextId][2] = event;
|
||||||
self._sendAddInterest(contextId, self._interestIdScopes, parentId, zoneIdList)
|
self._sendAddInterest(contextId, DoInterestManager._interestIdScopes, parentId, zoneIdList)
|
||||||
answer = 1
|
answer = 1
|
||||||
assert self.printInterests()
|
assert self.printInterests()
|
||||||
else:
|
else:
|
||||||
@ -95,8 +99,8 @@ class DoInterestManager(DirectObject.DirectObject):
|
|||||||
"""
|
"""
|
||||||
assert self.notify.debugCall()
|
assert self.notify.debugCall()
|
||||||
answer = 0
|
answer = 0
|
||||||
if self._interests.has_key(contextId):
|
if DoInterestManager._interests.has_key(contextId):
|
||||||
answer = self._interests[contextId][1];
|
answer = DoInterestManager._interests[contextId][1];
|
||||||
else:
|
else:
|
||||||
self.notify.warning("GetInterestScopeID: contextId not found: %s" % (contextId))
|
self.notify.warning("GetInterestScopeID: contextId not found: %s" % (contextId))
|
||||||
return answer
|
return answer
|
||||||
@ -108,8 +112,8 @@ class DoInterestManager(DirectObject.DirectObject):
|
|||||||
"""
|
"""
|
||||||
assert self.notify.debugCall()
|
assert self.notify.debugCall()
|
||||||
answer = None
|
answer = None
|
||||||
if self._interests.has_key(contextId):
|
if DoInterestManager._interests.has_key(contextId):
|
||||||
answer = self._interests[contextId][2];
|
answer = DoInterestManager._interests[contextId][2];
|
||||||
else:
|
else:
|
||||||
self.notify.warning("GetInterestScopeEvent: contextId not found: %s" % (contextId))
|
self.notify.warning("GetInterestScopeEvent: contextId not found: %s" % (contextId))
|
||||||
return answer
|
return answer
|
||||||
@ -119,9 +123,9 @@ class DoInterestManager(DirectObject.DirectObject):
|
|||||||
Consider whether we should cull the interest set.
|
Consider whether we should cull the interest set.
|
||||||
"""
|
"""
|
||||||
assert self.notify.debugCall()
|
assert self.notify.debugCall()
|
||||||
if self._interests.has_key(handle):
|
if DoInterestManager._interests.has_key(handle):
|
||||||
if self._interests[handle][3] == "PendingDel":
|
if DoInterestManager._interests[handle][3] == "PendingDel":
|
||||||
del self._interests[handle]
|
del DoInterestManager._interests[handle]
|
||||||
|
|
||||||
if __debug__:
|
if __debug__:
|
||||||
def printInterests(self):
|
def printInterests(self):
|
||||||
@ -129,13 +133,13 @@ class DoInterestManager(DirectObject.DirectObject):
|
|||||||
Part of the new otp-server code.
|
Part of the new otp-server code.
|
||||||
"""
|
"""
|
||||||
print "*********************** Interest Sets **************"
|
print "*********************** Interest Sets **************"
|
||||||
for i in self._interests.keys():
|
for i in DoInterestManager._interests.keys():
|
||||||
print "Interest ID:%s, Description=%s Scope=%s Event=%s Mode=%s"%(
|
print "Interest ID:%s, Description=%s Scope=%s Event=%s Mode=%s"%(
|
||||||
i,
|
i,
|
||||||
self._interests[i][0],
|
DoInterestManager._interests[i][0],
|
||||||
self._interests[i][1],
|
DoInterestManager._interests[i][1],
|
||||||
self._interests[i][2],
|
DoInterestManager._interests[i][2],
|
||||||
self._interests[i][3])
|
DoInterestManager._interests[i][3])
|
||||||
print "****************************************************"
|
print "****************************************************"
|
||||||
return 1 # for assert()
|
return 1 # for assert()
|
||||||
|
|
||||||
@ -202,3 +206,4 @@ class DoInterestManager(DirectObject.DirectObject):
|
|||||||
print "handleInterestDoneMessage--> Scope MisMatch :%s :%s"%(expect_scope,scope);
|
print "handleInterestDoneMessage--> Scope MisMatch :%s :%s"%(expect_scope,scope);
|
||||||
|
|
||||||
assert self.printInterests()
|
assert self.printInterests()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user