mirror of
https://github.com/openmax-server/server.git
synced 2026-05-22 19:41:41 +03:00
Compare commits
4 Commits
7426e83914
...
6bb0d52419
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bb0d52419 | ||
|
|
911008c0a1 | ||
|
|
b8472821eb | ||
|
|
f1c1639d9f |
@@ -116,10 +116,11 @@ class OnemeController(ControllerBase):
|
||||
OnemeWS(
|
||||
host=self.config.host,
|
||||
port=self.config.oneme_ws_port,
|
||||
clients=api['clients'],
|
||||
ssl_context=api['ssl'],
|
||||
db_pool=api['db'],
|
||||
send_event=api['event']
|
||||
clients=api['clients'],
|
||||
send_event=api['event'],
|
||||
telegram_bot=api.get('telegram_bot'),
|
||||
).start()
|
||||
)
|
||||
|
||||
|
||||
@@ -631,8 +631,9 @@ class AuthProcessors(BaseProcessor):
|
||||
"token": token,
|
||||
"videoChatHistory": False,
|
||||
"time": int(time.time() * 1000),
|
||||
} # Собираем пакет
|
||||
|
||||
}
|
||||
|
||||
# Собираем пакет
|
||||
packet = self.proto.pack_packet(
|
||||
cmd=self.proto.CMD_OK, seq=seq, opcode=self.opcodes.LOGIN, payload=payload
|
||||
)
|
||||
|
||||
@@ -10,7 +10,9 @@ from common.opcodes import Opcodes
|
||||
from common.tools import Tools
|
||||
|
||||
class OnemeWS:
|
||||
def __init__(self, host, port, clients, ssl_context, db_pool, send_event):
|
||||
def __init__(
|
||||
self, host, port, ssl_context, db_pool, clients, send_event, telegram_bot
|
||||
):
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.ssl_context = ssl_context
|
||||
@@ -22,7 +24,13 @@ class OnemeWS:
|
||||
self.opcodes = Opcodes()
|
||||
|
||||
self.proto = WebProto()
|
||||
self.processors = Processors(db_pool=db_pool, clients=clients, send_event=send_event, type="web")
|
||||
self.processors = Processors(
|
||||
db_pool=db_pool,
|
||||
clients=clients,
|
||||
send_event=send_event,
|
||||
telegram_bot=telegram_bot,
|
||||
type="web"
|
||||
)
|
||||
self.auth_required = Tools().auth_required
|
||||
|
||||
# rate limiter
|
||||
@@ -120,7 +128,7 @@ class OnemeWS:
|
||||
userPhone,
|
||||
userId,
|
||||
hashedToken,
|
||||
) = await self.processors.login(payload, seq, websocket, deviceType, appVersion)
|
||||
) = await self.processors.login(payload, seq, websocket, appVersion)
|
||||
|
||||
if userPhone:
|
||||
await self._finish_auth(
|
||||
|
||||
@@ -407,6 +407,24 @@ class AuthProcessors(BaseProcessor):
|
||||
"DELETE FROM tokens WHERE token_hash = %s", (hashedToken,)
|
||||
)
|
||||
|
||||
# ⣿⡇⣽⣿⣿⣿⣧⠘⣿⣿⠠⣤⣍⡛⢿⣿⣿⠏⣰⣿⣿⣿⣿⣿⡆⢿
|
||||
# ⣿⢀⣿⣿⣿⣿⣿⣷⡈⢿⡄⢿⣿⣿⣦⡙⠏⣰⣿⣿⣿⣿⣿⣿⡇⣿
|
||||
# ⣿⢸⣿⣿⣿⣿⣿⣿⡿⠄⣡⣤⣿⣿⣿⣿⣄⣿⣿⣿⣿⣿⣿⣿⡇⣿
|
||||
# ⣿⢸⣿⣿⣿⣿⣿⣿⣤⣬⣭⣬⣬⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⣿
|
||||
# ⣿⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⣿
|
||||
# ⣿⡀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠿⠿⠿⣿⣿⡿⢠⣿
|
||||
# ⣿⣧⠸⣿⣧⠀⣴⡆⣤⠀⢸⣿⣿⣿⣿⠀⠀⢸⣿⡌⣶⣿⠟⢁⣾⣿
|
||||
# ⠙⠛⠂⠹⡿⢸⣿⡇⢸⠁⢸⣿⣿⣿⣿⠀⠀⢈⣿⡇⢸⣯⣤⣤⠀⣿
|
||||
# ⣆⠙⣿⣿⣇⢸⣿⣇⠀⢀⣾⡿⢿⣿⣿⣀⣀⣼⣿⡇⣸⣿⡿⢁⣾⣿
|
||||
# ⣿⣷⢀⡟⡉⠞⢻⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⣿⠋⠘⣹⣿⡄⢻⣿⣿
|
||||
# ⣿⡇⣼⣿⣧⣶⣿⣿⣿⣟⠻⢋⣍⣉⣋⣼⣿⣿⣿⣶⢿⣿⣿⡄⢻⣿
|
||||
# ⣿⣧⣭⣭⣄⡙⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠛⣡⣤⣭⣤⣴⣾⣿
|
||||
# ⣿⣿⣿⣿⣿⣿⣇⠠⣬⣭⣽⣿⣿⣿⣿⣿⣷⡈⢿⣿⣿⣿⣿⣿⣿⣿
|
||||
# ⣿⣿⣿⣿⣿⣿⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⣷⡈⣿⣿⣿⣿⣿⣿⣿
|
||||
# ⣿⣿⣿⣿⣿⣿⣿⠃⠼⢿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠹⣿⣿⣿⣿⣿⣿
|
||||
# ⣿⣿⣿⣿⣿⣿⣿⣶⠆⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⣿⣿⣿⣿⣿⣿
|
||||
# ⣿⣿⣿⣿⣿⣿⣿⣿⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢹⣿⣿⣿⣿⣿
|
||||
|
||||
# Создаем пакет
|
||||
response = self.proto.pack_packet(
|
||||
cmd=self.proto.CMD_OK, seq=seq, opcode=self.opcodes.LOGOUT, payload=None
|
||||
|
||||
Reference in New Issue
Block a user