Example #1
0
        public void MessageDecode(string message)
        {
            string code = "default";

            if (message.Contains('/'))
            {
                int index = message.IndexOf('/');

                code    = message.Substring(0, index);
                message = message.Substring(++index);
            }

            switch (code)
            {
            case "private":
                PrivateDecode(message);
                break;

            default:
                message = String.Format("{0}: {1}", userName, message);
                Console.WriteLine(DateTime.Now.ToLongTimeString() + ' ' + message);
                server.AddChatString(DateTime.Now, message);
                server.BroadcastMessage(code + '/' + DateTime.Now.ToLongTimeString() + '/' + message, this.Id);
                break;
            }
        }