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
91a2a55e
Commit
91a2a55e
authored
Apr 28, 2022
by
KingRainbow44
Browse files
Bug fixes & class updates
parent
694b5c15
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/Account.java
View file @
91a2a55e
...
@@ -104,7 +104,7 @@ public class Account {
...
@@ -104,7 +104,7 @@ public class Account {
}
}
public
boolean
hasPermission
(
String
permission
)
{
public
boolean
hasPermission
(
String
permission
)
{
return
this
.
permissions
.
contains
(
permission
)
||
this
.
permissions
.
contains
(
"*"
)
?
true
:
false
;
return
this
.
permissions
.
contains
(
permission
)
||
this
.
permissions
.
contains
(
"*"
);
}
}
public
boolean
removePermission
(
String
permission
)
{
public
boolean
removePermission
(
String
permission
)
{
...
...
src/main/java/emu/grasscutter/plugin/api/ServerHook.java
View file @
91a2a55e
...
@@ -2,7 +2,7 @@ package emu.grasscutter.plugin.api;
...
@@ -2,7 +2,7 @@ package emu.grasscutter.plugin.api;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.CommandHandler
;
import
emu.grasscutter.command.CommandHandler
;
import
emu.grasscutter.game.
Genshin
Player
;
import
emu.grasscutter.game.
player.
Player
;
import
emu.grasscutter.server.dispatch.DispatchServer
;
import
emu.grasscutter.server.dispatch.DispatchServer
;
import
emu.grasscutter.server.game.GameServer
;
import
emu.grasscutter.server.game.GameServer
;
...
@@ -33,7 +33,7 @@ public final class ServerHook {
...
@@ -33,7 +33,7 @@ public final class ServerHook {
public
ServerHook
(
GameServer
gameServer
,
DispatchServer
dispatchServer
)
{
public
ServerHook
(
GameServer
gameServer
,
DispatchServer
dispatchServer
)
{
this
.
gameServer
=
gameServer
;
this
.
gameServer
=
gameServer
;
this
.
dispatchServer
=
dispatchServer
;
this
.
dispatchServer
=
dispatchServer
;
instance
=
this
;
instance
=
this
;
}
}
...
@@ -50,12 +50,12 @@ public final class ServerHook {
...
@@ -50,12 +50,12 @@ public final class ServerHook {
public
DispatchServer
getDispatchServer
()
{
public
DispatchServer
getDispatchServer
()
{
return
this
.
dispatchServer
;
return
this
.
dispatchServer
;
}
}
/**
/**
* Gets all online players.
* Gets all online players.
* @return Players connected to the server.
* @return Players connected to the server.
*/
*/
public
List
<
Genshin
Player
>
getOnlinePlayers
()
{
public
List
<
Player
>
getOnlinePlayers
()
{
return
new
LinkedList
<>(
this
.
gameServer
.
getPlayers
().
values
());
return
new
LinkedList
<>(
this
.
gameServer
.
getPlayers
().
values
());
}
}
...
...
src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java
View file @
91a2a55e
...
@@ -209,7 +209,7 @@ public final class DispatchServer {
...
@@ -209,7 +209,7 @@ public final class DispatchServer {
return
null
;
return
null
;
}
}
private
KeyManagerFactory
createKeyManagerFactory
(
File
keystore
,
String
password
)
throws
Exception
{
private
KeyManagerFactory
createKeyManagerFactory
(
File
keystore
,
String
password
)
{
char
[]
pass
=
password
.
toCharArray
();
char
[]
pass
=
password
.
toCharArray
();
KeyManagerFactory
kmf
=
null
;
KeyManagerFactory
kmf
=
null
;
...
@@ -220,8 +220,8 @@ public final class DispatchServer {
...
@@ -220,8 +220,8 @@ public final class DispatchServer {
kmf
=
KeyManagerFactory
.
getInstance
(
"SunX509"
);
kmf
=
KeyManagerFactory
.
getInstance
(
"SunX509"
);
kmf
.
init
(
ks
,
pass
);
kmf
.
init
(
ks
,
pass
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
xception
)
{
throw
e
;
Grasscutter
.
getLogger
().
error
(
"Unable to load keystore."
,
exception
)
;
}
}
return
kmf
;
return
kmf
;
...
@@ -257,7 +257,7 @@ public final class DispatchServer {
...
@@ -257,7 +257,7 @@ public final class DispatchServer {
server
=
this
.
safelyCreateServer
(
this
.
getAddress
());
server
=
this
.
safelyCreateServer
(
this
.
getAddress
());
}
}
HttpsServer
httpsServer
=
null
;
HttpsServer
httpsServer
;
try
{
try
{
httpsServer
=
HttpsServer
.
create
(
getAddress
(),
0
);
httpsServer
=
HttpsServer
.
create
(
getAddress
(),
0
);
...
...
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