SendWriter() public method

This sends the contents of a NetworkWriter object on the connection.

public SendWriter ( NetworkWriter writer, int channelId ) : bool
writer NetworkWriter A writer object containing data to send.
channelId int The transport channel to send on.
return bool
コード例 #1
0
 protected void SendTargetRPCInternal(NetworkConnection conn, NetworkWriter writer, int channelId, string rpcName)
 {
     if (!this.isServer)
     {
         if (LogFilter.logWarn)
         {
             Debug.LogWarning("TargetRpc call on un-spawned object");
         }
     }
     else
     {
         writer.FinishMessage();
         conn.SendWriter(writer, channelId);
     }
 }
コード例 #2
0
        protected void SendTargetRPCInternal(NetworkConnection conn, NetworkWriter writer, int channelId, string rpcName)
        {
            // This cannot use NetworkServer.active, as that is not specific to this object.
            if (!isServer)
            {
                if (LogFilter.logWarn)
                {
                    Debug.LogWarning("TargetRpc call on un-spawned object");
                }
                return;
            }

            writer.FinishMessage();

            conn.SendWriter(writer, channelId);
        }
コード例 #3
0
 public bool SendWriter(NetworkWriter writer, int channelId)
 {
     if (m_Connection != null)
     {
         if (m_AsyncConnect != ConnectState.Connected)
         {
             if (LogFilter.logError)
             {
                 Debug.LogError("NetworkClient SendWriter when not connected to a server");
             }
             return(false);
         }
         return(m_Connection.SendWriter(writer, channelId));
     }
     if (LogFilter.logError)
     {
         Debug.LogError("NetworkClient SendWriter with no connection");
     }
     return(false);
 }
コード例 #4
0
        protected void SendTargetRPCInternal(NetworkConnection conn, NetworkWriter writer, int channelId, string rpcName)
        {
            // This cannot use NetworkServer.active, as that is not specific to this object.
            if (!isServer)
            {
                if (LogFilter.logWarn)
                {
                    Debug.LogWarning("TargetRpc call on un-spawned object");
                }
                return;
            }

            writer.FinishMessage();

            conn.SendWriter(writer, channelId);

#if UNITY_EDITOR
            UnityEditor.NetworkDetailStats.IncrementStat(
                UnityEditor.NetworkDetailStats.NetworkDirection.Outgoing,
                MsgType.Rpc, rpcName, 1);
#endif
        }