Example #1
0
        /// New Client Event Handler
        private void OnNewClient(IClientAPI client)
        {
            // Subscribe to messages

            // Classifieds
            client.AddGenericPacketHandler("avatarclassifiedsrequest", HandleAvatarClassifiedsRequest);
            client.OnClassifiedInfoRequest += ClassifiedInfoRequest;
            client.OnClassifiedInfoUpdate  += ClassifiedInfoUpdate;
            client.OnClassifiedDelete      += ClassifiedDelete;

            // Picks
            client.AddGenericPacketHandler("avatarpicksrequest", HandleAvatarPicksRequest);
            client.AddGenericPacketHandler("pickinforequest", HandlePickInfoRequest);
            client.OnPickInfoUpdate += PickInfoUpdate;
            client.OnPickDelete     += PickDelete;

            // Notes
            client.AddGenericPacketHandler("avatarnotesrequest", HandleAvatarNotesRequest);
            client.OnAvatarNotesUpdate += AvatarNotesUpdate;

            //Profile
            client.OnRequestAvatarProperties += RequestAvatarProperties;
            client.OnUpdateAvatarProperties  += UpdateAvatarProperties;
            client.OnAvatarInterestUpdate    += AvatarInterestsUpdate;
            client.OnUserInfoRequest         += UserPreferencesRequest;
            client.OnUpdateUserInfo          += UpdateUserPreferences;

            AgentCircuitData clientinfo = client.RequestClientInfo();
            string           agentID    = client.AgentId.ToString();
            string           agentIP    = client.RemoteEndPoint.ToString();
            string           agentName  = clientinfo.Name;
            // Fill parameters for informing jOpenSim about this user.
            Hashtable paramTable = new Hashtable();

            paramTable["agentID"]   = agentID;
            paramTable["agentIP"]   = agentIP;
            paramTable["agentName"] = agentName;

            // Generate the request for transfer.
            Hashtable resultTable = GenericXMLRPCRequest(paramTable, "clientInfo");
        }
 void EventManager_OnNewClient(IClientAPI client)
 {
     UserData ud = new UserData
                       {
                           FirstName = client.FirstName,
                           LastName = client.LastName,
                           ServerURLs = client.RequestClientInfo().ServiceURLs
                       };
     if (ud.ServerURLs != null && ud.ServerURLs.ContainsKey (GetHandlers.Helpers_HomeURI))
         ud.HomeURL = ud.ServerURLs[GetHandlers.Helpers_HomeURI].ToString ();
     else
         ud.HomeURL = "";
     if (ud.ServerURLs == null)
         ud.ServerURLs = new Dictionary<string, object> ();
     m_UserCache[client.AgentId] = ud;//Cache them
     client.OnNameFromUUIDRequest += HandleUUIDNameRequest;
 }