Пример #1
0
        private void ProcessTags(RdlTagCollection tags)
        {
            if (tags.Count == 0)
            {
                return;
            }

            this.ProcessFileUpdates(tags);
            this.ProcessCommands(tags);
            //this.ProcessSkills(tags);
            //this.ProcessTerrain(tags);
            //this.ProcessSkillGroups(tags);
            //this.ProcessRaces(tags);
            //this.ProcessNews(tags);

            //if (_step == Step.Characters)
            //{
            this.ProcessCharacters(tags);
            //}

            // Process any messages, send errors and system messages to the alert panel.
            List <RdlMessage> messages = tags.GetMessages();

            foreach (var msg in messages)
            {
                switch (msg.TypeName)
                {
                case "ERROR":
                case "SYSTEM":
                    _waitDialog.Text = msg.Text;
                    _hasErrors       = true;
                    break;
                }
            }

            //if (_step == Step.Role) _step = Step.FileUpdates;
            //else if (_step == Step.FileUpdates) _step = Step.Skills;
            //else if (_step == Step.Skills) _step = Step.SkillGroups;
            //else if (_step == Step.SkillGroups) _step = Step.Races;
            //else if (_step == Step.Races) _step = Step.Terrain;
            //else if (_step == Step.Terrain) _step = Step.Characters;
            //else if (_step == Step.Characters) _step = Step.News;
            //else if (_step == Step.News) _step = Step.None;

            //this.ExecuteCommand();
        }
Пример #2
0
        public void WriteMessages(RdlTagCollection tags)
        {
            List <RdlMessage> messages = tags.GetMessages();

            if (messages.Count > 0)
            {
                foreach (var msg in messages)
                {
                    switch (msg.TypeName)
                    {
                    case "ERROR":
                        this.Write(MessageType.Error, msg.Text);
                        break;

                    case "SYSTEM":
                        RdlSystemMessage sysMsg = msg as RdlSystemMessage;
                        if (sysMsg != null)
                        {
                            switch ((RdlSystemMessage.PriorityType)sysMsg.Priority)
                            {
                            case RdlSystemMessage.PriorityType.PlaceDescription:
                                this.Write(MessageType.PlaceDesc, msg.Text);
                                break;

                            case RdlSystemMessage.PriorityType.PlaceName:
                                this.Write(MessageType.PlaceName, msg.Text);
                                break;

                            case RdlSystemMessage.PriorityType.PlaceExits:
                                this.Write(MessageType.PlaceExits, msg.Text);
                                break;

                            case RdlSystemMessage.PriorityType.PlaceActors:
                                this.Write(MessageType.PlaceActors, msg.Text);
                                break;

                            case RdlSystemMessage.PriorityType.PlaceAvatars:
                                this.Write(MessageType.PlaceAvatars, msg.Text);
                                break;

                            case RdlSystemMessage.PriorityType.Positive:
                                this.Write(MessageType.Positive, msg.Text);
                                break;

                            case RdlSystemMessage.PriorityType.Negative:
                                this.Write(MessageType.Negative, msg.Text);
                                break;

                            case RdlSystemMessage.PriorityType.Emote:
                                this.Write(MessageType.Emote, msg.Text);
                                break;

                            case RdlSystemMessage.PriorityType.Help:
                                this.Write(MessageType.Help, msg.Text);
                                break;

                            case RdlSystemMessage.PriorityType.Level:
                                this.Write(MessageType.Level, msg.Text);
                                break;

                            case RdlSystemMessage.PriorityType.Cast:
                                this.Write(MessageType.Cast, msg.Text);
                                break;

                            case RdlSystemMessage.PriorityType.Melee:
                                this.Write(MessageType.Melee, msg.Text);
                                break;

                            default:
                                this.Write(MessageType.System, msg.Text);
                                break;
                            }
                        }
                        break;

                    case "NEWS":
                        this.Write(MessageType.News, msg.Text);
                        break;

                    case "TELL":
                        RdlTellMessage tellMsg = (RdlTellMessage)msg;
                        ctlChat.Append(ctlChat.CreateLink(tellMsg.Text, Brushes.MsgTellBrush, FontWeights.Normal, 11, tellMsg.From, new RoutedEventHandler(this.OnChatTellLinkClick)));
                        //this.Write(MessageType.Tell, msg.Text);
                        break;

                    default:
                        this.Write(MessageType.Say, msg.Text);
                        break;
                    }
                }
            }
        }