I've this code
Code:
if (packet.Header == "OK")
{
SendPacket("game_start");
_pulseTimer.Start();
Task.Run(() =>
{
while (_client.Connected)
{
packets = ReceivePackets();
foreach (string value in packets)
{
PacketReceived?.Invoke(this, new Packet(value));
}
}
});
return true;
}
Code:
private void OnPacketReceived(object sender, Packet packet)
{
Console.WriteLine(packet.Header);
}
Code:
tit info fd fd c_info c_info_reset equip lev stat ski at c_map sc cond pairy rsfi rage rank_cool clinit flinit kdlinit
Code:
private List<string> ReceivePackets()
{
var bytes = new byte[_client.ReceiveBufferSize];
int size = _stream.Read(bytes, 0, bytes.Length);
return Decrypt(bytes, size);
}
I believe it's because the #Read method is blocked waiting for something from the server but idk what's the problem
Thanks in advance for your help, i'm beginner to this kind of stuff (socket etc..)
Edit : I'm posting this here because i'm not sure if it's a C# general question or just something i'm missing about nostale server (like sending a packet or something like this)






