Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yannick Schinko
Dynmap-Multiserver
Commits
78f9f38d
Commit
78f9f38d
authored
Sep 15, 2015
by
leMaik
Browse files
Fix MapConfigHandler.
parent
38171881
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/net/cubespace/dynmap/multiserver/GSON/DynmapWorldConfig.java
View file @
78f9f38d
package
net.cubespace.dynmap.multiserver.GSON
;
import
java.util.List
;
/**
* @author geNAZt (fabian.fassbender42@googlemail.com)
*/
...
...
@@ -10,7 +12,7 @@ public class DynmapWorldConfig {
private
Boolean
isThundering
;
private
Integer
servertime
;
private
Integer
currentcount
;
private
Player
[]
players
;
private
List
<
Player
>
players
;
private
Integer
confighash
;
public
Long
getTimestamp
()
{
...
...
@@ -37,7 +39,7 @@ public class DynmapWorldConfig {
return
currentcount
;
}
public
Player
[]
getPlayers
()
{
public
List
<
Player
>
getPlayers
()
{
return
players
;
}
...
...
@@ -69,7 +71,7 @@ public class DynmapWorldConfig {
this
.
currentcount
=
currentcount
;
}
public
void
setPlayers
(
Player
[]
players
)
{
public
void
setPlayers
(
List
<
Player
>
players
)
{
this
.
players
=
players
;
}
...
...
src/main/java/net/cubespace/dynmap/multiserver/HTTP/Handler/MapConfigHandler.java
View file @
78f9f38d
...
...
@@ -14,9 +14,7 @@ import net.cubespace.dynmap.multiserver.GSON.DynmapWorldConfig;
import
net.cubespace.dynmap.multiserver.HTTP.HandlerUtil
;
import
net.cubespace.dynmap.multiserver.Main
;
import
static
io
.
netty
.
handler
.
codec
.
http
.
HttpHeaders
.
Names
.
CONNECTION
;
import
static
io
.
netty
.
handler
.
codec
.
http
.
HttpHeaders
.
Names
.
CONTENT_LENGTH
;
import
static
io
.
netty
.
handler
.
codec
.
http
.
HttpHeaders
.
Names
.
CONTENT_TYPE
;
import
static
io
.
netty
.
handler
.
codec
.
http
.
HttpHeaders
.
Names
.*;
import
static
io
.
netty
.
handler
.
codec
.
http
.
HttpResponseStatus
.
NOT_FOUND
;
import
static
io
.
netty
.
handler
.
codec
.
http
.
HttpResponseStatus
.
OK
;
import
static
io
.
netty
.
handler
.
codec
.
http
.
HttpVersion
.
HTTP_1_1
;
...
...
@@ -31,14 +29,14 @@ public class MapConfigHandler implements IHandler {
public
void
handle
(
ChannelHandlerContext
ctx
,
FullHttpRequest
request
)
throws
Exception
{
//Get the correct DynmapServer
String
world
=
request
.
getUri
().
split
(
"/"
)[
3
].
split
(
"\\."
)[
0
];
for
(
DynmapServer
dynmapServer
:
Main
.
getDynmapServers
())
{
for
(
DynmapWorld
dynmapWorld
:
dynmapServer
.
getWorlds
())
{
if
(
dynmapWorld
.
getName
().
equals
(
world
))
{
for
(
DynmapServer
dynmapServer
:
Main
.
getDynmapServers
())
{
for
(
DynmapWorld
dynmapWorld
:
dynmapServer
.
getWorlds
())
{
if
(
dynmapWorld
.
getName
().
equals
(
world
))
{
DynmapWorldConfig
dynmapWorldConfig
=
dynmapServer
.
getWorldConfig
(
dynmapWorld
.
getName
());
dynmapWorldConfig
.
setConfighash
(
0
);
dynmapWorldConfig
.
setPlayers
(
Main
.
getPlayers
());
dynmapWorldConfig
.
setCurrentcount
(
dynmapWorldConfig
.
getPlayers
().
length
);
dynmapWorldConfig
.
setCurrentcount
(
dynmapWorldConfig
.
getPlayers
().
size
()
);
String
responseStr
=
gson
.
toJson
(
dynmapWorldConfig
);
...
...
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