Klasse Server

java.lang.Object
Server.Server

public class Server extends Object

Server

This is the Server for the Tic Tac Toe Game
!!!Attention the IPs must be set to the IPs of the Clients!!!
Version:
1.0
Autor:
Julian Lombardo, Diego Zwahlen, Lean Melone
  • Felddetails

    • playing

      public static boolean playing
    • board

      public static char[] board
  • Konstruktordetails

    • Server

      public Server()
  • Methodendetails

    • main

      public static void main(String[] args) throws Exception
      Mainfunction for the Server
      Parameter:
      args -
      Löst aus:
      Exception
    • win

      public static void win(InetAddress activePlayer, DatagramSocket socket, int fullCounter) throws IOException
      Handels the different kind of wins/draws
      Parameter:
      activePlayer -
      socket -
      fullCounter -
      Löst aus:
      IOException
    • boardToString

      public static String boardToString(char[] board)
      Transforms the board to a String
      Parameter:
      board -
      Gibt zurück:
      String
    • sendCurrentBoard

      public static void sendCurrentBoard(char[] board, InetAddress player1, InetAddress player2, DatagramSocket socket) throws IOException
      Sends current Board to all Players
      Parameter:
      board -
      player1 -
      player2 -
      socket -
      Löst aus:
      IOException
    • checkWin

      public static boolean checkWin(char[] board, char player)
      Checks for a win on the board
      Parameter:
      board -
      player -
      Gibt zurück:
      boolean
    • sendMessageToPlayer

      public static void sendMessageToPlayer(InetAddress Player, DatagramSocket socket, String msg) throws IOException
      Sends Messages to certain Players
      Parameter:
      Player -
      socket -
      msg -
      Löst aus:
      IOException