javadoc fixes
#story[1188]
This commit is contained in:
@@ -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