Structure - AllenJB/polykephal GitHub Wiki
Server -> ClientThread -> IcecapProtocolHandler -> IrcProtocolHandler (protocol interface)
- Server: Handles listening port, creates ClientThreads from incoming connections.
- ClientThread: Handles individual client connections. Handles low level command interpretation.
- IcecapProtocolHandler: Handles non-protocol-specific Icecap protocol commands.
- IrcProtocolHandler: Handles IRC protocol specific commands. Deals with IRC server communication.
Other parts:
- Logger: Deals with logging and event/command storage / recall
- DataStore: Deals with on-disk data store
- Scripts: Scripting / Plugin interface. Not sure how to make this work yet. Look at QtPlugin and QtScript.
It may be better to split IcecapProtocolHandler into 3 separate parts:
-
IcecapMyPresenceHandler:
- 1 per MyPresence (IrcProtocolHandler / IRC server connection).
- Deals with ???
-
IcecapClientHandler:
- 1 per client (ClientThread / client connection).
- Deals with ???
-
IcecapHandler:
- 1 per PK instance.
- Keeps track of connected clients
- Allows broadcasting of events to all clients
- Deals with ???
The commands and events which don't have an associated Network (and thus the protocol isn't known) are:
- Networks (add / remove / rename)
- Events
- Client connect / disconnect
- Configuration / Settings
- Authentication
- List of available protocol (this is needed internally and would be useful for clients)
- Polykephal shutdown / restart - not sure how useful this would be, but might be nice to have anyway.
Things that need to be configured before Polykephal starts:
- Client authentication (could be handled by having an initial default username/password)
- Client communication encryption (if TLS, will need to be able to set the certificate)
- IP / Port to listen on