javadoc fixes
#story[1188]
This commit is contained in:
@@ -90,6 +90,7 @@ public class HostGameController extends Controller {
|
||||
* Connect to a socket
|
||||
* @param address address of the server
|
||||
* @param port port that the server is run off
|
||||
* @throws IOException socket error
|
||||
*/
|
||||
public void connectSocket(String address, int port) throws IOException {
|
||||
Socket socket = new Socket(address, port);
|
||||
@@ -99,6 +100,7 @@ public class HostGameController extends Controller {
|
||||
|
||||
/**
|
||||
* Menu button pressed. Prompt alert then return to menu
|
||||
* @throws IOException socket error
|
||||
*/
|
||||
public void menuBtnPressed() throws Exception {
|
||||
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
|
||||
|
||||
@@ -262,9 +262,6 @@ public class InGameLobbyController extends Controller {
|
||||
}.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Hosts a game.
|
||||
*/
|
||||
public void enterGameLobby(Socket socket, boolean isHost){
|
||||
try {
|
||||
|
||||
@@ -283,6 +280,7 @@ public class InGameLobbyController extends Controller {
|
||||
|
||||
/**
|
||||
* Menu button pressed. Prompt alert then return to menu
|
||||
* @throws IOException socket erro
|
||||
*/
|
||||
public void menuBtnPressed() throws IOException {
|
||||
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
|
||||
|
||||
@@ -7,22 +7,17 @@ import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import network.Messages.HostGame;
|
||||
import visualiser.app.MatchBrowserSingleton;
|
||||
import visualiser.model.RaceConnection;
|
||||
import visualiser.network.MatchBrowserClientRunnable;
|
||||
import visualiser.network.MatchBrowserInterface;
|
||||
import visualiser.network.MatchBrowserLobbyInterface;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.DatagramSocket;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketException;
|
||||
import java.net.URL;
|
||||
import java.util.Observable;
|
||||
import java.util.Observer;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* Controller for the Lobby for entering games
|
||||
@@ -87,6 +82,7 @@ public class LobbyController extends Controller {
|
||||
|
||||
/**
|
||||
* Connect to a connection.
|
||||
* @throws IOException socket error
|
||||
*/
|
||||
public void connectSocket() throws IOException {
|
||||
RaceConnection connection = lobbyTable.getSelectionModel().getSelectedItem();
|
||||
|
||||
@@ -38,6 +38,7 @@ public class TitleController extends Controller {
|
||||
/**
|
||||
* To be implemented at a later date- will open the next scene displaying
|
||||
* games a player can join. Place holder method for now!
|
||||
* @throws IOException socket error
|
||||
*/
|
||||
public void joinAGame() throws IOException {
|
||||
loadScene("lobby.fxml");
|
||||
|
||||
@@ -20,6 +20,7 @@ public class SeaSurface {
|
||||
* @param size size of the sea surface (has to be square for simplicity's sake)
|
||||
* @param freq frequency the perlin noise is to be generated at
|
||||
* @param x offset that the sea should be set at position-wise
|
||||
* @param y offset that the sea should be set at position-wise
|
||||
* @param z offset that the sea should be set at position-wise
|
||||
*/
|
||||
public SeaSurface(int size, double freq, double x, double y, double z){
|
||||
|
||||
@@ -2,20 +2,18 @@ package visualiser.network;
|
||||
|
||||
import network.BinaryMessageEncoder;
|
||||
import network.Exceptions.InvalidMessageException;
|
||||
import network.MessageDecoders.HostedGamesRequestDecoder;
|
||||
import network.MessageEncoders.HostGameMessageEncoder;
|
||||
import network.MessageEncoders.HostedGamesRequestEncoder;
|
||||
import network.Messages.AC35Data;
|
||||
import network.Messages.Enums.MessageType;
|
||||
import network.Messages.HostGamesRequest;
|
||||
import shared.model.RunnableWithFramePeriod;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.*;
|
||||
import java.net.DatagramPacket;
|
||||
import java.net.DatagramSocket;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* UDP interface for the matchBrowser to send out hosted game info and get in other hosts info
|
||||
@@ -40,6 +38,7 @@ public class MatchBrowserInterface {
|
||||
* Used by host to send out race information to the server
|
||||
* @param gameInfo the hostGame info for message
|
||||
* @param socket the udp socket assigned on startup
|
||||
* @throws IOException socket error
|
||||
*/
|
||||
protected void sendOutGameInfo(AC35Data gameInfo, DatagramSocket socket) throws IOException{
|
||||
byte[] fullMessageToSend;
|
||||
@@ -58,7 +57,9 @@ public class MatchBrowserInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* start to send these messages on repeat until game stopped
|
||||
* start to send these messages on repeat until game stopped
|
||||
* @param gameInfo hostgame data
|
||||
* @param socket socket to send to
|
||||
*/
|
||||
public void startSendingHostData(AC35Data gameInfo, DatagramSocket socket){
|
||||
MatchBrowserHostRunnable hostRunnable = new MatchBrowserHostRunnable(this, socket, gameInfo);
|
||||
@@ -69,6 +70,7 @@ public class MatchBrowserInterface {
|
||||
/**
|
||||
* Used by a client to setup a connection with the match browser server
|
||||
* @return the socket created for this connection
|
||||
* @throws IOException socket error
|
||||
*/
|
||||
public DatagramSocket setupMatchBrowserConnection() throws IOException{
|
||||
DatagramSocket clientSocket = new DatagramSocket();
|
||||
|
||||
@@ -27,6 +27,7 @@ public class MatchBrowserLobbyInterface extends Observable {
|
||||
|
||||
/**
|
||||
* start receiving game info
|
||||
* @param socket to receive from
|
||||
*/
|
||||
public void startReceivingHostData(DatagramSocket socket) {
|
||||
this.socket = socket;
|
||||
@@ -37,6 +38,8 @@ public class MatchBrowserLobbyInterface extends Observable {
|
||||
|
||||
/**
|
||||
* Used by client to received race information from the server
|
||||
* @param socket socket to read from
|
||||
* @throws IOException socket error
|
||||
*/
|
||||
protected void receiveGameInfo(DatagramSocket socket) throws IOException {
|
||||
byte[] data = new byte[64];
|
||||
@@ -47,7 +50,7 @@ public class MatchBrowserLobbyInterface extends Observable {
|
||||
try {
|
||||
HostGamesRequest message = (HostGamesRequest) hostedGamesRequestDecoder.decode(data);
|
||||
games = message.getKnownGames();
|
||||
System.out.println(games.get(0).getIp());
|
||||
// System.out.println(games.get(0).getIp());
|
||||
setChanged();
|
||||
notifyObservers();
|
||||
} catch (InvalidMessageException e) {
|
||||
@@ -57,6 +60,7 @@ public class MatchBrowserLobbyInterface extends Observable {
|
||||
|
||||
/**
|
||||
* Gets the host games
|
||||
* @return games to be returned in list
|
||||
*/
|
||||
public List<HostGame> getGames() {
|
||||
return games;
|
||||
|
||||
Reference in New Issue
Block a user