Marco
544e0b22c5
1. Disconnect websocket connection before connecting 2. store playerInfo when hosting a game to reuse it when rejoining
35 lines
634 B
Dart
35 lines
634 B
Dart
const prodURL = 'chess.sw-gross.de:9999';
|
|
const debugURL = 'localhost:8080';
|
|
|
|
const useDbgUrl = true;
|
|
|
|
String getHostURL() {
|
|
var prot = 'https';
|
|
var domain = prodURL;
|
|
if (useDbgUrl) {
|
|
prot = 'http';
|
|
domain = debugURL;
|
|
}
|
|
return '$prot://$domain/api/hostPrivate';
|
|
}
|
|
|
|
String getJoinURL() {
|
|
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';
|
|
}
|