當前位置: 首頁>>代碼示例>>C#>>正文


C# RakNet.BitStream類代碼示例

本文整理匯總了C#中RakNet.BitStream的典型用法代碼示例。如果您正苦於以下問題:C# BitStream類的具體用法?C# BitStream怎麽用?C# BitStream使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BitStream類屬於RakNet命名空間,在下文中一共展示了BitStream類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: _SendUnitData

        static void _SendUnitData (){
            FT_UnitData data = new FT_UnitData();

            BitStream writeBitStream = new BitStream();
            writeBitStream.Write((byte)FT_MessageTypes.ID_SERVER_LOGIN);
            writeBitStream.Write((byte)FT_MessageTypesNode.NODE_FT_TEST1);
            data.Serialize(true, writeBitStream);
            client.Send(writeBitStream, (char)0);
        }
開發者ID:ThiagoGarciaAlves,項目名稱:ClashOfClans,代碼行數:9,代碼來源:Program.cs

示例2: Write

 public void Write(BitStream bitStream, uint numberOfBits) {
   RakNetPINVOKE.BitStream_Write__SWIG_1(swigCPtr, BitStream.getCPtr(bitStream), numberOfBits);
 }
開發者ID:ThiagoGarciaAlves,項目名稱:ClashOfClans,代碼行數:3,代碼來源:BitStream.cs

示例3: WriteOutOfBandHeader

 public virtual void WriteOutOfBandHeader(BitStream bitStream) {
   RakNetPINVOKE.RakPeerInterface_WriteOutOfBandHeader(swigCPtr, BitStream.getCPtr(bitStream));
 }
開發者ID:nulhax,項目名稱:VOID,代碼行數:3,代碼來源:RakPeerInterface.cs

示例4: RespondOnVerifiedJoinCapable

 public virtual void RespondOnVerifiedJoinCapable(Packet packet, bool accept, BitStream additionalData)
 {
     RakNetPINVOKE.FullyConnectedMesh2_RespondOnVerifiedJoinCapable(swigCPtr, Packet.getCPtr(packet), accept, BitStream.getCPtr(additionalData));
 }
開發者ID:kmiron,項目名稱:BattleBoy,代碼行數:4,代碼來源:FullyConnectedMesh2.cs

示例5: GetVerifiedJoinAcceptedAdditionalData

 public virtual void GetVerifiedJoinAcceptedAdditionalData(Packet packet, SWIGTYPE_p_bool thisSystemAccepted, RakNetListRakNetGUID systemsAccepted, BitStream additionalData)
 {
     RakNetPINVOKE.FullyConnectedMesh2_GetVerifiedJoinAcceptedAdditionalData(swigCPtr, Packet.getCPtr(packet), SWIGTYPE_p_bool.getCPtr(thisSystemAccepted), RakNetListRakNetGUID.getCPtr(systemsAccepted), BitStream.getCPtr(additionalData));
     if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
 }
開發者ID:kmiron,項目名稱:BattleBoy,代碼行數:5,代碼來源:FullyConnectedMesh2.cs

示例6: Serialize

 public void Serialize(BitStream outBitStream) {
   RakNetPINVOKE.FileList_Serialize(swigCPtr, BitStream.getCPtr(outBitStream));
 }
開發者ID:nulhax,項目名稱:VOID,代碼行數:3,代碼來源:FileList.cs

示例7: DeserializeConstruction

 public bool DeserializeConstruction(TeamManager teamManager, BitStream constructionBitstream) {
   bool ret = RakNetPINVOKE.TM_Team_DeserializeConstruction(swigCPtr, TeamManager.getCPtr(teamManager), BitStream.getCPtr(constructionBitstream));
   return ret;
 }
開發者ID:ThiagoGarciaAlves,項目名稱:ClashOfClans,代碼行數:4,代碼來源:TM_Team.cs

