Beispiel #1
0
 public void DeRegisterMessageServer(MessageServerInfo m)
 {
     lock (m_messageServers)
     {
         if (m_messageServers.Contains(m))
             m_messageServers.Remove(m);
     }
 }
Beispiel #2
0
        public XmlRpcResponse XmlRPCDeRegisterMessageServer(XmlRpcRequest request, IPEndPoint remoteClient)
        {
            XmlRpcResponse response = new XmlRpcResponse();
            Hashtable requestData = (Hashtable)request.Params[0];
            Hashtable responseData = new Hashtable();

            if (requestData.Contains("uri"))
            {
                string URI = (string)requestData["uri"];
                string sendkey = (string)requestData["sendkey"];
                string recvkey = (string)requestData["recvkey"];
                MessageServerInfo m = new MessageServerInfo();
                m.URI = URI;
                m.sendkey = sendkey;
                m.recvkey = recvkey;
                DeRegisterMessageServer(m);
                responseData["responsestring"] = "TRUE";
                response.Value = responseData;
            }
            return response;
        }
Beispiel #3
0
 public void RegisterMessageServer(MessageServerInfo m)
 {
     lock (m_messageServers)
     {
         if (!m_messageServers.Contains(m))
             m_messageServers.Add(m);
     }
 }
        private void NotifyMessageServerAboutUser(MessageServerInfo serv,
                                                    UUID agentID, UUID sessionID, UUID RegionID,
                                                    ulong regionhandle, float positionX, float positionY, float positionZ,
                                                    string firstname, string lastname)
        {
            Hashtable reqparams = new Hashtable();
            reqparams["sendkey"] = serv.sendkey;
            reqparams["agentid"] = agentID.ToString();
            reqparams["sessionid"] = sessionID.ToString();
            reqparams["regionid"] = RegionID.ToString();
            reqparams["regionhandle"] = regionhandle.ToString();
            reqparams["positionx"] = positionX.ToString();
            reqparams["positiony"] = positionY.ToString();
            reqparams["positionz"] = positionZ.ToString();
            reqparams["firstname"] = firstname;
            reqparams["lastname"] = lastname;

            //reqparams["position"] = Position.ToString();

            ArrayList SendParams = new ArrayList();
            SendParams.Add(reqparams);

            XmlRpcRequest GridReq = new XmlRpcRequest("login_to_simulator", SendParams);
            try
            {
                GridReq.Send(serv.URI, 6000);
                m_log.Info("[LOGIN]: Notified : " + serv.URI + " about user login");
            }
            catch (WebException)
            {
                m_log.Warn("[MSGCONNECTOR]: Unable to notify Message Server about login.  Presence might be borked for this user");
            }

        }
        private void NotifyMessageServerAboutRegionShutdown(MessageServerInfo serv, UUID regionID)
        {
            Hashtable reqparams = new Hashtable();
            reqparams["sendkey"] = serv.sendkey;
            reqparams["regionid"] = regionID.ToString();
            ArrayList SendParams = new ArrayList();
            SendParams.Add(reqparams);

            XmlRpcRequest GridReq = new XmlRpcRequest("process_region_shutdown", SendParams);
            try
            {
                GridReq.Send(serv.URI, 6000);
            }
            catch (WebException)
            {
                m_log.Warn("[MSGCONNECTOR]: Unable to notify Message Server about region shutdown.");
            }
            m_log.Info("[REGION UPDOWN]: Notified : " + serv.URI + " about region state change");
        }
        private void NotifyMessageServerAboutUserLogoff(MessageServerInfo serv, UUID agentID)
        {
            Hashtable reqparams = new Hashtable();
            reqparams["sendkey"] = serv.sendkey;
            reqparams["agentid"] = agentID.ToString();
            ArrayList SendParams = new ArrayList();
            SendParams.Add(reqparams);

            XmlRpcRequest GridReq = new XmlRpcRequest("logout_of_simulator", SendParams);
            try
            {
                GridReq.Send(serv.URI, 6000);
            }
            catch (WebException)
            {
                m_log.Warn("[MSGCONNECTOR]: Unable to notify Message Server about log out.  Other users might still think this user is online");
            }
            m_log.Info("[LOGOUT]: Notified : " + serv.URI + " about user logout");
        }
 public void RegisterMessageServer(string URI, MessageServerInfo serverData)
 {
     lock (MessageServers)
     {
         if (!MessageServers.ContainsKey(URI))
             MessageServers.Add(URI, serverData);
     }
 }
        public XmlRpcResponse XmlRPCRegisterMessageServer(XmlRpcRequest request, IPEndPoint remoteClient)
        {
            // Check IP Endpoint Access
            if (!TrustManager.Instance.IsTrustedPeer(remoteClient))
                return (Util.CreateTrustManagerAccessDeniedResponse()); 
            
            XmlRpcResponse response = new XmlRpcResponse();
            Hashtable requestData = (Hashtable)request.Params[0];
            Hashtable responseData = new Hashtable();

            if (requestData.Contains("uri"))
            {
                string URI = (string)requestData["uri"];
                string sendkey=(string)requestData["sendkey"];
                string recvkey=(string)requestData["recvkey"];
                MessageServerInfo m = new MessageServerInfo();
                m.URI = URI;
                m.sendkey = sendkey;
                m.recvkey = recvkey;
                RegisterMessageServer(URI, m);
                responseData["responsestring"] = "TRUE";
                response.Value = responseData;
            }
            return response;
        }