Теперь мы не должны отправлять 128 опкод самому себе. вроде

This commit is contained in:
Alexey Polyakov 2026-03-22 16:51:31 +03:00
parent ef512b060f
commit 8d7a1dacb5
3 changed files with 9 additions and 10 deletions

View File

@ -71,8 +71,9 @@ class OnemeMobileController(ControllerBase):
)
# Отправляем пакет
writer.write(packet)
await writer.drain()
if writer != eventData.get("writer"):
writer.write(packet)
await writer.drain()
def launch(self, api):
async def _start_all():

View File

@ -10,12 +10,12 @@ class UserAgentModel(pydantic.BaseModel):
pushDeviceType: str
arch: str = None
locale: str
buildNumber: int
buildNumber: int = None
deviceName: str
deviceLocale: str
class HelloPayloadModel(pydantic.BaseModel):
clientSessionId: int
clientSessionId: int = None
mt_instanceid: str = None
userAgent: UserAgentModel
deviceId: str

View File

@ -525,10 +525,6 @@ class Processors:
"time": int(time.time() * 1000)
}
print(
json.dumps(payload, indent=4)
)
# Собираем пакет
packet = self.proto.pack_packet(
cmd=self.proto.CMD_OK, seq=seq, opcode=self.opcodes.LOGIN, payload=payload
@ -692,7 +688,8 @@ class Processors:
"chatId": 0 if chatId == senderId else chatId,
"message": bodyMessage,
"prevMessageId": lastMessageId,
"time": messageTime
"time": messageTime,
"writer": writer
}
)
@ -1263,7 +1260,8 @@ class Processors:
user.get('id'),
{
"eventType": "profile_updated",
"profile": profile
"profile": profile,
"writer": writer
}
)