|
@@ -5,7 +5,6 @@ from inspect import signature
|
|
|
|
|
|
import connection
|
|
import connection
|
|
from connection import client_request
|
|
from connection import client_request
|
|
-from debug import debug
|
|
|
|
from game import DEFAULT_ORDER_EXPIRY, CURRENCY_NAME, MIN_INTEREST_INTERVAL, CURRENCY_SYMBOL, OWNABLE_NAME_PATTERN
|
|
from game import DEFAULT_ORDER_EXPIRY, CURRENCY_NAME, MIN_INTEREST_INTERVAL, CURRENCY_SYMBOL, OWNABLE_NAME_PATTERN
|
|
from routes import client_commands
|
|
from routes import client_commands
|
|
from run_client import fake_loading_bar
|
|
from run_client import fake_loading_bar
|
|
@@ -41,7 +40,7 @@ def login(username=None, password=None):
|
|
print('Login failed.')
|
|
print('Login failed.')
|
|
|
|
|
|
|
|
|
|
-def register(username=None, game_key='', password=None, retype_pw=None):
|
|
|
|
|
|
+def register(username=None, password=None, retype_pw=None):
|
|
if connection.session_id is not None:
|
|
if connection.session_id is not None:
|
|
connection.session_id = None
|
|
connection.session_id = None
|
|
fake_loading_bar('Signing out', duration=0.7)
|
|
fake_loading_bar('Signing out', duration=0.7)
|
|
@@ -68,15 +67,8 @@ def register(username=None, game_key='', password=None, retype_pw=None):
|
|
print('Passwords do not match.')
|
|
print('Passwords do not match.')
|
|
return
|
|
return
|
|
|
|
|
|
- if not debug:
|
|
|
|
- if game_key == '':
|
|
|
|
- print('Entering a game key will provide you with some starting money and other useful stuff.')
|
|
|
|
- game_key = input('Game key (leave empty if you don\'t have one): ')
|
|
|
|
-
|
|
|
|
fake_loading_bar('Validating Registration', duration=5.2)
|
|
fake_loading_bar('Validating Registration', duration=5.2)
|
|
- if game_key != '':
|
|
|
|
- fake_loading_bar('Validating Game Key', duration=0.4)
|
|
|
|
- response = client_request('register', {"username": username, "password": password, "game_key": game_key})
|
|
|
|
|
|
+ response = client_request('register', {"username": username, "password": password})
|
|
|
|
|
|
if 'error' in response:
|
|
if 'error' in response:
|
|
print('Registration failed with message:', response['error'])
|
|
print('Registration failed with message:', response['error'])
|
|
@@ -205,20 +197,6 @@ def leaderboard():
|
|
print('Leaderboard access failed.')
|
|
print('Leaderboard access failed.')
|
|
|
|
|
|
|
|
|
|
-def activate_key(key=''):
|
|
|
|
- if key == '':
|
|
|
|
- print('Entering a game key may get you some money or other useful stuff.')
|
|
|
|
- key = input('Key: ')
|
|
|
|
-
|
|
|
|
- if key == '':
|
|
|
|
- print('Invalid key.')
|
|
|
|
-
|
|
|
|
- fake_loading_bar('Validating Key', duration=0.4)
|
|
|
|
- response = client_request('activate_key', {"session_id": connection.session_id, 'key': key})
|
|
|
|
- if 'error' in response:
|
|
|
|
- print('Key activation failed with message:', response['error'])
|
|
|
|
-
|
|
|
|
-
|
|
|
|
def _order(is_buy_order, obj_name=None, amount=None, limit=None, stop_loss=None, expiry=None, ioc=None):
|
|
def _order(is_buy_order, obj_name=None, amount=None, limit=None, stop_loss=None, expiry=None, ioc=None):
|
|
if obj_name is None: # TODO list some available objects
|
|
if obj_name is None: # TODO list some available objects
|
|
obj_name = input('Name of object to sell: ')
|
|
obj_name = input('Name of object to sell: ')
|