コード例 #1
0
        public void SendUpdate(string name, IBuddyProperties properties, UserStatus status)
        {
            UserStatus lastStatus = thisUser.Status;

            UserInfo userInfo;

            lock (thisUser)
            {
                thisUser.DisplayName = name;
                thisUser.Status      = status;
                thisUser.Properties  = properties.ToDictionary();

                userInfo = thisUser.Clone();
            }

            if (lastStatus == UserStatus.Offline)
            {
                if (status != UserStatus.Offline)
                {
                    discovery.Login(userInfo);
                }
            }
            else if (status == UserStatus.Offline)
            {
                discovery.FakeLogout(userInfo);
            }
            else
            {
                discovery.Update(userInfo);
            }
        }
コード例 #2
0
        public void Login(string name, IBuddyProperties properties)
        {
            thisUser.DisplayName = name;
            thisUser.Status      = UserStatus.Online;
            thisUser.Properties  = properties.ToDictionary();

            channel.Start();
            discovery.Login(thisUser.Clone());
            keepAlive.Start();
        }