6 Commits

Author SHA1 Message Date
CaiHQ
8a3c59ed59 update for async get endpoint info 2025-07-18 19:59:27 +08:00
CaiHQ
9ecbf54c2d update for async get endpoint info 2025-07-18 19:59:22 +08:00
CaiHQ
a9ec23400e update audit tool 2025-07-18 18:03:29 +08:00
CaiHQ
247adc11de Merge remote-tracking branch 'origin/master' 2025-07-15 13:38:12 +08:00
CaiHQ
957cdb469f add readme 2025-07-15 13:37:45 +08:00
蔡华谦
afd6363fd5 !2 feat: the startup parameter prioritizes the doipStartPort specified in…
Merge pull request !2 from 赵伟杰/feat/start-port
2025-07-15 05:02:31 +00:00
3 changed files with 24 additions and 10 deletions

View File

@@ -17,3 +17,8 @@ copy debugconf.json.template debugconf.json
```
执行DebugMain.main即可
```
## 构建可执行版本
执行`cp/build.gradle`中的`buildBundle`任务。
`cp/build/output`即为相关的jar包。
`yjs.jar`即cp.jar)和一系列依赖在libs目录下)组成。

View File

@@ -8,7 +8,7 @@ plugins {
apply from: '../spotless.gradle'
group = "org.bdware.sc"
version = "1.10.5"
version = "1.10.6"
tasks.withType(JavaCompile) {
// options.compilerArgs << '-Xlint:none'
// options.compilerArgs << '-Xlint:deprecation' << "-Werror"
@@ -51,7 +51,7 @@ dependencies {
implementation 'com.sun.mail:javax.mail:1.6.2'
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
implementation 'org.bdware.bdcontract:sdk-java:1.0.2'
implementation 'org.bdware.doip:doip-audit-tool:1.5.9'
implementation 'org.bdware.doip:doip-audit-tool:1.6.0'
implementation 'org.bdware.doip:doip-sdk:1.5.9'
implementation 'org.apache.logging.log4j:log4j-layout-template-json:2.17.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3'

View File

@@ -82,21 +82,30 @@ public class DoipLocalSingleton {
}
if (config.routerURI != null && config.repoName != null) {
AuditIrpClient irpClient = new AuditIrpClient(config);
EndpointInfo endpointInfo = irpClient.getEndpointInfo();
EndpointInfo endpointInfo = null;
for (int i = 0; i < 10; i++) {
endpointInfo = irpClient.getEndpointInfo();
if (endpointInfo == null)
Thread.sleep(200);
}
if (endpointInfo != null) {
repoID = endpointInfo.getDoId();
owner = endpointInfo.getPubKey();
infos.clear();
}
infos.add(new DoipListenerConfig(endpointInfo.getURI(), "2.1"));
port = new URI(endpointInfo.getURI()).getPort();
SharableVarManager.initSharableVarManager(repoID, config);
}
}
// 如果启动参数中添加了 doipStartPort 参数,使用该参数作为启动端口
if (otherConfigs != null && otherConfigs.isJsonObject() && otherConfigs.getAsJsonObject().has("doipStartPort") && infos.size() == 1) {
if (otherConfigs != null && otherConfigs.isJsonObject()
&& otherConfigs.getAsJsonObject().has("doipStartPort") && infos.size() == 1) {
int doipStartPort = otherConfigs.getAsJsonObject().get("doipStartPort").getAsInt();
// 如果当前启动的端口和指定的端口不一致,修改启动端口
if (doipStartPort != port) {
infos.get(0).url = infos.get(0).url.replace(String.valueOf(port), String.valueOf(doipStartPort));
infos.get(0).url = infos.get(0).url.replace(String.valueOf(port),
String.valueOf(doipStartPort));
port = doipStartPort;
}
}