if not FParent.GetUser(FRemUIN, User) then begin if Assigned(OnError) then FOnError(Self, ERR_WARNING, 'Direct connection cannot be initialized'); OnSockError(Self); Exit; end;
if GetLInt(@Pak, 2) < 7 then begin if Assigned(OnError) then FOnError(Self, ERR_WARNING, 'Direct connection cannot be initialized due to security issues'); OnSockError(Self); Exit; end;
if GetLInt(@Pak, 2) <> $2b then begin if Assigned(OnError) then FOnError(Self, ERR_WARNING, 'Direct connection cannot be initialized due to malformed packet'); OnSockError(Self); Exit; end;
if GetLInt(@Pak, 4) <> FParent.FUIN then begin if Assigned(OnError) then FOnError(Self, ERR_WARNING, 'Direct connection cannot be initialized due to security issues'); OnSockError(Self); Exit; end;
Inc(Pak.Len, 2); //00 00 - empty
port := GetLInt(@Pak, 4); //remote port
FRemUIN := GetLInt(@Pak, 4); //remote UIN
Inc(Pak.Len, 8); //IPs, not used
ptype := GetInt(@Pak, 1); //Proxy type
if (ptype <> 04) and (ptype <> 02) then begin if Assigned(OnError) then FOnError(Self, ERR_WARNING, 'Direct connection cannot be initialized due to unsupported proxy type'); OnSockError(Self); Exit; end;
if GetLInt(@Pak, 4) <> port then begin if Assigned(OnError) then FOnError(Self, ERR_WARNING, 'Direct connection cannot be initialized due to security issues'); OnSockError(Self); Exit; end;
if not FParent.GetUser(FRemUIN, User) then begin if Assigned(OnError) then FOnError(Self, ERR_WARNING, 'Direct connection cannot be initialized'); OnSockError(Self); Exit; end;
if GetInt(@Pak, 4) <> User.Cookie then begin if Assigned(OnError) then FOnError(Self, ERR_WARNING, 'Direct connection cannot be initialized due to security issues'); OnSockError(Self); Exit; end;