本文整理汇总了C#中NetworkReader类的典型用法代码示例。如果您正苦于以下问题:C# NetworkReader类的具体用法?C# NetworkReader怎么用?C# NetworkReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NetworkReader类属于命名空间,在下文中一共展示了NetworkReader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
public override void Deserialize(NetworkReader reader)
{
this.netId = reader.ReadNetworkId();
this.payload = reader.ReadBytesAndSize();
this.teleport = reader.ReadBoolean();
this.time = (int) reader.ReadPackedUInt32();
}
示例2: Deserialize
public override void Deserialize(NetworkReader reader)
{
proxyId = reader.ReadInt16();
packet.Compression = (VoiceChatCompression)reader.ReadInt16();
packet.Length = reader.ReadInt32();
packet.Data = reader.ReadBytesAndSize();
}
示例3: OnDeserialize
public override void OnDeserialize(NetworkReader reader, bool initialState)
{
/*
Interpolate: pass reader as parameter to fbxobj
*/
fbxObj.gameObject.transform.position = reader.ReadVector3();
}
示例4: ClientVC
public ClientVC(NetworkReader nr)
: base(new Vec2i(0,0), 0)
{
this.data = new VesselTile[VesselChunk.DATA_COUNT];
index.x = nr.ReadInt32();
index.y = nr.ReadInt32();
version = nr.ReadUInt32();
tileCount = nr.ReadInt32();
for (int i = 0; i < tileCount; i++) {
//read in vessel tile
Vec2i tileI;
tileI.x = nr.ReadInt32();
tileI.y = nr.ReadInt32();
FloorType floor0 = (FloorType)nr.ReadByte();
FloorType floor1 = (FloorType)nr.ReadByte();
WallTypeMask wallMask = (WallTypeMask)nr.ReadByte();
bool wallNode = nr.ReadBoolean();
VesselTile tile = new VesselTile(wallMask, wallNode, floor0, floor1, (uint)VesselTile.FLAGS.NONE);
SetTile(tileI, tile);
}
}
示例5: OnDeserialize
private CharacterState serverLastState; //SERVER: Store last state
#endregion Fields
#region Methods
/// <summary>
/// All Clients: Deserialize the state from network
/// </summary>
/// <param name="reader"></param>
/// <param name="initialState"></param>
public override void OnDeserialize(NetworkReader reader, bool initialState)
{
CharacterState state = new CharacterState();
state.state = reader.ReadInt32();
state.position = reader.ReadVector3();
state.rotation = reader.ReadQuaternion();
//Client: Received a new state for the local player, treat it as an ACK and do reconciliation
if (isLocalPlayer) {
SendMessage("ServerState", state, SendMessageOptions.DontRequireReceiver);
} else {
//Other Clients: Received a state, treat it like a new position snapshot from authority
if (initialState)
{
//Others Clients: First state, just snap to new position
transform.position = state.position;
transform.rotation = state.rotation;
}
else if (networkInterpolation != null)
{
//Others Clients: Interpolate between received positions
networkInterpolation.ReceiveState(state);
}
}
}
示例6: Deserialize
public override void Deserialize(NetworkReader reader)
{
this.netId = reader.ReadNetworkId();
this.sceneId = reader.ReadSceneId();
this.position = reader.ReadVector3();
this.payload = reader.ReadBytesAndSize();
}
示例7: Deserialize
public override void Deserialize(NetworkReader reader)
{
this.netId = reader.ReadNetworkId();
this.stateHash = (int) reader.ReadPackedUInt32();
this.normalizedTime = reader.ReadSingle();
this.parameters = reader.ReadBytesAndSize();
}
示例8: NetworkClient
/// <summary>
///
/// <para>
/// Creates a new NetworkClient instance.
/// </para>
///
/// </summary>
public NetworkClient()
{
if (LogFilter.logDev)
Debug.Log((object) ("Client created version " + (object) Version.Current));
this.m_MsgBuffer = new byte[49152];
this.m_MsgReader = new NetworkReader(this.m_MsgBuffer);
NetworkClient.AddClient(this);
}
示例9: Deserialize
public override void Deserialize(NetworkReader reader)
{
this.connectionId = (int) reader.ReadPackedUInt32();
this.address = reader.ReadString();
this.port = (int) reader.ReadPackedUInt32();
this.isHost = reader.ReadBoolean();
this.isYou = reader.ReadBoolean();
}
示例10: Deserialize
public override void Deserialize(NetworkReader reader)
{
m_id = reader.ReadNetworkId();
m_parentId = reader.ReadNetworkId();
m_childId = reader.ReadInt32();
m_position = reader.ReadVector3();
m_payload = reader.ReadBytesAndSize();
}
示例11: Deserialize
public override void Deserialize(NetworkReader reader)
{
ChannelId = reader.ReadString();
SenderUserId = reader.ReadString();
SenderUserName = reader.ReadString();
Message = reader.ReadString();
Timestamp = JsonWrapper.DeserializeObject<DateTime>(reader.ReadString());
}
示例12: OnDeserialize
public override void OnDeserialize(NetworkReader reader, bool initialState)
{
if (reader.ReadPackedUInt32() != 0)
{
this.m_Slot = reader.ReadByte();
this.m_ReadyToBegin = reader.ReadBoolean();
}
}
示例13: Deserialize
public override void Deserialize(NetworkReader reader)
{
base.Deserialize(reader);
int count = reader.ReadInt32();
Polyline = new List<Vector3>(count);
for(int i=0; i < count; i++)
Polyline.Add(reader.ReadVector3());
}
示例14: Deserialize
public override void Deserialize(NetworkReader reader)
{
this.playerControllerId = (short) reader.ReadUInt16();
this.msgData = reader.ReadBytesAndSize();
if (this.msgData == null)
this.msgSize = 0;
else
this.msgSize = this.msgData.Length;
}
示例15: NetworkServer
private NetworkServer()
{
NetworkTransport.Init();
if (LogFilter.logDev)
Debug.Log((object) ("NetworkServer Created version " + (object) Version.Current));
this.m_MsgBuffer = new byte[49152];
this.m_MsgReader = new NetworkReader(this.m_MsgBuffer);
this.m_RemoveList = new HashSet<NetworkInstanceId>();
}