public static void UDPTest(Packet _packet) //3 part { string _msg = _packet.ReadString(); // Debug.Log($"Received packet via UDP. Contains message: {_msg}"); Console.WriteLine($"Received packet via UDP. Contains message: {_msg}"); ClientSend.UDPTestReceived(); }
public static void Welcome(Packet _packet) { string _msg = _packet.ReadString(); int _myId = _packet.ReadInt(); // Debug.Log($"Message from server: {_msg}"); Console.WriteLine($"Message from server: {_msg}"); Client.instance.myId = _myId; ClientSend.WelcomeReceived(); Client.instance.udp.Connect(((IPEndPoint)Client.instance.tcp.socket.Client.LocalEndPoint).Port); }