Merge branch 'feature/anonymous-mode' into 'master'
Emulator config generator: Anonymous mode, argparser See merge request Mr_Goldberg/goldberg_emulator!51merge-requests/51/merge
commit
4422471b84
|
@ -13,6 +13,7 @@ from steam.enums import common
|
|||
from steam.enums.common import EResult
|
||||
from steam.enums.emsg import EMsg
|
||||
from steam.core.msg import MsgProto
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
|
@ -23,19 +24,26 @@ import queue
|
|||
|
||||
prompt_for_unavailable = True
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("\nUsage: {} appid appid appid etc..\n\nExample: {} 480\n".format(sys.argv[0], sys.argv[0]))
|
||||
exit(1)
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="GenerateEmuConfig",
|
||||
description="Emulator Config Generator"
|
||||
)
|
||||
|
||||
appids = []
|
||||
for id in sys.argv[1:]:
|
||||
appids += [int(id)]
|
||||
parser.add_argument("app_id", nargs="+", help="Steam application IDs")
|
||||
parser.add_argument("-a", "--anonymous", action="store_true", help="Enable anonymous login mode")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
appids = [int(id) for id in args.app_id]
|
||||
|
||||
client = SteamClient()
|
||||
if not os.path.exists("login_temp"):
|
||||
os.makedirs("login_temp")
|
||||
client.set_credential_location("login_temp")
|
||||
|
||||
if args.anonymous:
|
||||
client.anonymous_login()
|
||||
else:
|
||||
if (len(USERNAME) == 0 or len(PASSWORD) == 0):
|
||||
client.cli_login()
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue