当前位置: 首页>>代码示例>>C#>>正文


C# RakNet.AddressOrGUID类代码示例

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


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

示例1: getCPtr

 internal static HandleRef getCPtr(AddressOrGUID obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
开发者ID:nulhax,项目名称:VOID,代码行数:3,代码来源:AddressOrGUID.cs

示例2: ToInteger

 public static uint ToInteger(AddressOrGUID aog) {
   uint ret = RakNetPINVOKE.AddressOrGUID_ToInteger(AddressOrGUID.getCPtr(aog));
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
开发者ID:nulhax,项目名称:VOID,代码行数:5,代码来源:AddressOrGUID.cs

示例3: GetClockDifferential

 public virtual ulong GetClockDifferential(AddressOrGUID systemIdentifier) {
   ulong ret = RakNetPINVOKE.RakPeerInterface_GetClockDifferential(swigCPtr, AddressOrGUID.getCPtr(systemIdentifier));
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
开发者ID:nulhax,项目名称:VOID,代码行数:5,代码来源:RakPeerInterface.cs

示例4: Send

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

示例5: 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

示例6: GetConnectionState

 public virtual ConnectionState GetConnectionState(AddressOrGUID systemIdentifier) {
   ConnectionState ret = (ConnectionState)RakNetPINVOKE.RakPeerInterface_GetConnectionState(swigCPtr, AddressOrGUID.getCPtr(systemIdentifier));
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
开发者ID:nulhax,项目名称:VOID,代码行数:5,代码来源:RakPeerInterface.cs

示例7: OnProcess

 public override void OnProcess(FT_Session session, BitStream bsIn, AddressOrGUID systemIdentifier)
 {
     Log.Debug("FT_Node_Process_Test1.OnProcess :");
     FT_UnitData unitData = new FT_UnitData();
     unitData.Serialize(false, bsIn);
 }
开发者ID:ThiagoGarciaAlves,项目名称:ClashOfClans,代码行数:6,代码来源:Program.cs

示例8: 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

示例9: Main

        static void Main(string[] args)
        {

           if(!File.Exists("RakNet.dll"))
           {
                Console.WriteLine("Error: The SWIG build of the DLL has not been copied to the executable directory.\nPress enter.");
                Console.Read();
                return;
           }
            
            Packet testPacket;
            int loopNumber;
            BitStream stringTestSendBitStream = new BitStream();
            BitStream rakStringTestSendBitStream = new BitStream();
            BitStream receiveBitStream = new BitStream();
            String holdingString;
            TimeSpan startTimeSpan;
            RakString rakStringTest = new RakString();

            RakPeerInterface testClient = RakPeer.GetInstance();
            testClient.Startup(1, new SocketDescriptor(60000, "127.0.0.1"), 1);

            RakPeerInterface testServer = RakPeer.GetInstance();
            testServer.Startup(1, new SocketDescriptor(60001, "127.0.0.1"), 1);
            testServer.SetMaximumIncomingConnections(1);

            Console.WriteLine("Press enter to start RakString send and receive loop using BitStream.\nBitStream read done into RakString");
            Console.WriteLine("Loop will run for 15 seconds");
            Console.ReadLine();

            testClient.Connect("127.0.0.1", 60001, "", 0);

            String sendString = "The test string";
            stringTestSendBitStream.Write((byte)DefaultMessageIDTypes.ID_USER_PACKET_ENUM);
            stringTestSendBitStream.Write(sendString);

            RakString testRakString = new RakString("Test RakString");
            rakStringTestSendBitStream.Write((byte)DefaultMessageIDTypes.ID_USER_PACKET_ENUM);
            rakStringTestSendBitStream.Write(testRakString);

            startTimeSpan = (DateTime.UtcNow - new DateTime(1970, 1, 1));
            loopNumber = 0;
                while (startTimeSpan.TotalSeconds + 15 > (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds)
                {
                    testPacket = testServer.Receive();
                    if (testPacket != null && testPacket.data[0] == (byte)DefaultMessageIDTypes.ID_USER_PACKET_ENUM)
                    {
                        receiveBitStream.Reset();
                        receiveBitStream.Write(testPacket.data, testPacket.length);
                        receiveBitStream.IgnoreBytes(1);
                        receiveBitStream.Read(rakStringTest);
                        Console.WriteLine("Loop number: " + loopNumber + "\nData: " + rakStringTest.C_String());
                    }
                    testServer.DeallocatePacket(testPacket);
                    loopNumber++;
                    System.Threading.Thread.Sleep(50);
                    testClient.Send(rakStringTestSendBitStream, PacketPriority.LOW_PRIORITY, PacketReliability.RELIABLE_ORDERED, (char)0, new AddressOrGUID(new SystemAddress("127.0.0.1", 60001)), false);
                }

                Console.WriteLine("Press enter to start String send and receive loop using BitStream.\nBitStream read done into String");
                Console.WriteLine("Loop will run for 15 seconds");
                Console.ReadLine();

                startTimeSpan = (DateTime.UtcNow - new DateTime(1970, 1, 1));
                loopNumber = 0;
                while (startTimeSpan.TotalSeconds + 15 > (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds)
                {
                    testPacket = testServer.Receive();
                    if (testPacket != null && testPacket.data[0] == (byte)DefaultMessageIDTypes.ID_USER_PACKET_ENUM)
                    {
                        receiveBitStream.Reset();
                        receiveBitStream.Write(testPacket.data, testPacket.length);
                        receiveBitStream.IgnoreBytes(1);
                        receiveBitStream.Read(out holdingString);
                        Console.WriteLine("Loop number: " + loopNumber + "\nData: " + holdingString);
                    }
                    testServer.DeallocatePacket(testPacket);
                    loopNumber++;
                    System.Threading.Thread.Sleep(50);
                    testClient.Send(stringTestSendBitStream, PacketPriority.LOW_PRIORITY, PacketReliability.RELIABLE_ORDERED, (char)0, new AddressOrGUID(new SystemAddress("127.0.0.1", 60001)), false);
                }
            //-----------------------------Above is the same as the public tests, below the internal tests are ran.
            /*Member variables are also tested to assure working typemaps
             * Also variables use functions as well, they are not direct access
             * act like it. Test write and read on these items, especially arrays.
             * Most tests in this section are simple running functions with no verification.
             * 
             * 
            */

            RakString workingRakStringCopy;//This is needed for temp RakString Instances in the main function so dispose can be called

            //RakNetStatistics
            Console.WriteLine("RakNetStatistics");
            string rakNetStatisticsTestString;
            RakNetStatistics testRakNetStatistics = new RakNetStatistics();
            testRakNetStatistics.bytesInSendBuffer[0] = 22.44;
            testRakNetStatistics.BPSLimitByCongestionControl = 9;
            testRakNetStatistics.BPSLimitByOutgoingBandwidthLimit = 9;
            testRakNetStatistics.connectionStartTime = 9;
//.........这里部分代码省略.........
开发者ID:0521guo,项目名称:RakNet,代码行数:101,代码来源:TestMain.cs

示例10: OnProcess

 public virtual void OnProcess(FT_Session session, BitStream bsIn, AddressOrGUID systemIdentifier) {
   if (SwigDerivedClassHasMethod("OnProcess", swigMethodTypes1)) RakNetPINVOKE.FT_Node_Process_OnProcessSwigExplicitFT_Node_Process(swigCPtr, FT_Session.getCPtr(session), BitStream.getCPtr(bsIn), AddressOrGUID.getCPtr(systemIdentifier)); else RakNetPINVOKE.FT_Node_Process_OnProcess(swigCPtr, FT_Session.getCPtr(session), BitStream.getCPtr(bsIn), AddressOrGUID.getCPtr(systemIdentifier));
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
 }
开发者ID:ThiagoGarciaAlves,项目名称:ClashOfClans,代码行数:4,代码来源:FT_Node_Process.cs

示例11: GetLastPing

 public override int GetLastPing(AddressOrGUID systemIdentifier) {
   int ret = RakNetPINVOKE.RakPeer_GetLastPing(swigCPtr, AddressOrGUID.getCPtr(systemIdentifier));
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
开发者ID:songotony,项目名称:RType-Client,代码行数:5,代码来源:RakPeer.cs

示例12: CloseConnection

 public override void CloseConnection(AddressOrGUID target, bool sendDisconnectionNotification, byte orderingChannel) {
   RakNetPINVOKE.RakPeer_CloseConnection__SWIG_1(swigCPtr, AddressOrGUID.getCPtr(target), sendDisconnectionNotification, orderingChannel);
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
 }
开发者ID:songotony,项目名称:RType-Client,代码行数:4,代码来源:RakPeer.cs

示例13: Send

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

示例14: GetSystemFilterSet

 public int GetSystemFilterSet(AddressOrGUID addressOrGUID) {
   int ret = RakNetPINVOKE.MessageFilter_GetSystemFilterSet(swigCPtr, AddressOrGUID.getCPtr(addressOrGUID));
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
开发者ID:songotony,项目名称:RType-Client,代码行数:5,代码来源:MessageFilter.cs

示例15: SetSystemFilterSet

 public void SetSystemFilterSet(AddressOrGUID addressOrGUID, int filterSetID) {
   RakNetPINVOKE.MessageFilter_SetSystemFilterSet(swigCPtr, AddressOrGUID.getCPtr(addressOrGUID), filterSetID);
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
 }
开发者ID:songotony,项目名称:RType-Client,代码行数:4,代码来源:MessageFilter.cs


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