好的,所以我正在为迪士尼现已关闭的游戏 Toontown Online 制作服务器,但我在添加此代码后遇到了问题。游戏需要这部分,它对游戏至关重要,没有它,游戏将不发送客户端,“AvatarChooser.enter”,玩家将无法创建他们的角色!如果需要,我会放出更多的代码,但现在是这样。
class DistributedDistrict(DistributedObject):
__module__ = __name__
notify = directNotify.newCategory('DistributedDistrict')
neverDisable = 1
def __init__(self, cr):
print 'DistributedDistrict: BlankTest Canvas is now Online..'
DistributedObject.__init__(self, cr)
self.name = 'BlankTest Canvas'
self.available = 0
self.avatarCount = 0
self.newAvatarCount = 0
def announceGenerate(self):
DistributedObject.announceGenerate(self)
self.cr.activeDistrictMap[self.doId] = self
messenger.send('shardInfoUpdated')
def delete(self):
if base.cr.distributedDistrict is self:
base.cr.distributedDistrict = None
if self.cr.activeDistrictMap.has_key(self.doId):
del self.cr.activeDistrictMap[self.doId]
DistributedObject.delete(self)
messenger.send('shardInfoUpdated')
return
def setAvailable(self, available):
self.available = available
messenger.send('shardInfoUpdated')
def setName(self, name):
self.name = name
messenger.send('shardInfoUpdated')
simbase = DistributedDistrict()
#run() # Initialize the Panda3D API.
我收到此错误:
TypeError: __ init __() 正好需要 2 个参数(1 个给定)
任何帮助将不胜感激!
错误发生在:
simbase = DistributedDistrict()
#run() # Initialize the Panda3D API.