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

Fixed getting game/replay id from /savereplay cmd argument in the game #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions modules/score_manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,12 @@ function GetReplayId()
log.Trace('GetReplayId()... from cmd /syncreplay ' .. tostring(id) )

elseif HasCommandLineArg("/savereplay") then
-- /savereplay format is gpgnet://local_ip:port/replay_id/USERNAME.SCFAreplay
-- see https://github.com/FAForever/downlords-faf-client/blob/b819997b2c4964ae6e6801d5d2eecd232bca5688/src/main/java/com/faforever/client/fa/LaunchCommandBuilder.java#L192
local url = GetCommandLineArg("/savereplay", 1)[1]
local lastpos = string.find(url, "/", 20)
id = string.sub(url, 20, lastpos-1)
local fistpos = string.find(url, "/", 10) + 1
local lastpos = string.find(url, "/", fistpos) - 1
id = string.sub(url, fistpos, lastpos)
log.Trace('GetReplayId()... from cmd /savereplay ' .. tostring(id) )

elseif HasCommandLineArg("/replayid") then
Expand Down