Exemple #1
0
        private void lsvMaplist_DragDrop(object sender, DragEventArgs e)
        {
            this.lsvMaplist.Refresh();

            MaplistEntry insertingMap = ((MaplistEntry)e.Data.GetData(typeof(MaplistEntry)));

            if (this.m_client != null && this.m_client.Game != null)
            {
                Point        cp         = this.lsvMaplist.PointToClient(new Point(e.X, e.Y));
                ListViewItem dragToItem = this.lsvMaplist.GetItemAt(cp.X, cp.Y);

                this.m_blSettingAppendingSingleMap = true;

                if (insertingMap.Index >= 0)
                {
                    this.m_client.Game.SendMapListRemovePacket(insertingMap.Index);
                }

                if (dragToItem != null)
                {
                    this.WaitForSettingResponse("local.maplist.append");
                    this.m_client.Game.SendMapListInsertPacket(new MaplistEntry(insertingMap.Gamemode, insertingMap.MapFileName, insertingMap.Rounds, dragToItem.Index));
                }
                else
                {
                    this.WaitForSettingResponse("local.maplist.append");

                    this.m_client.Game.SendMapListAppendPacket(insertingMap);
                }

                this.m_client.Game.SendMapListSavePacket();
            }
        }
Exemple #2
0
        /*
         * protected override void DispatchMapListClearResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) {
         *  if (cpRequestPacket.Words.Count >= 1) {
         *      if (this.MapListCleared != null) {
         *          FrostbiteConnection.RaiseEvent(this.MapListCleared.GetInvocationList(), this);
         *      }
         *  }
         * }
         */
        protected override void DispatchMapListAppendResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket)
        {
            if (cpRequestPacket.Words.Count >= 4)
            {
                MaplistEntry mapEntry = null;

                int rounds = 0;
                int index  = -1;

                if (int.TryParse(cpRequestPacket.Words[3], out rounds) == true)
                {
                    mapEntry = new MaplistEntry(cpRequestPacket.Words[2], cpRequestPacket.Words[1], rounds);
                }

                if (cpRequestPacket.Words.Count >= 5 && int.TryParse(cpRequestPacket.Words[4], out index) == true)
                {
                    mapEntry = new MaplistEntry(cpRequestPacket.Words[2], cpRequestPacket.Words[1], rounds, index);
                }

                if (this.MapListMapAppended != null)
                {
                    if (index == -1)
                    {
                        FrostbiteConnection.RaiseEvent(this.MapListMapAppended.GetInvocationList(), this, mapEntry);
                    }
                    else
                    {
                        FrostbiteConnection.RaiseEvent(this.MapListMapInserted.GetInvocationList(), this, mapEntry);
                    }
                }
            }
        }
Exemple #3
0
        // Find default

        /*
         *
         * public override void SendMapListRemovePacket(int index) {
         *  if (this.IsLoggedIn == true) {
         *      this.BuildSendPacket("mapList.remove", index.ToString());
         *  }
         * }
         */
        public override void SendMapListInsertPacket(MaplistEntry map)
        {
            if (this.IsLoggedIn == true)
            {
                this.BuildSendPacket("mapList.add", map.MapFileName, map.Gamemode, (map.Rounds > 0 ? map.Rounds : 2).ToString(), map.Index.ToString());
            }
        }
Exemple #4
0
        private void btnAddMap_Click(object sender, EventArgs e)
        {
            if (this.m_client != null && this.m_client.Game != null && this.lsvMaplistPool.SelectedItems.Count > 0)
            {
                if (this.lsvMaplistPool.SelectedItems[0].Tag != null)
                {
                    this.WaitForSettingResponse("local.maplist.append");
                    this.m_blSettingAppendingSingleMap = true;

                    MaplistEntry entry = ((MaplistEntry)this.lsvMaplistPool.SelectedItems[0].Tag);
                    this.m_client.Game.SendMapListAppendPacket(new MaplistEntry(entry.Gamemode, entry.MapFileName, (int)this.numRoundsSelect.Value));

                    this.m_client.Game.SendMapListSavePacket();
                }
            }
        }
Exemple #5
0
 private void Game_MapListMapInserted(FrostbiteClient sender, MaplistEntry mapEntry)  // int mapIndex, string mapFileName, int rounds) {
 {
     this.InvokeIfRequired(() => this.InsertMapInMapList(mapEntry.Index, mapEntry));
 }
