Marco
adf8c86692
1. A game is only identified by a passphrase (not a lobby id) 2. We can store multiple passphrase/playerID combinations
35 lines
644 B
Dart
35 lines
644 B
Dart
const prodURL = 'chess.sw-gross.de:9999';
|
|
const debugURL = 'localhost:8080';
|
|
|
|
const useDbgUrl = true;
|
|
|
|
String getCreateGameURL() {
|
|
var prot = 'https';
|
|
var domain = prodURL;
|
|
if (useDbgUrl) {
|
|
prot = 'http';
|
|
domain = debugURL;
|
|
}
|
|
return '$prot://$domain/api/hostPrivate';
|
|
}
|
|
|
|
String getJoinGameURL() {
|
|
var prot = 'https';
|
|
var domain = prodURL;
|
|
if (useDbgUrl) {
|
|
prot = 'http';
|
|
domain = debugURL;
|
|
}
|
|
return '$prot://$domain/api/joinPrivate';
|
|
}
|
|
|
|
String getWebsocketURL() {
|
|
var prot = 'wss';
|
|
var domain = prodURL;
|
|
if (useDbgUrl) {
|
|
prot = 'ws';
|
|
domain = debugURL;
|
|
}
|
|
return '$prot://$domain/api/ws';
|
|
}
|