public void Process(Envelope envelope)
        {
            if (envelope == null)
            {
                throw new Exception();
            }

            Conversation conv = convDictionary.GetConv(envelope.message.convId);

            if (conv != null)
            {
                throw new Exception();
            }
            else
            {
                conv = factory.Create(envelope);
                if (convDictionary.TryAdd(conv.FirstEnvelope.message.convId, conv))
                {
                    conv?.Start();
                }
                else
                {
                    Logger.Error("Unable to add conversation to dictionary");
                }
            }
        }
Пример #2
0
        public void CreateConversation(Envelope e)
        {
            Conversation conversation;

            if (e.message.MessageType == 1)
            {
                conversation = new UAJoinGameConversation(e);
                ConversationDictionary.TryAdd(e.message.convId, conversation);
            }
            // TODO: Add the rest of the conversations;
        }