Conversation CreateConversation(IContact who, bool clientStarted)
        {
            Conversation convo;
            var          events = new ConversationEvents();

            if (who is User)
            {
                convo = new Conversation(client, who as User, events);
            }
            else if (who is Group)
            {
                convo = new Conversation(client, who as Group, events);
            }
            else
            {
                throw new ArgumentException("who is not a User or a Group");
            }

            conversations.Add(convo);
            conversationEventsMap[who.Name] = events;

            NewConversation.SafeInvoke(this, new NewConversationEventArgs(convo, clientStarted));

            return(convo);
        }
    NewResult nr;                  //结果集操作

    private void Start()
    {
        nt            = new NewTalk();
        Nresult       = new NewResult();
        nConversation = new NewConversation();
        nr            = new NewResult();
        s0            = new string[3, 2];
        c0            = GameObject.Find("c0").GetComponent <mCharacter>();
        c1            = GameObject.Find("c1").GetComponent <mCharacter>();
        c2            = GameObject.Find("c2").GetComponent <mCharacter>();
        c             = isplayer();
        if (c.ID == 0)
        {
            actor = "Partner_1002";
        }
        if (c.ID == 1)
        {
            actor = "Partner_1001";
        }
        if (c.ID == 2)
        {
            actor = "Partner_1003";
        }
        floor = GameData.floor;
    }
示例#3
0
        //roomName/groupName = string.Empty if ConversationType.OneToOne
        public async Task <string> CreateRoom(Constants.ConversationTypes conversationType, string userId, string groupName)
        {
            NewConversation nc = new NewConversation()
            {
                roomType = Convert.ToInt32(conversationType),
                invite   = userId,
                roomName = groupName
            };

            var jContent = JsonConvert.SerializeObject(nc);

            HttpResponseMessage response = await RequestsBL.POSTRequest("/room", jContent, Constants.BaseRequestStub);

            if (response != null)
            {
                string jResponse     = JsonConvert.SerializeXNode(XDocument.Parse(await response.Content.ReadAsStringAsync()));
                JToken documentToken = JToken.Parse(jResponse);

                var roomContainer = documentToken["ocs"]["data"]["token"].AsJEnumerable();

                if (roomContainer != null)
                {
                    return(roomContainer.ToString());
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }
示例#4
0
    void Start()
    {
        GameObject theConvoObject = GameObject.FindGameObjectWithTag("TheConvo");

        yes              = theConvoObject.GetComponent <NewConversation>();
        OptionOne.text   = "";
        OptionTwo.text   = "";
        OptionThree.text = "";
        OptionFour.text  = "";
    }
示例#5
0
    void Start()
    {
        GameObject theConvoObject = GameObject.FindGameObjectWithTag("TheConvo");

        newcon = theConvoObject.GetComponent <NewConversation>();
    }