1
0
mirror of https://github.com/TheGreyDiamond/Enlight.git synced 2025-07-19 05:03:49 +02:00

Added network session broadcaster

This commit is contained in:
TheGreyDiamond
2020-11-24 22:05:23 +01:00
parent a2f4ab1ce7
commit 7b9f09cf88
7 changed files with 1534 additions and 30 deletions

View File

@ -205,5 +205,17 @@
<h1>Sessions</h1>
yes.
<button onclick='ipcRenderer.sendSync("synchronous-message", "PAGE:change.index");'>Go back</button>
<state>Sessionstate: <state id = "sessionStateText">unknown</state></state>
<script>
connectionStatesAsText = {"-1": "Unknown", "0": "Not connected to a session", "1": "Connecting...", "2": "Hosting", "3": "Connected", "4": "Connection failed"};
setInterval(function(){
connectionState = ipcRenderer.sendSync("synchronous-message", "SESSION:get.state");
document.getElementById("sessionStateText").innerHTML = connectionStatesAsText[String(connectionState)];
}, 1000);
</script>
<button onclick='ipcRenderer.sendSync("synchronous-message", "SESSION:createNew");''>
Create new session
</button>
</body>
</html>