public OutMessage Invoke(params object[] Parameters)
        {
            var Items = Parameters[0] as IEnumerable<string>;
            var Message = new OutMessage(420);
            Message.Append(Items.Count());

            foreach (var Item in Items)
            {
                Message.Append(Item);
            }

            return Message;
        }
Beispiel #2
0
        public void GetResponse(OutMessage Message, Character Character)
        {
            var Achievements = StorageHandler.GetCharacterAchievements(Character.Id);
            var Details = StorageHandler.GetAchievementDetailsSorted(Id);

            int MaxLevel = Details.Count() > 0 ? Details.Count() : 1;

            var MyProgress = new CharacterAchievement(-1, Character.Id, Id, 0);

            foreach (var Item in Achievements)
            {
                if (Item.AchievementId == Id)
                {
                    MyProgress = Item;
                }
            }

            var CurrentLevel = MyProgress.CurrentLevel;
            var NextLevel = (CurrentLevel + 1);

            int NextRequired = 1;

            foreach (var Item in Details)
            {
                if (Item.Level == NextLevel)
                {
                    NextRequired = Item.RequiredAmmount;
                }
            }

            if (NextLevel > MaxLevel)
            {
                NextLevel = MaxLevel;
            }

            if (CurrentLevel >= MaxLevel)
            {
                CurrentLevel = MaxLevel;
            }

            Message.Append(Id);
            Message.Append(NextLevel);
            Message.Append(GetBadge(NextLevel));
            Message.Append(NextRequired);
            Message.Append(GetPixelReward(NextLevel));
            Message.Append(0); // TODO <> BadgeId
            Message.Append(0); // TODO <> GotAlready
            Message.Append(CurrentLevel == MaxLevel);
            Message.Append(AchievementHandler.GetCategory(ParentId).Caption.ToLower());
            Message.Append(MaxLevel);
        }
Beispiel #3
0
        public Types.OutMessage Invoke(params object[] Parameters)
        {
            var Length = (int)(Parameters[0].ToString().Length / 720);

            if (Length <= 0)
            {
                Length = 1;
            }

            var Message = new OutMessage(810);
            Message.Append(Length);
            Message.Append(Parameters[0]);
            return Message;
        }
        public OutMessage Invoke(params object[] Parameters)
        {
            var Message = new OutMessage(436);
            var Character = Parameters[0] as Character;
            var Items = AchievementHandler.GetAchievements(Character);

            Message.Append(Items.Count());

            foreach (var Item in Items)
            {
                Item.GetResponse(Message,Character);
            }

            return Message;
        }
        public OutMessage Invoke(params object[] Parameters)
        {
            var Message = new OutMessage(450);
            Message.Append(NavigatorHandler.Validate());

            foreach (var Public in NavigatorHandler.GetChilds(-1))
            {
                Public.GetResponse(Message);

                if (Public.Type == 4)
                {
                    foreach (var Child in NavigatorHandler.GetChilds(Public.Id))
                    {
                        Child.GetResponse(Message);
                    }
                }
            }

            return Message;
        }
Beispiel #6
0
        public OutMessage Invoke(params object[] Parameters)
        {
            var Message = new OutMessage(627);
            Message.Append(AchievementHandler.Achievements.Count);

            foreach (var Achievement in AchievementHandler.Achievements.Values)
            {
                var Items = StorageHandler.GetAchievementDetailsSorted(Achievement.Id);

                Message.Append(Achievement.Badge);
                Message.Append(Items.Count());

                foreach (var Item in (from item in Items orderby item.Level ascending select item))
                {
                    Message.Append(Item.Level);
                    Message.Append(Item.RequiredAmmount);
                }
            }

            return Message;
        }
        Types.OutMessage IMessageComposer.Invoke(params object[] Parameters)
        {
            var Message = new OutMessage(257);
            var Length = 9;
            var Random = new Random();

            Message.Append(Length);

            for (int i = 0; i <= 9; i++)
            {
                if (i == 2)
                {
                    Message.Append(3);
                }
                else if (i == 3)
                {
                    Message.Append(2);
                }
                else
                {
                    Message.Append(i);
                }

                if (i == 5)
                {
                    Message.Append("dd-MM-yyyy");
                }
                else if (i == 8)
                {
                    Message.Append("http://google.com");
                }
                else
                {
                    Message.Append(Random.Next(0, 2));
                }
            }

            return Message;
        }
Beispiel #8
0
        public void GetResponse(OutMessage Message)
        {
            Message.Append(Id);
            Message.Append(Caption); // TODO: Room name
            Message.Append(Description); // TODO: Room description
            Message.Append(ImagePlace);
            Message.Append(Caption); // TODO: Room name

            if (Type >= 2 && Type <= 3)
            {
                Message.Append(ImageSrc.Contains('/') ? ImageSrc : string.Empty);
            }
            else Message.Append(ImageSrc);

            Message.Append(ParentId);
            Message.Append(0); // TODO: RoomUnitsAmount
            Message.Append(Type);

            switch (Type)
            {
                case 1:
                    Message.Append(SearchTags);
                    break;
                case 2:
                case 3:
                    Message.Append(!ImageSrc.Contains('/') ? ImageSrc : string.Empty);
                    Message.Append(0);
                    Message.Append(0);
                    Message.Append(CCTs);
                    Message.Append(25); // TODO: LimitUsers
                    Message.Append(RoomId);
                    break;
                case 4:
                    Message.Append(Focus);
                    break;
            }
        }
 public OutMessage Invoke(params object[] Parameters)
 {
     var Message = new OutMessage(6);
     Message.Append(Parameters[0] + string.Empty);
     return Message;
 }
 public OutMessage Invoke(params object[] Parameters)
 {
     var Message = new OutMessage(443);
     Message.Append(Parameters[0]);
     return Message;
 }
 public OutMessage Invoke(params object[] Parameters)
 {
     var Message = new OutMessage(913);
     (Parameters[0] as Achievement).GetResponse(Message, (Parameters[1] as Character));
     return Message;
 }
        public OutMessage Invoke(params object[] Parameters)
        {
            var Message = new OutMessage(5);
            var Character = (Character)Parameters[0];

            Message.Append(Character.Id + string.Empty);
            Message.Append(Character.Username);
            Message.Append(string.Empty); // Figure
            Message.Append(string.Empty); // Gender U
            Message.Append(string.Empty); // Motto
            Message.Append(string.Empty); // Figure
            Message.Append(string.Empty); // Facebook Name?
            Message.Append(true); // ?
            Message.Append(0); // Respect Received
            Message.Append(3); // Respect Left
            Message.Append(3); // Respect Left Animals

            return Message;
        }