Mkp
Mkp
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
idk wtf I am looking at
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
Are you sure the PI is 192.168.0.135 and its being hosted on that ip and port? If you hosting on localhost its not gonna work
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
Which is expected cuz you not using Async
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
If it blocks until it gets data, then yeah the game will get hung up
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
Yeah it seems like _Process() is at fault
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
comment
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
You can remove the code from _Process() for now
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
It shouldn't hang on _Ready()
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
That doesnt make sense
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
Those warnings seem old
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
Did you?
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
No description
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
(did you save??)
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
commenting is definitely not the solution
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
Okay then just omit it
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
Is there anything in intellisense?
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
im not sure if flush exists on UdpClient, its convention though so, might be FlushAsync ¯\_(ツ)_/¯
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
This is more akin to what you want
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
using Godot;
using Microsoft.Win32;
using System.Net;
using System.Net.Sockets;
using System.Text;

public partial class ClientUDP : Node
{
private UdpClient client = new UdpClient();
private IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Parse("192.168.0.135"), 1738);
private IPEndPoint receiveEndPoint = new IPEndPoint(IPAddress.Any, 0);

public override void _Ready()
{
// Send data to the server
byte[] data = Encoding.UTF8.GetBytes("UDP client connected");
client.Send(data, data.Length, remoteEndPoint);

client.Flush();
}

public override void _Process(double delta)
{
byte[] receivedData = client.Receive(ref receiveEndPoint);
string response = Encoding.UTF8.GetString(receivedData);

GD.Print("THIRD PART WORKS"); //
// Listen for packets
if (response == "RK")
{
GD.Print("RK WORKS!!!!");
}
else if (response == "LK")
{
GD.Print("LK WORKS!!!!");
}
else if (response == "RP")
{
GD.Print("RP WORKS!!!!");
}
}
}
using Godot;
using Microsoft.Win32;
using System.Net;
using System.Net.Sockets;
using System.Text;

public partial class ClientUDP : Node
{
private UdpClient client = new UdpClient();
private IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Parse("192.168.0.135"), 1738);
private IPEndPoint receiveEndPoint = new IPEndPoint(IPAddress.Any, 0);

public override void _Ready()
{
// Send data to the server
byte[] data = Encoding.UTF8.GetBytes("UDP client connected");
client.Send(data, data.Length, remoteEndPoint);

client.Flush();
}

public override void _Process(double delta)
{
byte[] receivedData = client.Receive(ref receiveEndPoint);
string response = Encoding.UTF8.GetString(receivedData);

GD.Print("THIRD PART WORKS"); //
// Listen for packets
if (response == "RK")
{
GD.Print("RK WORKS!!!!");
}
else if (response == "LK")
{
GD.Print("LK WORKS!!!!");
}
else if (response == "RP")
{
GD.Print("RP WORKS!!!!");
}
}
}
85 replies
CC#
Created by Based on 10/30/2024 in #help
Godot UDP Client not functioning properly
...
client = new UdpClient();
...
...
client = new UdpClient();
...
will assign the class member client to the value you want (UdpClient)
85 replies