当前位置: 首页>>代码示例>>C#>>正文


C# NetworkConnection.FlushInternalBuffer方法代码示例

本文整理汇总了C#中UnityEngine.Networking.NetworkConnection.FlushInternalBuffer方法的典型用法代码示例。如果您正苦于以下问题:C# NetworkConnection.FlushInternalBuffer方法的具体用法?C# NetworkConnection.FlushInternalBuffer怎么用?C# NetworkConnection.FlushInternalBuffer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.Networking.NetworkConnection的用法示例。


在下文中一共展示了NetworkConnection.FlushInternalBuffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InternalUpdate


//.........这里部分代码省略.........
       this.GenerateDataError(conn, (int) error1);
       return;
     }
     NetworkDetailStats.IncrementStat(NetworkDetailStats.NetworkDirection.Incoming, (short) 29, "msg", 1);
     if (conn != null)
     {
       this.m_MsgReader.SeekZero();
       conn.HandleMessage(this.m_MessageHandlers.GetHandlers(), this.m_MsgReader, receivedSize, channelId);
       goto case 3;
     }
     else if (LogFilter.logError)
     {
       Debug.LogError((object) "Unknown connection data event?!?");
       goto case 3;
     }
     else
       goto case 3;
       case NetworkEventType.ConnectEvent:
     if (LogFilter.logDebug)
       Debug.Log((object) ("Server accepted client:" + (object) connectionId));
     if ((int) error1 != 0)
     {
       this.GenerateConnectError((int) error1);
       return;
     }
     string address;
     int port;
     NetworkID network;
     NodeID dstNode;
     byte error2;
     NetworkTransport.GetConnectionInfo(this.m_ServerId, connectionId, out address, out port, out network, out dstNode, out error2);
     NetworkConnection networkConnection = new NetworkConnection();
     networkConnection.Initialize(address, this.m_ServerId, connectionId, this.m_hostTopology);
     networkConnection.SetMaxDelay(this.m_MaxDelay);
     this.m_Connections.Add(connectionId, networkConnection);
     this.m_MessageHandlers.InvokeHandlerNoData((short) 32, networkConnection);
     if (this.m_SendPeerInfo)
       this.SendNetworkInfo(networkConnection);
     this.SendCRC(networkConnection);
     goto case 3;
       case NetworkEventType.DisconnectEvent:
     NetworkConnection @unsafe = this.m_Connections.GetUnsafe(connectionId);
     if ((int) error1 != 0 && (int) error1 != 6)
       this.GenerateDisconnectError(@unsafe, (int) error1);
     this.m_Connections.Remove(connectionId);
     if (@unsafe != null)
     {
       this.m_MessageHandlers.InvokeHandlerNoData((short) 33, @unsafe);
       for (int index = 0; index < @unsafe.playerControllers.Count; ++index)
       {
         if ((UnityEngine.Object) @unsafe.playerControllers[index].gameObject != (UnityEngine.Object) null && LogFilter.logWarn)
           Debug.LogWarning((object) "Player not destroyed when connection disconnected.");
       }
       if (LogFilter.logDebug)
         Debug.Log((object) ("Server lost client:" + (object) connectionId));
       @unsafe.RemoveObservers();
       @unsafe.Dispose();
     }
     else if (LogFilter.logDebug)
       Debug.Log((object) "Connection is null in disconnect event");
     if (this.m_SendPeerInfo)
     {
       this.SendNetworkInfo(@unsafe);
       goto case 3;
     }
     else
       goto case 3;
       case NetworkEventType.Nothing:
     if (++num >= 500)
     {
       if (LogFilter.logDebug)
       {
         Debug.Log((object) ("kMaxEventsPerFrame hit (" + (object) 500 + ")"));
         goto label_47;
       }
       else
         goto label_47;
     }
     else
       continue;
       default:
     if (LogFilter.logError)
     {
       Debug.LogError((object) ("Unknown network message type received: " + (object) networkEventType1));
       goto case 3;
     }
     else
       goto case 3;
     }
       }
       while (networkEventType1 != NetworkEventType.Nothing);
     label_47:
       this.UpdateServerObjects();
       for (int localIndex = this.m_Connections.LocalIndex; localIndex < this.m_Connections.Count; ++localIndex)
       {
     NetworkConnection networkConnection = this.m_Connections.Get(localIndex);
     if (networkConnection != null)
       networkConnection.FlushInternalBuffer();
       }
 }
开发者ID:Kitabalef,项目名称:Unet-Decompiles,代码行数:101,代码来源:NetworkServer.cs


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