public void EnterLoginMenu() { currentGameState = GameState.Login; login_menu = new LoginMenu(this); if (MediaPlayer.State == MediaState.Stopped) { MediaPlayer.Play(Assets.titleSong); } }
void DrawWinner() { Winner.text = LoginMenu.RandomPlayerVar.Username; LoginMenu.ComDataVar.CurrentWinnerCommunityChest = LoginMenu.RandomPlayerVar.Username; LoginMenu.RandomPlayerVar.dollar += 1000; LoginMenu.ComDataVar.CommunityChestDonations -= 1100; LoginMenu.UploadData(LoginMenu.RandomPlayerVar); LoginMenu.UploadCom(); }
/// <summary> /// Here is where the user will login to the system, using previous credentials. /// if they have not before made an account, they will be prompted to. /// </summary> /// <param name="clientNumber">Client number.</param> /// <param name="client">Client socket connection</param> /// private User ManageUserLogin(int clientNumber, TcpClient client) { try { // Loop until the user has made a correct choice while (true) { // Presenting and sending the menu to the user, allow them to make their choice on what to do. NetworkStream stream = client.GetStream(); SendMessage(LoginMenu.LoginMenuString, stream); // Read the users input string userInput = RecieveMessage(client.GetStream()); // Checking if the user's input is within the login menu choice constraints, this allows us to pass // a correct input into the function to determine what the user wants to do. if (LoginMenu.VerifyLoginMenuChoice(userInput)) { // S §end off the input to the login menu, to allow the user to login. var loginInformation = LoginMenu.ManageUserChoice(userInput, client, clientNumber); bool shouldUserQuit = loginInformation.Item1; User userAccount = loginInformation.Item2; // If the user wants to quit if (shouldUserQuit) { SendMessage("Your session has been ended. Type Exit to terminate program.\n", client.GetStream()); // If the user wants to quit, we simply terminate the connection. client.GetStream().Close(); client.Close(); client.Dispose(); // Return to close this thread that the user is operating on. return(null); } // The user wants to view the menu again if ((!shouldUserQuit) && (userAccount == null)) { continue; } // The user is logged in // Assign the current tcp client connection to this user, userAccount.Connection = client; return(userAccount); } // Tell the current client to try again. SendMessage("Invalid Input, try agian.", stream); } } catch (IOException ex) { Console.WriteLine("Unable to read data from client. ABORTING.\n" + ex); return(null); } }
public void Start() { Instance = this; bLoggedIn = false; cLoginMenu = gameObject.GetComponent <LoginMenu> (); cExchangeGameData = gameObject.GetComponent <ExchangeGameData> (); Application.runInBackground = true; AsynchronousClient.Instance.OkayToTick = true; }
/// <summary> /// Kollar om användaren är aktiv /// </summary> /// <param name="adminId"></param> /// <returns></returns> public static bool IsUserActice(int adminId) { var userActive = api.Ping(adminId); if (userActive != "pong") { LoginMenu.LoginAgain(); } return(true); }
void Awake() { m_loginMenu = GameObject.FindObjectOfType<LoginMenu>(); m_mainMenu = GameObject.FindObjectOfType<MainMenu>(); m_optionMenu = GameObject.FindObjectOfType<OptionMenu>(); m_artworkMenu = GameObject.FindObjectOfType<ArtworksMenu>(); m_creditsMenu = GameObject.FindObjectOfType<CreditsMenu>(); m_shopMenu = GameObject.FindObjectOfType<ShopMenu>(); m_singleton = this; }
public void UpdateCommon(string key, int addition) { if (key.CompareTo("CommunityChestDonations") == 0) { LoginMenu.ComDataVar.CommunityChestDonations += addition; } if (key.CompareTo("NumberOfUsers") == 0) { LoginMenu.ComDataVar.NumberOfUsers += addition; } LoginMenu.UploadCom(); }
private static void llenarListaForms() { forms.Add("FrbaHotel", FrbaHotel.obtenerInstancia()); forms.Add("Roles", Roles.obtenerInstancia()); forms.Add("AltaRol", AltaRol.obtenerInstancia()); forms.Add("GenerarModificarReserva", GenerarModificarReserva.obtenerInstancia()); forms.Add("Login", Login.Login.obtenerInstancia()); forms.Add("LoginPerfil", LoginPerfil.obtenerInstancia()); forms.Add("LoginMenu", LoginMenu.obtenerInstancia()); forms.Add("Hoteles", Hoteles.obtenerInstancia()); forms.Add("Habitaciones", Habitaciones.obtenerInstancia()); forms.Add("Regimenes", Regimenes.obtenerInstancia()); forms.Add("Clientes", Clientes.obtenerInstancia()); forms.Add("EditarRol", EditarRol.obtenerInstancia()); }
public void UpdateAssets(int t, int c, int d) { int temp; temp = int.Parse(Tickets.text) + t; Tickets.text = temp.ToString(); LoginMenu.Player.tickets = temp; temp = int.Parse(Coins.text) + c; Coins.text = temp.ToString(); LoginMenu.Player.coins = temp; temp = int.Parse(Dollars.text) + d; Dollars.text = temp.ToString(); LoginMenu.Player.dollar = temp; LoginMenu.UploadData(LoginMenu.Player); }
void Update() { LoginMenu lm = LoginRegisterPanel.GetComponent <LoginMenu>(); if (Hour == 0 && Min == 1 && RandomGenerator == false) //random var generator when 1min is left { //StartCoroutine(lm.RandomUser()); RandomGenerator = true; } if (Hour == 0 && Min == 0) { ResetTimer(); //DailyRaffle script = DailyRaffleObject.GetComponent<DailyRaffle>(); //script.RaffleTime(); } }
protected virtual void Awake() { Data = (T)Activator.CreateInstance(typeof(T)); if (loginMenu == null) { loginMenu = gameObject.GetOrCreateComponent <LoginMenu>(); } if (saveMenu == null) { saveMenu = gameObject.GetOrCreateComponent <SavegameMenu>(); } if (backendManager == null) { backendManager = gameObject.GetOrCreateComponent <BackendManager>(); } }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here self = this; //LoadConfig(); Wallpaper = Utils.CreateTexture(GraphicsDevice, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); // gd = GraphicsDevice; loginMenu = new LoginMenu(); loginMenu.Initialize(Content); registerMenu = new RegisterMenu(); registerMenu.Initialize(Content); menus.Add(loginMenu); menus.Add(registerMenu); base.Initialize(); state = State.LoginMenu; }
static void Main(string[] args) { while (true) { try { LoginMenu.MainMenuLogin(MembersDB.Members, MembersDB.Admins, MembersDB.Trainers, MembersDB.Students); } catch (Exception ex) { Console.Clear(); Console.WriteLine("\nOops! Looks like something went wrong. Let's see what..."); Console.WriteLine($"\n{ex.Message}"); Console.WriteLine("\nPlease try again."); LoginMenu.PressAnyKey(); } } }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { if (!this.Visible) { return; } CommonHelper.AddLinkedStyleSheet(this.Page, "~/Structure/Base/Controls/Toolbar/styles/LoginMenuStyle.css"); CommonHelper.AddLinkedStyleSheet(this.Page, "~/Structure/Base/Controls/Toolbar/styles/Toolbars.css"); CommonHelper.AddLinkedStyleSheet(this.Page, "~/Structure/Base/Controls/Toolbar/styles/ToolbarMenuStyle.css"); CommonHelper.AddLinkedStyleSheet(this.Page, "~/Structure/Base/Controls/Toolbar/styles/ToolbarStyle.css"); CommonHelper.AddLinkedStyleSheet(this.Page, "~/Structure/Base/Controls/Toolbar/styles/ToolbarDrag.css"); // Register Javascripts Page.ClientScript.RegisterClientScriptInclude(typeof(ToolbarControl), "ToolbarClient", Page.ResolveClientUrl("~/Structure/Base/Controls/Toolbar/Scripts/ToolbarClient.js")); //Page.ClientScript.RegisterClientScriptInclude(typeof(ToolbarControl), "TbSettings", Page.ResolveClientUrl("~/Structure/Base/Controls/Toolbar/Scripts/TbSettings.js")); //Page.ClientScript.RegisterClientScriptInclude(typeof(ToolbarControl), "ToolBar", Page.ResolveClientUrl("~/Structure/Base/Controls/Toolbar/Scripts/ToolBar.js")); //Page.ClientScript.RegisterClientScriptInclude(typeof(ToolbarControl), "ToolBox", Page.ResolveClientUrl("~/Structure/Base/Controls/Toolbar/Scripts/CMS_ToolBox.js")); Page.ClientScript.RegisterClientScriptInclude(typeof(ToolbarControl), "DragToolBox", Page.ResolveClientUrl("~/Structure/Base/Controls/Toolbar/Scripts/Drag.js")); if (CMSContext.Current.IsDesignMode) { TopToolBar.SelectedIndex = 1; } else { TopToolBar.SelectedIndex = 0; } BindToolBar(); if (!this.IsPostBack) { BindSites(); LoginMenu.Items[0].Items[0].NavigateUrl = ResolveUrl("~/login.aspx"); LoginMenu.Items[0].Items[1].NavigateUrl = ResolveUrl("~/logout.aspx"); LoginMenu.DataBind(); } }
private void Start() { LoginMenu script = LoginRegisterPanel.GetComponent <LoginMenu>(); script.DownloadCommon(); }
/// <summary> /// Get the users login menu choice. /// </summary> /// <returns></returns> private static string GetLoginAction() { var loginMenu = new LoginMenu(); return(loginMenu.GetMenuChoice()); }
private void Start() { LoginMenu = GameObject.FindGameObjectWithTag("LoginMenu").GetComponent <LoginMenu>(); }
private void button1_Click(object sender, EventArgs e) { this.Hide(); LoginMenu.obtenerInstancia().Show(); }
void Start() { mainScript = GetComponent<LoginMenu>(); }
public AccountCreationMenuEventWiring(AccountCreationMenu accountCreationMenu, LoginMenu loginMenu, AccountCreation accountCreation, WaitScreen waitScreen) { //Escape was pressed accountCreationMenu.OnEscape += sender => { loginMenu.Open(); accountCreationMenu.Close(); }; //Account creation canceled. accountCreationMenu.ChancelSelected += sender => { loginMenu.Open(); accountCreationMenu.Close(); }; //Account creation started. accountCreationMenu.CreationInformationEntered += sender => { waitScreen.Open(); waitScreen.Message = "Accounterstellung läuft..."; sender.Close(); accountCreation.StartAccountCreation(accountCreationMenu.UserName, accountCreationMenu.Password); }; //Account creation successful return to login menu accountCreation.AccountCreationSuccessful += sender => { loginMenu.UserName = accountCreationMenu.UserName; loginMenu.Password = accountCreationMenu.Password; loginMenu.Open(); accountCreationMenu.Close(); waitScreen.Close(); }; //Account creation failed. Display error. accountCreation.AccountCreationFailed += (sender, args) => { accountCreationMenu.SetErrorText(args.ReasonText); accountCreationMenu.Open(); waitScreen.Close(); }; }
public void EnterState() { var window = new LoginMenu(); Program.MainWindow.SwitchScreen(window); }
void Start() { mainScript = GetComponent <LoginMenu>(); }
public void OpenRegister() { StartMenu.SetActive(false); LoginMenu.SetActive(false); RegisterMenu.SetActive(true); }
public MainMenuEventWiring( MainMenu mainMenu, CharCreationMenu charCreationMenu, ExitMenu exitMenu, ScriptClient client, LoginMenu loginMenu, Login.Login login, WaitScreen waitScreen, CharacterSelectionMenu selectionMenu, JoinGameSender joinGameSender, CharacterList characterList, ErrorScreenManager errorScreenManager) { mainMenu.CharacterCreationSelected += sender => { sender.Close(); charCreationMenu.Open(); }; mainMenu.JoinGameSelected += sender => { if (!characterList.TryGetActiveCharacter(out Character.Character character)) { mainMenu.Close(); errorScreenManager.ShowError("Kein Character gewählt!", mainMenu.Open); return; } joinGameSender.StartJoinGame(character); waitScreen.Message = "Trete Spiel bei..."; waitScreen.Open(); mainMenu.Close(); //client.SendSpectateMessage(); }; mainMenu.BackToLoginSelected += sender => { sender.Close(); waitScreen.Message = "Logout läuft..."; waitScreen.Open(); login.StartLogout(); }; mainMenu.CharacterSelectionSelected += sender => { selectionMenu.Open(); sender.Close(); }; mainMenu.ExitGameSelected += sender => { sender.Close(); exitMenu.Open(); }; joinGameSender.JoinGameRequestSuccessful += sender => { //The server accepted the join request, close the ui, from here on the server does most of the controlling. waitScreen.Close(); }; joinGameSender.JoinGameFailed += (sender, args) => { //Something went wrong show an error message to the player and then return to the main menu. waitScreen.Close(); errorScreenManager.ShowError(args.ReasonText, mainMenu.Open); }; }
public static void StartMenu() { Console.WriteLine("Välkommen till bokhandeln"); Console.WriteLine("Vänligen logga in: "); LoginMenu.Startup(); }
private void Awake() { GameObject usernameText = GameObject.Find("LoggedInText"); LoginMenu loginMenu = GetComponent <LoginMenu>(); }