示例8: RequestForwarding

 public bool RequestForwarding(SystemAddress proxyCoordinator, SystemAddress sourceAddress, RakNetGUID targetGuid, uint timeoutOnNoDataMS, BitStream serverSelectionBitstream) {
   bool ret = RakNetPINVOKE.UDPProxyClient_RequestForwarding__SWIG_2(swigCPtr, SystemAddress.getCPtr(proxyCoordinator), SystemAddress.getCPtr(sourceAddress), RakNetGUID.getCPtr(targetGuid), timeoutOnNoDataMS, BitStream.getCPtr(serverSelectionBitstream));
   if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
開發者ID:songotony,項目名稱:RType-Client,代碼行數:5,代碼來源:UDPProxyClient.cs

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

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

        static void ProcessMessage(RakPeerInterface peer, RakNet.Packet packet)
        {
            if (packet != null)
            {
                if (packet.data[0] == (byte)(FT_MessageTypes.ID_SERVER_LOGIN))
                {
                    BitStream receiveBitStream = new BitStream();
                    receiveBitStream.Write(packet.data, packet.length);
                    receiveBitStream.IgnoreBytes(2);
                    FT_UnitData data = new FT_UnitData();
                    data.Serialize(false, receiveBitStream);
                    Log.Debug(" data.nGrid_x: " + data.nGrid_x);

                    BitStream writeBitStream = new BitStream();
                    writeBitStream.Write((byte)FT_MessageTypes.ID_SERVER_LOGIN);
                    writeBitStream.Write((byte)FT_MessageTypesNode.NODE_FT_TEST1);
                    data.Serialize(true, writeBitStream);
                    uint sendLength = peer.Send(writeBitStream, PacketPriority.HIGH_PRIORITY, PacketReliability.RELIABLE_ORDERED, (char)0, packet.systemAddress, false);
                    Log.Debug("SendLength = " + sendLength);
                }
            }
        }
開發者ID:ThiagoGarciaAlves,項目名稱:ClashOfClans,代碼行數:22,代碼來源:Program.cs

示例12: OnRead

 public virtual PluginReceiveResult OnRead(BitStream bsIn) {
   PluginReceiveResult ret = (PluginReceiveResult)RakNetPINVOKE.FT_ConnectProcessResultHandler_OnRead(swigCPtr, BitStream.getCPtr(bsIn));
   return ret;
 }
開發者ID:ThiagoGarciaAlves,項目名稱:ClashOfClans,代碼行數:4,代碼來源:FT_ConnectProcessResultHandler.cs

示例13: ProcessMessage

        public void ProcessMessage()
        {
            while (!_bStop)
            {
                _packet = _peer.Receive();
                while (_packet != null)
                {
                    byte messageType = _packet.data[0];
                    if (messageType < (byte)DefaultMessageIDTypes.ID_USER_PACKET_ENUM)
                    {
                        DefaultMessageIDTypes idType = (DefaultMessageIDTypes)messageType;
                        switch (idType)
                        {
                            case DefaultMessageIDTypes.ID_CONNECTION_REQUEST_ACCEPTED:
                                Log.Info("In a client/server environment, our connection request to the server has been accepted.\n");
                                break;
                            case DefaultMessageIDTypes.ID_CONNECTION_ATTEMPT_FAILED:
                                Log.Info("Sent to the player when a connection request cannot be completed due to inability to connect.\n ");
                                break;
                            case DefaultMessageIDTypes.ID_ALREADY_CONNECTED:
                                Log.Info("Sent a connect request to a system we are currently connected to.\n ");
                                break;
                            case DefaultMessageIDTypes.ID_NEW_INCOMING_CONNECTION:
                                Log.Info("A remote system has successfully connected.\n");
                                break;
                            case DefaultMessageIDTypes.ID_DISCONNECTION_NOTIFICATION:
                                Log.Info(" A remote system has disconnected. \n");
                                break;
                            case DefaultMessageIDTypes.ID_CONNECTION_LOST:
                                Log.Info(" The connection to that system has been closed. \n");
                                break;
                        }
                    }
                    else
                    {
                        if (messageType == (byte)FT_MessageTypes.ID_SERVER_LOGIN)
                        {
                            byte dataType = _packet.data[1];
                            RakNet.BitStream bsIn = new RakNet.BitStream(_packet.data, _packet.length, false);
                            bsIn.IgnoreBytes(2);
                            FT_UnitData unitData = new FT_UnitData();
                            unitData.session.Serialize(false, bsIn);
                            unitData.Serialize(false, bsIn);
                            Log.Info("" + unitData.sInfo.C_String());

                            byte serverLogin = (byte)RakNet.FT_MessageTypes.ID_SERVER_LOGIN;
                            
                            RakNet.BitStream bsOut = new RakNet.BitStream();
                            bsOut.Serialize(true, ref serverLogin);
                            bsOut.Serialize(true, ref dataType);
                            unitData.session.Serialize(true, bsOut);
                            unitData.Serialize(true, bsOut);

                            uint sendLength =  _peer.Send(bsOut,
                                RakNet.PacketPriority.IMMEDIATE_PRIORITY,
                                RakNet.PacketReliability.RELIABLE_ORDERED, (char)0,
                                _packet.systemAddress,
                                false);

                            Log.Info("SendLength:" + sendLength);
                        }
                    }
                    Log.Info(string.Format("Receive Data. [0] = {0}, Length = {1}", _packet.data[0], _packet.data.Length));
                    _peer.DeallocatePacket(_packet);
                    _packet = _peer.Receive();
                }
                System.Threading.Thread.Sleep(30);
            }
        }
開發者ID:ThiagoGarciaAlves,項目名稱:ClashOfClans,代碼行數:69,代碼來源:Test.cs

示例14: DeserializeCompressed

 public static bool DeserializeCompressed(string str, BitStream bs, bool readLanguageId) {
   bool ret = RakNetPINVOKE.RakString_DeserializeCompressed__SWIG_2(str, BitStream.getCPtr(bs), readLanguageId);
   return ret;
 }
開發者ID:sureandrew,項目名稱:RakNet,代碼行數:4,代碼來源:RakString.cs

示例15: Serialize

 public void Serialize(BitStream bs) {
   RakNetPINVOKE.RakString_Serialize__SWIG_0(swigCPtr, BitStream.getCPtr(bs));
 }
開發者ID:sureandrew,項目名稱:RakNet,代碼行數:3,代碼來源:RakString.cs


注:本文中的RakNet.BitStream類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。