From cf080b2d3fcaa475d412d348ebaf40cdf83a574b Mon Sep 17 00:00:00 2001 From: Alex Nisnevich Date: Wed, 13 Mar 2024 01:10:38 -0700 Subject: [PATCH] Update websocket server URL --- Kalevala.elm | 10 ++++---- .../USER/PROJECT/1.0.0/Kalevala.elmo | 2 +- elm.js | 24 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Kalevala.elm b/Kalevala.elm index 8fa04b5..3c7069b 100644 --- a/Kalevala.elm +++ b/Kalevala.elm @@ -28,8 +28,8 @@ import Deserialize import Debug isRemoteSignal : Signal Bool -isRemoteSignal = - let getIsRemoteFromClickSignal event = +isRemoteSignal = + let getIsRemoteFromClickSignal event = case event of StartSinglePlayer -> Just False StartTwoPlayerHotseat -> Just False @@ -92,10 +92,10 @@ processClick signal = in constructAction <~ signal ~ seedSignal ~ sampledMouse ~ Window.dimensions ~ sampledPlayerName -{- Path to a Voluspa game server +{- Path to a Voluspa game server (see https://github.com/neunenak/voluspa-server) -} server : String -server = "ws://ec2-52-10-22-64.us-west-2.compute.amazonaws.com:22000" +server = "ws://209.38.174.55:22000" {- Encodes an Action as a JSON string -} encode : Action -> String @@ -126,7 +126,7 @@ getCpuResponse playerAction delayTime = in Time.delay delayTime (processCpuResponse <~ playerAction) -{- The main game loop. +{- The main game loop. The state is folded over time over a stream of Actions, coming from the client and from the server (for an online game.) Actions from the client are constructed by processing a signal of ClickEvents from clickMailbox. In the case the the game type is HumanVsHumanRemote, Actions are also sent to the server over a websocket, diff --git a/elm-stuff/build-artifacts/USER/PROJECT/1.0.0/Kalevala.elmo b/elm-stuff/build-artifacts/USER/PROJECT/1.0.0/Kalevala.elmo index 1f0d4c6..834904f 100644 --- a/elm-stuff/build-artifacts/USER/PROJECT/1.0.0/Kalevala.elmo +++ b/elm-stuff/build-artifacts/USER/PROJECT/1.0.0/Kalevala.elmo @@ -72,7 +72,7 @@ Elm.Kalevala.make = function (_elm) { 0, $Serialize.action(action)); }; - var server = "ws://ec2-52-10-22-64.us-west-2.compute.amazonaws.com:22000"; + var server = "wss://ec2-52-10-22-64.us-west-2.compute.amazonaws.com:22000"; var constructAction = F5(function (clickType, seed, mousePos, diff --git a/elm.js b/elm.js index 26fb1e2..42f5935 100644 --- a/elm.js +++ b/elm.js @@ -6692,7 +6692,7 @@ Elm.Kalevala.make = function (_elm) { 0, $Serialize.action(action)); }; - var server = "ws://ec2-52-10-22-64.us-west-2.compute.amazonaws.com:22000"; + var server = "ws://209.38.174.55:22000"; var constructAction = F5(function (clickType, seed, mousePos, @@ -14685,7 +14685,7 @@ var commonEvents = [ Only one DOMDelegator should exist because we do not want duplicate event listeners bound to the DOM. - `Delegator` will also `listenTo()` all events unless + `Delegator` will also `listenTo()` all events unless every caller opts out of it */ module.exports = Delegator @@ -14727,7 +14727,7 @@ function Delegator(opts) { * Safe for element IDs and server-side lookups. * * Extracted from CLCTR - * + * * Copyright (c) Eric Elliott 2012 * MIT License */ @@ -14793,7 +14793,7 @@ function Delegator(opts) { counter = safeCounter().toString(36).slice(-4); - return date.slice(-2) + + return date.slice(-2) + counter + print + random; }; @@ -15884,11 +15884,11 @@ function renderThunk(thunk, previous) { } },{"./is-thunk":28,"./is-vnode":30,"./is-vtext":31,"./is-widget":32}],28:[function(require,module,exports){ -module.exports = isThunk - -function isThunk(t) { - return t && t.type === "Thunk" -} +module.exports = isThunk + +function isThunk(t) { + return t && t.type === "Thunk" +} },{}],29:[function(require,module,exports){ module.exports = isHook @@ -16362,7 +16362,7 @@ Elm.Native.WebSocket.make = function(elm) { var pending = []; var ready = false; - + ws.onopen = function(e) { var len = pending.length; for (var i = 0; i < len; ++i) { ws.send(pending[i]); } @@ -16371,11 +16371,11 @@ Elm.Native.WebSocket.make = function(elm) { ws.onmessage = function(event) { elm.notify(incoming.id, event.data); }; - + function send(msg) { ready ? ws.send(msg) : pending.push(msg); } - + function take1(x,y) { return x } return A3(Signal.map2, F2(take1), incoming, A2(Signal.map, send, outgoing)); }