Scoreboard successor of dart-o-mat-3000. Darts games score keeping application

Overview

Project

This is the successor of my previous project Dart-O-Mat 3000. I chost to rewrite it using go as a backend language and svelte as a frontend framework. Also I spiced it up a little and did a full redesign. It is now called DaSCR - Board and will be one of three projects within the DaSCR range.

It will handle darts games and keep the score. That's its basic function. Detailed documentation will follow.

Detailed documentation

A detailed documentation on how to set that up and use it you can find at dascr.org.

Donate

If you like this project and want to leave me a cup of coffee or an icecold German beer:

Donate

Installation

DaSCR - Board should work for multiple operating systems. I develop and test on linux but it should basically compile on any os gcc and go is running on.

Create required files

You will need to create a .env file each in the root directory and in the frontend directory if you plan to use the Makefile as described below.

For the start it is enough to just create them as empty file from the root directory of the project like:

touch .env
touch frontend/.env

Basic requirements

You need go and gcc as mentioned and you are better off installing git as well. Then do:

git clone https://github.com/dascr/dascr-board
cd dascr-board

Building the frontend

Before building the frontend you will need to provide a file called .env in folder ./frontend/ as this will be integrated while building.

.env in frontend folder

API_BASE=http://localhost:8000/
API_URL=http://localhost:8000/api
WS_URL=ws://localhost:8000/ws

This file will tell the frontend where to look for the backend api. Remember you need to provide this information at build time. So if the location of the backend changes (another ip or url) you need to rebuild the app.

To build the frontend you will also need node and yarn (you could use npm, but Makefile is designed to use yarn, as I am using it).

Please be advised your yarn version should be something like: 1.22.10 not 0.32+git which the Raspberry PI will install from the repositories. Better use this tutorial to install yarn (applicable for Debian): https://linuxize.com/post/how-to-install-yarn-on-debian-10/.

Then you do:

make build-frontend

This should result in ./frontend/public/ having a build folder. You are now ready to serve the frontend from public folder via a webserver or run make run-dev-frontend for running it via the development server.

Building the backend

I have the following build targets:

  • build-linux_64
  • build-linux_386
  • build-mac
  • build-armv5
  • build-armv6
  • build-armv7
  • build-armv8_64

So in my arch linux Installation I do:

make build-linux_x64

This will result in a file ./dist/linux_amd64/dascr-board.

Windows

In Windows you can also build this project. I tested it using MSYS2. After installing this I followed this instructions https://gist.github.com/V0idExp/604c61cb7fd1bbcba8142ac94c184f20 to setup my MSYS2 environment.

After setting up accordingly you can build like (from root directory of project within MSYS2 cli):

go mod download
go generate
go build -o dist/windows_amd64/dascr-board.exe

Running it

You will also need to provide at least two environment variables to run the app. Those are API_IP and API_PORT. The app will use these to setup the server.

In Linux you can run the app like so:

API_IP=0.0.0.0 API_PORT=8000 ./dascr-board

There is also the env variable DEBUG=TRUE if you want to see more logging output.

I did not find a way yet to run an App with custom env variables in Windows, yet.

Developing

When providing an .env file, both in root directory and in frontend directory you can run those from Makefile with. The .env file in the root directory for example might look like this:

API_IP=0.0.0.0
API_PORT=8000
DEBUG=TRUE

Then you can run the development server like this from two seperate terminals

make run-dev-backend

and

make run-dev-frontend

You will need to restart the backend service if you change something in the go code.

Docker

You can build and run the two services with docker, too. I provided a Dockerfile each.

So in root you can run docker build . -t dascr-board-backend and in the folder frontend you can run docker build . -t dascr-board-frontend to build those two services.

Afterwards you can run them. Be sure to put them on the same network and to expose port 5000 on the frontend container to be able to interact with it.

If you want to add some recognition software to the mix you will have to expose the API on backend container on port 8000 as well.

To make this easy for you I also designed a docker-compose file. You can run all of this by doing:

docker network create dascr
docker-compose up

Usage

When running you need to navigate your browser to http://ip:port of the frontend. Basically everything there is explained in detail. But in short you need to create player and then you need two browser windows. One is pointing at http://ip:port/<gameid>/start. There the scoreboard will be shown after starting a game. To start a game and input data you point your browser to http://ip:port/<gameid>/game.

Deployment

As of covid-19 I use my scoreboard to host a remote game once a week and therefore deployed it to my hosting server. This is the way I did it.

I used caddy server v2 to host the frontend. Also I used a systemd service file to run the backend service in the background.

/etc/caddy/Caddyfile

example.com {
	root * /var/www/dascr
	encode gzip

	handle /api/* {
		reverse_proxy localhost:8000
	}

	handle /images/* {
		reverse_proxy localhost:8000
	}

	handle /uploads/* {
		reverse_proxy localhost:8000
	}

	handle /ws/* {
		reverse_proxy localhost:8000
	}

	handle {
		try_files {path} {file} /index.html
		file_server
	}

	header {
	# enable HSTS
	Strict-Transport-Security max-age=31536000;

	# disable clients from sniffing the media type
	X-Content-Type-Options nosniff

	# clickjacking protection
	X-Frame-Options DENY

	# keep referrer data off of HTTP connections
	Referrer-Policy no-referrer-when-downgrade
	}

	log {
		output file /var/log/caddy/example.com.access.log {
			roll_size 1gb
			roll_keep 5
			roll_keep_for 720h
		}
	}
}

var/www/dascr in this case points to ./frontend/public of the project folder after building it.

/etc/systemd/system/dascr-board

[Unit]
Description=DaSCR Board - Backend API
After=network.target

[Service]
Type=simple
User=dascr
Group=dascr
Restart=always
RestartSec=5s

Environment=API_IP=0.0.0.0
Environment=API_PORT=8000

WorkingDirectory=/var/lib/dascr
ExecStart=/var/lib/dascr/dascr-board
SyslogIdentifier=dascr-board

[Install]
WantedBy=multi-user.target

/var/lib/dascr-board is the executable resulting from make found in ./dist folder.

When building my frontend I made sure to have my .env to point to my domain instead of a local ip address. This way the clients browser later knows where to fetch the data from API:

.env in frontend folder

API_BASE=https://example.com/
API_URL=https://example.co/api
WS_URL=wss://example.com/ws

Also make sure to choose the right protocol here. Caddy server automatically uses https and therefore also wss is used instead of ws.

API

The API has a few endpoints.

[*] Starting Backend Development
DEBUG  [2021-01-18 11:16:19] All routes are
DEBUG  [2021-01-18 11:16:19] GET /api/
DEBUG  [2021-01-18 11:16:19] GET /api/debug/{id}/redirect
DEBUG  [2021-01-18 11:16:19] GET /api/debug/{id}/update
DEBUG  [2021-01-18 11:16:19] GET /api/game/
DEBUG  [2021-01-18 11:16:19] GET /api/game/{id}
DEBUG  [2021-01-18 11:16:19] POST /api/game/{id}
DEBUG  [2021-01-18 11:16:19] DELETE /api/game/{id}
DEBUG  [2021-01-18 11:16:19] GET /api/game/{id}/display
DEBUG  [2021-01-18 11:16:19] POST /api/game/{id}/nextPlayer
DEBUG  [2021-01-18 11:16:19] POST /api/game/{id}/rematch
DEBUG  [2021-01-18 11:16:19] POST /api/game/{id}/throw/{number}/{modifier}
DEBUG  [2021-01-18 11:16:19] POST /api/game/{id}/undo
DEBUG  [2021-01-18 11:16:19] POST /api/player/
DEBUG  [2021-01-18 11:16:19] GET /api/player/
DEBUG  [2021-01-18 11:16:19] GET /api/player/{id}
DEBUG  [2021-01-18 11:16:19] PATCH /api/player/{id}
DEBUG  [2021-01-18 11:16:19] DELETE /api/player/{id}
DEBUG  [2021-01-18 11:16:19] POST /api/player/{id}/image
DEBUG  [2021-01-18 11:16:19] HEAD /images/*
DEBUG  [2021-01-18 11:16:19] PUT /images/*
DEBUG  [2021-01-18 11:16:19] POST /images/*
DEBUG  [2021-01-18 11:16:19] CONNECT /images/*
DEBUG  [2021-01-18 11:16:19] TRACE /images/*
DEBUG  [2021-01-18 11:16:19] PATCH /images/*
DEBUG  [2021-01-18 11:16:19] GET /images/*
DEBUG  [2021-01-18 11:16:19] DELETE /images/*
DEBUG  [2021-01-18 11:16:19] OPTIONS /images/*
DEBUG  [2021-01-18 11:16:19] PATCH /uploads/*
DEBUG  [2021-01-18 11:16:19] PUT /uploads/*
DEBUG  [2021-01-18 11:16:19] CONNECT /uploads/*
DEBUG  [2021-01-18 11:16:19] HEAD /uploads/*
DEBUG  [2021-01-18 11:16:19] GET /uploads/*
DEBUG  [2021-01-18 11:16:19] TRACE /uploads/*
DEBUG  [2021-01-18 11:16:19] OPTIONS /uploads/*
DEBUG  [2021-01-18 11:16:19] DELETE /uploads/*
DEBUG  [2021-01-18 11:16:19] POST /uploads/*
DEBUG  [2021-01-18 11:16:19] GET /ws/{id}
INFO   [2021-01-18 11:16:19] Starting API at: 0.0.0.0:8000

Those are basically all endpoints (you can read them when starting with DEBUG=TRUE in the console). The most important ones are POST /api/game/{id}/nextPlayer and POST /api/game/{id}/throw/{number}/{modifier}. Those are the endpoints a recognition software should send to (and will after finishing dascr-machine and dascr-cam).

Screenshots

Here are a few screenshots of the games and the UI.

Setup

Player Setup

Player Setup

Start Page

Start

Game Setup

Game Setup

X01

Scoreboard

Controller

Cricket

Scoreboard

Controller

Roadmap

Right now I am missing a few things I planned on.

  • More games (Highscore)

Credits

Sound effects obtained from https://www.zapsplat.com

Comments
  • JavaScript out of Memory, run frontend

    JavaScript out of Memory, run frontend

    Ich erhalte folgenden Fehler, wenn ich versuche das frontend über make run-dev-frontend zu starten.

    FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
    Aborted
    error Command failed with exit code 134.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    ERROR: "rollup" exited with 134.
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    make: *** [Makefile:86: run-dev-frontend] Error 1
    

    Backend wird ganz normal gestartet und ich kann auch im Browser alles ordnungsgemäß bedienen.

    unrelated 
    opened by chico408 5
  • Cricket broken

    Cricket broken

    When one player cannot win anymore cause he cannot score another player cause the other player has already closed everything an one player is left with something open then game is not shot automatically. Check winning condition against this test

    bug 
    opened by patrickhener 4
  • Finish-Vorschlag wird überschrieben

    Finish-Vorschlag wird überschrieben

    Sobald man im Finish-Bereich ist, wird korrekt ein möglicher Finish-Weg angezeigt. Wenn man dann allerdings wirft, verschwindet der Vorschlag und es erscheint "Round XX - Its players turn". Hier sollte der neue Finish-Weg angezeigt werden. #

    unrelated 
    opened by chico408 3
  • make build-frontend fails

    make build-frontend fails

    Output of make build-frontend :

    [*] Cleanup SvelteKit App
    [OK] Cleanup done
    [*] Building SvelteKit App
    
    > [email protected] tailwind:build
    > cross-env TAILWIND_MODE=build cross-env NODE_ENV=production postcss src/styles/tailwind.css -o src/styles/tailwind-output.css
    
    
    
    
    warn - You have enabled the JIT engine which is currently in preview.
    warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time.
    Source path: /data/dascr-board/frontend/src/styles/tailwind.css
    Setting up new context...
    Finding changed files: 5.329ms
    Generate rules: 52.277ms
    Build stylesheet: 1.104ms
    Potential classes:  2611
    Active contexts:  1
    Content match entries 1206
    JIT TOTAL: 187.436ms
    
    
    
    > [email protected] build:only
    > svelte-kit build
    
    file:///data/dascr-board/frontend/node_modules/.pnpm/@[email protected][email protected]/node_modules/@sveltejs/kit/dist/cli.js:1176
    					} else if (allow?.length && cwd) {
    					                 ^
    
    SyntaxError: Unexpected token '.'
        at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
    npm ERR! code 1
    npm ERR! path /data/dascr-board/frontend
    npm ERR! command failed
    npm ERR! command sh -c svelte-kit build
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/davy/.npm/_logs/2022-02-10T10_16_34_810Z-debug.log
    make: *** [Makefile:52: build-frontend] Error 1
    

    Log file :

    0 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build:only' ]
    1 info using [email protected]
    2 info using [email protected]
    3 timing config:load:defaults Completed in 1ms
    4 timing config:load:file:/usr/share/nodejs/npm/npmrc Completed in 2ms
    5 timing config:load:builtin Completed in 2ms
    6 timing config:load:cli Completed in 2ms
    7 timing config:load:env Completed in 0ms
    8 timing config:load:file:/data/dascr-board/frontend/.npmrc Completed in 0ms
    9 timing config:load:project Completed in 1ms
    10 timing config:load:file:/home/davy/.npmrc Completed in 0ms
    11 timing config:load:user Completed in 0ms
    12 timing config:load:file:/etc/npmrc Completed in 1ms
    13 timing config:load:global Completed in 1ms
    14 timing config:load:cafile Completed in 0ms
    15 timing config:load:validate Completed in 2ms
    16 timing config:load:setUserAgent Completed in 0ms
    17 timing config:load:setEnvs Completed in 1ms
    18 timing config:load Completed in 10ms
    19 verbose npm-session 20088485fea873b5
    20 timing npm:load Completed in 19ms
    21 timing command:run-script Completed in 112ms
    22 verbose stack Error: command failed
    22 verbose stack     at ChildProcess.<anonymous> (/usr/share/nodejs/@npmcli/promise-spawn/index.js:64:27)
    22 verbose stack     at ChildProcess.emit (events.js:314:20)
    22 verbose stack     at maybeClose (internal/child_process.js:1022:16)
    22 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
    23 verbose pkgid [email protected]
    24 verbose cwd /data/dascr-board/frontend
    25 verbose Linux 5.13.0-28-generic
    26 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build:only"
    27 verbose node v12.22.5
    28 verbose npm  v7.5.2
    29 error code 1
    30 error path /data/dascr-board/frontend
    31 error command failed
    32 error command sh -c svelte-kit build
    33 verbose exit 1
    

    These are the versions that are installed : git : 2.32.0 go : 1.17.6 gcc : 11.2.0 node : 12.22.5 pnmp : 6.30.1 yarn : 1.22.17

    I have no idea on how to solve this.

    Can anyone help?

    opened by ptahbe 2
  • Fehler Building SvelteKit App / make build-frontend

    Fehler Building SvelteKit App / make build-frontend

    Hallo,

    beim Versuch das Frontend auf einem Raspberry 4 mit Raspberry Pi OS x64 ans Laufen zu bekommen, bleibt der make-Aufruf bei svelte-kit build hängen. Das Backend lässt sich problemlos erstellen.

    pi@raspberrypi:/opt/dascr/dascr-board $ make build-frontend
    [*] Cleanup SvelteKit App
    [OK] Cleanup done
    [*] Building SvelteKit App
    
    > [email protected] tailwind:build /opt/dascr/dascr-board/frontend
    > cross-env TAILWIND_MODE=build cross-env NODE_ENV=production postcss src/styles/tailwind.css -o src/styles/tailwind-output.css
    
    
    
    
    warn - You have enabled the JIT engine which is currently in preview.
    warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time.
    Source path: /opt/dascr/dascr-board/frontend/src/styles/tailwind.css
    Setting up new context...
    Finding changed files: 16.611ms
    Generate rules: 161.866ms
    Build stylesheet: 3.52ms
    Potential classes:  2611
    Active contexts:  1
    Content match entries 1206
    JIT TOTAL: 570.005ms
    
    
    
    > [email protected] build:only /opt/dascr/dascr-board/frontend
    > svelte-kit build
    
    > config.kit.router has been moved to config.kit.browser.router
        at file:///opt/dascr/dascr-board/frontend/node_modules/.pnpm/@[email protected][email protected]/node_modules/@sveltejs/kit/dist/cli.js:874:10
        at file:///opt/dascr/dascr-board/frontend/node_modules/.pnpm/@[email protected][email protected]/node_modules/@sveltejs/kit/dist/cli.js:766:43
        at file:///opt/dascr/dascr-board/frontend/node_modules/.pnpm/@[email protected][email protected]/node_modules/@sveltejs/kit/dist/cli.js:752:18
        at file:///opt/dascr/dascr-board/frontend/node_modules/.pnpm/@[email protected][email protected]/node_modules/@sveltejs/kit/dist/cli.js:752:18
        at validate_config (file:///opt/dascr/dascr-board/frontend/node_modules/.pnpm/@[email protected][email protected]/node_modules/@sveltejs/kit/dist/cli.js:936:9)
        at load_config (file:///opt/dascr/dascr-board/frontend/node_modules/.pnpm/@[email protected][email protected]/node_modules/@sveltejs/kit/dist/cli.js:913:20)
        at async file:///opt/dascr/dascr-board/frontend/node_modules/.pnpm/@[email protected][email protected]/node_modules/@sveltejs/kit/dist/cli.js:1048:19
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] build:only: `svelte-kit build`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] build:only script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/pi/.npm/_logs/2022-02-07T20_44_13_888Z-debug.log
    
    

    /home/pi/.npm/_logs/2022-02-07T20_44_13_888Z-debug.log:

    0 info it worked if it ends with ok
    1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build:only' ]
    2 info using [email protected]
    3 info using [email protected]
    4 verbose run-script [ 'prebuild:only', 'build:only', 'postbuild:only' ]
    5 info lifecycle [email protected]~prebuild:only: [email protected]
    6 info lifecycle [email protected]~build:only: [email protected]
    7 verbose lifecycle [email protected]~build:only: unsafe-perm in lifecycle true
    8 verbose lifecycle [email protected]~build:only: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/dascr/dascr-board/frontend/node_modules/.bin:/opt/dascr/dascr-board/frontend/node_modules/.bin:/usr/pnpm-global/5/node_modules/.pnpm/[email protected]/node_m>
    9 verbose lifecycle [email protected]~build:only: CWD: /opt/dascr/dascr-board/frontend
    10 silly lifecycle [email protected]~build:only: Args: [ '-c', 'svelte-kit build' ]
    11 silly lifecycle [email protected]~build:only: Returned: code: 1  signal: null
    12 info lifecycle [email protected]~build:only: Failed to exec build:only script
    13 verbose stack Error: [email protected] build:only: `svelte-kit build`
    13 verbose stack Exit status 1
    13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
    13 verbose stack     at EventEmitter.emit (events.js:400:28)
    13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
    13 verbose stack     at ChildProcess.emit (events.js:400:28)
    13 verbose stack     at maybeClose (internal/child_process.js:1058:16)
    13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
    14 verbose pkgid [email protected]
    15 verbose cwd /opt/dascr/dascr-board/frontend
    16 verbose Linux 5.10.92-v8+
    17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build:only"
    18 verbose node v14.19.0
    19 verbose npm  v6.14.16
    20 error code ELIFECYCLE
    21 error errno 1
    22 error [email protected] build:only: `svelte-kit build`
    22 error Exit status 1
    23 error Failed at the [email protected] build:only script.
    23 error This is probably not a problem with npm. There is likely additional logging output above.
    24 verbose exit [ 1, true ]
    

    Leider habe ich bei Google auch keine treffende Antwort auf die Meldung "config.kit.router has been moved to config.kit.browser.router" gefunden.

    yarn --version
    1.22.17
    
    node --version
    v14.19.0
    
    pnpm
    Version 6.30.0
    
    npm --version
    6.14.16
    
    gcc version 10.2.1 20210110 (Debian 10.2.1-6)
    
    go version
    go version go1.17.6 linux/arm64
    
    git --version
    git version 2.30.2
    
    Distributor ID: Debian
    Description:    Debian GNU/Linux 11 (bullseye)
    Release:        11
    Codename:       bullseye
    
    

    Hier komme ich leider nicht weiter.

    Danke für Unterstützung.

    Viele Grüße

    opened by RobLil 2
  • X01 broken

    X01 broken

    When using nextPlayer as 0-fill park score does not get updated. So if you bust in the next throw you will not get the actual park score but the old park score before nextPlayer 0-fill.

    bug 
    opened by patrickhener 1
  • Node Version Raspberry Pi

    Node Version Raspberry Pi

    Ich habe nun schon alles versucht, die Node.js Version auf meinem Raspberry zu erneuern. Allerdings bleibe ich immer wieder bei der Version 10.23.1 hängen. Sämtliche Problemlösungen aus den Foren habe ich schon ausprobiert. Erfolgslos... Was mache ich da falsch?

    Edit: https://forum.iobroker.net/topic/35090/howto-nodejs-installation-und-upgrades-unter-debian/2

    unrelated 
    opened by chico408 0
  • make build Frontend

    make build Frontend

    Hallo ich bekommen folgenden Fehler beim Erstellen des Frontends

    grafik

    Versuche das ganze auf einem Raspberry Pi 4. Woran könnte das liegen ?

    go version go1.17 node v19.2.0 npm 9.2.0 pnpm Version 7.18.2 git version 2.30.0

    Gruß

    opened by TimoboD 0
  • multi-stage docker builds, base image updates and gh-actions

    multi-stage docker builds, base image updates and gh-actions

    Use multi-stage builds for creating images.

    Updated used build images.

    Use GitHub Action to build and publish container images for multiple platforms.

    opened by fishingbit 0
  • Destroyed game after Nextplayer > Undo > Throw

    Destroyed game after Nextplayer > Undo > Throw

    Wenn man nach "Nextplayer" auf "Undo" geht und dann direkt einen Wurf über den Controller eingibt, werden die Spieldaten im API-Dienst korrupt. Ebenfalls werden die WS-Verbindungen abgebrochen. image Nach einem Reload der Seite werden nur noch unvollständige Spieledaten angezeigt. Mit "End Game" kann das Spiel abgebrochen werden und danach funktionieren neue Spiele wieder.

    yarn --version
    1.22.17
    
    node --version
    v14.19.0
    
    pnpm
    Version 6.30.0
    
    npm --version
    6.14.16
    
    gcc version 10.2.1 20210110 (Debian 10.2.1-6)
    
    go version
    go version go1.17.6 linux/arm64
    
    git --version
    git version 2.30.2
    
    Distributor ID: Debian
    Description:    Debian GNU/Linux 11 (bullseye)
    Release:        11
    Codename:       bullseye
    
    opened by RobLil 0
  • API-Service/WebSocket-Connection not updating Scoreboard when URL opened directly

    API-Service/WebSocket-Connection not updating Scoreboard when URL opened directly

    Beim öffnen des Scoreboards direkt über die URL http://192.168.3.101:5000/dascr/scoreboard wird zwar die Websocket-Verbindung aufgebaut, aber keine Updates versendet. Ähnlich ist es bei einem Reload der Scoreboard-Seite. Im Debug-Modus des API-Dienstes wurde die WS-Verbindung geloggt, aber keine Messages an den Browser Client versendet. Beim Controller hat es hingegen immer funktioniert. Da ich einen Timeout vermutet habe, habe ich in den Scoreboards mal den Block für die initiale Datenabfrage

        await state.updateState(gameid).then(async () => {
          if ($state.gameData.Settings.Sound) {
            await playSound($state.soundToPlay);
          }
        });
        const res = setCricketModeHeader($state.gameData);
        mode = res[0];
        randomGhost = res[1];
    

    nach hinten verschoben, bzw. die addEventListener nach vorne, was mein Problem gelöst hat:

      onMount(async () => {
        // init websocket
        const im = await import('$utils/socket');
        const ws = im.default;
        const socket = ws.init(gameid, 'Cricket Scoreboard');
        socket.addEventListener('update', async () => {
          await state.updateState(gameid).then(async () => {
            if ($state.gameData.Settings.Sound) {
              await playSound($state.soundToPlay);
            }
          });
        });
        socket.addEventListener('redirect', () => {
          goto(`/${gameid}/start`);
        });
        await state.updateState(gameid).then(async () => {
          if ($state.gameData.Settings.Sound) {
            await playSound($state.soundToPlay);
          }
        });
        const res = setCricketModeHeader($state.gameData);
        mode = res[0];
        randomGhost = res[1];
      });
    
    opened by RobLil 0
  • Uncaught TypeError when loading CricketController after played X01-Game

    Uncaught TypeError when loading CricketController after played X01-Game

    image Gleiches passiert auch beim Scoarboard. image

    Der Fehler tritt auch bei Wechsel von anderen Spielen wie Split-Score nach Cricket auf. Nach einem Reload der Seite ist der Controller wieder funktionsfähig.

    yarn --version
    1.22.17
    
    node --version
    v14.19.0
    
    pnpm
    Version 6.30.0
    
    npm --version
    6.14.16
    
    gcc version 10.2.1 20210110 (Debian 10.2.1-6)
    
    go version
    go version go1.17.6 linux/arm64
    
    git --version
    git version 2.30.2
    
    Distributor ID: Debian
    Description:    Debian GNU/Linux 11 (bullseye)
    Release:        11
    Codename:       bullseye
    
    opened by RobLil 0
Owner
DaScr
DaScr - Score and More
DaScr
Dart package to rank proposals according to Majority Judgment, using a score-based algorithm for performance and scalability

Majority Judgment for Dart This Dart package helps to resolve polls using Majority Judgment. Features Efficient Majority Judgment algorithm, scales we

Mieux Voter 1 Oct 18, 2021
A simple easy to use Flutter DApp , which keeps a track of all your day to day transactions by using Ethereum blockchain in the background which in turn increases your credit score.

Sahayog A simple easy to use Flutter DApp , which keeps a track of all your day to day transactions by using Ethereum blockchain in the background whi

Utkarsh Agarwal 15 May 21, 2022
A book-keeping/business management app.

verido A book-keeping/business management app. Getting Started This project is a starting point for a Flutter application. A few resources to get you

Oluwatobi Odunaiya 1 Nov 18, 2021
An app for keeping your neighbourhood clean and tidy.

Tidy An eco friendly app, keeping your friendly neighbourhood clean. Made with ❤️ from London. Available on iOS and Android. Created as part of Google

Sameen 24 May 12, 2022
A simple todo app for keeping track of complete and incomplete tasks

bloc_todo_list A simple todo app built using bloc architecture and state management Getting Started This project is a starting point for a Flutter app

Olusesi Boluwatife Barry 0 Nov 29, 2021
Nakama is an open-source server designed to power modern games and apps

Nakama is an open-source server designed to power modern games and apps. Features include user accounts, chat, social, matchmaker, realtime multiplayer, and much more.

Allan Nava 85 Dec 30, 2022
a modern games app UI made with flutter

games_mix A game app UI made using flutter. Inspiration https://github.com/developedbyed/glass-website Screenshot Support If you like what we do, and

null 2 Oct 14, 2021
Flutter app for purchasing and renting games.

Flutter Games A Flutter app for purchasing and renting games. View Demo Flutter Games is an app for purchasing and renting games. This demo app is my

Ray Li 234 Dec 22, 2022
Front-end of multiplayer web3 games implemented with Flutter to run on all platforms (Web, Android, iOS, Linux, Window, macOS, TV-OS)

Front-end of multiplayer web3 games implemented with Flutter to run on all platforms (Web, Android, iOS, Linux, Window, macOS, TV-OS)

R-Team 5 Nov 15, 2022
GChat is a chatting application developed using Flutter(Dart) and firebase for 2 users. Trying to Develop an application that does not sell your data with whatsapp rolling out its privacy policy updates.

Gchat - The Chatting Application A Flutter project for chatting. I used Android Studio and you can you any editor of your choice for ex: VS Code, Inte

Sanchaksh Kaul 6 Nov 6, 2022
Weather-application - A weather application based on dart programming language

weather based mobile app A new Flutter project with dart programmingg language S

Munem Sarker 5 Nov 13, 2022
This is application using Flutter for develop a trello application

flutter_desktop_trello A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you s

Dao Hong Vinh 14 Aug 16, 2022
The application helps the patient to follow up on medication schedules, and each patient has his own profile. The application is connected to Bluetooth to help the patient's dependents follow up on the patient.

spoon_medicines A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you star

null 0 Nov 27, 2021
Chat-application - Build Chat Application using Flutter and Firebase

Build Chat Application using Flutter & Firebase Source Code - Enjoy ! Social Med

Muhammad Irvan 0 Jan 3, 2022
Software of Application using Dart, Flutter, Kotlin,Swift,Objective-C, and NodeJS

TouchMe-MobileApp-Dart-And-Flutter Description Software of Application using Dart, Flutter and Kotlin. Installation Using Dart 2.13.1, Flutter 2.2.1,

Daniel Arturo Alejo Alvarez 7 Nov 9, 2021
A modern voice chat application. The project has been written solely in Dart Language.

VChat A modern voice chat application. The application welcomes the user with the login screen. After a simple registration process, an empty "Home" s

Bulent Baris Kilic 6 Aug 18, 2022
🚀 Full-Stack Flutter application, encoded using Dart. Utilizes native device features 📷 and stores user data on a local SQFLite database. ✔

great_places_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Soumyadeep Das 2 Jan 24, 2022
A API integrated 5 day weather forecast and prediction application created using flutter framework and Dart language.

A API integrated 5 day weather forecast and prediction application created using flutter framework and Dart language. This API used here is OPEN WEATHER API, which specializes in predicting the weather of any city in this world.

Nitin Verma 0 Dec 26, 2021
Development of a simple mobile application to perform mathematical operations, using DART and FLUTTER

Desenvolvimento de uma aplicação mobile simples para realizar operações matemáticas, usando DART e FLUTTER.

Bruno Silva 2 Jan 20, 2022