Ejemplo n.º 1
0
        private void OnCS_PvE_DungeonList_Req(SecurePacketRequest reqPacket)
        {
            SecurePacketResponse resPacket = new SecurePacketResponse(reqPacket, 4096);

            try
            {
                //  상위 필드정보
                Int32 fieldId = reqPacket.GetInt32();
                var field = GameMap.PvE_Field.Find(fieldId);

                //  결과 패킷
                Int32 count = 0;
                Int32 idxCount = resPacket.PutInt32(count);
                foreach (var data in field.SubDungeons)
                {
                    resPacket.PutInt32(data.DungeonId);
                    resPacket.PutStringAsUtf16(data.Name);
                    resPacket.PutInt32(data.Level);
                    resPacket.PutInt32(data.EnterFee_EnergyId);
                    resPacket.PutInt32(data.EnterFee_Amount);
                    ++count;
                }

                resPacket.ResultCodeNo = ResultCode.Ok;
                resPacket.OverwriteInt32(idxCount, count);
            }
            catch (AegisException e)
            {
                resPacket.ResultCodeNo = e.ResultCodeNo;
            }

            SendPacket(resPacket);
        }
        private void OnCS_GameData_CharacterBook_Req(SecurePacketRequest reqPacket)
        {
            Int32 startId = reqPacket.GetInt32();
            SecurePacketResponse resPacket = new SecurePacketResponse(reqPacket, 65000);
            resPacket.ResultCodeNo = ResultCode.Ok;

            Int32 count = 0;
            Int32 idxCount = resPacket.PutInt32(count);
            foreach (var ch in CharacterBook.Data.Items
                                                 .Where(v => v.CharacterId >= startId)
                                                 .OrderBy(v => v.CharacterId))
            {
                resPacket.PutInt32(ch.CharacterId);
                resPacket.PutStringAsUtf16(ch.Name);
                resPacket.PutInt32(ch.RaceId);
                resPacket.PutInt32(ch.CharacterTypeId);
                resPacket.PutInt32(ch.JobId);
                resPacket.PutInt32(ch.PositionId);
                resPacket.PutInt32(ch.DamageTypeId);
                resPacket.PutInt32(ch.InitGradeId);
                resPacket.PutInt32(ch.InitPromotionId);
                resPacket.PutInt32(ch.MaxGradeId);
                resPacket.PutInt32(ch.MaxPromotionId);
                resPacket.PutInt32(ch.AP);
                resPacket.PutInt32(ch.DP);
                resPacket.PutInt32(ch.HP);

                if (++count >= 400)
                    break;
            }
            resPacket.OverwriteInt32(idxCount, count);
            SendPacket(resPacket);
        }
Ejemplo n.º 3
0
        private void OnCS_PvE_EnterDungeon_Req(SecurePacketRequest reqPacket)
        {
            Int32 dungeonId = reqPacket.GetInt32();
            SecurePacketResponse resPacket = new SecurePacketResponse(reqPacket);

            try
            {
                EnterDungeon(dungeonId);

                resPacket.ResultCodeNo = ResultCode.Ok;
                Int32 roundCount = 0, idxRoundCount = resPacket.PutInt32(0);
                foreach (var playingRound in PlayingRounds)
                {
                    resPacket.PutInt32(playingRound.Round.RoundId);
                    resPacket.PutStringAsUtf16(playingRound.Round.Name);
                    resPacket.PutBoolean(playingRound.Round.IsBossRound);

                    Int32 monsterCount = 0, idxMonsterCount = resPacket.PutInt32(0);
                    foreach (var monster in playingRound.Monsters)
                    {
                        resPacket.PutInt32(monster.MonsterNo);
                        resPacket.PutInt32(monster.MonsterId);
                        resPacket.PutStringAsUtf16(monster.Base.Name);
                        resPacket.PutInt32(monster.Base.GradeId);
                        resPacket.PutInt32(monster.Base.PromotionId);
                        resPacket.PutInt32(monster.Level);

                        ++monsterCount;
                    }
                    resPacket.OverwriteInt32(idxMonsterCount, monsterCount);
                    ++roundCount;
                }
                resPacket.OverwriteInt32(idxRoundCount, roundCount);
            }
            catch (AegisException e)
            {
                resPacket.Clear();
                resPacket.ResultCodeNo = e.ResultCodeNo;
            }

            SendPacket(resPacket);
        }
