Exemplo n.º 1
0
        private void btnExitRoom_Click(object sender, System.EventArgs e)
        {
            gbRooms.Enabled    = true;
            gbRoomInfo.Enabled = false;
            GamePlayer         = null;

            txtRoomInfo.Text = "";
            lstRoomPlayers.Items.Clear();

            OnlineClient.Host.Send(new LeaveRoomScriptClient());
            OnlineClient.Host.Send(new AskRoomListScriptClient());
        }
Exemplo n.º 2
0
        protected override void Execute(IOnlineConnection Sender)
        {
            PlayerWithID NewPlayer = new PlayerWithID(PlayerID);

            Owner.ActiveGame.DicPlayerByID.Add(PlayerID, NewPlayer);

            if (IsPlayerControlled)
            {
                Owner.GamePlayer = NewPlayer;
            }

            Owner.UpdateGame();
            UpdateUI();
        }
Exemplo n.º 3
0
        public ClientForm()
        {
            InitializeComponent();

            DicAllRoom = new Dictionary <string, RoomInformations>();
            GamePlayer = null;

            Dictionary <string, OnlineScript> DicOnlineScripts = new Dictionary <string, OnlineScript>();

            DicOnlineScripts.Add(LoginSuccessScriptClient.ScriptName, new LoginSuccessScriptClient(this));
            DicOnlineScripts.Add(SendRoomInformationScriptClient.ScriptName, new SendRoomInformationScriptClient(this));
            DicOnlineScripts.Add(RoomListScriptClient.ScriptName, new RoomListScriptClient(this));
            DicOnlineScripts.Add(PlayerJoinedScriptClient.ScriptName, new PlayerJoinedScriptClient(this));
            DicOnlineScripts.Add(PlayerLeftScriptClient.ScriptName, new PlayerLeftScriptClient(this));
            DicOnlineScripts.Add(JoinRoomLocalScriptClientForm.ScriptName, new JoinRoomLocalScriptClientForm(this));
            DicOnlineScripts.Add(CreateGameScriptClient.ScriptName, new CreateGameScriptClient(this));
            DicOnlineScripts.Add(CreatePlayerScriptClient.ScriptName, new CreatePlayerScriptClient(this));
            DicOnlineScripts.Add(StartGameScriptClientForm.ScriptName, new StartGameScriptClientForm(this));
            DicOnlineScripts.Add(SendPlayerUpdateScriptClient.ScriptName, new SendPlayerUpdateScriptClient(this));

            OnlineClient = new Client(DicOnlineScripts);
        }
Exemplo n.º 4
0
 private void btnStartGame_Click(object sender, System.EventArgs e)
 {
     btnStartGame.Enabled = false;
     GamePlayer           = null;
     OnlineClient.StartGame();
 }