예제 #1
0
        public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID)
        {
            PresenceData prevUser = GetUser(userID);

            if (!m_allowDuplicatePresences && (prevUser != null))
                m_Database.Delete("UserID", userID.ToString());

            PresenceData data = new PresenceData();

            data.UserID = userID;
            data.RegionID = UUID.Zero;
            data.SessionID = sessionID;
            data.Data = new Dictionary<string, string>();
            data.Data["SecureSessionID"] = secureSessionID.ToString();
            
            m_Database.Store(data);

            string prevUserStr = "";
            if (prevUser != null)
                prevUserStr = string.Format(". This user was already logged-in: session {0}, region {1}", prevUser.SessionID, prevUser.RegionID);

            m_log.DebugFormat("[PRESENCE SERVICE]: LoginAgent: session {0}, user {1}, region {2}, secure session {3}{4}",
                data.SessionID, data.UserID, data.RegionID, secureSessionID, prevUserStr);
            
            return true;
        }
예제 #2
0
        public bool Store(PresenceData data)
        {
            if (Instance != this)
                return Instance.Store(data);

//            m_log.DebugFormat("[NULL PRESENCE DATA]: Storing presence {0}", data.UserID);
//            Console.WriteLine("HOME for " + data.UserID + " is " + (data.Data.ContainsKey("HomeRegionID") ? data.Data["HomeRegionID"] : "Not found"));

            m_presenceData[data.SessionID] = data;
            return true;
        }
예제 #3
0
        public bool Report(PresenceInfo presence)
        {
            PresenceData p = new PresenceData();
            p.Data = new Dictionary<string, string>();

            p.UUID = presence.PrincipalID;
            p.currentRegion = presence.RegionID;

            foreach (KeyValuePair<string, string> kvp in presence.Data)
                p.Data[kvp.Key] = kvp.Value;

            return false;
        }
예제 #4
0
        public bool LoginAgent(string userID, UUID sessionID,
                UUID secureSessionID)
        {
            PresenceData[] d = m_Database.Get("UserID", userID);

            PresenceData data = new PresenceData();

            data.UserID = userID;
            data.RegionID = UUID.Zero;
            data.SessionID = sessionID;
            data.Data = new Dictionary<string, string>();
            data.Data["SecureSessionID"] = secureSessionID.ToString();
            
            m_Database.Store(data);

            m_log.DebugFormat("[PRESENCE SERVICE]: LoginAgent {0} with session {1} and ssession {2}",
                userID, sessionID, secureSessionID);
            return true;
        }
예제 #5
0
        public bool LoginAgent(string userID, UUID sessionID,
                UUID secureSessionID)
        {
            if (!m_allowDuplicatePresences)
                m_Database.LogoutAgent(UUID.Parse(userID));

            PresenceData data = new PresenceData();

            data.UserID = userID;
            data.RegionID = UUID.Zero;
            data.SessionID = sessionID;
            data.Data = new Dictionary<string, string>();
            data.Data["SecureSessionID"] = secureSessionID.ToString();
            data.Data["LastSeen"] = Util.UnixTimeSinceEpoch().ToString();
            
            m_Database.Store(data);

            m_log.DebugFormat("[PRESENCE SERVICE]: LoginAgent {0} with session {1} and ssession {2}",
                userID, sessionID, secureSessionID);
            return true;
        }
예제 #6
0
        public bool LoginAgent(string userID, UUID sessionID,
                UUID secureSessionID)
        {
            m_Database.Prune(userID);

            PresenceData[] d = m_Database.Get("UserID", userID);

            PresenceData data = new PresenceData();

            data.UserID = userID;
            data.RegionID = UUID.Zero;
            data.SessionID = sessionID;
            data.Data = new Dictionary<string, string>();
            data.Data["SecureSessionID"] = secureSessionID.ToString();
            data.Data["Online"] = "true";
            data.Data["Login"] = Util.UnixTimeSinceEpoch().ToString();
            if (d != null && d.Length > 0)
            {
                data.Data["HomeRegionID"] = d[0].Data["HomeRegionID"];
                data.Data["HomePosition"] = d[0].Data["HomePosition"];
                data.Data["HomeLookAt"] = d[0].Data["HomeLookAt"];
                data.Data["Position"] = d[0].Data["Position"];
                data.Data["LookAt"] = d[0].Data["LookAt"];

                data.RegionID = d[0].RegionID;
            }
            else
            {
                data.Data["HomeRegionID"] = UUID.Zero.ToString();
                data.Data["HomePosition"] = new Vector3(128, 128, 0).ToString();
                data.Data["HomeLookAt"] = new Vector3(0, 1, 0).ToString();
            }
            
            m_Database.Store(data);

            m_log.DebugFormat("[PRESENCE SERVICE]: LoginAgent {0} with session {1} and ssession {2}",
                userID, sessionID, secureSessionID);
            return true;
        }