An assetsless (headless) game client library for Jedi Knight: Jedi Academy and Jedi Knight II: Jedi Outcast games.
var jkclient = new JKClient(JKClient.GetKnownClientHandler(ProtocolVersion.Protocol26, ClientVersion.JA_v1_01));
jkclient.Start(ExceptionCallback);
jkclient.ServerCommandExecuted += ServerCommandExecuted;
await jkclient.Connect("192.168.0.1", ProtocolVersion.Protocol26);
jkclient.Disconnect();
jkclient.ServerCommandExecuted -= ServerCommandExecuted;
jkclient.Stop();
jkclient.Dispose();
void ServerCommandExecuted(CommandEventArgs commandEventArgs) {
Debug.WriteLine(commandEventArgs.Command.Argv(0));
}
var serverBrowser = new ServerBrowser(ServerBrowser.GetKnownBrowserHandler(ProtocolVersion.Protocol26));
serverBrowser.Start(ExceptionCallback);
var servers = await serverBrowser.GetNewList();
servers = await serverBrowser.RefreshList();
serverBrowser.Stop();
serverBrowser.Dispose();
Task ExceptionCallback(JKClientException exception) {
Debug.WriteLine(exception);
}
The library targets .NET Standard 2.0 (optionally .NET Standard 2.1), that means that the library can be ran on Windows, Mac, Linux, iOS, Android and others: https://docs.microsoft.com/en-us/dotnet/standard/net-standard
Dual license:
- GPL covers most of the game-related code.
- WTFPL covers the rest additional code that is not related to the game code.