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

Offline mode #1278

Closed
kjeet opened this issue Jun 4, 2019 · 17 comments
Closed

Offline mode #1278

kjeet opened this issue Jun 4, 2019 · 17 comments

Comments

@kjeet
Copy link

kjeet commented Jun 4, 2019

Fairly new to FAF, so correct me if I'm wrong about any of the following.

The FAF client is the main (maybe only?) way to launch the game with the all the standard changes. Things like balance changes, patches for performance, AI additions, sim mods, etc. are absent or inconvenient to use using Steam or normal application launchers.

The only slightly annoying part is that every single game launched gets it's replay uploaded publicly, even for private games or practice against AIs. A number of forum posts and people on discord seem to be under the impression that private games don't get uploaded but they do from what I can tell.

I get that replays may be mandatory for policing hackers and what not, so I'd like to propose that only private games may optionally disable replays.

I can dig in and try to implement this myself, but I'd like to know if this change is welcome first, thanks!

@1-alex98
Copy link
Member

1-alex98 commented Jun 6, 2019

They are uploaded but there is a way to launch without producing a replay. You can launch the exe under C:\ProgrammData\Faforever\bin and it will launch with FAF changes i think(maybe u need \init init.lua as a param not sure ) also you could do some hack to stop faf from producing a replay. in settings under command line format u could enter "%s /savereplay gpgnet://127.0.0.1:12" that should break replay recording

@kjeet
Copy link
Author

kjeet commented Jun 6, 2019

Thanks! I'll be using that!

If there is interest in getting this baked in more formally, I'd love to chip in and make the changes. Let me know. Otherwise, I can close this out.

@1-alex98
Copy link
Member

1-alex98 commented Jun 6, 2019

Well I mean I see no particular reason in implementing it but sure go ahead why not....

@1-alex98
Copy link
Member

1-alex98 commented Jun 6, 2019

Write me an email alexander.von.trostoff@gmail.com and I will send you a slack invite as well.

@1-alex98
Copy link
Member

1-alex98 commented Jun 6, 2019

@kjeet

@kjeet
Copy link
Author

kjeet commented Jun 9, 2019

@axel1200 Was that address right? gmail bounced.

@1-alex98
Copy link
Member

The Email is correct however I did not receive one or deleted it by accident. Just resend

@kjeet
Copy link
Author

kjeet commented Jun 11, 2019

A few things updates, for you and posterity.

Under the settings > command line format, adding "%s /savereplay gpgnet://127.0.0.1:12" wasn't even able to start the game because, on Ubuntu at least, it treats that whole string spaces and all as a file name. Using "%s" /savereplay gpgnet://127.0.0.1:12 did boot and ultimately runs with parameters as noted in stdout:

[/home/kjeet/XXX/downlords-faf-client-0.10.6-beta/run, /home/kjeet/.faforever/bin/ForgedAlliance.exe, /savereplay, gpgnet://127.0.0.1:12, /init, init.lua, /nobugreport, /log, /home/kjeet/.faforever/logs/game.log, /gpgnet, 127.0.0.1:25731, /mean, 1500.0, /deviation, 500.0, /savereplay, gpgnet://127.0.0.1:38439/9774223/kjeetgill.SCFAreplay, /country, US, /numgames, 0]

Note that though this let's the game run, the flag /savereplay now gets specified twice. A quick check shows that this game still has a record in the FAF Vault (not ideal) but does fail to upload a replay as intended (nice)!

Here's the thing: With only the default mods in place the bottom build queue piece of the UI fails to load now. What that has to do with replay I do not know. I have verified this by adding removing the flags in commandline and can break/bring back the UI.

Strange!

@kjeet
Copy link
Author

kjeet commented Jun 11, 2019

Screenshot from 2019-06-10 21-52-06

I questioned the email address because google said it was unroutable. I'd ask you about it privately but I can't email you. shrugs

@kjeet
Copy link
Author

kjeet commented Jun 11, 2019

Ahh, from a vimdiff of the a good and bad game.logs I got this error pretty early in the log:

   631 warning: Error in file /lua/SessionInit.lua : ...\kjeet\.faforever\gamedata\lua.nx2\lua\ui\uiutil.lua(1102): attempt to perform arithmetic on local `lastpos' (a nil value)
   632          stack traceback:
   633                 ...\kjeet\.faforever\gamedata\lua.nx2\lua\ui\uiutil.lua(1102): in function `GetReplayId'
   634                 ...e\kjeet\.faforever\gamedata\lua.nx2\lua\userinit.lua(79): in main chunk
   635                 [C]: in function `doscript'
   636                 ...d alliance\gamedata\mohodata.scd\lua\sessioninit.lua(9): in main chunk

and a ton of these

   853 warning: Error running lua command: [string "OnSync()"](1): access to nonexistent global variable "OnSync"
   854          stack traceback:
   855                 [C]: in function `error'
   856                 ...alliance\gamedata\mohodata.scd\lua\system\config.lua(53): in function <...alliance\gamedata\mohodata.scd\lua\system\config.lua:52>
   857                 [string "OnSync()"](1): in main chunk

I'm guessing uiutil.lua not gracefully handling the lack of a ReplayId is probably an over site. Which repo is that stuff in?

@kjeet
Copy link
Author

kjeet commented Jun 11, 2019

Digging a little more, apparently the UI code parses the arguments to /savereplay so instead of passing it a /savereplay gpgnet://127.0.0.1:12 I passed it /savereplay gpgnet://127.0.0.1:12/00110011/kjeetgill.SCFAreplay in the pattern of the redundant arg I'd noticed earlier.

It still leaves a record of the game in Valut (not ideal) but it keeps failes to upload the replay, as intended, while actually being playable.

Dope! Stuff like this is why it's nice to formalize vs hack around the platform for a feature like this.

@1-alex98
Copy link
Member

Sorry it is alexander.von.trostorff@gmail.com

@1-alex98
Copy link
Member

Yeah I did not try my suggestion and it was more like a int how one could do it ;) Never done this twitching of command lines... If you want no record of it in the vault u would need to tell the server in some way and for that make a way to be able to tell it.

If you wan to make it a formal option you should add a Variable in the Preferences.class and a toogle in the settings.fxml bind it in the SettingsController.class and remove the /savereplay parameter in the LaunchCommandBuilder.class if variable is true.

@1-alex98
Copy link
Member

Or make an offline mod and not tell the server at all but then nobody can join your game

@1-alex98
Copy link
Member

Making an offline mode is an issue since like 3 years. You would probably need a new UI for the offline mode. But it should be pretty easy to launch the game offline.

@1-alex98 1-alex98 changed the title Optionally disable Replays for private/practice games Offline mode Feb 29, 2020
@1-alex98
Copy link
Member

Well provide a button as alternative to login that launches faf exe

@Sheikah45
Copy link
Member

Same as #63

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

No branches or pull requests

3 participants