Exemple #6
0
 private void m_prcClient_MapListMapInserted(FrostbiteClient sender, MaplistEntry mapEntry) { // int mapIndex, string mapFileName, int rounds) {
     this.InvokeOnAllEnabled("OnMaplistMapInserted", mapEntry.Index, mapEntry.MapFileName, mapEntry.Rounds);
 }
Exemple #7
0
 private void m_prcClient_MapListMapAppended(FrostbiteClient sender, MaplistEntry mapEntry) {
     this.InvokeOnAllEnabled("OnMaplistMapAppended", mapEntry.MapFileName);
 }
Exemple #8
0
        // Find default 
        /*

        public override void SendMapListRemovePacket(int index) {
            if (this.IsLoggedIn == true) {
                this.BuildSendPacket("mapList.remove", index.ToString());
            }
        }
        */
        public override void SendMapListInsertPacket(MaplistEntry map) {
            if (this.IsLoggedIn == true) {
                this.BuildSendPacket("mapList.add", map.MapFileName, map.Gamemode, (map.Rounds > 0 ? map.Rounds : 2).ToString(), map.Index.ToString());
            }
        }
Exemple #9
0
        /*
        protected override void DispatchMapListClearResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) {
            if (cpRequestPacket.Words.Count >= 1) {
                if (this.MapListCleared != null) {
                    FrostbiteConnection.RaiseEvent(this.MapListCleared.GetInvocationList(), this);
                }
            }
        }
        */
        protected override void DispatchMapListAppendResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) {
            if (cpRequestPacket.Words.Count >= 4) {
                MaplistEntry mapEntry = null;

                int rounds = 0;
                int index = -1;

                if (int.TryParse(cpRequestPacket.Words[3], out rounds) == true) {
                    mapEntry = new MaplistEntry(cpRequestPacket.Words[2], cpRequestPacket.Words[1], rounds);
                }

                if (cpRequestPacket.Words.Count >= 5 && int.TryParse(cpRequestPacket.Words[4], out index) == true) {
                    mapEntry = new MaplistEntry(cpRequestPacket.Words[2], cpRequestPacket.Words[1], rounds, index);
                }

                if (this.MapListMapAppended != null) {
                    if (index == -1) {
                        FrostbiteConnection.RaiseEvent(this.MapListMapAppended.GetInvocationList(), this, mapEntry);
                    }
                    else {
                        FrostbiteConnection.RaiseEvent(this.MapListMapInserted.GetInvocationList(), this, mapEntry);
                    }
                }
            }
        }
Exemple #10
0
        protected virtual void DispatchMapListAppendResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket)
        {
            if (cpRequestPacket.Words.Count >= 2) {

                MaplistEntry mapEntry = null;

                int iRounds = 0;

                if (cpRequestPacket.Words.Count == 2) {
                    mapEntry = new MaplistEntry(cpRequestPacket.Words[1]);
                }
                else if (cpRequestPacket.Words.Count >= 3 && int.TryParse(cpRequestPacket.Words[2], out iRounds) == true) {
                    mapEntry = new MaplistEntry(cpRequestPacket.Words[1], iRounds);
                }

                if (this.MapListMapAppended != null) {
                    FrostbiteConnection.RaiseEvent(this.MapListMapAppended.GetInvocationList(), this, mapEntry);
                }
            }
        }
Exemple #11
0
 public virtual void SendMapListInsertPacket(MaplistEntry map) {
     if (this.IsLoggedIn == true) {
         this.BuildSendPacket("mapList.insert", map.Index.ToString(), map.MapFileName, map.Rounds.ToString());
     }
 }
Exemple #12
0
 public virtual void SendMapListAppendPacket(MaplistEntry map) {
     if (this.IsLoggedIn == true) {
         this.BuildSendPacket("mapList.append", map.MapFileName, map.Rounds.ToString());
     }
 }
Exemple #13
0
 private void Game_MapListMapInserted(FrostbiteClient sender, MaplistEntry mapEntry) {// int mapIndex, string mapFileName, int rounds) {
     this.InsertMapInMapList(mapEntry.Index, mapEntry);
 }