Ejemplo n.º 4
0
        private void OnCS_PvE_FieldList_Req(SecurePacketRequest reqPacket)
        {
            SecurePacketResponse resPacket = new SecurePacketResponse(reqPacket, 4096);

            try
            {
                //  상위 월드정보
                Int32 worldId = reqPacket.GetInt32();
                var world = GameMap.PvE_World.Find(worldId);

                //  결과 패킷
                Int32 count = 0;
                Int32 idxCount = resPacket.PutInt32(count);
                foreach (var data in world.SubFields)
                {
                    resPacket.PutInt32(data.FieldId);
                    resPacket.PutStringAsUtf16(data.Name);
                    resPacket.PutInt32(data.NeedVIPLevel);
                    resPacket.PutInt32(data.NeedPlayerLevel);
                    ++count;
                }

                resPacket.ResultCodeNo = ResultCode.Ok;
                resPacket.OverwriteInt32(idxCount, count);
            }
            catch (AegisException e)
            {
                resPacket.ResultCodeNo = e.ResultCodeNo;
            }

            SendPacket(resPacket);
        }
Ejemplo n.º 5
0
        private void OnCS_PvE_WorldList_Req(SecurePacketRequest reqPacket)
        {
            SecurePacketResponse resPacket = new SecurePacketResponse(reqPacket, 4096);
            Int32 count = 0;
            Int32 idxCount = resPacket.PutInt32(count);
            foreach (var data in GameMap.PvE_World.Worlds)
            {
                resPacket.PutInt32(data.WorldId);
                resPacket.PutStringAsUtf16(data.Name);
                resPacket.PutInt32(data.NeedVIPLevel);
                resPacket.PutInt32(data.NeedPlayerLevel);
                resPacket.PutInt32(data.NeedCharacterLevel);
                ++count;
            }

            resPacket.ResultCodeNo = ResultCode.Ok;
            resPacket.OverwriteInt32(idxCount, count);
            SendPacket(resPacket);
        }
Ejemplo n.º 6
0
        private void OnCS_PvE_GetDeck_Req(SecurePacketRequest reqPacket)
        {
            DeckType deckType = (DeckType)reqPacket.GetInt32();
            SecurePacketResponse resPacket = new SecurePacketResponse(reqPacket);

            try
            {
                PlayDeck.Deck deck = PlayDeck[deckType];
                Int32 slotNo = 0, idxCount;

                resPacket.ResultCodeNo = ResultCode.Ok;
                idxCount = resPacket.PutInt32(0);
                foreach (Character ch in deck.Characters)
                {
                    resPacket.PutInt32(slotNo);
                    if (ch == null)
                        resPacket.PutInt32(0);
                    else
                        resPacket.PutInt32(ch.CharacterNo);

                    ++slotNo;
                }
                resPacket.OverwriteInt32(idxCount, slotNo);
            }
            catch (AegisException e)
            {
                resPacket.Clear();
                resPacket.ResultCodeNo = e.ResultCodeNo;
            }

            SendPacket(resPacket);
        }
Ejemplo n.º 7
0
        private void OnCS_Auth_WorldList_Req(SecurePacketRequest reqPacket)
        {
            SecurePacketResponse resPacket = new SecurePacketResponse(reqPacket);
            Int32 idxCount, count = 0;

            resPacket.ResultCodeNo = ResultCode.Ok;
            idxCount = resPacket.PutInt32(count);
            foreach (var world in WorldCatalog.Items
                                              .Where(v => v.IsOpen == true))
            {
                resPacket.PutInt32(world.WorldId);
                resPacket.PutStringAsUtf16(world.WorldName);
                ++count;
            }

            resPacket.OverwriteInt32(idxCount, count);
            SendPacket(resPacket);
        }