FECipherVit.MsgProcessor.Send C# (CSharp) Method

Send() public method

public Send ( string type, string text ) : void
type string
text string
return void
        public void Send(string type, string text)
        {
            if (Owner.PointedOutCardPic != null)
            {
                Owner.PointedOutCardPic.Invalidate();
                Owner.PointedOutCardPic = null;
            }

            string code;
            //List<string> allcards = Owner.GetAllCardsInfo();
            if (text != "")
            {
                if (Owner.MyAccessCharacter == AccessCharater.Watcher)
                {
                    text = Environment.NewLine + Environment.NewLine + Owner.WatcherName + " " + System.DateTime.Now.ToString("HH:mm:ss") + Environment.NewLine + text;
                }
                else
                {
                    text = Environment.NewLine + Environment.NewLine + Owner.PlayerName + " " + System.DateTime.Now.ToString("HH:mm:ss") + Environment.NewLine + text;
                }
            }

            //Combining
            code = type + "#";
            code += Owner.Player.toString();
            //for (int i = 0; i < allcards.Count; i++)
            //{
            //    if (i != 0)
            //    {
            //        code += ";";
            //    }
            //    code += allcards[i];
            //}
            code += "#";
            code += text;

            //Sending
            if (Owner.connection.connected)
            {
                try
                {
                    Owner.socket.Send("☻" + code + "☂", null, false);
                }
                catch (Exception ecp)
                {
                    MessageBox.Show(ecp.Message, "Error");
                    return;
                }
            }

            //Display
            if (text != "")
            {
                Owner.UpdateGetMsgTextBox(text);
            }
        }