blah
This commit is contained in:
parent
7566423889
commit
c4312faf4a
@ -21,6 +21,7 @@ namespace RageCoop.Client
|
|||||||
internal static readonly Dictionary<PacketType, Func<byte[], Packet>> RequestHandlers = new Dictionary<PacketType, Func<byte[], Packet>>();
|
internal static readonly Dictionary<PacketType, Func<byte[], Packet>> RequestHandlers = new Dictionary<PacketType, Func<byte[], Packet>>();
|
||||||
internal static float SimulatedLatency=0;
|
internal static float SimulatedLatency=0;
|
||||||
public static bool IsConnecting { get; private set; }
|
public static bool IsConnecting { get; private set; }
|
||||||
|
public static IPEndPoint _targetServerEP;
|
||||||
static Networking()
|
static Networking()
|
||||||
{
|
{
|
||||||
Security=new Security(Main.Logger);
|
Security=new Security(Main.Logger);
|
||||||
@ -77,7 +78,7 @@ namespace RageCoop.Client
|
|||||||
|
|
||||||
PlayerList.Cleanup();
|
PlayerList.Cleanup();
|
||||||
EntityPool.AddPlayer();
|
EntityPool.AddPlayer();
|
||||||
if (publicKey==null && !string.IsNullOrEmpty(password) && !Menus.CoopMenu.ShowPopUp("WARNING", "WARNING", "Server's IP can be spoofed when using direct connection, do you wish to continue?", "", true))
|
if (publicKey==null && !string.IsNullOrEmpty(password) && !Menus.CoopMenu.ShowPopUp("", "WARNING", "Server's IP can be spoofed when using direct connection, do you wish to continue?", "", true))
|
||||||
{
|
{
|
||||||
IsConnecting=false;
|
IsConnecting=false;
|
||||||
return;
|
return;
|
||||||
@ -86,6 +87,7 @@ namespace RageCoop.Client
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
_targetServerEP=CoreUtils.StringToEndPoint(address);
|
||||||
DownloadManager.Cleanup();
|
DownloadManager.Cleanup();
|
||||||
Peer = new CoopPeer(config);
|
Peer = new CoopPeer(config);
|
||||||
Peer.OnMessageReceived+= (s, m) =>
|
Peer.OnMessageReceived+= (s, m) =>
|
||||||
|
@ -197,7 +197,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
case PacketType.PublicKeyResponse:
|
case PacketType.PublicKeyResponse:
|
||||||
{
|
{
|
||||||
if(Security.ServerRSA!=null){break;}
|
if(message.SenderEndPoint.ToString()!=_targetServerEP.ToString() ||!IsConnecting){break;}
|
||||||
var packet = data.GetPacket<Packets.PublicKeyResponse>();
|
var packet = data.GetPacket<Packets.PublicKeyResponse>();
|
||||||
Security.SetServerPublicKey(packet.Modulus, packet.Exponent);
|
Security.SetServerPublicKey(packet.Modulus, packet.Exponent);
|
||||||
_publicKeyReceived.Set();
|
_publicKeyReceived.Set();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user