• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Capabilities.Caps类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中OpenSim.Framework.Capabilities.Caps的典型用法代码示例。如果您正苦于以下问题:C# OpenSim.Framework.Capabilities.Caps类的具体用法?C# OpenSim.Framework.Capabilities.Caps怎么用?C# OpenSim.Framework.Capabilities.Caps使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OpenSim.Framework.Capabilities.Caps类属于命名空间,在下文中一共展示了OpenSim.Framework.Capabilities.Caps类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: UploadBakedTextureServerConnector

        public UploadBakedTextureServerConnector(IConfigSource config, IHttpServer server, string configName) :
                base(config, server, configName)
        {
            if (configName != String.Empty)
                m_ConfigName = configName;

            IConfig serverConfig = config.Configs[m_ConfigName];
            if (serverConfig == null)
                throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));

            string assetService = serverConfig.GetString("AssetService", String.Empty);

            if (assetService == String.Empty)
                throw new Exception("No AssetService in config file");

            Object[] args = new Object[] { config };
            m_AssetService =
                    ServerUtils.LoadPlugin<IAssetService>(assetService, args);

            if (m_AssetService == null)
                throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));

            // NEED TO FIX THIS
            OpenSim.Framework.Capabilities.Caps caps = new OpenSim.Framework.Capabilities.Caps(server, "", server.Port, "", UUID.Zero, "");
            server.AddStreamHandler(new RestStreamHandler(
                        "POST",
                        "/CAPS/UploadBakedTexture/",
                        new UploadBakedTextureHandler(caps, m_AssetService, true).UploadBakedTexture,
                        "UploadBakedTexture",
                        "Upload Baked Texture Capability"));

         }
开发者ID:CassieEllen,项目名称:opensim,代码行数:32,代码来源:UploadBakedTextureServerConnector.cs


示例2: RegisterCaps

        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capuuid = UUID.Random();

            caps.RegisterHandler("ViewerStartAuction",
                                new RestHTTPHandler("POST", "/CAPS/" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return ViewerStartAuction(m_dhttpMethod, capuuid);
                                                      }));
        }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:11,代码来源:AuctionModule.cs


示例3: RegisterCaps

        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capuuid = UUID.Random();
            
//            m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/");

            caps.RegisterHandler("ObjectAdd",
                                 new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/",
                                                       delegate(Hashtable m_dhttpMethod)
                                                       {
                                                           return ProcessAdd(m_dhttpMethod, agentID, caps);
                                                       }));
        }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:13,代码来源:ObjectAdd.cs


示例4: RegisterCaps

        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capuuid = UUID.Random();
            
//            m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/");

            caps.RegisterHandler(
                "ObjectAdd",
                new RestHTTPHandler(
                    "POST",
                    "/CAPS/OA/" + capuuid + "/",
                    httpMethod => ProcessAdd(httpMethod, agentID, caps),
                    "ObjectAdd",
                    agentID.ToString()));;
        }
开发者ID:JAllard,项目名称:opensim,代码行数:15,代码来源:ObjectAdd.cs


示例5: EventManager_OnRegisterCaps

        void EventManager_OnRegisterCaps(UUID agentID, Caps caps)
        {
            CAPSPrivateSeedHandler handler = new CAPSPrivateSeedHandler(null,//the server IS null for a reason, so that we don't add the handlers at the wrong time
                m_scene.InventoryService, 
                m_scene.LibraryService, m_scene.GridUserService,
                m_scene.PresenceService, "", agentID, ""); //URL and Hostname are all "" as well so that we don't add the hostname by accident

            List<IRequestHandler> handlers = handler.GetServerCAPS();

            foreach (IRequestHandler handle in handlers)
            {
                if (handler.registeredCAPSPath.ContainsKey(handle.Path))
                {
                    caps.RegisterHandler(handler.registeredCAPSPath[handle.Path].ToString(), handle);
                }
            }
        }
开发者ID:WordfromtheWise,项目名称:Aurora,代码行数:17,代码来源:LocalCAPSService.cs


