-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move away from Steam client to full Stratz client
- A stratz token is necessary for the app to work - GSI is necessary for the app to work - Get game info from Stratz live graphql - Get player info from Stratz player graphql - Detect last game with Stratz instead of Opendota - Added player account level and country code
- Loading branch information
Showing
298 changed files
with
12,983 additions
and
1,844 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,6 @@ | ||
class MessageConnect: | ||
"""Ask the client to connect with specific credentials | ||
class MessageGSI: | ||
"""MatchId send by the GSI""" | ||
match_id: str | ||
|
||
Attributes: | ||
user: steam username | ||
password: steam password | ||
""" | ||
user: str | ||
password: str | ||
|
||
def __init__(self, user: str, password: str): | ||
self.user = user | ||
self.password = password | ||
|
||
|
||
class MessageConnectionStatus: | ||
"""Report the status of the connections of steam/dota clients | ||
Attributes: | ||
steam: Steam connection status | ||
dota: Dota connection status | ||
""" | ||
steam: str | ||
dota: str | ||
|
||
def __init__(self, steam: str, dota: str): | ||
self.steam = steam | ||
self.dota = dota | ||
|
||
|
||
class MessageServerIdRequest: | ||
"""Request the server ID a specific account is playing on""" | ||
account_id: str | ||
|
||
def __init__(self, account_id: str): | ||
self.account_id = account_id | ||
|
||
|
||
class MessageServerIdResponse: | ||
"""Server ID where a specific player is playing on""" | ||
server_id: int | ||
|
||
def __init__(self, server_id: int): | ||
self.server_id = server_id | ||
def __init__(self, match_id): | ||
self.match_id = match_id |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from sqlalchemy.orm import DeclarativeBase | ||
|
||
|
||
class BaseEntity(DeclarativeBase): | ||
"""Database model base class""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import os | ||
import sys | ||
|
||
from sqlalchemy import create_engine | ||
from sqlalchemy.orm import Session | ||
|
||
from dota_notes.data.models.base_entity import BaseEntity | ||
from dota_notes.data.models.settings_entity import SettingEntity | ||
|
||
|
||
class Database: | ||
"""Singleton defining database URI and unique ressources. | ||
Attributes: | ||
_instance: Singleton instance | ||
uri: database location | ||
engine: database connection used for session generation | ||
""" | ||
|
||
_instance = None | ||
|
||
def __new__(cls, *args, **kwargs): | ||
"""New overload to create a singleton.""" | ||
if not isinstance(cls._instance, cls): | ||
cls._instance = object.__new__(cls) | ||
return cls._instance | ||
|
||
def __init__(self): | ||
"""Defines all necessary ressources (URI & engine) and create database if necessary.""" | ||
if getattr(sys, 'frozen', False): | ||
file_uri = os.path.dirname(sys.executable) | ||
elif __file__: | ||
file_uri = os.path.dirname(__file__) | ||
self.uri = f"sqlite+pysqlite:///{file_uri}/sqlite.db" | ||
self.engine = create_engine(self.uri, echo=False) | ||
BaseEntity.metadata.create_all(self.engine) | ||
|
||
with Session(self.engine) as session: | ||
if session.get(SettingEntity, "version") is None: | ||
session.add(SettingEntity("version", "1")) | ||
session.commit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.