Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
Add username override parameter
Browse files Browse the repository at this point in the history
This only works with Diabotical as far as I can tell, but hey, that's
good enough for me :Add username override parameter
  • Loading branch information
derrod committed Mar 16, 2020
1 parent 62f978d commit e5d4523
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ Usage is fairly simple:
```
usage: rktlnch.exe [-h] (--launch APP_NAME | --list-games)
[--skip-version-check]
[--override-username USER_NAME_OVERRIDE]
Launch an EGS game without EGS.
Launch an EGS game without EGS. Any extra parameters will be used as extra
launch parameters for the game.
optional arguments:
-h, --help show this help message and exit
--launch APP_NAME Launch game with codename APP_NAME
--list-games List installed app names and their corresponding game
names.
--skip-version-check Skip version check
--override-username USER_NAME_OVERRIDE
Override epic username
```

`APP_NAME` is the codename the game is using on EGS, *not* the actual name of the game. For instance, for Diabotical this is `Honeycreeper`.
Expand Down
14 changes: 12 additions & 2 deletions src/rktlnch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def exit(code=0):


if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Launch an EGS game without EGS.')
parser = argparse.ArgumentParser(description='Launch an EGS game without EGS. Any extra parameters will be used as extra launch parameters for the game.')

group = parser.add_mutually_exclusive_group()
group.required = True
Expand All @@ -31,6 +31,8 @@ def exit(code=0):

parser.add_argument('--skip-version-check', dest='skip_version_check', action='store_true',
default=False, help='Skip version check')
parser.add_argument('--override-username', dest='user_name_override', action='store',
help='Override epic username')

args, extra = parser.parse_known_args()

Expand Down Expand Up @@ -118,6 +120,14 @@ def exit(code=0):
print('[FAIL]\nFailed to get game token with:', repr(e))
exit(1)

# Override user name
if args.user_name_override:
user_name = args.user_name_override.strip()
print(f'Overriding username with "{user_name}"')
else:
user_name = auth_data["displayName"]

# Launching the game!
exe_path = os.path.join(game_manifest['InstallLocation'],
game_manifest['LaunchExecutable'])

Expand All @@ -128,7 +138,7 @@ def exit(code=0):
f'-epicapp={game_manifest["AppName"]}',
'-epicenv=Prod',
'-EpicPortal',
f'-epicusername={auth_data["displayName"]}',
f'-epicusername={user_name}',
f'-epicuserid={auth_data["account_id"]}',
'-epiclocale=en']

Expand Down

0 comments on commit e5d4523

Please sign in to comment.