コード例 #1
0
ファイル: BaseMessageClient.cs プロジェクト: tsiru/pcsx2
        /// <summary>
        /// Parse the raw data received from the server and create Message structures.
        /// </summary>
        /// <param name="sender">Sender of the event.</param>
        /// <param name="Data">Line of data received.</param>
        void BaseMessageClient_OnDataReceived(Client sender, Data Data)
        {
            TCPMessage msg = null;
            try
            {
                msg = TCPMessage.FromByteArray(Data.Message);
            }
            catch (Exception)
            {

            }
            if (msg != null)
                if (OnMessageReceived != null)
                    OnMessageReceived(sender, msg);
        }
コード例 #2
0
ファイル: BaseMessageClient.cs プロジェクト: tsiru/pcsx2
 /// <summary>
 /// Parse the raw data sent to the server and create Message structures.
 /// </summary>
 /// <param name="sender">Sender of the event.</param>
 /// <param name="Data">Line of data sent.</param>
 void BaseMessageClient_OnDataSent(Client sender, Data Data)
 {
     TCPMessage msg = TCPMessage.FromByteArray(Data.Message);
     if (OnAfterMessageSent != null)
         OnAfterMessageSent(sender, msg);
 }
コード例 #3
0
ファイル: BaseMessageClient.cs プロジェクト: tsiru/pcsx2
 /// <summary>
 /// When the connection is rejected by the server raise the correct event.
 /// </summary>
 /// <param name="sender">Sender of the event.</param>
 /// <param name="Message">Message of the server.</param>
 void BaseMessageClient_OnConnectFailed(Client sender, byte[] Message)
 {
     if (TCPLibrary.MessageBased.Core.TCPMessage.FromByteArray(Message).MessageType == MessageType.MaxUsers)
         if (OnMaxUsersConnectionFail != null)
             OnMaxUsersConnectionFail(sender);
 }