source: binary-improvements/7dtd-server-fixes/src/ChatHookExample.cs@ 269

Last change on this file since 269 was 267, checked in by alloc, 9 years ago

Update Chat stuff to 14.6 b26

File size: 751 bytes
RevLine 
[238]1using System;
2
3namespace AllocsFixes
4{
5 public class ChatHookExample {
6 private const string ANSWER = " [ff0000]I[-] [ff7f00]W[-][ffff00]A[-][80ff00]S[-] [00ffff]H[-][0080ff]E[-][0000ff]R[-][8b00ff]E[-]";
7
[267]8 public static bool Hook (ClientInfo _cInfo, EnumGameMessages _type, string _message, string _playerName) {
[238]9 if (!string.IsNullOrEmpty (_message)) {
10 if (_message.ToLower () == "/alloc") {
11 if (_cInfo != null) {
12 Log.Out ("Sent chat hook reply to {0}", _cInfo.playerId);
[267]13 _cInfo.SendPackage (new NetPackageGameMessage (EnumGameMessages.Chat, ANSWER, "", false, "", false));
[238]14 } else {
15 Log.Error ("Argument _cInfo null on message: {0}", _message);
16 }
17 return false;
18 }
19 }
20
21 return true;
22 }
23
24 }
25}
Note: See TracBrowser for help on using the repository browser.