mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2025-12-06 06:52:01 +01:00
Support multiple Test DC connections
This commit is contained in:
parent
26942d33f2
commit
b1649839d9
|
|
@ -100,6 +100,7 @@ namespace WTelegram
|
||||||
TcpHandler = cloneOf.TcpHandler;
|
TcpHandler = cloneOf.TcpHandler;
|
||||||
MTProxyUrl = cloneOf.MTProxyUrl;
|
MTProxyUrl = cloneOf.MTProxyUrl;
|
||||||
PingInterval = cloneOf.PingInterval;
|
PingInterval = cloneOf.PingInterval;
|
||||||
|
TLConfig = cloneOf.TLConfig;
|
||||||
_dcSession = dcSession;
|
_dcSession = dcSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -706,6 +707,7 @@ namespace WTelegram
|
||||||
if (MTProxyUrl != null)
|
if (MTProxyUrl != null)
|
||||||
{
|
{
|
||||||
#if OBFUSCATION
|
#if OBFUSCATION
|
||||||
|
if (TLConfig?.test_mode == true) dcId += 10000;
|
||||||
if (_dcSession.DataCenter?.flags.HasFlag(DcOption.Flags.media_only) == true) dcId = -dcId;
|
if (_dcSession.DataCenter?.flags.HasFlag(DcOption.Flags.media_only) == true) dcId = -dcId;
|
||||||
var parms = HttpUtility.ParseQueryString(MTProxyUrl[MTProxyUrl.IndexOf('?')..]);
|
var parms = HttpUtility.ParseQueryString(MTProxyUrl[MTProxyUrl.IndexOf('?')..]);
|
||||||
var server = parms["server"];
|
var server = parms["server"];
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ namespace WTelegram
|
||||||
new_nonce = new Int256(RNG),
|
new_nonce = new Int256(RNG),
|
||||||
dc = session.DataCenter?.id ?? 0
|
dc = session.DataCenter?.id ?? 0
|
||||||
};
|
};
|
||||||
|
if (client.TLConfig?.test_mode == true) pqInnerData.dc += 10000;
|
||||||
if (session.DataCenter?.flags.HasFlag(DcOption.Flags.media_only) == true) pqInnerData.dc = -pqInnerData.dc;
|
if (session.DataCenter?.flags.HasFlag(DcOption.Flags.media_only) == true) pqInnerData.dc = -pqInnerData.dc;
|
||||||
byte[] encrypted_data = null;
|
byte[] encrypted_data = null;
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue