Giter Club home page Giter Club logo

gomoku's Introduction

Program:

  • A Networked Gomoku Game

Author:

  • InsidiousMind and Romulus10

GitHub Repository

Compile:

  • cd Gomoku
  • make

run:

  • build/bin/server database_file_name
  • python3 build/bin/curses-client.py

scripts:

  • Scripts in the ./scripts/ directory should be invoked from the root of the repository, they allow ease of testing.

Wiki

Wiki

Feel free to clone and contribute!

What is Gomoku?

Go means 5, moku is a word for pieces, and narabe a word for line up

So it's basically just Five-In-A-Row.

In this variation of Gomoku, player 1 (black) goes first and always places their piece in the middle

gomoku's People

Contributors

romulus10 avatar

Watchers

 avatar  avatar

gomoku's Issues

Handles Signals, in a way which doesn't screw everything up

Not sure whether to put this in part 2 or 3,

I still have the suspicion that sending ctrl-C in the client when the server is up (in a terminal) send the ctrl-C signal TO the server, and the server ends.

Need to read up on Beej's signal handling guide a bit more.

Wrong Color

The FIRST PLAYER TO CONNECT should be the first player to move. Currently, no matter which player you are it tells you that the other player selected the middle piece. We could also just make it so that the board is smart enough to keep track of what color it's client is playing as.

CLI

Build the CLI with both a command processor and a translator from text to GIPS

Decide on code standards

Ok, so, every programmer has their own style. But for the purposes of this project we should decide on one in order to maintain some kind of fluency throughout.

I feel like we have some of it down :
2space indents
Brackets don't have their own lines

Things we should figure out:
I feel like we should use camelCase but we have both been like, alternative between doing_something_like_this and camelCase
We should probably make that all camelCase as per most standards

Can't think of anything else that's different, but there probs is

PS - il fix where I made the brackets with their own lines :P

Client side waiting for client to connect

Client side, a waiting client should wait for a flag which means that the client has connected
the flag will be an integer.
should be set to:
isOtherPlayerConnected = FALSE.
at first
it should be blocking, IE
printf('Waiting for other player to connect...");
recv(sockfd, &isOtherPlayerConnected, sizeof(int), 0);
//\
Client Logic
////////
(recv is blocking by description)

parseQuery method in Client

If the player has a uniquePID that's registered and wants to see it's wins/losses then they should be able to go

? info

or something like that and get a message back from the server with a player struct.

right now it just accepts two digits

Game Hangs on Second Turn

Alright, in the server_v2 branch I broke something drastically. I sent a move from player 2 and neither player thinks it's their turn now.

Last Client to Connect Monolpoizes Process

The way it stands in this version, the last client to connect to the server perpetually receives the signal that it's the other player's turn. The other player can then send packets as long as he wants.

Server Restart

The server has to be restarted between every game or player 1 segfaults.

Implement a Lobby

A lobby where Players can talk to each other, and share each others Unique PID's to play Gomoku against each other.

Makefile

Create a Makefile that can handle producing built versions of all files.

Game Logic

Game Logic should be server-side, so that the client remains as lightweight as possible

Gomoku Rules:
Black always goes first, starting in the middle
first to hit five-in-a-row wins
once someone hits five in a row, server can send a message displaying who one, and close connection

Are we building one-player mode or two-player mode? B/C if one-player that means we have to build an AI to go with the game, too.

GIPS

Build the communication protocol between client and server.

Create a truly dynamic server

Rules for a truly dynamic server (I'm making this stuff up):

  1. If a client disconnects, at any time, the server should remain persistant and be able to accept other incoming connections, setting up games.
    I've made strides with implementing a Linked List that keeps track of socket descriptors. I may need to go one step further and dedicate a thread which all it does is:
    1. check if a socket connection is no longer valid
    2. check if sockets are still up
    3. if a connection is no longer valid, delete the corresponding entry in the linked list
  2. NEVER segfault, under any circumstance (duh)
  3. Be as responsive as possible

I'll probably add more rules as I discover more bugs. The server is maaaybbeee 40% of the way there already.

This is of high priority, because it's basically the uptime of the server. I never want this thing to crash, ever.

Inform Client if the other client disconnected

If a client disconnects mid-game, the server should gracefully inform the client which is still connected that the player has disconnected, and disconnect this client as well.

In the future, when a lobby exists, this client which is still connected should be given the option of being thrown back into the lobby or to disconnect

Incorporate Database with Server

I re-read through his project description and it seems like our structure should be like this:

Instead of sending the name to the server, the client can send their Unique Player ID (Of their choosing) up to 15 characters. Server will parse it and check if it's actually unique. Once this is done, the player will get back a structure with their player data (wins losses etc etc whatever Bi wants)

N'd dats it

serverside I'll keep a LinkedList and write to it, seperate from GIPS and the shared variable data. IT will read from and write to a file on start and finish

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.