🐛 mis à jour du serveur, mais j'ai quand meme une exception lors de la connexion client

ServerDeployement
Bruno DA COSTA CUNHA 2 years ago
parent d1eb396d99
commit b0d54b2af9

@ -8,6 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using Shared.DTO;
using System.ComponentModel;
using System.Text.Json;
namespace Server
{
@ -81,6 +82,13 @@ namespace Server
if (maxPlayer == 2)
{
IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0);
byte[] receivedDataHost = playerHost.Value.Receive(ref remoteEndPoint);
playerJoin.Value.Send(receivedDataHost, receivedDataHost.Length, remoteEndPoint);
byte[] receivedDataJoin = playerJoin.Value.Receive(ref remoteEndPoint);
playerHost.Value.Send(receivedDataJoin, receivedDataJoin.Length, remoteEndPoint);
Thread receiveThread1 = new Thread(() => ReceiveMessages(playerHost.Value, playerJoin.Value));

@ -9,6 +9,16 @@ namespace Shared.DTO
public class Informations
{
public Action Action { get; set; }
public string? IdRoom { get; set; }
public long Frame { get; set; }
public string TypeData { get; set; }
public string? IdRoom { get; set; }
public Informations(Action action, long frame, string typeData, string? idRoom = null)
{
Action = action;
Frame = frame;
TypeData = typeData;
IdRoom = idRoom;
}
}
}

@ -10,5 +10,11 @@ namespace Shared.DTO
{
public Informations Informations { get; set; }
public T Data { get; set; }
public ObjectTransfert(Informations infos, T data)
{
Informations = infos;
Data = data;
}
}
}

Loading…
Cancel
Save