Giter VIP home page Giter VIP logo

risc's Introduction

ece651-spr20-RISC

Android game in Java

grade: 97/100

prelude

Thanks to my teammate Kewei & Chendga. It is a great journey.

I am responsible for persisting data & recovering.

We use IntelliJ IDEA for editing & debugging

It is much better than Emacs

video demo for evo.2

evo.2

preview

login

login

room view

room

add room

addroom

choose territory

init

play

play

action

action

UML

link

evo.2

code structure

3 parts:

frontend

RiscClient/app/src/main/java/edu/duke/ece651/riskclient

backend

server/src/main/java/edu/duke/ece651/risk/server
shared/src/main/java/edu/duke/ece651/risk/shared

suggestions

persist & recover

I use Postgres to store the User name & password

I use MongoDB for storing gaming data, because the data is more like document.

I use Morphia for ODM, and use annotation to store the data.

db config:

server/src/main/java/edu/duke/ece651/risk/server/Mongo.java

save & recover

server/src/main/java/edu/duke/ece651/risk/server/Room.java

save in Room.java mainGame

Mongo m = new Mongo();
m.morCon().save(this);

recover in Room.java recover

Threading strategy

Server has thread pool to handle the incoming request.

Each room has 1 main thread, and each player thread has its own player thread & its own chat thread.

synchronization

We use barrier to make sure all info for all thread are up to date

Print out the info can help, but I think setting break point is much better

run game

My vm may stop working at this moment, and you need to config the MongoDB & Postgres to make it works.

client

in

RiscClient/app/src/main/java/edu/duke/ece651/riskclient/Constant.java
//local ip for debug, change it to where you run the server
public static final String HOST = "192.168.0.132"; 
public static final int PORT = 12345;

change the host

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.