Giter Club home page Giter Club logo

fsst-battleships's People

Contributors

c2vi avatar damaric avatar delano1q avatar thomas1q avatar

Watchers

 avatar

fsst-battleships's Issues

server-sprint-2

this task no longer includes any message handling

  • make a class Player, of which an object is created, when ever a player connects. and added to the player Dict

  • this Player class holds things like the player_id, the connection obj, player_name.....

  • it gets all those things passed to the constructor

  • has a method: set_name(name), to set the name of the player

  • the handle_socket() is a function outside of the Server Class.

  • gets the following params: handle_socket(server_obj, player_obj)

  • and is run in another thread (which it already is)

  • the handle_message(server_obj, player_obj, message) gets those params

server start

branch: server-start
store each client-socket, the name in a dict and give them an id

  • that id is then also the key in the dict
  • also a variable for the next free id to give to the next connecting client

client-class

  • the client message handling

  • make a Client class (name: Client, file: client/main.py)

  • that listens for messages from the server and calls methods from the Gui Main Window class

  • and exposes methods, to interact with the game, for the Gui class to call

  • run the window (main gui class) in another thread

fix-server-conn

in server/main.py every conn gets set as self.conn, so when a new client connects, his connections overwrites the one from the old client.

handle-invalid-json-msg

When the server receives a message that is not valid json, then send back an error msg with the message: "what you sent was not valid JSON", and print "received a message that was not valid JSON"

client matchmaking gui

branch: client-gui
file: gui/matchmaking.py, gui/main.py

  • gui/main.py should be a wrapper widget, and a function, that starts the window, so that we can add header bars or something like that in the future
  • field, for inputing the name, and button to call an set_name() function in main.py
  • do if name == "main": in gui/main.py, so that you can run the window for testing (with some test data as well)
  • expose methods for the Client class to call, when it recieves messages from the server

server-game-class

add a game class in a file server/game.py which stores the state of a game, and has methods to get this game-state and do things to the game.

server-methods

improve (or add a way) the way code from the handle_message accesses game state (like the list of players)
make a method for all the things the handle_message function has to do (for that go through the proto.md file)

eg: a method for getting the list of players: get_player_list()
and dfinetly one to send a message to another player: send_to_player(player_id, msg)

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.