示例6: RegisterCaps

        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capuuid = UUID.Random();

            caps.RegisterHandler("ServerReleaseNotes",
                                new RestHTTPHandler("POST", "/CAPS/ServerReleaseNotes/" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return ProcessServerReleaseNotes(m_dhttpMethod, agentID, capuuid);
                                                      }));

            caps.RegisterHandler("CopyInventoryFromNotecard",
                                new RestHTTPHandler("POST", "/CAPS/" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return CopyInventoryFromNotecard(m_dhttpMethod, capuuid, agentID);
                                                      }));
        }
开发者ID:WordfromtheWise,项目名称:Aurora,代码行数:18,代码来源:SetHomeModule.cs


示例7: RegisterCaps

        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capuuid = UUID.Random();
            
            caps.RegisterHandler("ObjectAdd",
                                 new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/",
                                                       delegate(Hashtable m_dhttpMethod)
                                                       {
                                                           return ProcessAdd(m_dhttpMethod, agentID, caps);
                                                       }));

            caps.RegisterHandler("ServerReleaseNotes",
                                new RestHTTPHandler("POST", "/CAPS/ServerReleaseNotes/" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return ProcessServerReleaseNotes(m_dhttpMethod, agentID, capuuid);
                                                      }));
        }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:18,代码来源:ObjectAdd.cs


示例8: RegisterCaps

        /// <summary>
        /// Set up the CAPS for display names
        /// </summary>
        /// <param name="agentID"></param>
        /// <param name="caps"></param>
        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capuuid = UUID.Random();

            caps.RegisterHandler("SetDisplayName",
                                new RestHTTPHandler("POST", "/CAPS" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return ProcessSetDisplayName(m_dhttpMethod, agentID);
                                                      }));

            capuuid = UUID.Random();

            caps.RegisterHandler("GetDisplayNames",
                                new RestHTTPHandler("POST", "/CAPS" + capuuid + "/",
                                                      delegate(Hashtable m_dhttpMethod)
                                                      {
                                                          return ProcessGetDisplayName(m_dhttpMethod, agentID);
                                                      }));
        }
开发者ID:WordfromtheWise,项目名称:Aurora,代码行数:25,代码来源:DisplayNamesModule.cs


示例9: RegisterCaps

        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

            m_log.Info("[GETMESH]: /CAPS/" + capID);
            caps.RegisterHandler("GetMesh",
                                 new RestHTTPHandler("GET", "/CAPS/" + capID,
                                                       delegate(Hashtable m_dhttpMethod)
                                                       {
                                                           return ProcessGetMesh(m_dhttpMethod, agentID, caps);
                                                       }));
         
        }
开发者ID:N3X15,项目名称:VoxelSim,代码行数:13,代码来源:GetMeshModule.cs


示例10: EventManager_OnRegisterCaps

 void EventManager_OnRegisterCaps(UUID agentID, Caps caps)
 {
     /*string capsBase = "/CAPS/" + UUID.Random();
     caps.RegisterHandler("GroupProposalBallot",
                         new RestHTTPHandler("POST", capsBase + "/",
                                               delegate(Hashtable m_dhttpMethod)
                                               {
                                                   return GroupProposalBallot(m_dhttpMethod, agentID);
                                               }));*/
 }
开发者ID:WordfromtheWise,项目名称:Aurora,代码行数:10,代码来源:GroupsModule.cs


示例11: OnRegisterCaps

        public void OnRegisterCaps(UUID agentID, Caps caps)
        {
            // Register an event queue for the client

            //m_log.DebugFormat(
            //    "[EVENTQUEUE]: OnRegisterCaps: agentID {0} caps {1} region {2}",
            //    agentID, caps, m_scene.RegionInfo.RegionName);

            // Let's instantiate a Queue for this agent right now
            TryGetQueue(agentID);

            UUID eventQueueGetUUID;

            lock (m_AvatarQueueUUIDMapping)
            {
                // Reuse open queues.  The client does!
                if (m_AvatarQueueUUIDMapping.ContainsKey(agentID))
                {
                    //m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!");
                    eventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID];
                }
                else
                {
                    eventQueueGetUUID = UUID.Random();
                    //m_log.DebugFormat("[EVENTQUEUE]: Using random UUID!");
                }
            }

            lock (m_QueueUUIDAvatarMapping)
            {
                if (!m_QueueUUIDAvatarMapping.ContainsKey(eventQueueGetUUID))
                    m_QueueUUIDAvatarMapping.Add(eventQueueGetUUID, agentID);
            }

            lock (m_AvatarQueueUUIDMapping)
            {
                if (!m_AvatarQueueUUIDMapping.ContainsKey(agentID))
                    m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID);
            }

            string eventQueueGetPath = GenerateEqgCapPath(eventQueueGetUUID);

            // Register this as a caps handler
            // FIXME: Confusingly, we need to register separate as a capability so that the client is told about
            // EventQueueGet when it receive capability information, but then we replace the rest handler immediately
            // afterwards with the poll service.  So for now, we'll pass a null instead to simplify code reading, but
            // really it should be possible to directly register the poll handler as a capability.
            caps.RegisterHandler("EventQueueGet", new RestHTTPHandler("POST", eventQueueGetPath, null));
//                                                       delegate(Hashtable m_dhttpMethod)
//                                                       {
//                                                           return ProcessQueue(m_dhttpMethod, agentID, caps);
//                                                       }));

            // This will persist this beyond the expiry of the caps handlers
            // TODO: Add EventQueueGet name/description for diagnostics
            MainServer.Instance.AddPollServiceHTTPHandler(
                eventQueueGetPath,
                new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID));

//            m_log.DebugFormat(
//                "[EVENT QUEUE GET MODULE]: Registered EQG handler {0} for {1} in {2}",
//                eventQueueGetPath, agentID, m_scene.RegionInfo.RegionName);

            Random rnd = new Random(Environment.TickCount);
            lock (m_ids)
            {
                if (!m_ids.ContainsKey(agentID))
                    m_ids.Add(agentID, rnd.Next(30000000));
            }
        }
开发者ID:rryk,项目名称:omp-server,代码行数:70,代码来源:EventQueueGetModule.cs


示例12: RegisterCaps

        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

//            m_log.Debug("[UPLOAD OBJECT ASSET MODULE]: /CAPS/" + capID);
            caps.RegisterHandler(
                "UploadObjectAsset",
                new RestHTTPHandler(
                    "POST",
                    "/CAPS/OA/" + capID + "/",
                    httpMethod => ProcessAdd(httpMethod, agentID, caps),
                    "UploadObjectAsset",
                    agentID.ToString()));

            /*
                   caps.RegisterHandler("NewFileAgentInventoryVariablePrice",

                           new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>("POST",
                                                                                                  "/CAPS/" + capID.ToString(),
                                                                                                  delegate(LLSDAssetUploadRequest req)
                                                              {
                                                                  return NewAgentInventoryRequest(req,agentID);
                                                              }));
             */

        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:26,代码来源:UploadObjectAssetModule.cs


示例13: ViewerStatsReport

        /// <summary>
        /// Callback for a viewerstats cap
        /// </summary>
        /// <param name="request"></param>
        /// <param name="path"></param>
        /// <param name="param"></param>
        /// <param name="agentID"></param>
        /// <param name="caps"></param>
        /// <returns></returns>
        public string ViewerStatsReport(string request, string path, string param,
                                      UUID agentID, Caps caps)
        {
            //m_log.Debug(request);

            dataConnector.UpdateUserStats(ParseViewerStats(request, agentID));

            return String.Empty;
        }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:18,代码来源:WebStatsModule.cs


示例14: OnRegisterCaps

        public void OnRegisterCaps(UUID agentID, Caps caps)
        {
            // Register an event queue for the client

            m_log.DebugFormat(
                "[EVENTQUEUE]: OnRegisterCaps: agentID {0} caps {1} region {2}",
                agentID, caps, m_scene.RegionInfo.RegionName);

            // Let's instantiate a Queue for this agent right now
            TryGetQueue(agentID);

            UUID eventQueueGetUUID;

            eventQueueGetUUID = m_AvatarQueueUUIDMapping.GetOrAddIfNotExists(agentID, delegate() { return UUID.Random(); });

            m_QueueUUIDAvatarMapping[eventQueueGetUUID] = agentID;
            m_AvatarQueueUUIDMapping[agentID] = eventQueueGetUUID;

            caps.RegisterPollHandler(
                "EventQueueGet",
                new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, agentID, SERVER_EQ_TIME_NO_EVENTS));

            Random rnd = new Random(Environment.TickCount);
            try
            {
                m_ids.AddIfNotExists(agentID, delegate() { return rnd.Next(30000000); });
            }
            catch(ThreadedClasses.RwLockedDictionary<UUID, int>.KeyAlreadyExistsException)
            {

            }
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:32,代码来源:EventQueueGetModule.cs


示例15: OnDeRegisterCaps

 private void OnDeRegisterCaps(UUID agentID, Caps caps)
 {
 }
开发者ID:emperorstarfinder,项目名称:arribasim-dev-extras,代码行数:3,代码来源:WebStatsModule.cs


示例16: ProcessQueue

        public Hashtable ProcessQueue(Hashtable request, UUID agentID, Caps caps)
        {
            // TODO: this has to be redone to not busy-wait (and block the thread),
            // TODO: as soon as we have a non-blocking way to handle HTTP-requests.

//            if (m_log.IsDebugEnabled)
//            { 
//                String debug = "[EVENTQUEUE]: Got request for agent {0} in region {1} from thread {2}: [  ";
//                foreach (object key in request.Keys)
//                {
//                    debug += key.ToString() + "=" + request[key].ToString() + "  ";
//                }
//                m_log.DebugFormat(debug + "  ]", agentID, m_scene.RegionInfo.RegionName, System.Threading.Thread.CurrentThread.Name);
//            }

            Queue<OSD> queue = TryGetQueue(agentID);
            OSD element = queue.Dequeue(); // 15s timeout

            Hashtable responsedata = new Hashtable();
            
            int thisID = 0;
            lock (m_ids) 
                thisID = m_ids[agentID];

            if (element == null)
            {
                //m_log.ErrorFormat("[EVENTQUEUE]: Nothing to process in " + m_scene.RegionInfo.RegionName);
                if (thisID == -1) // close-request
                {
                    m_log.ErrorFormat("[EVENTQUEUE]: 404 in " + m_scene.RegionInfo.RegionName);
                    responsedata["int_response_code"] = 404; //501; //410; //404;
                    responsedata["content_type"] = "text/plain";
                    responsedata["keepalive"] = false;
                    responsedata["str_response_string"] = "Closed EQG";
                    return responsedata;
                }
                responsedata["int_response_code"] = 502;
                responsedata["content_type"] = "text/plain";
                responsedata["keepalive"] = false;
                responsedata["str_response_string"] = "Upstream error: ";
                responsedata["error_status_text"] = "Upstream error:";
                responsedata["http_protocol_version"] = "HTTP/1.0";
                return responsedata;
            }

            OSDArray array = new OSDArray();
            if (element == null) // didn't have an event in 15s
            {
                // Send it a fake event to keep the client polling!   It doesn't like 502s like the proxys say!
                array.Add(EventQueueHelper.KeepAliveEvent());
                //m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName);
            }
            else
            {
                array.Add(element);
                while (queue.Count > 0)
                {
                    array.Add(queue.Dequeue());
                    thisID++;
                }
            }

            OSDMap events = new OSDMap();
            events.Add("events", array);

            events.Add("id", new OSDInteger(thisID));
            lock (m_ids)
            {
                m_ids[agentID] = thisID + 1;
            }

            responsedata["int_response_code"] = 200;
            responsedata["content_type"] = "application/xml";
            responsedata["keepalive"] = false;
            responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events);
            //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]);

            return responsedata;
        }
开发者ID:openmetaversefoundation,项目名称:fortis-opensim,代码行数:79,代码来源:EventQueueGetModule.cs


示例17: RegisterCaps

        public void RegisterCaps(UUID agentID, Caps caps)
        {
            IRequestHandler reqHandler
                = new RestHTTPHandler(
                    "GET", "/CAPS/" + UUID.Random(),
                    x => { return HandleSimulatorFeaturesRequest(x, agentID); }, "SimulatorFeatures", agentID.ToString());

            caps.RegisterHandler("SimulatorFeatures", reqHandler);
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:9,代码来源:SimulatorFeaturesModule.cs


示例18: AddCapsHandler

        public void AddCapsHandler(UUID agentId)
        {
            if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId))
                return;

            String capsObjectPath = GetCapsPath(agentId);

            if (m_capsHandlers.ContainsKey(agentId))
            {
                Caps oldCaps = m_capsHandlers[agentId];
                
                m_log.DebugFormat(
                    "[CAPS]: Reregistering caps for agent {0}.  Old caps path {1}, new caps path {2}. ", 
                    agentId, oldCaps.CapsObjectPath, capsObjectPath);
                // This should not happen. The caller code is confused. We need to fix that.
                // CAPs can never be reregistered, or the client will be confused.
                // Hence this return here.
                //return;
            }

            Caps caps
                = new Caps(
                    m_scene.AssetService, MainServer.Instance, m_scene.RegionInfo.ExternalHostName,
                    MainServer.Instance.Port,
                    capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName);
            
            caps.RegisterHandlers();

            m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps);

            caps.AddNewInventoryItem = m_scene.AddUploadedInventoryItem;
            caps.ItemUpdatedCall = m_scene.CapsUpdateInventoryItemAsset;
            caps.TaskScriptUpdatedCall = m_scene.CapsUpdateTaskInventoryScriptAsset;
            caps.CAPSFetchInventoryDescendents = m_scene.HandleFetchInventoryDescendentsCAPS;
            caps.GetClient = m_scene.SceneContents.GetControllingClient;
            
            m_capsHandlers[agentId] = caps;
        }
开发者ID:ChrisD,项目名称:opensim,代码行数:38,代码来源:CapabilitiesModule.cs


示例19: RegisterCaps

        public void RegisterCaps(UUID agentID, Caps caps)
        {
            UUID capID = UUID.Random();

//            m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
            caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
        }
开发者ID:phantasmagoric,项目名称:InfiniteGrid-Opensim,代码行数:7,代码来源:GetTextureModule.cs


示例20: RegisterCaps

 public void RegisterCaps(UUID agent, Caps caps)
 {
     UUID capId = UUID.Random();
     caps.RegisterHandler("AgentPreferences",
         new RestStreamHandler("POST", "/CAPS/" + capId,
             delegate(string request, string path, string param,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
             {
                 return UpdateAgentPreferences(request, path, param, agent);
             }));
     caps.RegisterHandler("UpdateAgentLanguage",
         new RestStreamHandler("POST", "/CAPS/" + capId,
             delegate(string request, string path, string param,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
             {
                 return UpdateAgentPreferences(request, path, param, agent);
             }));
     caps.RegisterHandler("UpdateAgentInformation",
         new RestStreamHandler("POST", "/CAPS/" + capId,
             delegate(string request, string path, string param,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
             {
                 return UpdateAgentPreferences(request, path, param, agent);
             }));
 }
开发者ID:CassieEllen,项目名称:opensim,代码行数:25,代码来源:AgentPreferencesModule.cs



注:本文中的OpenSim.Framework.Capabilities.Caps类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LSL_Types.LSLFloat类代码示例发布时间:2022-05-24
下一篇:
C# OpenSim类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap