public void RegisterSendHook() { // Note: send hook functionality only applies to messages containing a single float value if (_sendHook == null) { _sendHook = new SendHook(OnMessageSent); hv_setSendHook(_context, _sendHook); } }
public static void Initialize() { GetHostByNameHook.Install(); ConnectHook.Install(); SendHook.InstallSend(); SendHook.InstallRecv(); PortPatch.Apply(); DisableEncryptionPatch.Apply(); GameProtocolHook.Install2((msgid, msg) => { Debugging.Debug.Log("msg: " + msgid.ToString()); }); GameProtocolHook.Install((gameProtocol, type) => { Debugging.Debug.Log(gameProtocol.ToString() + ", " + type.ToString()); if (type == 0) { GameServer.Protocol = new Protocol.Protocol(gameProtocol); } else if (type == 3) { AuthServer.Protocol = new Protocol.Protocol(gameProtocol); } else { Debugging.Debug.Log("Unknown protocol type: " + gameProtocol.ToString() + ", " + type.ToString()); } }); _fileServer.Start(); AuthServer.Start(); GameServer.Start(); }
private static extern void hv_setSendHook(IntPtr ctx, SendHook sendHook);