LiveSplit.Server icon indicating copy to clipboard operation
LiveSplit.Server copied to clipboard

Cannot retrieve gametime.

Open roninpawn opened this issue 6 years ago • 3 comments

'getcurrenttime' is the only command that will directly retrieve livesplit's timer data, and it always retrieves via TimingMethod.RealTime. I've initialized game time. I've setcomparison to gametime. Doesn't matter. When I ask for 'getcurrenttime,' I always get back the RealTime.

Python:

import time
import socket

livesplit = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
livesplit.connect(("localhost", 16834))
livesplit.send("initgametime\r\n".encode())
livesplit.send("setcomparison gametime\r\n".encode())
livesplit.send("starttimer\r\n".encode())
livesplit.send("pausegametime\r\n".encode())
time.sleep(3)
livesplit.send("getcurrenttime\r\n".encode())
ls_time = livesplit.recv(1024).decode()[:-2]
print(ls_time)

roninpawn avatar Apr 07 '19 06:04 roninpawn

Just ctrl+f'd the serverComponents.cs where the commands are listed... If it's supposed to be in that file, there is no "initgametime" command shown.

So when 'getcurrenttime' checks if (timingMethod == TimingMethod.GameTime && !State.IsGameTimeInitialized), IsGameTimeInitialized will always be False, because there's no way to query the server to initialize it.

roninpawn avatar Apr 07 '19 06:04 roninpawn

Hello? Is this thing on? ...Also, the first split received by livesplit does not log its time in the game-time view. The results are the same as if you had hit the split key manually. I'm assuming that gametime doesn't log it, because it's a manual split and that's not what gametime is meant to track.

But, of course, I AM sending the split time in via the server, and it IS a gametime split. It's just behaving like it isn't. The second split to come down, as well all subsequent splits, are logged correctly as gametime. So I'm thinking this is maybe ALSO a problem of not having initiated gametime in advance?

But I can't really test that, because, as previously mentioned, no one put any code in this server plugin to do anything when the "initgametime" command listed in the documentation is sent to it.

Or so it seems.

roninpawn avatar Apr 09 '19 01:04 roninpawn

Found a way to fudge my way around it: starttimer\r\nsetgametime 0.0\r\n

If I force a setgametime through, the first split works like it should.

roninpawn avatar Apr 09 '19 01:04 roninpawn