コード例 #1
0
 /// <summary>
 /// Called when a chat message arrives.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The args.</param>
 void vp_OnChatMessage(Instance sender, ChatMessageEventArgsT <Avatar, ChatMessage> args)
 {
     // Write a serialized version showing all the data of the chat message event using VpNet.Extension methods.
     Console.WriteLine("Chat message received.\r\n{0}", args.Serialize());
     if (args.ChatMessage.Message.ToLower().StartsWith("!consoletest"))
     {
         // test a console message in pretty pink :)
         sender.ConsoleMessage("Hello", "World", new Color(255, 64, 128));
     }
 }
コード例 #2
0
 void OnChatMessage(Instance sender, ChatMessageEventArgsT <Avatar, ChatMessage> args)
 {
     args.Serialize().AppendTextFile(LogName(args.GetType()));
 }