Ejemplo n.º 1
0
        /*
            Shows the various options given before entering the game, registration, etc.
        */

        public static async Task Do(Connection conn)
        {
            //send the MOTD
            await conn.SendANSI(string.Format("{0}Choose an option:{0}1: Enter the Lattice.{0}2: Register a new account.{0}3: Quit.", "\n"), Encode.ANSI.ANSIColor.FG_Yellow, Encode.ANSI.ANSIColor.BG_Black, true, Encode.ANSI.ExtendedTextAttribute.Bold);
            await conn.resetWait();
            conn.State = States.ClientState.LOBBY;
            await conn.inputWaiting.Task;

            switch (conn.inputLine)
            {
                case "1":
                    await Authenticate.Do(conn);
                    break;

                case "2":
                    await conn.SendASCII("Not yet implemented.");
                    await Lobby.Do(conn);
                    return;

                case "3":
                    await conn.SendASCII("Goodbye!");
                    await conn.Close();
                    return;

                default:
                    await Lobby.Do(conn);
                    return;

            }
        }
Ejemplo n.º 2
0
        /*
            Dialog for authenticating Connections and turning them into Players.
        */

        public static async Task Do(Connection conn)
        {
            //do the authentication routine
            await conn.resetWait(); //reset waiting point
            conn.State = States.ClientState.AUTHENTICATING;

            await conn.SendANSI("\nEnter your username:"******"Hello, {0}. Enter your password so I can be sure you're not some Syrian refugee.", conn.inputLine));

            await conn.resetWait();
            await conn.SendANSI("\nEnter your password:"******"password")
            {
                await conn.SendASCII("You win the most secure password award, fuckstick.");
                conn.State = States.ClientState.AUTHENTICATED;
            }
            else
            {
                await conn.SendASCII("Are you even trying?");
                await conn.resetWait();
                await Lobby.Do(conn);
            }
        }
Ejemplo n.º 3
0
 public static async void send_MOTD(Connection conn)
 {
     await conn.SendANSI(MOTD_Message, Encode.ANSI.ANSIColor.FG_Blue, Encode.ANSI.ANSIColor.BG_Black);
     await conn.SendANSI("It probably could be worse, somehow.", Encode.ANSI.ANSIColor.FG_Red, Encode.ANSI.ANSIColor.BG_White);
 }