public async Task StartClient(int localWorldId, short portOffset, bool membersWorld) { Task clientRunningAwaitable = signlink.startpriv("127.0.0.1"); ClientConfiguration configuration = new ClientConfiguration(localWorldId, portOffset, membersWorld); OpenTkImageProducerFactory imageProducerFactory = new OpenTkImageProducerFactory(); OpenTKClient client = CreateOpenTkClient(configuration, imageProducerFactory); using (OpenTKGameWindow gameWindow = new OpenTKGameWindow(765, 503, client, imageProducerFactory, client)) { client.createClientFrame(765, 503); gameWindow.Run(20, 60); } await clientRunningAwaitable .ConfigureAwait(false); }
public async Task StartClient(int localWorldId, short portOffset, bool membersWorld) { Task clientRunningAwaitable = signlink.startpriv(IPAddress.Parse("127.0.0.1")); ClientConfiguration configuration = new ClientConfiguration(localWorldId, portOffset, membersWorld); //Wait for signlink while (!signlink.IsSignLinkThreadActive) { await Task.Delay(50) .ConfigureAwait(false); } OpenTkImageProducerFactory imageProducerFactory = new OpenTkImageProducerFactory(); OpenTKClient client = CreateOpenTkClient(configuration, imageProducerFactory); using (OpenTKGameWindow gameWindow = new OpenTKGameWindow(765, 503, client, imageProducerFactory, client)) { client.createClientFrame(765, 503); gameWindow.Run(20, 60); } await clientRunningAwaitable .ConfigureAwait(false); }