Library to communicate to C&C Renegade FDS over RenRem protocol with useful extra features.
$ dotnet add package FDSRemFDSRem is a ibrary to communicate with C&C Renegade servers over RenRem protocol with useful extra features such as keep alive.
ConnectionStatus.Connecting, and library will automatically attempt to reconnect.DisconnectedEvent will raise with DisconnectReason.ClientTimeOut.ConnectionStatus.Connecting, keep alive procedure will end, connection status will be set to ConnectionStatus.Disconnected and connection will need to be restarted manually.DisconnectedEvent will never raise with DisconnectReason.ClientTimeOut.** Connection timed out - Bye! ** and ** Server exiting - Connection closed! ** will be automatically handled and suppressed from DataReceivedEvent. Instead, these will be raised as an event via DisconnectedEvent, with DisconnectReason.ServerTimeOut and DisconnectReason.ServerShutdown.Password accepted. will be automatically handled and suppressed from DataReceivedEvent. Instead, this will raise ConnectedEvent. Continuing lines after Password accepted. will be extracted to RenRemClient.MessageOfTheDay property.There is an example below of initializing RenRemClient with a host name.
var renremPort = 4849;
var client = new RenRemClient("myserver.com", renremPort);
Alternatively, you can specify a local port number to bind the UdpClient.
Every RenRemClient constructor accepts the last parameter as local port optionally.
var renremPort = 4849;
var localPort = 1337;
var client = new RenRemClient("myserver.com", renremPort, localPort);
It is also possible to initialize RenRemClient with an IP address instead.
var renremPort = 4849;
var ipAddress = System.Net.IPAddress.Parse("127.0.0.1");
var client = new RenRemClient(ipAddress, renremPort);
Or an IPEndPoint instead.
var renremPort = 4849;
var ipAddress = System.Net.IPAddress.Parse("127.0.0.1");
var ep = new System.Net.IPEndPoint(ipAddress, renremPort);
var client = new RenRemClient(ep);
To enable Keep Alive feature, you need to set KeepAlive property to true.
client.KeepAlive = true;
client.Start(), or asynchronously using client.StartAsync() methods.client.Send() or client.SendAsync() methods.RenRemClient forces an immediate closure, and does not raise any events. Use client.Stop() if you want events to raise with a graceful closure.