Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot retrieve gametime. #25

Open
roninpawn opened this issue Apr 7, 2019 · 3 comments
Open

Cannot retrieve gametime. #25

roninpawn opened this issue Apr 7, 2019 · 3 comments

Comments

@roninpawn
Copy link

'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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant