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

C# PacketPriority类代码示例

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

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



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

示例1: PacketHandler

 /// <summary>
 /// 
 /// </summary>
 /// <param name="iPacketID"></param>
 /// <param name="priority"></param>
 /// <param name="taskType"></param>
 /// <param name="onPacketReceive"></param>
 internal PacketHandler(ushort iPacketID, PacketPriority priority, TaskType taskType,
     PacketReceiveCallback onPacketReceive)
 {
     m_PacketID = iPacketID;
     m_PacketPriority = priority;
     m_OnReceive = onPacketReceive;
     m_TaskType = taskType;
 }
开发者ID:zaq1xsw,项目名称:DogSE,代码行数:15,代码来源:PacketHandler.cs


示例2: PacketHandler

        /// <summary>
        /// 
        /// </summary>
        /// <param name="iPacketID"></param>
        /// <param name="iLength"></param>
        /// <param name="bInGame"></param>
        /// <param name="onPacketReceive"></param>
        internal PacketHandler(long iPacketID, long iMinLength, PacketPriority priority, PacketReceiveCallback onPacketReceive)
        {
            m_PacketID = iPacketID;
            m_MinLength = iMinLength;
            m_PacketPriority = priority;
            m_OnReceive = onPacketReceive;

            CallTimes = 0;
            ElapsedTicks = 0;
        }
开发者ID:zaq1xsw,项目名称:DogSE,代码行数:17,代码来源:PacketHandler.cs


示例3: Shutdown

 public virtual void Shutdown(uint blockDuration, byte orderingChannel, PacketPriority disconnectionNotificationPriority) {
   RakNetPINVOKE.RakPeerInterface_Shutdown__SWIG_0(swigCPtr, blockDuration, orderingChannel, (int)disconnectionNotificationPriority);
 }
开发者ID:nulhax,项目名称:VOID,代码行数:3,代码来源:RakPeerInterface.cs


示例4: Rpc

            /// <summary>
            /// Starts a RPC to the scene host.
            /// </summary>
            /// <param name="route">The remote route on which the message will be sent.</param>
            /// <param name="writer">The writer used to build the request's content.</param>
            /// <param name="priority">The priority used to send the request.</param>
            /// <returns>An IObservable instance returning the RPC responses.</returns>
            public IObservable<Packet<IScenePeer>> Rpc(string route, Action<Stream> writer, PacketPriority priority)
            {
                return Observable.Create<Packet<IScenePeer>>(
                    observer =>
                    {
                        var rr = _scene.RemoteRoutes.FirstOrDefault(r => r.Name == route);
                        if (rr == null)
                        {
							_scene.resolver.GetComponent<ILogger>().Error("Tried to send a message on a non existing route");
                            throw new ArgumentException("The target route does not exist on the remote host.");
                        }
                        string version;
                        if (!rr.Metadata.TryGetValue(RpcClientPlugin.PluginName, out version) || version != RpcClientPlugin.Version)
                        {
							_scene.resolver.GetComponent<ILogger>().Error("Target remote does not support RPC");
                            throw new InvalidOperationException("The target remote route does not support the plugin RPC version " + Version);
                        }

                        var rq = new Request { Observer = observer };
                        var id = this.ReserveId();
                        if (_pendingRequests.TryAdd(id, rq))
                        {

                            _scene.SendPacket(route, s =>
                            {
                                s.Write(BitConverter.GetBytes(id), 0, 2);
                                writer(s);
                            }, priority, PacketReliability.RELIABLE_ORDERED);
                        }

                        return () =>
                        {
                            _scene.SendPacket(CancellationRouteName, s =>
                            {
                                s.Write(BitConverter.GetBytes(id), 0, 2);
                            });
                            _pendingRequests.TryRemove(id, out rq);

                        };
                    });
            }
开发者ID:LaurentQUERSIN,项目名称:Project-EW2D,代码行数:48,代码来源:RpcClientPlugin.cs


示例5: Register

        /// <summary>
        /// 
        /// </summary>
        /// <param name="iPacketID"></param>
        /// <param name="priority"></param>
        /// <param name="onPacketReceive"></param>
        public void Register(ushort iPacketID, PacketPriority priority, PacketReceiveCallback onPacketReceive)
        {
            if (m_Handlers[iPacketID] != null)
            {
                Logs.Warn("Msgid {0} is replace.", iPacketID);
            }

            NetTaskProfile.GetNetTaskProfile(iPacketID);

            m_Handlers[iPacketID] = new PacketHandler(iPacketID, priority, onPacketReceive);
        }
开发者ID:zaq1xsw,项目名称:DogSE,代码行数:17,代码来源:PacketHandlersBase.cs


示例6: Send

 public uint Send(FT_Session session, FT_DataBase data, PacketPriority priority, PacketReliability reliability, char orderingChannel, AddressOrGUID systemIdentifier) {
   uint ret = RakNetPINVOKE.FT_Node_Plugin_Send__SWIG_1(swigCPtr, FT_Session.getCPtr(session), FT_DataBase.getCPtr(data), (int)priority, (int)reliability, orderingChannel, AddressOrGUID.getCPtr(systemIdentifier));
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
开发者ID:ThiagoGarciaAlves,项目名称:ClashOfClans,代码行数:5,代码来源:FT_Node_Plugin.cs


示例7: SetUploadSendParameters

 public void SetUploadSendParameters(PacketPriority _priority, char _orderingChannel) {
   RakNetPINVOKE.DirectoryDeltaTransfer_SetUploadSendParameters(swigCPtr, (int)_priority, _orderingChannel);
 }
开发者ID:ThiagoGarciaAlves,项目名称:ClashOfClans,代码行数:3,代码来源:DirectoryDeltaTransfer.cs


示例8: CloseConnection

 public virtual void CloseConnection(AddressOrGUID target, bool sendDisconnectionNotification, byte orderingChannel, PacketPriority disconnectionNotificationPriority) {
   RakNetPINVOKE.RakPeerInterface_CloseConnection__SWIG_0(swigCPtr, AddressOrGUID.getCPtr(target), sendDisconnectionNotification, orderingChannel, (int)disconnectionNotificationPriority);
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
 }
开发者ID:nulhax,项目名称:VOID,代码行数:4,代码来源:RakPeerInterface.cs


示例9: Register

 /// <summary>
 /// 
 /// </summary>
 /// <param name="iPacketID"></param>
 /// <param name="priority"></param>
 /// <param name="onPacketReceive"></param>
 public void Register(ushort iPacketID, PacketPriority priority, PacketReceiveCallback onPacketReceive)
 {
     m_Handlers[iPacketID] = new PacketHandler(iPacketID, priority, onPacketReceive);
 }
开发者ID:Jimlan,项目名称:DogSE,代码行数:10,代码来源:PacketHandlersBase.cs


示例10: Send

 public override uint Send(BitStream bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, AddressOrGUID systemIdentifier, bool broadcast, uint forceReceiptNumber) {
   uint ret = RakNetPINVOKE.RakPeer_Send__SWIG_2(swigCPtr, BitStream.getCPtr(bitStream), (int)priority, (int)reliability, orderingChannel, AddressOrGUID.getCPtr(systemIdentifier), broadcast, forceReceiptNumber);
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
开发者ID:songotony,项目名称:RType-Client,代码行数:5,代码来源:RakPeer.cs


示例11: Serialize

 public override ReplicaReturnResult Serialize(ref bool sendTimestamp, BitStream outBitStream, uint lastSendTime, ref PacketPriority priority, ref PacketReliability reliability, uint currentTime, SystemAddress systemAddress, SWIGTYPE_p_unsigned_int flags)
 {
     return Listener.Serialize(ref sendTimestamp, outBitStream, lastSendTime, ref priority, ref reliability, currentTime, systemAddress, flags);
 }
开发者ID:JetCrusherTorpedo,项目名称:raknetdotnet,代码行数:4,代码来源:ReplicaMember.cs


示例12: SendSystemRequest

        public Task<Packet> SendSystemRequest(IConnection peer, byte msgId, Action<Stream> writer, PacketPriority priority)
        {
            var tcs = new TaskCompletionSource<Packet>();
            var request = ReserveRequestSlot(tcs);

            peer.SendSystem((byte)MessageIDTypes.ID_SYSTEM_REQUEST, bs =>
            {
                var bw = new BinaryWriter(bs);
                bw.Write(msgId);
                bw.Write(request.id);
                bw.Flush();
                writer(bs);

            }, priority);

            return tcs.Task;
        }
开发者ID:LaurentQUERSIN,项目名称:pop-the-balls---UnityClient,代码行数:17,代码来源:RequestProcessor.cs


示例13: Send

 public virtual uint Send(string data, int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, AddressOrGUID systemIdentifier, bool broadcast, uint forceReceiptNumber) {
   uint ret = RakNetPINVOKE.RakPeerInterface_Send__SWIG_0(swigCPtr, data, length, (int)priority, (int)reliability, orderingChannel, AddressOrGUID.getCPtr(systemIdentifier), broadcast, forceReceiptNumber);
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
开发者ID:nulhax,项目名称:VOID,代码行数:5,代码来源:RakPeerInterface.cs


示例14: Send

 public void Send(FileList fileList, RakPeerInterface rakPeer, SystemAddress recipient, ushort setID, PacketPriority priority, char orderingChannel) {
   RakNetPINVOKE.FileListTransfer_Send__SWIG_2(swigCPtr, FileList.getCPtr(fileList), RakPeerInterface.getCPtr(rakPeer), SystemAddress.getCPtr(recipient), setID, (int)priority, orderingChannel);
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
 }
开发者ID:songotony,项目名称:RType-Client,代码行数:4,代码来源:FileListTransfer.cs


示例15: SendPacket

        /// <summary>
        /// Sends a packet to the scene.
        /// </summary>
        /// <param name="route">A string containing the route on which the message should be sent.</param>
        /// <param name="writer">An action called.</param>
        /// <returns>A task completing when the transport takes</returns>
        public void SendPacket(string route, Action<Stream> writer, PacketPriority priority = PacketPriority.MEDIUM_PRIORITY, PacketReliability reliability = PacketReliability.RELIABLE)
        {
            if (route == null)
            {
                DependencyResolver.GetComponent<ILogger>().Error("SendPacket failed: Tried to send a meesage on null route");
                throw new ArgumentNullException("no route selected");
            }
            if (writer == null)
            {
                DependencyResolver.GetComponent<ILogger>().Error("SendPacket failed: Tried to send message with a null writer");
                throw new ArgumentNullException("no writer given");
            }
            if (!this.Connected)
            {
                DependencyResolver.GetComponent<ILogger>().Error("SendPacket failed: Tried to send message without being connected");
                throw new InvalidOperationException("The scene must be connected to perform this operation.");
            }
            Route routeObj;
            if (!_remoteRoutesMap.TryGetValue(route, out routeObj))
            {
                DependencyResolver.GetComponent<ILogger>().Error("SendPacket failed: The route '{1}' doesn't exist on the scene.", route);
                throw new ArgumentException("The route " + route + " doesn't exist on the scene.");
            }

            _peer.SendToScene(this.Handle, routeObj.Handle, writer, priority, reliability);//.SendPacket(routeObj, writer, priority, reliability, channel);
        }
开发者ID:LaurentQUERSIN,项目名称:The-interpolator---client,代码行数:32,代码来源:Scene.cs


示例16: Serialize

        public ReplicaReturnResult Serialize(ref bool sendTimestamp, BitStream outBitStream, uint lastSendTime, ref PacketPriority priority, ref PacketReliability reliability, uint currentTime, SystemAddress systemAddress, SWIGTYPE_p_unsigned_int flags)
        {
            if (lastSendTime == 0)
                Console.Write("First call to Player::Serialize for {0}:{1}\n", systemAddress.binaryAddress, systemAddress.port);

            outBitStream.Write(position);
            outBitStream.Write(health);
            return ReplicaReturnResult.REPLICA_PROCESSING_DONE;
        }
开发者ID:JetCrusherTorpedo,项目名称:raknetdotnet,代码行数:9,代码来源:Player.cs


示例17: DownloadFromSubdirectory

 public ushort DownloadFromSubdirectory(FileList localFiles, string subdir, string outputSubdir, bool prependAppDirToOutputSubdir, SystemAddress host, FileListTransferCBInterface onFileCallback, PacketPriority _priority, char _orderingChannel, FileListProgress cb) {
   ushort ret = RakNetPINVOKE.DirectoryDeltaTransfer_DownloadFromSubdirectory__SWIG_1(swigCPtr, FileList.getCPtr(localFiles), subdir, outputSubdir, prependAppDirToOutputSubdir, SystemAddress.getCPtr(host), FileListTransferCBInterface.getCPtr(onFileCallback), (int)_priority, _orderingChannel, FileListProgress.getCPtr(cb));
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
开发者ID:ThiagoGarciaAlves,项目名称:ClashOfClans,代码行数:5,代码来源:DirectoryDeltaTransfer.cs


示例18: Serialize

 public ReplicaReturnResult Serialize(ref bool sendTimestamp, BitStream outBitStream, uint lastSendTime, ref PacketPriority priority, ref PacketReliability reliability, uint currentTime, SystemAddress systemAddress, SWIGTYPE_p_unsigned_int flags)
 {
     return ReplicaReturnResult.REPLICA_CANCEL_PROCESS;
 }
开发者ID:JetCrusherTorpedo,项目名称:raknetdotnet,代码行数:4,代码来源:IReplicaListener.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# PacketReader类代码示例发布时间:2022-05-24
下一篇:
C# PacketParser类代码示例发布时间: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