Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genie_logiciel_2015
the_dungeon_project
Commits
7fd4ca9c
Commit
7fd4ca9c
authored
Jan 06, 2016
by
Bogdan
Browse files
Some minor modifications...
parent
4a24d57a
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/graphics/guiSkeleton/guiPanel/menuPanel/ServerAddressPanel.java
View file @
7fd4ca9c
...
...
@@ -57,7 +57,7 @@ public class ServerAddressPanel extends MenuPanel{
private
ActionListener
serverButtonActionListener
=
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
actionEvent
)
{
RPCServer
.
main
();
RPCServer
.
startServer
();
getGraphicsMaster
().
changeGUIStateTo
(
GraphicsMaster
.
GUIStates
.
SERVER_CREATED_PANEL
);
}
};
...
...
src/network/innershell/LoungeServer.java
View file @
7fd4ca9c
...
...
@@ -8,7 +8,7 @@ import network.outershell.Lounge;
/**
* Created by bogdanbear on 20/11/2015.
*/
public
class
LoungeServer
{
public
class
LoungeServer
extends
Thread
{
private
Lounge
lounge
;
private
int
numberOfPlayers
;
public
LoungeServer
(
Lounge
lounge
,
int
numberOfPlayers
)
...
...
@@ -16,12 +16,27 @@ public class LoungeServer {
this
.
lounge
=
lounge
;
this
.
numberOfPlayers
=
numberOfPlayers
;
}
public
void
initiateServer
()
@Override
public
void
run
()
{
ServerConnection
serverConnection
=
new
ServerConnection
(
lounge
.
getPort
(),
0
,
true
,
lounge
.
MAX_PLAYERS
);
Logging
.
getInstance
().
getLogger
().
info
(
"Server started second phase, initialization done"
);
ServerLoop
dummyServerLoop
=
new
ServerLoop
(
serverConnection
);
dummyServerLoop
.
start
();
notifyOnIt
();
}
public
synchronized
void
notifyOnIt
()
{
notify
();
}
public
synchronized
void
waitOnIt
()
{
try
{
wait
();
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
}
src/network/outershell/server/RPCServer.java
View file @
7fd4ca9c
...
...
@@ -14,7 +14,7 @@ import java.util.logging.Logger;
public
class
RPCServer
{
public
static
int
scale
=
25
;
private
static
Logger
LOGGER
=
Logging
.
getInstance
().
getLogger
();
public
static
void
main
()
public
static
void
startServer
()
{
try
{
LocateRegistry
.
createRegistry
(
1099
);
...
...
@@ -24,5 +24,9 @@ public class RPCServer {
LOGGER
.
warning
(
"RPCServer: Server failed: "
+
e
);
}
}
public
static
void
main
(
String
[]
arguments
)
{
startServer
();
}
}
src/network/outershell/server/Registrar.java
View file @
7fd4ca9c
...
...
@@ -67,7 +67,8 @@ public class Registrar extends UnicastRemoteObject implements RegisterInterface
waiting
.
put
(
genID
,
lounge
);
//instantiate a loungeServer on the serverside and then put it into motion
LoungeServer
loungeServer
=
new
LoungeServer
(
lounge
,
lounge
.
MAX_PLAYERS
);
loungeServer
.
initiateServer
();
loungeServer
.
start
();
loungeServer
.
waitOnIt
();
//after obtaining the genID the host will immediately launch joinGame
return
lounge
;
...
...
Write
Preview
Supports
Markdown
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