WritePackedUInt32() 공개 메소드

This writes the 32-bit value to the stream using variable-length-encoding.

public WritePackedUInt32 ( uint value ) : void
value uint Value to write.
리턴 void
예제 #1
0
 public override void Serialize(NetworkWriter writer)
 {
     writer.WritePackedUInt32((uint) this.oldConnectionId);
     writer.WritePackedUInt32((uint) this.playerControllerId);
     writer.Write(this.netId);
     writer.WriteBytesAndSize(this.msgData, this.msgSize);
 }
예제 #2
0
 public override void Serialize(NetworkWriter writer)
 {
     writer.WritePackedUInt32((uint) this.connectionId);
     writer.Write(this.address);
     writer.WritePackedUInt32((uint) this.port);
     writer.Write(this.isHost);
     writer.Write(this.isYou);
 }
 public override void Serialize(NetworkWriter writer)
 {
     writer.Write(this.netId);
     writer.WriteBytesFull(this.payload);
     writer.Write(this.teleport);
     writer.WritePackedUInt32((uint) this.time);
 }
예제 #4
0
 public override void Serialize(NetworkWriter writer)
 {
     writer.Write(this.netId);
     writer.WritePackedUInt32((uint) this.stateHash);
     writer.Write(this.normalizedTime);
     writer.WriteBytesAndSize(this.parameters, this.parameters.Length);
 }
예제 #5
0
 public static byte[] Serialize(INetMsg msg)
 {
     var networkWriter = new NetworkWriter();
     uint index = GetMsgIndexFromType( msg.GetType() );
     networkWriter.WritePackedUInt32( index );
     ((MessageBase)msg).Serialize(networkWriter);
     return networkWriter.AsArray();
 }
예제 #6
0
 public override void Serialize(NetworkWriter writer)
 {
     writer.WritePackedUInt32((uint) this.oldServerConnectionId);
     writer.Write((ushort) this.peers.Length);
     for (int i = 0; i < this.peers.Length; i++)
     {
         this.peers[i].Serialize(writer);
     }
 }
예제 #7
0
 public override void Serialize(NetworkWriter writer)
 {
     writer.WritePackedUInt32((uint) this.connectionId);
     writer.Write(this.address);
     writer.WritePackedUInt32((uint) this.port);
     writer.Write(this.isHost);
     writer.Write(this.isYou);
     if (this.playerIds == null)
     {
         writer.WritePackedUInt32(0);
     }
     else
     {
         writer.WritePackedUInt32((uint) this.playerIds.Length);
         for (int i = 0; i < this.playerIds.Length; i++)
         {
             writer.Write(this.playerIds[i].netId);
             writer.WritePackedUInt32((uint) this.playerIds[i].playerControllerId);
         }
     }
 }
예제 #8
0
 public override bool OnSerialize(NetworkWriter writer, bool initialState)
 {
     writer.WritePackedUInt32(1);
     writer.Write(this.m_Slot);
     writer.Write(this.m_ReadyToBegin);
     return true;
 }
 public override bool OnSerialize(NetworkWriter writer, bool initialState)
 {
   if (!initialState)
   {
     if ((int) this.syncVarDirtyBits == 0)
     {
       writer.WritePackedUInt32(0U);
       return false;
     }
     writer.WritePackedUInt32(1U);
   }
   switch (this.transformSyncMode)
   {
     case NetworkTransform.TransformSyncMode.SyncNone:
       return false;
     case NetworkTransform.TransformSyncMode.SyncTransform:
       this.SerializeModeTransform(writer);
       break;
     case NetworkTransform.TransformSyncMode.SyncRigidbody2D:
       this.SerializeMode2D(writer);
       break;
     case NetworkTransform.TransformSyncMode.SyncRigidbody3D:
       this.SerializeMode3D(writer);
       break;
     case NetworkTransform.TransformSyncMode.SyncCharacterController:
       this.SerializeModeCharacterController(writer);
       break;
   }
   return true;
 }
예제 #10
0
 public override void Serialize(NetworkWriter writer)
 {
     writer.WritePackedUInt32((uint) this.value);
 }
