mirror of
https://github.com/wownero/cyberwow.git
synced 2026-12-03 13:43:59 +01:00
add host to config
This commit is contained in:
@@ -32,5 +32,8 @@ const arch = 'arm64';
|
||||
// const arch = 'x86_64';
|
||||
const minimumHeight = 118361;
|
||||
|
||||
const isPC = arch == 'x86_64';
|
||||
const isEmu = arch == 'x86_64';
|
||||
const emuHost = '192.168.10.100';
|
||||
|
||||
const host = isEmu ? emuHost : '127.0.0.1';
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import '../config.dart';
|
||||
int rpcID = 0;
|
||||
|
||||
Future<http.Response> rpc(String method) async {
|
||||
final url = 'http://127.0.0.1:${config.port}/json_rpc';
|
||||
final url = 'http://${host}:${config.port}/json_rpc';
|
||||
|
||||
rpcID += 1;
|
||||
|
||||
@@ -154,7 +154,7 @@ Future<String> getConnectionsString() async => rpcString('get_connections', fiel
|
||||
|
||||
|
||||
Future<http.Response> rpcOther(String method) async {
|
||||
final url = 'http://127.0.0.1:${config.port}/json_rpc';
|
||||
final url = 'http://${host}:${config.port}/json_rpc';
|
||||
|
||||
var response;
|
||||
try {
|
||||
|
||||
@@ -63,7 +63,7 @@ Stream<String> runBinary (String name) async* {
|
||||
yield line;
|
||||
}
|
||||
|
||||
if (isPC) return;
|
||||
if (isEmu) return;
|
||||
|
||||
// the app should never reach here
|
||||
log.severe('Daemon is gone!');
|
||||
|
||||
Reference in New Issue
Block a user