Add register user endpoint for connexion
This commit is contained in:
@@ -18,7 +18,7 @@ from discord import discord_oauth
|
||||
from fivemserver.whitelistmanager import WhiteList
|
||||
from fivemserver.fivemlauncher import FiveMLauncher
|
||||
from fivemserver.queuemanager import QueueManager
|
||||
|
||||
from fivemserver.get_server_token import GetServerTokenForDiscord
|
||||
from fake_patch_notes import patch_note
|
||||
|
||||
# For Linux Wayland to authorize moving window
|
||||
@@ -137,6 +137,8 @@ class MainWindow(QMainWindow):
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
def _on_connexion(self) -> None:
|
||||
GetServerTokenForDiscord.register_discord_user(self.config.get_discord_user(),
|
||||
GetServerTokenForDiscord.authenticate(Urls.API_URL.value))
|
||||
FiveMLauncher.launch()
|
||||
|
||||
@staticmethod
|
||||
@@ -148,7 +150,9 @@ class MainWindow(QMainWindow):
|
||||
self._glow.start()
|
||||
|
||||
def _on_discord_auth_btn(self) -> None:
|
||||
self.config.set_discord_user(discord_oauth.get_discord_user_id())
|
||||
test = discord_oauth.get_discord_user_id()
|
||||
self.config.set_discord_user(test[0])
|
||||
PlayerServerInfo.session_id = test[1]
|
||||
self.config.save()
|
||||
self.ui.stackedWidget.setCurrentIndex(0)
|
||||
|
||||
@@ -199,7 +203,7 @@ class MainWindow(QMainWindow):
|
||||
self.queue_thread.start()
|
||||
|
||||
# 🧪 TEMP - Simule une position en queue pour tester l'UI
|
||||
self.handle_update("position:3:10")
|
||||
# self.handle_update("position:3:10")
|
||||
|
||||
def handle_update(self, message: str):
|
||||
# print(f"[handle_update] reçu: {message}") # ← Debug
|
||||
|
||||
Reference in New Issue
Block a user