예제 #11
0
 public override void Serialize(NetworkWriter writer)
 {
     writer.Write(this.netId);
     writer.WritePackedUInt32((uint) this.hash);
 }
예제 #12
0
 private void WriteParameters(NetworkWriter writer, bool autoSend)
 {
     for (int index = 0; index < this.m_Animator.parameters.Length; ++index)
       {
     if (!autoSend || this.GetParameterAutoSend(index))
     {
       AnimatorControllerParameter controllerParameter = this.m_Animator.parameters[index];
       if (controllerParameter.type == AnimatorControllerParameterType.Int)
       {
     writer.WritePackedUInt32((uint) this.m_Animator.GetInteger(controllerParameter.nameHash));
     this.SetSendTrackingParam(controllerParameter.name + ":" + this.m_Animator.GetInteger(controllerParameter.nameHash).ToString(), index);
       }
       if (controllerParameter.type == AnimatorControllerParameterType.Float)
       {
     writer.Write(this.m_Animator.GetFloat(controllerParameter.nameHash));
     this.SetSendTrackingParam(controllerParameter.name + ":" + this.m_Animator.GetFloat(controllerParameter.nameHash).ToString(), index);
       }
       if (controllerParameter.type == AnimatorControllerParameterType.Bool)
       {
     writer.Write(this.m_Animator.GetBool(controllerParameter.nameHash));
     this.SetSendTrackingParam(controllerParameter.name + ":" + this.m_Animator.GetBool(controllerParameter.nameHash).ToString(), index);
       }
     }
       }
 }
예제 #13
0
 private void WriteParameters(NetworkWriter writer, bool autoSend)
 {
     for (int i = 0; i < this.m_Animator.parameters.Length; i++)
     {
         if (!autoSend || this.GetParameterAutoSend(i))
         {
             AnimatorControllerParameter parameter = this.m_Animator.parameters[i];
             if (parameter.type == AnimatorControllerParameterType.Int)
             {
                 writer.WritePackedUInt32((uint) this.m_Animator.GetInteger(parameter.nameHash));
                 this.SetSendTrackingParam(parameter.name + ":" + this.m_Animator.GetInteger(parameter.nameHash), i);
             }
             if (parameter.type == AnimatorControllerParameterType.Float)
             {
                 writer.Write(this.m_Animator.GetFloat(parameter.nameHash));
                 this.SetSendTrackingParam(parameter.name + ":" + this.m_Animator.GetFloat(parameter.nameHash), i);
             }
             if (parameter.type == AnimatorControllerParameterType.Bool)
             {
                 writer.Write(this.m_Animator.GetBool(parameter.nameHash));
                 this.SetSendTrackingParam(parameter.name + ":" + this.m_Animator.GetBool(parameter.nameHash), i);
             }
         }
     }
 }
예제 #14
0
 protected override void SerializeItem(NetworkWriter writer, uint item)
 {
     writer.WritePackedUInt32(item);
 }
 public override void Serialize(NetworkWriter writer)
 {
     writer.WritePackedUInt32((uint) this.connectionId);
     writer.Write(this.netId);
     writer.Write(this.authorityState);
 }
 public override bool OnSerialize(NetworkWriter writer, bool initialState)
 {
   if (!initialState)
   {
     if ((int) this.syncVarDirtyBits == 0)
     {
       writer.WritePackedUInt32(0U);
       return false;
     }
     writer.WritePackedUInt32(1U);
   }
   this.SerializeModeTransform(writer);
   return true;
 }
 public override void Serialize(NetworkWriter writer)
 {
     writer.WritePackedUInt32(this.state);
 }
예제 #18
0
 // OnSerialize is called on the server side when the server sends data to the client
 public override bool OnSerialize(NetworkWriter writer, bool forceAll)
 {
     var state = _shipComponent.GetCurrentState();
     writer.WritePackedUInt32(_lastServerFrameForPlayer);
     writer.Write(state.position);
     writer.Write(state.rotation);
     writer.Write(state.force);
     writer.WritePackedUInt32(Checksum(state));
     return true;
 }