Coordinator
Apr 2, 2012 at 11:13 PM
Edited Apr 2, 2012 at 11:15 PM
|
Since I assume most people don't use the issue tracker, I'll post this here.
I have decided to implement a breaking change to how certain methods work. For methods that return void or a boolean representing success, such as BanCollection.Add or Player.Kill, a new class will be returned called RconResult.
RconResult will be a class that contains properties for Success and Error. Success will be true if the request doesn't timeout and the first word is OK, and Error will return the first word if Success is false. It will also have implicit conversion operators
for bool and string representing those properties.
Here's an example of the upcoming change:
RconClient client;
RconResult result = client.Bans.Add(...);
if (result) Console.WriteLine("Ban successful.");
else Console.WriteLine("Ban Error: {0}", result);
Also, I'll eventually put the errors in an enumeration in order to make it programmatically easier to use.
|