Coder Social home page Coder Social logo

gomoku-desktop's People

Contributors

cd3046 avatar oliviawyq avatar ws2505 avatar zksun95 avatar

Watchers

 avatar  avatar

Forkers

kmejia

gomoku-desktop's Issues

Room.java joinRoom method ignores all exceptions

In File : Gomoku-Desktop/server/src/main/java/com/gomoku/server/redis/model/Room.java

For method joinRoom the body automatically ignores any exception of type Exception, which is dangerous because it will mask critical programming errors.

 public boolean joinRoom(String audience){
        try{
            this.audience.add(audience);
            return true;
        }catch (Exception e){
            //System.out.println(e);
            return false;
        }
    }

GameStatus.java getAudience method returns mutable set

In file : Gomoku-Desktop/server/src/main/java/com/gomoku/server/websocket/model/GameStatus.java

The getAudience method insecurely returns a mutable field object (Set). For security concerns this can lead to uncontrolled modification of the object by a user. This can be fixed by returning a copy of the the audience set instead of the original set.

public Set<WebSocketSession> getAudience() {
        return audience;
   }

Room.java uses public void method instead of constructor

In file: Gomoku-Desktop/server/src/main/java/com/gomoku/server/redis/model/Room.java

In the following code we see the public class Room, and a public void method also called Room. This public void method was most likely meant to be a constructor, so to fix this just delete the void in the Room method to make it a constructor.

public class Room implements Serializable {
    @Id
    private String roomName;
    private String master;
    private String guest;
    private Set<String> audience;
    private boolean playing;
    private String gameNo;

    public void Room(String roomName, String master){
        this.roomName = roomName;
        this.master = master;
        this.audience = new HashSet<>();
    }

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.