public void GetServerAndName() { if (File.Exists("serverlogin.tmp")) { File.Delete("serverlogin.tmp"); } File.WriteAllText("serverlogin.tmp", DateTime.Now.Year + ":" + DateTime.Now.Month + ":" + DateTime.Now.Day + ":" + DateTime.Now.Hour + ":" + DateTime.Now.Minute); AwaitingServerAndName = true; InstanceKeeper.GetAccountMenu().GetType().GetMethod("ShowLoginAccountPanel", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(InstanceKeeper.GetAccountMenu(), null); InstanceKeeper.SetMainClient(this); }
public void Connect(string serverIP, int port, string username) { WriteLog.Verbose("Attempting to start client"); gClient = new GameClient(); WriteLog.Verbose("Successfully instantiated client"); WriteLog.Verbose("Server IP is " + serverIP + ":" + port.ToString() + " , and connecting with username " + username); gClient.Start(serverIP, port, username); WriteLog.Debug("Client started successfully"); InstanceKeeper.SetGameClient(gClient); IsConnected = true; }