Oh god what the fuck and the other incredible tales
This commit is contained in:
parent
5e26ab48d1
commit
aa7b935de7
@ -111,17 +111,17 @@ class SyncplayClient(object):
|
||||
self._playerPaused = paused
|
||||
if(self._lastGlobalUpdate):
|
||||
self._lastPlayerUpdate = time.time()
|
||||
if(pauseChange or seeked):
|
||||
self.playerPositionBeforeLastSeek = self.getGlobalPosition()
|
||||
if(self._protocol):
|
||||
self._protocol.sendState(self.getPlayerPosition(), self.getPlayerPaused(), seeked, None, True)
|
||||
if(pauseChange or seeked and self._protocol):
|
||||
if(seeked):
|
||||
self.playerPositionBeforeLastSeek = self.getGlobalPosition()
|
||||
self._protocol.sendState(self.getPlayerPosition(), self.getPlayerPaused(), seeked, None, True)
|
||||
|
||||
def getLocalState(self):
|
||||
paused = self.getPlayerPaused()
|
||||
position = self.getPlayerPosition()
|
||||
pauseChange, seeked = self._determinePlayerStateChange(paused, position)
|
||||
pauseChange, _ = self._determinePlayerStateChange(paused, position)
|
||||
if(self._lastGlobalUpdate):
|
||||
return position, paused, seeked, pauseChange
|
||||
return position, paused, _, pauseChange
|
||||
else:
|
||||
return None, None, None, None
|
||||
|
||||
@ -166,10 +166,10 @@ class SyncplayClient(object):
|
||||
return madeChangeOnPlayer
|
||||
|
||||
def _slowDownToCoverTimeDifference(self, diff):
|
||||
if(0.5 < diff):
|
||||
if(1.0 < diff and not self._speedChanged):
|
||||
self._player.setSpeed(0.95)
|
||||
self._speedChanged = True
|
||||
elif(self._speedChanged and diff < 0.2 ):
|
||||
elif(self._speedChanged and diff < 0.1 ):
|
||||
self._player.setSpeed(1.00)
|
||||
self._speedChanged = False
|
||||
madeChangeOnPlayer = True
|
||||
|
||||
@ -75,7 +75,7 @@ class MPCHCAPIPlayer(BasePlayer):
|
||||
self.__mpcVersion = self._mpcApi.version.split('.')
|
||||
if(self.__mpcVersion[0:3] == ['1', '6', '4']):
|
||||
self.__switchPauseCalls = True
|
||||
if(self.__mpcVersion[0:3] >= ['1', '6', '5']):
|
||||
if(False and self.__mpcVersion[0:3] >= ['1', '6', '5']): #disabled!
|
||||
self.speedSupported = True
|
||||
if(filePath):
|
||||
self._mpcApi.openFile(filePath)
|
||||
|
||||
@ -20,7 +20,7 @@ class JSONCommandProtocol(LineReceiver):
|
||||
elif command == "Error":
|
||||
self.handleState(message[1])
|
||||
else:
|
||||
self.dropWithError("Unknown Command") #TODO: log, not drop
|
||||
self.dropWithError("Unknown Command\n" + message[1]) #TODO: log, not drop
|
||||
|
||||
def printReceived(self, line): #TODO: remove
|
||||
# print ">>i", line
|
||||
@ -38,7 +38,7 @@ class JSONCommandProtocol(LineReceiver):
|
||||
try:
|
||||
messages = json.loads(line)
|
||||
except:
|
||||
self.dropWithError("Not a json encoded string")
|
||||
self.dropWithError("Not a json encoded string\n" + line)
|
||||
return
|
||||
self.handleMessages(messages)
|
||||
|
||||
@ -68,6 +68,7 @@ class SyncClientProtocol(JSONCommandProtocol):
|
||||
self._client.destroyProtocol()
|
||||
|
||||
def dropWithError(self, error):
|
||||
print error
|
||||
self._client.ui.showErrorMessage(error)
|
||||
self._client.protocolFactory.stopRetrying()
|
||||
self.drop()
|
||||
@ -81,9 +82,9 @@ class SyncClientProtocol(JSONCommandProtocol):
|
||||
def handleHello(self, hello):
|
||||
username, roomName, version = self._extractHelloArguments(hello)
|
||||
if(not username or not roomName or not version):
|
||||
self.dropWithError("Not enough Hello arguments")
|
||||
self.dropWithError("Not enough Hello arguments\n" + hello)
|
||||
elif(version.split(".")[0:2] != syncplay.version.split(".")[0:2]):
|
||||
self.dropWithError("Mismatch between versions of client and server")
|
||||
self.dropWithError("Mismatch between versions of client and server\n" + hello)
|
||||
else:
|
||||
self._client.setUsername(username)
|
||||
self._client.setRoom(roomName)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user