Example #1
0
        private void btnStartGame_Click(object sender, RoutedEventArgs e)
        {
            ShowInfo("*** Sending start game ***");
            if (cmbPlayers.SelectedItem != null)
            {
                var item = cmbPlayers.SelectedItem as ComboBoxItem;
                if (item != null)
                {
                    string id = (string)item.Tag;
                    if (!string.IsNullOrEmpty(id))
                    {
                        //var userReq = OrderFactory.CreateSetPlayerSelectUserOrder("Jan");
                        //_gameClient.Send(userReq);
                        //ShowInfo("*** Player selects user " + userReq.Id);
                        var selectReq = GameControlRequest.CreateControlRequestObject(
                            CommsMarshaller.GameControlRequestType.PlayerSelectScenarioPlayer,
                            id, "", 0);
                        _gameClient.Send(selectReq);
                        ShowInfo("*** Player selects scenario player " + id);
                    }
                }
            }
            GameControlRequest req = GameControlRequest.CreateControlRequestObject(
                CommsMarshaller.GameControlRequestType.GameSceneLoaded, "", "", 0);

            _gameClient.Send(req);
            req = GameControlRequest.CreateControlRequestObject(
                CommsMarshaller.GameControlRequestType.StartGame, "", "", 0);
            _gameClient.Send(req);
            var timeComprReq = GameControlRequest.CreateControlRequestObject(CommsMarshaller.GameControlRequestType.SetTimeCompressionRatio, "", "", 10);

            _gameClient.Send(timeComprReq);
        }
Example #2
0
    public void StartGame()
    {
        GameControlRequest req = GameControlRequest.CreateControlRequestObject(
            CommsMarshaller.GameControlRequestType.StartGame, "", "", 0);

        _client.Send(req);
    }
Example #3
0
        private void btnScenario_Click(object sender, RoutedEventArgs e)
        {
            if (_gameClient == null)
            {
                ShowInfo("** NOT CONNECTED **");
                return;
            }
            GameControlRequest reqCampaign = GameControlRequest.CreateControlRequestObject(
                CommsMarshaller.GameControlRequestType.PlayerSelectCampaign, "test", string.Empty, 0);

            _gameClient.Send(reqCampaign);

            ShowInfo("*** Sending select scenario ***");
            if (cmbPlayers.SelectedItem != null)
            {
                var item = cmbPlayers.SelectedItem as ComboBoxItem;
                if (item != null)
                {
                    string id = (string)item.Tag;
                    if (!string.IsNullOrEmpty(id))
                    {
                        var selectReq = GameControlRequest.CreateControlRequestObject(
                            CommsMarshaller.GameControlRequestType.PlayerSelectScenarioPlayer,
                            id, "", 0);
                        _gameClient.Send(selectReq);
                    }
                }
            }
            GameControlRequest req = GameControlRequest.CreateControlRequestObject(
                CommsMarshaller.GameControlRequestType.PlayerSelectScenario,
                txtScenario.Text, "", 0);

            _gameClient.Send(req);
        }
Example #4
0
    public void LoadScenario(string scenarioName)
    {
        GameControlRequest req = GameControlRequest.CreateControlRequestObject(CommsMarshaller.GameControlRequestType.PlayerSelectScenario, scenarioName, "", 0);

        _client.Send(req);
    }