Skip to content

Commit e723d5a

Browse files
committed
fix(sdk): various logging inconsistencies
1 parent c73bf29 commit e723d5a

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

sdk/src/server-api/sc/framework/plugins/Player.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,7 @@ open class Player @JvmOverloads constructor(
8686
return result
8787
}
8888

89+
fun longString() =
90+
"Player(color=$color, displayName='$displayName', listeners=$listeners, canTimeout=$canTimeout, left=$left, softTimeout=$softTimeout, hardTimeout=$hardTimeout, violationReason=$violationReason)"
91+
8992
}

sdk/src/server-api/sc/networking/clients/LobbyClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ public void authenticate(String password) {
137137

138138
public AdminClient authenticate(String password, Consumer<ResponsePacket> consumer) {
139139
start();
140+
if(administrativeListener != null)
141+
logger.warn("Re-authentication replaces {}", administrativeListener);
140142
administrativeListener = consumer;
141143
send(new AuthenticateRequest(password));
142144
return new AdminClient(this);

sdk/src/server-api/sc/networking/clients/XStreamClient.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,11 @@ public void send(ProtocolPacket packet) {
171171
protected synchronized void sendObject(Object packet) {
172172
if (!isReady())
173173
throw new IllegalStateException(
174-
String.format("Trying to write packet %s on non-started client {}", packet, this));
174+
String.format("Trying to write packet %s on non-started client %s", packet, this));
175175

176176
if (isClosed()) {
177-
logger.warn("Writing on a closed Stream -> dropped the packet (tried to send package of type {}) Thread: {}",
178-
packet.getClass().getSimpleName(),
179-
Thread.currentThread().getName());
177+
logger.warn("Writing on a closed Stream -> dropped the packet (tried to send package of type {})",
178+
packet.getClass().getSimpleName());
180179
return;
181180
}
182181

@@ -200,7 +199,7 @@ protected final void handleDisconnect(DisconnectCause cause) {
200199

201200
protected final void handleDisconnect(DisconnectCause cause, Throwable exception) {
202201
if (exception != null) {
203-
logger.warn("{} disconnected (Cause: {}, Exception: {})", this, cause, exception);
202+
logger.warn("{} disconnected (Cause: {}, Exception: {})", this, cause, exception, exception);
204203
} else {
205204
logger.info("{} disconnected (Cause: {})", this, cause);
206205
}

0 commit comments

Comments
 (0)