Skip to content

Commit b6436e1

Browse files
authored
Merge pull request #4 from 3944Realms/develop
Update Release
2 parents fceb872 + 6a79960 commit b6436e1

File tree

78 files changed

+3225
-1331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3225
-1331
lines changed

.github/workflows/gradle.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
name: Java CI with Gradle
9+
10+
on:
11+
push:
12+
branches: [ "release", "develop" ]
13+
pull_request:
14+
branches: [ "release", "develop" ]
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up JDK 17
26+
uses: actions/setup-java@v4
27+
with:
28+
java-version: '17'
29+
distribution: 'temurin'
30+
31+
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
32+
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
33+
- name: Setup Gradle
34+
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
35+
# 添加权限修复步骤
36+
- name: Set gradlew executable
37+
run: chmod +x gradlew
38+
39+
- name: Build with Gradle Wrapper
40+
run: ./gradlew build
41+
42+
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
43+
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
44+
#
45+
# - name: Setup Gradle
46+
# uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
47+
# with:
48+
# gradle-version: '8.9'
49+
#
50+
# - name: Build with Gradle 8.9
51+
# run: gradle build
52+
53+
dependency-submission:
54+
55+
runs-on: ubuntu-latest
56+
permissions:
57+
contents: write
58+
59+
steps:
60+
- uses: actions/checkout@v4
61+
- name: Set up JDK 17
62+
uses: actions/setup-java@v4
63+
with:
64+
java-version: '17'
65+
distribution: 'temurin'
66+
67+
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
68+
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
69+
- name: Generate and submit dependency graph
70+
uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ dependencies {
3030
testImplementation platform('org.junit:junit-bom:5.10.0')
3131
testImplementation 'org.junit.jupiter:junit-jupiter'
3232
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.16'
33+
implementation 'org.apache.logging.log4j:log4j-slf4j2-impl:2.20.0'
3334
}
3435
shadowJar {
3536
destinationDirectory = file('output')

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22
project_group ='com.r3944realms.dg_lab'
3-
project_version=2.0.1.7
3+
project_version=2.2.8.16

sc/gradle.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/main/java/com/r3944realms/dg_lab/DgLab.java

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024-2025 R3944Realms. All rights reserved.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
******************************************************************************/
16+
117
package com.r3944realms.dg_lab;
218

319
import io.netty.handler.logging.LogLevel;
@@ -12,14 +28,16 @@ public class DgLab {
1228
*/
1329
public static LoggingHandler LOGGING_HANDLER = new LoggingHandler(LogLevel.DEBUG);
1430

31+
1532
/**
16-
* Instantiates a new Dg lab.
33+
* Sets logging handler level.
1734
*
18-
* @param level Netty日志级别()
35+
* @param level the level
1936
*/
20-
public DgLab(LogLevel level) {
37+
public void setLoggingHandlerLevel(LogLevel level) {
2138
LOGGING_HANDLER = new LoggingHandler(level);
2239
}
2340

2441

42+
2543
}

src/main/java/com/r3944realms/dg_lab/api/dataType/PowerBoxCommands.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024-2025 R3944Realms. All rights reserved.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
******************************************************************************/
16+
117
package com.r3944realms.dg_lab.api.dataType;
218

319
import com.r3944realms.dg_lab.websocket.message.data.type.PowerBoxDataType;

src/main/java/com/r3944realms/dg_lab/api/dataType/PowerBoxMsgType.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024-2025 R3944Realms. All rights reserved.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
******************************************************************************/
16+
117
package com.r3944realms.dg_lab.api.dataType;
218

319
import com.r3944realms.dg_lab.websocket.message.data.type.PowerBoxDataType;

src/main/java/com/r3944realms/dg_lab/api/handler/ClientOperation.java

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,57 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024-2025 R3944Realms. All rights reserved.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
******************************************************************************/
16+
117
package com.r3944realms.dg_lab.api.handler;
218

319
import com.r3944realms.dg_lab.websocket.message.data.PowerBoxData;
420

521
/**
622
* The interface Client operation.
723
*/
8-
public interface ClientOperation {
24+
public interface ClientOperation extends IOperation {
25+
/**
26+
* 客户端线程开启中处理
27+
*/
28+
void ClientStartingHandler();
29+
30+
/**
31+
* 客户端线程完全开启后处理
32+
*/
33+
void ClientStartedHandler();
34+
35+
/**
36+
* 客户端启动遇到错误后处理
37+
*/
38+
void ClientStartingErrorHandler();
39+
40+
/**
41+
* 客户端线程关闭中处理
42+
*/
43+
void ClientStoppingHandler();
44+
45+
/**
46+
* 客户端线程关闭中遇到错误后处理
47+
*/
48+
void ClientStoppingErrorHandler();
49+
50+
/**
51+
* 客户端线程完全关闭后处理
52+
*/
53+
void ClientStoppedHandler();
54+
955
/**
1056
* 接收一个参数,实现二维码生成
1157
*
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024-2025 R3944Realms. All rights reserved.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
******************************************************************************/
16+
17+
package com.r3944realms.dg_lab.api.handler;
18+
19+
/**
20+
* The interface Operation.
21+
*/
22+
public interface IOperation {
23+
}

src/main/java/com/r3944realms/dg_lab/api/handler/ServerOperation.java

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,59 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024-2025 R3944Realms. All rights reserved.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
******************************************************************************/
16+
117
package com.r3944realms.dg_lab.api.handler;
218

319
import com.r3944realms.dg_lab.websocket.message.PowerBoxMessage;
20+
import org.jetbrains.annotations.Nullable;
421

522
/**
623
* The interface Server operation.
724
*/
8-
public interface ServerOperation {
25+
public interface ServerOperation extends IOperation {
26+
27+
/**
28+
* 服务器线程开启中通知
29+
*/
30+
void ServerStartingHandler();
31+
32+
/**
33+
* 服务器线程开启中遇到错误后处理
34+
*/
35+
void ServerStartingErrorHandler();
36+
37+
/**
38+
* 服务器线程开启后处理
39+
*/
40+
void ServerStartedHandler();
41+
42+
/**
43+
* 服务器线程关闭中处理后通知
44+
*/
45+
void ServerStoppingHandler();
46+
47+
/**
48+
* 服务器线程关闭中遇到错误后处理
49+
*/
50+
void ServerStoppingErrorHandler();
51+
52+
/**
53+
* 服务器线程完全关闭后处理
54+
*/
55+
void ServerStoppedHandler();
56+
957
/**
1058
* 在定时器里即将被移除的UUID处理
1159
*
@@ -75,7 +123,18 @@ public interface ServerOperation {
75123
* @param clearMessage 清理信息
76124
* @param pulseMessage 波形消息
77125
*/
78-
void PulseClientMessageHandler(final PowerBoxMessage clearMessage, final PowerBoxMessage pulseMessage);
126+
default void PulseClientMessageHandler(final PowerBoxMessage clearMessage, final PowerBoxMessage pulseMessage) {
127+
PulseClientMessageHandler(clearMessage, 500, pulseMessage);
128+
}
129+
130+
/**
131+
* 波形信息由客户端下发处理
132+
*
133+
* @param clearMessage 清理信息
134+
* @param delayTime 延迟时间
135+
* @param pulseMessage 波形消息
136+
*/
137+
void PulseClientMessageHandler(@Nullable final PowerBoxMessage clearMessage, final int delayTime, final PowerBoxMessage pulseMessage);
79138

80139
/**
81140
* 连接断开消息处理

0 commit comments

Comments
 (0)