Exemplo n.º 1
0
 public static void HandleCommand(Session session, GameServer server, ChatTalkMessage message)
 {
     var t = typeof (ChatService);
     var s = message.Message.Substring(1);
     s = s.Split(' ')[0];
     var m = t.GetMethod(s,
         BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.Public | BindingFlags.Instance);
     if (m != null && m.Name != "HandleCommand")
     {
         m.Invoke(null, new object[] {session, server, message});
     }
     else
         session.SendMessage(new ChatTalkMessage("This command is not valid !"));
 }
Exemplo n.º 2
0
        private void OnChatInput(string str)
        {
            ChatTalkMessage message = new ChatTalkMessage(str);

            Entry.GameClient.SendMessage(message);
        }
Exemplo n.º 3
0
 public static void Help(Session session, GameServer server, ChatTalkMessage message)
 {
     session.SendMessageOrdered(new ChatTalkMessage("/users : Display the number of players currently logged in."));
     session.SendMessageOrdered(new ChatTalkMessage("/help : Display this message."));
 }
Exemplo n.º 4
0
 public static void Users(Session session, GameServer server, ChatTalkMessage message)
 {
     session.SendMessage(new ChatTalkMessage("Currently " + server.SessionCount + " players are online."));
 }