Пример #1
0
 protected override void LoadConfig()
 {
     base.LoadConfig();
     _config   = Config.ReadObject <MsgConfig>();
     _messages = new MsgCollection {
         MessagesList = _config.Msgs
     };
     _messagesQueue = new MsgCollection {
         MessagesList = _config.QueueMsgs
     };
     if (_config.EnableQueueMessages || _config.QueueMsgs != null)
     {
         return;
     }
     _config.QueueMsgs = new List <MsgEntry>
     {
         new MsgEntry {
             TopString = "<color=#ffff00>You're in queue...</color>", BottomString = "<color=#add8e6>{AHEAD} players ahead of you.</color>"
         },
         new MsgEntry {
             TopString = "<color=#add8e6>You're in queue...</color>", BottomString = "<color=#ffff00>{BEHIND} players behind you.</color>"
         }
     };
     SaveConfig();
     PrintWarning("Detected probably outdated config. New entries added. Check your config.");
 }
Пример #2
0
        public ChattingViewModel(string strRoomSID, IRoomsControlable roomsController)
        {
            if (null == strRoomSID)
            {
                throw new ArgumentNullException("strRoomSID");
            }
            if (null == roomsController)
            {
                throw new ArgumentNullException("roomsController");
            }

            this.m_AnonymousThumbnailDictionary = new Dictionary <string, Brush>();
            this.m_AnonymousThumbnailDictionary.Add(AuthRepository.MQKeyInfo.UserSid, ColorGenerator.Instance.GetRandomBrush());
            this.RoomSID           = strRoomSID;
            this.m_RoomsController = roomsController;

            this.m_SendMessageService = new SendMessageService();
            this.m_LoadMsgService     = new LoadMessagesService(AuthRepository.MQKeyInfo.UserSid, this.m_AnonymousThumbnailDictionary);
            this.m_ReadMsgService     = new ReadMessageService();

            this.InitialLoadedCommand    = new DelegateCommand <IChattingViewBehavior>(ExecuteInitialLoadedCommand);
            this.InitialFocusCommand     = new DelegateCommand <UIElement>(ExecuteInitialFocusCommand);
            this.InputTextChangedCommand = new DelegateCommand(ExecuteInputTextChangedCommand);
            this.ReSendCommand           = new DelegateCommand <CommunicationMsg>(ExecuteReSendCommand);
            this.DeletePendingMsgCommand = new DelegateCommand <CommunicationMsg>(ExecuteDeletePendingMsgCommand);
            this.SendTextCommand         = new DelegateCommand <string>(ExecuteSendTextCommand, CanExecuteSendTextCommand);
            this.DefineScrollingCommand  = new DelegateCommand <ScrollViewer>(ExecuteDefineScrollingCommand);
            this.AttachFileCommand       = new DelegateCommand(ExecuteAttachFileCommand);
            this.m_ReceiveChatMsgCommand = new DelegateCommand <ReceivedMsg>(ExecuteReceiveChatMsgCommand);
            this.m_ReceiveReadMsgCommand = new DelegateCommand <ReceivedReadMsg>(ExecuteReceiveReadMsgCommand);
            this.Messages         = new MsgCollection(this.m_LoadMsgService.LoadMessages(strRoomSID, 0).Reverse());
            this.m_UnReadMessages = this.m_LoadMsgService.LoadUnReadMessages(strRoomSID);
        }
Пример #3
0
 private void Unload()
 {
     _messages      = null;
     _messagesQueue = null;
     if (_config.EnableQueueMessages)
     {
         ServerMgr.Instance.connectionQueue.nextMessageTime = 0f;
     }
 }