示例#1
0
        public static void Main(string[] args)
        {
            Console.Title = "Hatman";
            Console.Write("Reading config...");

            if (!File.Exists("Config.txt"))
            {
                Console.WriteLine("Config.txt not found." +
                    " \nPlease ensure the file can be found within the working directory.");
                Console.Read();
                return;
            }

            var email = "";
            var pass = "";
            ReadConfig(out email, out pass);

            Console.Write("done.\nLogging into SE...");
            chatClient = new Client(email, pass);

            Console.Write("done.\nJoining room...");
            chatRoom = chatClient.JoinRoom(roomURL, true);
            Extensions.SelfID = chatRoom.Me.ID;

            ChatEventRouter router = new ChatEventRouter(chatRoom);

            Console.WriteLine("done.\n");
            chatRoom.PostMessageLight("Hiya");

            router.ShutdownMre.WaitOne();

            chatRoom.PostMessageLight("Cya");
            chatRoom.Leave();
        }
示例#2
0
 public static void LeaveChat(string command, string arguments, User user, Room room, Client client)
 {
     room.PostMessageLight("Bye, sleeps for me!");
     room.Leave();
     client.Dispose();
     AdaRunner.Shutdown();
 }