Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
95df9a31
Commit
95df9a31
authored
Jun 24, 2022
by
KingRainbow44
Browse files
Hardcode `EventType.GAME` for `ServerLogEvent`
parent
52da2c23
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/event/internal/ServerLogEvent.java
View file @
95df9a31
package
emu.grasscutter.server.event.internal
;
import
ch.qos.logback.classic.spi.ILoggingEvent
;
import
ch.qos.logback.core.AppenderBase
;
import
emu.grasscutter.server.event.types.ServerEvent
;
public
class
ServerLogEvent
extends
ServerEvent
{
ILoggingEvent
loggingEvent
;
String
consoleMessage
;
public
final
class
ServerLogEvent
extends
ServerEvent
{
private
final
ILoggingEvent
loggingEvent
;
private
final
String
consoleMessage
;
public
ServerLogEvent
(
ILoggingEvent
loggingEvent
,
String
consoleMessage
)
{
super
(
Type
.
GAME
);
public
ServerLogEvent
(
Type
type
,
ILoggingEvent
loggingEvent
,
String
consoleMessage
)
{
super
(
type
);
this
.
loggingEvent
=
loggingEvent
;
this
.
consoleMessage
=
consoleMessage
;
}
public
ILoggingEvent
getLoggingEvent
()
{
return
loggingEvent
;
}
public
ILoggingEvent
getLoggingEvent
()
{
return
this
.
loggingEvent
;
}
public
String
getConsoleMessage
()
{
return
consoleMessage
;
return
this
.
consoleMessage
;
}
}
src/main/java/emu/grasscutter/utils/ServerLogEventAppender.java
View file @
95df9a31
...
...
@@ -17,12 +17,12 @@ public class ServerLogEventAppender<E> extends AppenderBase<E> {
@Override
protected
void
append
(
E
event
)
{
byte
[]
byteArray
=
this
.
encoder
.
encode
(
event
);
ServerLogEvent
sle
=
new
ServerLogEvent
(
ServerEvent
.
Type
.
GAME
,
(
ILoggingEvent
)
event
,
new
String
(
byteArray
,
StandardCharsets
.
UTF_8
));
ServerLogEvent
sle
=
new
ServerLogEvent
((
ILoggingEvent
)
event
,
new
String
(
byteArray
,
StandardCharsets
.
UTF_8
));
sle
.
call
();
}
public
Encoder
<
E
>
getEncoder
()
{
return
encoder
;
return
this
.
encoder
;
}
public
void
setEncoder
(
Encoder
<
E
>
encoder
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment