コード例 #1
0
        private void Handler_OnText(object sender, WebsocketTextEventArgs text)
        {
            m_Output.LogMessage("Info", "[WEBSOCKET]: We got some text data");
            var item = sender as WebSocketHttpServerHandler;

            item.SendMessage(text.Data);
        }
コード例 #2
0
        private void HandlerOnOnText(object sender, WebsocketTextEventArgs text)
        {
            WebSocketHttpServerHandler obj = sender as WebSocketHttpServerHandler;

            obj.SendMessage(text.Data);
            m_log.Info("[WebSocketEchoModule]: We received this: " + text.Data);
        }
コード例 #3
0
        private void Handler_OnText(object sender, WebsocketTextEventArgs text)
        {
            //BotOutput.Instance.LogMessage("Info", "[WEBSOCKET]: We got some text data");
            //var item = sender as WebSocketHttpServerHandler;
            //item.SendMessage(text.Data);
            OverLayMessage msg = null;

            if (TryParseJSON(text.Data, out msg))
            {
                if (m_RegisteredHandlers.ContainsKey(msg.module, msg.method))
                {
                    var item = m_RegisteredHandlers[msg.module, msg.method];
                    if (item != null)
                    {
                        item(msg.module, msg.method, msg.data);
                    }
                    // This is supposed to send a message from the overlay back to the module over the interface.
                }
                else
                {
                    // parse it ourselves for our own reasons?
                }
            }
        }