Skip to content

Commit 5b6c3af

Browse files
committed
rentnerend: connection info + fix a few bugs
1 parent 898fcb5 commit 5b6c3af

8 files changed

Lines changed: 228 additions & 141 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ rentnerend/pubspec.lock
99

1010
## Backend
1111
backend/interscore-backend
12-
docker/obs
1312

1413
## Frontend
1514
*.js

README.md

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -95,37 +95,41 @@ Building and running:
9595
- FINAL³ translations
9696

9797
## rentnerend
98-
- URGENT rentnerend infos über connection
99-
- BUG goal hotkeys vertauscht (input_window)
100-
- zeit sollte rot werden (oder gelb), wenn pausiert (im public window)
101-
- BUG UI reset wird nicht geupdatet (input_window)
102-
- verletzungscounter
103-
- recv & send time handshake
104-
- URGENT widget pipelines:
105-
- 5s this widget, 5s that
106-
- absolute cinema
107-
- JSON-Creator GUI for non-technical users
98+
### JSON-Creator
10899
- @julian :) Import tournaments from cycleball.eu (and Radball.at when library is ready)
109100
- @julian FINAL Import Spieler, Teams, Vereine, Ligen, Schiedsrichter for custom tournaments from cycleball.eu (and Radball.at)
110-
- FINAL make the streaming status button accurate
111-
- FINAL Reversing der anzeige im Anzeigefenster, je nach Position des Bildschirms/Beamers (maybe button anzeigen, wenn window im fokus?)
112-
- FINAL Add cycleball.eu push support
113-
- FINAL Cards for Coaches: "Coach von Gifhorn 1 bekommt eine gelbe Karte"
114-
- FINAL Ads in public window, e.g. fullscreen video/picture during a pause
115-
- FINAL Next Game in public window, e.g. before the fullscreen ad during a pause
116-
- FINAL delte cards
117101
- FINAL² add export to Spielplan-pdf:
118102
- we define a standard for what formular keys we expect
119103
- users can upload their template only if their matches our standard:
120104
- otherwise error dialog ig
121105
- we export the results as a writable formular
122106
- FINAL² Add referees
107+
### Input Window
108+
- verletzungscounter
109+
- widget pipelines: 5s this widget, 5s that
110+
- JSON-Creator GUI for non-technical users
111+
- support and create more gameactions easily
112+
- FINAL make the streaming status button accurate
113+
- FINAL Add cycleball.eu push support
114+
- FINAL Cards for Coaches: "Coach von Gifhorn 1 bekommt eine gelbe Karte"
115+
- FINAL delte cards
116+
### Public Window
117+
- zeit sollte rot werden (oder gelb), wenn pausiert (im public window)
118+
- FINAL Reversing der anzeige im Anzeigefenster, je nach Position des Bildschirms/Beamers (maybe button anzeigen, wenn window im fokus?)
119+
- recv & send time handshake
120+
- FINAL Ads, e.g. fullscreen video/picture during a pause
121+
- FINAL Next Game in public window, e.g. before the fullscreen ad during a pause
123122
- FINAL³ IDEA Ansagen durch KI bei der Hälfte
124-
### Remoteend
123+
### Remote Window
125124
- FINAL Display Gamerelated information:
126125
- Scoreboard Infos: Teams playing, Score, Time, Half
127126
- Connection Status of all Clients (backend, rentnerend, frontend)
128127
- OBS Scene / replay situation
128+
### Infoend
129+
- show connection status
130+
- zeit als bar um den oval rum
131+
- FINAL Info Window loggt wie viele leute da waren
132+
- FINAL Add Logo to Info Window
129133

130134
## backend
131135

@@ -145,12 +149,6 @@ Building and running:
145149
- FINAL Add different replay possibilities (?? make setting for: speed of replay, length of replay)
146150
- FINAL Allow changing/select Streaming Service
147151

148-
## Infoend
149-
- show connection status
150-
- zeit als bar um den oval rum
151-
- FINAL Info Window loggt wie viele leute da waren
152-
- FINAL Add Logo to Info Window
153-
154152
## interscore.mminl.de
155153
- UX improvement: look like frontend
156154
- mobile friendly

rentnerend/lib/input_window.dart

Lines changed: 188 additions & 107 deletions
Large diffs are not rendered by default.

rentnerend/lib/websocket.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class InterscoreWS {
1616
// This is needed, so Matchday can be updated and trigger a UI redraw
1717
// Also we need the Matchday informations in sendSignal() to send them
1818
late final ValueNotifier<Matchday> _mdl;
19-
ValueNotifier<bool>? get connection => client.connected;
19+
ValueNotifier<bool> get connection => client.connected;
2020

2121
// We have to use a "factory" so the constructor can be async
2222
InterscoreWS(String server_url, String client_url, this._mdl) {

rentnerend/lib/ws_client.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import 'lib.dart' as lib;
88
abstract class WSClient {
99
final String url;
1010
final ValueNotifier<Matchday> mdl;
11-
bool boss = false;
1211
final bool allowReadFrom, allowWriteTo;
1312
final ValueNotifier<bool> connected = ValueNotifier(false);
13+
final ValueNotifier<bool> boss = ValueNotifier(false);
1414

1515
WSClient(this.url, this.mdl, this.allowReadFrom, this.allowWriteTo);
1616

@@ -29,7 +29,7 @@ abstract class WSClient {
2929
if(msg[0] == MessageType.DATA_IM_BOSS.value) {
3030
if(msg.length < 2) return;
3131
debugPrint("Received DATA_IM_BOSS: ${msg[1] == 1}");
32-
this.boss = msg[1] == 1 ? true : false;
32+
boss.value = msg[1] == 1 ? true : false;
3333
}
3434
// Parse the message
3535
if(allowReadFrom) _listenRead(msg);

rentnerend/lib/ws_client_io.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ class WSClientIO extends WSClient {
2626
debugPrint("WS Client: Server \'${url}\' closed connection");
2727
connected.value = false;
2828
_ws = null;
29-
boss = false;
29+
boss.value = false;
3030
},
3131
onError: (err) {
3232
debugPrint("WS Client: ERR ${err}");
3333
connected.value = false;
3434
_ws = null;
35-
boss = false;
35+
boss.value = false;
3636
}
3737
);
3838
} catch (e) {
3939
debugPrint("WS Client: Connection failed with error: ${e}");
4040
_ws = null;
41-
boss = false;
41+
boss.value = false;
4242
}
4343
}
4444

@@ -52,7 +52,7 @@ class WSClientIO extends WSClient {
5252
void close() {
5353
_ws?.close();
5454
_ws = null;
55-
boss = false;
55+
boss.value = false;
5656
}
5757
}
5858

rentnerend/lib/ws_client_web.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,20 @@ class WSClientWeb extends WSClient{
3838
debugPrint("WS Client: ERR");
3939
connected.value = false;
4040
_ws = null;
41+
boss.value = false;
4142
}).toJS;
4243
ws.onclose = ((CloseEvent e) {
4344
debugPrint("WS Client: Server '$url' closed connection");
4445
connected.value = false;
4546
_ws = null;
47+
boss.value = false;
4648
}).toJS;
4749

4850
_ws = ws;
4951
} catch (e) {
5052
debugPrint("WS Client: Connection failed with error: ${e}");
5153
_ws = null;
54+
boss.value = false;
5255
}
5356
}
5457

@@ -62,7 +65,7 @@ class WSClientWeb extends WSClient{
6265
void close() {
6366
_ws?.close();
6467
_ws = null;
65-
boss = false;
68+
boss.value = false;
6669
}
6770
}
6871

rentnerend/lib/ws_server.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class WSServer {
1313
HttpServer? _server;
1414
ValueNotifier<Matchday> _mdl;
1515
bool readonly = true;
16+
ValueNotifier<int> clientsConnected = ValueNotifier(0);
1617

1718
WSServer(this._url, this._mdl, {this.readonly = true});
1819

@@ -44,12 +45,13 @@ class WSServer {
4445
final client = await WebSocketTransformer.upgrade(req);
4546
debugPrint("WS Server: upgraded client to WS");
4647
_clients.add(client);
48+
_updateClientCount();
4749

4850
// Listen is empty, because The server is write only.
4951
// Writing clients should connect to the real backend!
5052
client.listen(
5153
_listen,
52-
onDone: () => _clients.remove(client),
54+
onDone: () { _clients.remove(client); _updateClientCount(); },
5355
onError: (e) => debugPrint("grrr, client couldnt be connected properly!")
5456
);
5557
}
@@ -126,4 +128,8 @@ class WSServer {
126128
client.add(data);
127129
}
128130
}
131+
132+
void _updateClientCount() {
133+
clientsConnected.value = _clients.length;
134+
}
129135
}

0 commit comments

Comments
 (0)