本文整理汇总了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);
}
示例2: Write
public void Write(BitStream bitStream, uint numberOfBits) {
RakNetPINVOKE.BitStream_Write__SWIG_1(swigCPtr, BitStream.getCPtr(bitStream), numberOfBits);
}
示例3: WriteOutOfBandHeader
public virtual void WriteOutOfBandHeader(BitStream bitStream) {
RakNetPINVOKE.RakPeerInterface_WriteOutOfBandHeader(swigCPtr, BitStream.getCPtr(bitStream));
}
示例4: RespondOnVerifiedJoinCapable
public virtual void RespondOnVerifiedJoinCapable(Packet packet, bool accept, BitStream additionalData)
{
RakNetPINVOKE.FullyConnectedMesh2_RespondOnVerifiedJoinCapable(swigCPtr, Packet.getCPtr(packet), accept, BitStream.getCPtr(additionalData));
}
示例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();
}
示例6: Serialize
public void Serialize(BitStream outBitStream) {
RakNetPINVOKE.FileList_Serialize(swigCPtr, BitStream.getCPtr(outBitStream));
}
示例7: DeserializeConstruction
public bool DeserializeConstruction(TeamManager teamManager, BitStream constructionBitstream) {
bool ret = RakNetPINVOKE.TM_Team_DeserializeConstruction(swigCPtr, TeamManager.getCPtr(teamManager), BitStream.getCPtr(constructionBitstream));
return ret;
}
示例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;
}
示例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);
}
示例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();
}
示例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);
}
}
}
示例12: OnRead
public virtual PluginReceiveResult OnRead(BitStream bsIn) {
PluginReceiveResult ret = (PluginReceiveResult)RakNetPINVOKE.FT_ConnectProcessResultHandler_OnRead(swigCPtr, BitStream.getCPtr(bsIn));
return ret;
}
示例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);
}
}
示例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;
}
示例15: Serialize
public void Serialize(BitStream bs) {
RakNetPINVOKE.RakString_Serialize__SWIG_0(swigCPtr, BitStream.getCPtr(bs));
}