Implemented phpstruct and started turning everything into classes.
This commit is contained in:
parent
a6bd5655c0
commit
24396b23f0
2
TL.py
2
TL.py
@ -101,7 +101,7 @@ def serialize_param(bytes_io, type_, value):
|
||||
elif type_ in ["int128", "int256"]:
|
||||
assert isinstance(value, bytes)
|
||||
bytes_io.write(value)
|
||||
elif type_ == 'string' or 'bytes':
|
||||
elif type_ == 'string' or type_ == 'bytes':
|
||||
l = len(value)
|
||||
if l < 254: # short string format
|
||||
bytes_io.write(struct.pack('<b', l)) # 1 byte of string
|
||||
|
BIN
mtproto.php
BIN
mtproto.php
Binary file not shown.
@ -40,7 +40,6 @@ def vis(bs):
|
||||
if not len(bs) % symbols_in_one_line == 0:
|
||||
print(str((i+1)*symbols_in_one_line)+" | "+" ".join(["%02X" % b for b in bs[(i+1)*symbols_in_one_line:]])+"\n") # for last line
|
||||
|
||||
vis(b'ddd')
|
||||
class Session:
|
||||
""" Manages TCP Transport. encryption and message frames """
|
||||
def __init__(self, ip, port, auth_key=None, server_salt=None):
|
||||
|
Loading…
Reference in New Issue
Block a user