void SingleplayerGameMenuEntrySelected(object sender, EventArgs e) { // start a thread with the server Spacestro.Cloud.Cloud cloud = new Spacestro.Cloud.Cloud("spacestro", 8383); ThreadStart serverStart = new ThreadStart(cloud.Start); Thread serverThread = new Thread(serverStart); serverThread.Name = "Single Player Server"; serverThread.Start(); // create cloudMessenger CloudMessenger messenger = new CloudMessenger("spacestro", "localhost"); // HACK: ghettofabulous. while (!messenger.Connected) { ; } // launch the game with the cloud messenger LoadingScreen.Load(this.ScreenManager, true, new SpacestroScreen(messenger, spServer: cloud)); }
void SingleplayerGameMenuEntrySelected(object sender, EventArgs e) { // start a thread with the server Spacestro.Cloud.Cloud cloud = new Spacestro.Cloud.Cloud("spacestro", 8383); ThreadStart serverStart = new ThreadStart(cloud.Start); Thread serverThread = new Thread(serverStart); serverThread.Name = "Single Player Server"; serverThread.Start(); // create cloudMessenger CloudMessenger messenger = new CloudMessenger("spacestro", "localhost"); // HACK: ghettofabulous. while (!messenger.Connected) ; // launch the game with the cloud messenger LoadingScreen.Load(this.ScreenManager, true, new SpacestroScreen(messenger, spServer:cloud)); }
public SpacestroScreen(CloudMessenger messenger, Thread spServerThread = null, Spacestro.Cloud.Cloud spServer = null) { this.cloudMessenger = messenger; this.spServerThread = spServerThread; this.spServer = spServer; }