Esempio n. 1
0
        public static void Main()
        {
            // when the page loads, we need to know if we are being given a link to a room.
            // check the GET requests
            if (window.location.search != "")
            {
                // join room with id given.
                ClientPeerID = window.location.search.Substring(4);
                Console.WriteLine("Joining room {0}", ClientPeerID);
            }
            else
            {
                // create new room and new ID..
                ClientPeerID = GenerateRandomCharArray();

                window.location.search = "?id=" + ClientPeerID;
            }

            Socket = socket_io_client.io.connect("http://localhost:1337");

            document.getElementById("editor").onkeyup += (e) =>
            {
                ZippyCode.App.TriggerSendToServer();
            };

            es5.Function systemMessageFunc = new es5.Function("UniqueID", "ZippyCode.App.RXSystemMessage(UniqueID)");
            Socket.on("SystemMessage", systemMessageFunc);

            es5.Function toClientTextFunc = new es5.Function("Text", "ZippyCode.App.ToClientText(Text)");
            Socket.on("ToClientText", toClientTextFunc);

            es5.Function triggerTextToServer = new es5.Function("", "ZippyCode.App.TriggerSendToServer()");
            Socket.on("TriggerSendToServer", triggerTextToServer);



            Socket.on("connect", () => {
                Console.WriteLine("Connecting to the server...");

                Socket.compress(true).emit("UserJoinRoom", ClientPeerID);
            });

            Socket.on("disconnect", () =>
            {
                Console.WriteLine("Disconnected from server.");
            });



            ToolbarLanguageSelection.onchange += (e) =>
            {
                HTMLOptionElement optionElement = ToolbarLanguageSelection.selectedOptions[0];

                string modeJavascriptFilepath = optionElement.getAttribute("value");

                Script.Call("editor.session.setMode", modeJavascriptFilepath);
            };
        }
Esempio n. 2
0
 public virtual extern howler.Howl off(string @event, es5.Function callback, double id);
Esempio n. 3
0
 public virtual extern howler.Howl once(string @event, es5.Function callback);