Giter Site home page Giter Site logo

datchat's Introduction

datchat

datchat is a dirt simple client/server chat application written in Java. I wrote it because I was stuck using an terrible tool in an environment that did not support my needs, and I needed a basic reliable chat client.

datchat is written with a Swing front-end using a basic model-view-controller implementation for both the server and client applications. Currently it is expected that both client and server will be run in GUI mode, but a command-line version of either is easily doable.

datchat's People

Contributors

horatio-blackwood avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

tawn0s

datchat's Issues

Chat server should be configurable to offer multiple channels / rooms.

  • The channels should be defined in a properties file, perhaps like this?
    • server.channels=1:Lobby,2:Gaming,3:Music
  • The first channel in the list is where users are placed upon log in by default.
  • A CHANGE_CHANNEL MessageType will need to be added that supplies the necessary info to the server regarding the channel a user wishes to change to.
  • For now, all channels should be available to all users on the server. Permissions are not a thing. But maybe one day they could be....if this happens, password management will need to be considered....
    • store them in plaintext like this?
      • server.channels=1:Lobby:pw1,2:Gaming:pw2,3:Music:pw5 or like this:
      • server.channels=1:Lobby:None,2:Gaming:pw2,3:Music:pw5 (if the lobby has no password)
    • have the server generate them randomly at startup so the admin can distribute them.
    • Consider researching and implementing a more modern/proper password management system?

Server online/offline Schedule Configuration

Add a feature to server configurations that allows them to have scheduled online and offline times for automated on/off cycles.

For example you should be able to configure the server to come online at 6pm and go down every night at 12am - you would configure this in the configuration file or possibly through command line arguments.

If a connection is accepted and the client never completes handshaking, that client should be removed after a period of time.

Perhaps using a scheduled executor the Server could cull these on a periodic basis if any exist? Or a runnable could be scheduled for ~2 minutes or so after a connection is established to check whether the user has completely initialized and remove it if not.

Currently, such connections are started, a ClientThread is spawned and that client thread will block forever waiting on the invalid client to complete a connection - this is bad.

ChatMessage should be expanded and used for all communications between client and server

Chat Message currently has a string for the message and a message type. I propose is be updated with the following:

  • Message Type - enum representing message type
  • time - long representing when this message was originated. Is this client our server time? How important is it that these times stay on sync? Not very important yet, bit someday soon it probably will be. Probably the server could set this time when the messages were received or generated there....
  • Payload - an object that contains any necessary data needed to process the message. This could be smash casted after checking the message type to its correct type.
  • User - chat user who originated the message, could be server. Probably just a string to start but could become a more complex object
  • hostname - the hostname of the client that originated the message.

This would allow user status and chat messages to both be of type Chat Message, with the User Status or string as it's payload, paving the way for channel change messages, users having away status or password entry messages for password protected chat servers or rooms.

Apologies in advance for typos, did this on my phone.

Up arrow for entry History

When a user hits the up arrow, the previous chat message should be populated in the text entry box. If they hit it again, the one before that and so on. Not sure how many messages back this should go but something in the neighborhood of say....15-20 should do it.

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.