• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# NetworkReader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



NetworkReader类属于命名空间,在下文中一共展示了NetworkReader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:7,代码来源:OverrideTransformMessage.cs


示例2: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
     proxyId = reader.ReadInt16();
     packet.Compression = (VoiceChatCompression)reader.ReadInt16();
     packet.Length = reader.ReadInt32();
     packet.Data = reader.ReadBytesAndSize();
 }
开发者ID:dgkae,项目名称:unityassets,代码行数:7,代码来源:VoiceChatPacketMessage.cs


示例3: OnDeserialize

 public override void OnDeserialize(NetworkReader reader, bool initialState)
 {
     /*
         Interpolate: pass reader as parameter to fbxobj
     */
     fbxObj.gameObject.transform.position = reader.ReadVector3();
 }
开发者ID:menezesgam,项目名称:poc_vr,代码行数:7,代码来源:RpcManager.cs


示例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);
        }
    }
开发者ID:NickPowers43,项目名称:SW,代码行数:27,代码来源:ClientVC.cs


示例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);
            }
        }
    }
开发者ID:atrakeur,项目名称:unity-unet-authoritative-networking,代码行数:37,代码来源:CharacterNetworkSync.cs


示例6: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
     this.netId = reader.ReadNetworkId();
     this.sceneId = reader.ReadSceneId();
     this.position = reader.ReadVector3();
     this.payload = reader.ReadBytesAndSize();
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:7,代码来源:ObjectSpawnSceneMessage.cs


示例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();
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:7,代码来源:AnimationMessage.cs


示例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);
 }
开发者ID:Kitabalef,项目名称:Unet-Decompiles,代码行数:15,代码来源:NetworkClient.cs


示例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();
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:8,代码来源:PeerInfoMessage.cs


示例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();
 }
开发者ID:bpeake13,项目名称:UnityChildSpawning,代码行数:8,代码来源:ChildSpawnMessage.cs


示例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());
 }
开发者ID:PlayFab,项目名称:PlayFabGameServer,代码行数:8,代码来源:MessageModels.cs


示例12: OnDeserialize

 public override void OnDeserialize(NetworkReader reader, bool initialState)
 {
     if (reader.ReadPackedUInt32() != 0)
     {
         this.m_Slot = reader.ReadByte();
         this.m_ReadyToBegin = reader.ReadBoolean();
     }
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:8,代码来源:NetworkLobbyPlayer.cs


示例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());
 }
开发者ID:yuta0023,项目名称:demo,代码行数:8,代码来源:EditorMessages.cs


示例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;
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:9,代码来源:AddPlayerMessage.cs


示例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>();
 }
开发者ID:Kitabalef,项目名称:Unet-Decompiles,代码行数:9,代码来源:NetworkServer.cs


示例16: InputMessage

 public InputMessage(int connectionId, int hostId, int channelId, Subjects msgSubject, NetworkReader reader, float receivedTime)
 {
     ConnectionId = connectionId;
     HostId = hostId;
     ChannelId = channelId;
     MsgSubject = msgSubject;
     Reader = reader;
     ReceivedTime = receivedTime;
 }
开发者ID:buronix,项目名称:LLApi-Basic-Implementation,代码行数:9,代码来源:InputMessage.cs


示例17: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
     base.Deserialize(reader);
     _instructionBase = reader.ReadString();
     _variantReplacements = new string[reader.ReadInt32()];
     for (int i = 0; i < _variantReplacements.Length; i++) {
         _variantReplacements[i] = reader.ReadString();
     }
 }
开发者ID:imclab,项目名称:SpaceLeap,代码行数:9,代码来源:ReplacementPanelActionSet.cs


示例18: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
   this.scripts = new CRCMessageEntry[(int) reader.ReadUInt16()];
   for (int index = 0; index < this.scripts.Length; ++index)
     this.scripts[index] = new CRCMessageEntry()
     {
       name = reader.ReadString(),
       channel = reader.ReadByte()
     };
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:10,代码来源:CRCMessage.cs


示例19: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
     this.peers = new PeerInfoMessage[(int) reader.ReadUInt16()];
       for (int index = 0; index < this.peers.Length; ++index)
       {
     PeerInfoMessage peerInfoMessage = new PeerInfoMessage();
     peerInfoMessage.Deserialize(reader);
     this.peers[index] = peerInfoMessage;
       }
 }
开发者ID:Kitabalef,项目名称:Unet-Decompiles,代码行数:10,代码来源:PeerListMessage.cs


示例20: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
     int num = reader.ReadUInt16();
     this.peers = new PeerInfoMessage[num];
     for (int i = 0; i < this.peers.Length; i++)
     {
         PeerInfoMessage message = new PeerInfoMessage();
         message.Deserialize(reader);
         this.peers[i] = message;
     }
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:11,代码来源:PeerListMessage.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NetworkSessionType类代码示例发布时间:2022-05-24
下一篇:
C# NetworkReachabilityFlags类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap