Skip to content

2. Server Side

양유성 (Yang Yoo Seong) edited this page Dec 6, 2016 · 5 revisions

2.1. Outline of Server-side System

2.1 - 1. Non-DB Server System

  • Device and environment :
    Eclipse Neon under MacOS (Sierra, 10.12) and WindowsOS(10)

  • Features :
    It will communicates with Client-side system with TCP based Sockets and I/O Streams.
    It also store a list of user that currently joined in server, with each user's ID, Nick name and I/O Stream instances.
    With this informations,

    1. Server will send and broadcast messages to appropriate users,
    2. and will get the state of user that if user is in-game or not.
  • In-Game Jobs :
    Server will provide a initial word for word relaying system and will get a result if one of users is lose.
    According to result, server will consider if they have to play remain game or not.
    Finally, if game is end, server will send a message to deleting a file to loser.
    When loser got that message, loser will delete its own random file.

2.1 - 2. DB Server System

  • Used DB :
    MariaDB
  • Device and environment :
    Synology NAS & phpMyAdmin & MySQL
  • Features :
    When user register to game system, DB will store its data with column [ID, PW, NICK] that contains user's ID, Password and nick-name.
    Furthermore, It will store win/lose counts of specific user, with column [ID, WIN, LOSE] that contains ID, win counts and lose counts. With this DB, we will implement a ranking system.
  • DB hierarchy :
    There are two tables under one database.

2.2. Instruction of classes in Server project

  • Data package

    • Room.java
      This class is Data Type class to save a room information and users of current room. It also saved the title and number of it.
    • User.java
      This class is Data Type class to save a user information that currently joining in server.
  • RoomServer Package

    • RoomManager.java
      This class is a process class to manage a specific room, take care of its users and broadcasts appropriate messages to the room.
    • Server.java
      This class is a main running class that initialize a socket of server and processing a information about specific users or rooms.
    • UserHandler.java
      This class is a main running class that implements a thread linked with a specific user that joining in the server. It will communicates with the user and processing jobs that the user requests.