Skip to content

ali-arslan/GamingAsAService

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The aim of the project is to implement a distributed Remote Desktop/VNC style application geared towards remote 'cloud' gaming.

Contents

This document is split into two parts:

  • Implementation details
  • Running Instructions

Implementation

The deployment scenario of the project is shown below:

Central Server

The central server acts like a directory service for the p2p network. Workers (ESPs) first connect to it when they wish to join the network and the server adds them to its database. When a user wishes to engage in a remote session it first contacts the central server which responds with a list of free workers. The user then forms a direct p2p link with the worker.

The central server communicates using the TCP protocol and is fully fault tolerant. This is implemented using a backup method which periodically saves the servers state to a file. Whenever the server is started (i.e. in the event of failure) it first checks whether a previously saved state exists and attempts to start from that.

ESP Worker

This is the main end point server from which users stream sessions/games. It makes three concurrent connections using different sockets:

· A connection to receive keyboard and mouse input from the client

  • A connection to stream video to the client
  • A persistent connection the central server

Java's robot class is used to apply received keyboard and mouse inputs from the client. A comma separated protocol has been defined for this. A push mechanism is used where the client pushes IO updates as soon as it receives them rather then polling for them.

Video is captured as screenshots at about 10 fps and send over the network as soon as taken.

Client

The client comprises of a frontend GUI made from JavaFX and a backend which handles the communications with the servers. Unlike the ESP worker and central server which are both command line applications, the server is completely GUI based. Input from keyboard and mouse within a JavaFX frame is captures and sent to the worker in real time using a dedicated socket. Similarly, video is streamed from the worker using a socket and displayed in the frame. A screenshot of the client is shown below:

Instructions to run:

Due to the distributed nature of the application, the endpoint servers (workers) must be run in different virtual physical machine on the same network.

First, compile and run the central server as follows:

  • javac -cp kryonet.jar Main.java NetworkMain.java Client.java
  • java -cp .:kryonet.jar Main

Remember to note down the address of the central server as it will be the main bootstrapping point.

Second, Compile and/or run the workers on as many virtual/physical machines as needed as follows:

  • javac -cp kryonet.jar Test.java
  • java -cp .:kryonet.jar Test

The worker will prompt for the central servers address.

Third, launch the client by navigating to javafxmainapp folder and launching terminal with:

  • javac -cp kryonet.jar Main.java
  • java -cp .:kryonet.jar Main

Now enter the central servers address in the field in the GUI and click connect. The status should update; if so, you may connect video and IO through respective buttons.

About

Cloud gaming service with 3 tier architecture

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published