mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Remove phase checker
This commit is contained in:
parent
36400d6e51
commit
1dc5bdbf55
3 changed files with 6 additions and 74 deletions
|
@ -779,11 +779,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
def _removeLocalAvFromStateServer(self):
|
def _removeLocalAvFromStateServer(self):
|
||||||
self.sendSetAvatarIdMsg(0)
|
self.sendSetAvatarIdMsg(0)
|
||||||
self._removeAllOV()
|
self._removeAllOV()
|
||||||
callback = Functor(self.loginFSM.request, self._closeShardLoginState)
|
self.removeShardInterest(Functor(self.loginFSM.request, self._closeShardLoginState))
|
||||||
if base.slowCloseShard:
|
|
||||||
taskMgr.doMethodLater(base.slowCloseShardDelay * 0.5, Functor(self.removeShardInterest, callback), 'slowCloseShard')
|
|
||||||
else:
|
|
||||||
self.removeShardInterest(callback)
|
|
||||||
|
|
||||||
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
||||||
def _removeAllOV(self):
|
def _removeAllOV(self):
|
||||||
|
@ -804,16 +800,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
self.cleanGameExit = True
|
self.cleanGameExit = True
|
||||||
self.cache.flush()
|
self.cache.flush()
|
||||||
self.doDataCache.flush()
|
self.doDataCache.flush()
|
||||||
if base.slowCloseShard:
|
|
||||||
taskMgr.doMethodLater(base.slowCloseShardDelay * 0.5, Functor(self._callRemoveShardInterestCallback, callback), 'slowCloseShardCallback')
|
|
||||||
else:
|
|
||||||
self._callRemoveShardInterestCallback(callback, None)
|
|
||||||
return
|
|
||||||
|
|
||||||
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
|
||||||
def _callRemoveShardInterestCallback(self, callback, task):
|
|
||||||
callback()
|
callback()
|
||||||
return Task.done
|
|
||||||
|
|
||||||
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
||||||
def _removeCurrentShardInterest(self, callback):
|
def _removeCurrentShardInterest(self, callback):
|
||||||
|
|
|
@ -1,29 +1,17 @@
|
||||||
import math
|
|
||||||
import re
|
|
||||||
import time
|
|
||||||
|
|
||||||
import OTPGlobals
|
|
||||||
import OTPRender
|
|
||||||
from direct.showbase.ShowBase import ShowBase
|
from direct.showbase.ShowBase import ShowBase
|
||||||
from otp.ai.MagicWordGlobal import *
|
from otp.ai.MagicWordGlobal import *
|
||||||
from pandac.PandaModules import Camera, TPLow, VBase4, ColorWriteAttrib, Filename, getModelPath, NodePath, Vec4
|
from pandac.PandaModules import Camera, TPLow, VBase4, ColorWriteAttrib, Filename, getModelPath, NodePath, Vec4
|
||||||
|
import OTPGlobals, OTPRender, math
|
||||||
|
|
||||||
class OTPBase(ShowBase):
|
class OTPBase(ShowBase):
|
||||||
|
|
||||||
def __init__(self, windowType = None):
|
def __init__(self, windowType = None):
|
||||||
self.wantEnviroDR = False
|
self.wantEnviroDR = False
|
||||||
ShowBase.__init__(self, windowType=windowType)
|
ShowBase.__init__(self, windowType=windowType)
|
||||||
if config.GetBool('want-phase-checker', 0):
|
|
||||||
from direct.showbase import Loader
|
|
||||||
Loader.phaseChecker = self.loaderPhaseChecker
|
|
||||||
self.errorAccumulatorBuffer = ''
|
|
||||||
taskMgr.add(self.delayedErrorCheck, 'delayedErrorCheck', priority=10000)
|
|
||||||
self.idTags = config.GetBool('want-id-tags', 0)
|
self.idTags = config.GetBool('want-id-tags', 0)
|
||||||
if not self.idTags:
|
if not self.idTags:
|
||||||
del self.idTags
|
del self.idTags
|
||||||
self.wantNametags = self.config.GetBool('want-nametags', 1)
|
self.wantNametags = self.config.GetBool('want-nametags', 1)
|
||||||
self.slowCloseShard = self.config.GetBool('slow-close-shard', 0)
|
|
||||||
self.slowCloseShardDelay = self.config.GetFloat('slow-close-shard-delay', 10.0)
|
|
||||||
self.fillShardsToIdealPop = self.config.GetBool('fill-shards-to-ideal-pop', 1)
|
self.fillShardsToIdealPop = self.config.GetBool('fill-shards-to-ideal-pop', 1)
|
||||||
self.wantDynamicShadows = 1
|
self.wantDynamicShadows = 1
|
||||||
self.stereoEnabled = False
|
self.stereoEnabled = False
|
||||||
|
@ -31,8 +19,6 @@ class OTPBase(ShowBase):
|
||||||
self.enviroCam = None
|
self.enviroCam = None
|
||||||
self.pixelZoomSetup = False
|
self.pixelZoomSetup = False
|
||||||
self.gameOptionsCode = ''
|
self.gameOptionsCode = ''
|
||||||
self.locationCode = ''
|
|
||||||
self.locationCodeChanged = time.time()
|
|
||||||
if base.cam:
|
if base.cam:
|
||||||
if self.wantEnviroDR:
|
if self.wantEnviroDR:
|
||||||
base.cam.node().setCameraMask(OTPRender.MainCameraBitmask)
|
base.cam.node().setCameraMask(OTPRender.MainCameraBitmask)
|
||||||
|
@ -177,47 +163,6 @@ class OTPBase(ShowBase):
|
||||||
def getShardPopLimits(self):
|
def getShardPopLimits(self):
|
||||||
return (100, 200, -1)
|
return (100, 200, -1)
|
||||||
|
|
||||||
def setLocationCode(self, locationCode):
|
|
||||||
if locationCode != self.locationCode:
|
|
||||||
self.locationCode = locationCode
|
|
||||||
self.locationCodeChanged = time.time()
|
|
||||||
|
|
||||||
def delayedErrorCheck(self, task):
|
|
||||||
if self.errorAccumulatorBuffer:
|
|
||||||
buffer = self.errorAccumulatorBuffer
|
|
||||||
self.errorAccumulatorBuffer = ''
|
|
||||||
self.notify.error('\nAccumulated Phase Errors!:\n %s' % buffer)
|
|
||||||
return task.cont
|
|
||||||
|
|
||||||
def loaderPhaseChecker(self, path, loaderOptions):
|
|
||||||
if 'audio/' in path:
|
|
||||||
return 1
|
|
||||||
file = Filename(path)
|
|
||||||
if not file.getExtension():
|
|
||||||
file.setExtension('bam')
|
|
||||||
mp = getModelPath()
|
|
||||||
path = mp.findFile(file).cStr()
|
|
||||||
if not path:
|
|
||||||
return
|
|
||||||
match = re.match('.*phase_([^/]+)/', path)
|
|
||||||
if not match:
|
|
||||||
if 'dmodels' in path:
|
|
||||||
return
|
|
||||||
else:
|
|
||||||
self.errorAccumulatorBuffer += 'file not in phase (%s, %s)\n' % (file, path)
|
|
||||||
return
|
|
||||||
basePhase = float(match.groups()[0])
|
|
||||||
model = loader.loader.loadSync(Filename(path), loaderOptions)
|
|
||||||
if model:
|
|
||||||
model = NodePath(model)
|
|
||||||
for tex in model.findAllTextures():
|
|
||||||
texPath = tex.getFullpath().cStr()
|
|
||||||
match = re.match('.*phase_([^/]+)/', texPath)
|
|
||||||
if match:
|
|
||||||
texPhase = float(match.groups()[0])
|
|
||||||
if texPhase > basePhase:
|
|
||||||
self.errorAccumulatorBuffer += 'texture phase is higher than the models (%s, %s)\n' % (path, texPath)
|
|
||||||
|
|
||||||
def getRepository(self):
|
def getRepository(self):
|
||||||
return self.cr
|
return self.cr
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@ import types
|
||||||
class SCMenu(SCObject, NodePath):
|
class SCMenu(SCObject, NodePath):
|
||||||
config = getConfigShowbase()
|
config = getConfigShowbase()
|
||||||
SpeedChatRolloverTolerance = config.GetFloat('speedchat-rollover-tolerance', 0.08)
|
SpeedChatRolloverTolerance = config.GetFloat('speedchat-rollover-tolerance', 0.08)
|
||||||
WantFade = config.GetBool('want-speedchat-fade', 0)
|
WantFade = config.GetBool('want-speedchat-fade', 1)
|
||||||
FadeDuration = config.GetFloat('speedchat-fade-duration', 0.2)
|
FadeDuration = config.GetFloat('speedchat-fade-duration', 0.4)
|
||||||
SerialNum = 0
|
SerialNum = 0
|
||||||
BackgroundModelName = None
|
BackgroundModelName = None
|
||||||
GuiModelName = None
|
GuiModelName = None
|
||||||
|
@ -163,7 +163,7 @@ class SCMenu(SCObject, NodePath):
|
||||||
else:
|
else:
|
||||||
self.stopFade()
|
self.stopFade()
|
||||||
self.fadeIval = LerpFunctionInterval(self.fadeFunc, fromData=0.0, toData=1.0, duration=SCMenu.FadeDuration)
|
self.fadeIval = LerpFunctionInterval(self.fadeFunc, fromData=0.0, toData=1.0, duration=SCMenu.FadeDuration)
|
||||||
self.fadeIval.play()
|
self.fadeIval.start()
|
||||||
if parentMenu is not None:
|
if parentMenu is not None:
|
||||||
parentMenu.childHasFaded = 1
|
parentMenu.childHasFaded = 1
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue