コード例 #1
0
 public PlayerOperationsClassLib()
 {
     _testClient     = new TextTestClient();
     _wordRecogniser = new WordRecogniser();
     _playerOps      = new PlayerOperations();
     _testClient.LogInAndConnect("helen", "potato");
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: SimonasBanys/disertation
    public static void LoggedIn(string Username, string Password, object obj, EventArgs args)
    {
        client = new TextTestClient();
        client.LogInAndConnect(Username, Password);
        while (client.IsConnectedAndLoggedIn() == false)
        {
            Thread.Sleep(0);
        }
        playerOps = new PlayerOperations();
        myWin     = new Window("HistMMorpg Client");
        //Create a label and put some text in it.
        tableLayout = new Table(5, 5, false);
        northEast   = new Button("North East");
        northWest   = new Button("North West");
        east        = new Button("East");
        west        = new Button("West");
        southEast   = new Button("South East");
        southWest   = new Button("South West");
        siege       = new Button("Siege");
        hire        = new Button("Hire");
        SetUpDirectionalButtonClicks();
        SetUpOperationButtonClicks();
        //Add the label to the form
        tableLayout.Attach(northEast, 0, 1, 0, 1);
        tableLayout.Attach(northWest, 1, 2, 0, 1);
        tableLayout.Attach(east, 0, 1, 1, 2);
        tableLayout.Attach(west, 1, 2, 1, 2);
        tableLayout.Attach(siege, 2, 3, 1, 2);
        tableLayout.Attach(southEast, 0, 1, 2, 3);
        tableLayout.Attach(southWest, 1, 2, 2, 3);
        tableLayout.Attach(hire, 2, 3, 0, 1);
        myWin.Add(tableLayout);

        /*ProtoPlayerCharacter player = playerOps.Profile (client);
         * profileTable = new ProfileTable (player.playerID, player.firstName + " " + player.familyName, player.ownedFiefs, player.location, player.armyID, Convert.ToString( player.purse));
         * tableLayout.Attach (profileTable.getProfileLayout (), 3, 4, 1, 2);
         * ProtoFief fiefData = playerOps.FiefDetails (client);
         * fiefTable = new FiefTable (fiefData.fiefID, fiefData.owner, Convert.ToString (fiefData.industry),
         *      fiefData.charactersInFief, fiefData.armies);
         * tableLayout.Attach (fiefTable.getProfileTable (), 3, 4, 2, 3);*/
        //ProfileClickEvent (null, null);
        //FiefClickEvent (null, null);
        //Show Everything
        FiefClickEvent(obj, args);
        ProfileClickEvent(obj, args);
        myWin.ShowAll();
    }
コード例 #3
0
ファイル: Program.cs プロジェクト: SimonasBanys/disertation
        private static void LogInPrompt()
        {
            Console.WriteLine("Welcome to the JominiEngine Text Client! Please enter your username and password");
            Console.Write("What is your username: "******"What is your password: "******"What is the Server's IP Address?: ");
            var ipForReturn = Console.ReadLine();

            try
            {
                IPAddress.Parse(ipForReturn);
            }
            catch
            {
            }
            _testClient.LogInAndConnect(usernameForReturn, passwordForReturn, ipForReturn);
            Console.Clear();
        }
コード例 #4
0
ファイル: Controller.cs プロジェクト: zszazwzq/MscProject
    protected void LoginButton()
    {
        m_MyText.text += "1";
        string username = inputUsername.text;
        string password = inputPassword.text;

        tclient.LogInAndConnect("helen", "potato", "localhost");

        while (!tclient.IsConnectedAndLoggedIn())
        {
            Thread.Sleep(0);
        }

        buttonText.text = "loading";
        if (tclient.IsConnectedAndLoggedIn())
        {
            mf = FiefDetails(tclient);

            SceneManager.LoadScene(1);
            // FiefControl f = new FiefControl(tclient);
        }
    }
コード例 #5
0
    public static bool Login(string username, string password, out string reason)
    {
        reason = null;
        //tclient.LogInAndConnect(username, password, "localhost");
        tclient.LogInAndConnect(username, password, "92.239.228.86");

        //bool loggedIn = false;
        //while(!loggedIn){
        //    ProtoMessage reply = GetActionReply(Actions.LogIn, tclient);
        //    if(reply.ResponseType == DisplayMessages.LogInFail) {
        //        return false;
        //    }
        //    else if(reply.ResponseType == DisplayMessages.None){

        //    }
        //    else if(reply.ResponseType == DisplayMessages.LogInSuccess) {
        //        loggedIn = true;
        //    }
        //}

        Debug.Log("made it out of LogInAndConnect");

        int          i     = 1;
        ProtoMessage reply = null;

        while (!tclient.IsConnectedAndLoggedIn())
        {
            reply = GetActionReply(Actions.LogIn, tclient);
            if (reply == null)
            {
                reason = "Log in request timed out.";
                return(false);
            }
            if (reply.ResponseType == DisplayMessages.LogInFail)
            {
                reason = "Wrong username or password.";
                return(false);
            }
            if (reply.ResponseType == DisplayMessages.LogInSuccess)
            {
                break;
            }

            Debug.Log("I'm still waiting: " + i.ToString());
            i++;
        }

        protoClient = (ProtoClient)reply;
        return(true);


        //while (!tclient.IsConnectedAndLoggedIn())
        //{
        //    Thread.Sleep(0);
        //}

        //if (tclient.IsConnectedAndLoggedIn())
        //{
        //   // mf = GetFiefDetails(tclient);

        //    GoToScene("MainMenu");

        //    //SceneManager.LoadScene("MainMenu");
        //    // FiefControl f = new FiefControl(tclient);
        //}
    }