1
0
mirror of https://github.com/deavmi/birchwood synced 2024-09-20 17:22:59 +02:00
Commit Graph

232 Commits

Author SHA1 Message Date
988b1686d7 Messages
- FIxed assertion in unit test
2023-03-17 08:37:13 +02:00
1af73cb9d3 Messages
- Added unit test for `splitting(string)`
2023-03-17 08:36:09 +02:00
fc9301f632 Message
- Implemented `splitting(string)` which returns a `string[]` of split parameters according to the rfc1459's ENBF
2023-03-17 08:35:23 +02:00
75f3f7b867 Messages
- Slightly improved trailer detection
- Added some TODOs and notes

Client

- Log the key-value parameters and trailer
2023-03-16 18:38:06 +02:00
c0a249a31c Constants
- Don't use octals
2023-03-16 18:19:01 +02:00
f120a566a7 Client
- Added TODO regarding what needs to be done to update the `"PRIVMSG"` sub-handler
2023-03-16 13:58:20 +02:00
8a808cf9f2 Client
- Test out new `getKVPairs()` and `getTrailing()`
2023-03-16 13:53:14 +02:00
0224f4554b Messages
- Added `getTrailing()` which returns the trailing text
- Added `getKVPairs()` which returns the key-value pairs
2023-03-16 13:52:29 +02:00
b34eaf0e4e Messages
- Added work-in-progress `parameterParse()` which attempts to parse parameters and trailing text (if any of both)
- Added `ppTrailing` for any possible trailing text
- Added `ppKVPairs` for any potential key-value pairs
- Call `parameterParse()` on initialization of a new `Message` object
2023-03-16 13:45:56 +02:00
b024a14c7a Client
- WIP
2023-03-16 13:20:46 +02:00
9134a437d5 Constants
- Apparently that syntax does octal number representation, I don't want that
2023-03-16 13:07:29 +02:00
9633e76c1c Constants
- Added `RPL_BOUNCE` support back with the new code `010` as per the IRCv3 spec
2023-03-16 13:05:32 +02:00
9070bf4573 Client
- Switched to `ReplyType.RPL_USPPORT`
2023-03-16 12:59:52 +02:00
c51d7f402f Merge branch 'master' into ircv3 2023-03-16 12:59:30 +02:00
d21229b899 Constants
- Typo fix
2023-03-16 12:56:28 +02:00
5782b84c5d Constants
- `005` is now `RPL_ISUPPORT` in ircv3 and not `RPL_BOUNCE` as in rf2812
2023-03-16 12:56:14 +02:00
2c25a20ffb Merge branch 'master' into rfc2812 2023-03-16 12:44:34 +02:00
e0f1f1f841 Merge branch 'master' into ircv3 2023-03-16 12:44:26 +02:00
f3b5246a1c Merge branch 'master' into ping_pong_fix 2023-03-16 08:41:13 +02:00
246e3d1474 Merge branch 'master' into ircv3 2023-03-16 08:40:19 +02:00
9ff29d177d Merge branch 'master' into rfc2812 2023-03-16 08:39:41 +02:00
9cc40938ee Receiver
- Added documentation for `rq`

Sender

- Added documentation for `sq`
2023-03-16 08:38:47 +02:00
d2acd08a98 Client
- Removed commented-out code
2023-03-16 08:37:04 +02:00
a0acaccdec Merge branch 'master' into rfc2812 2023-03-16 08:35:12 +02:00
93fecfaad5 Client
- Removed now-completed TODO
- Implemented `joinChannel(string[])`

Unit tests

- Use BNET test server
- Added test calls to `joinChannel(string[])`
2023-03-16 08:26:03 +02:00
66c3a02d6e Client
- Added missing documentation for `onDirectMessage`, `onChannelMessage`, `onGenericCommand` and `onCommandReply`
2023-03-16 08:17:56 +02:00
087eb954d1 Client
- Print out `RPL_BOUNCE` when it appears
2023-03-16 08:05:34 +02:00
66cd409234 Package (protocol)
- Make `ReplyType` available
2023-03-15 21:29:07 +02:00
3393b60993 Client
- Switch to BNET test server
2023-03-15 21:27:01 +02:00
d66bec5fa6 Client
- Switch back to BNET test server
2023-03-15 21:26:07 +02:00
09e8d2e1b7 Merge branch 'master' into rfc2812 2023-03-15 21:19:46 +02:00
57ce756120 Constants
- Added `ERR_NOCHANMODES`
2023-03-15 20:50:03 +02:00
454dc86e66 Constants
- Added `RPL_GLOBALUSERS` and `RPL_WHOISCERTFP`
2023-03-15 20:47:37 +02:00
3b0136d725 Constants
- Added `RPL_LOCALUSERS`
2023-03-15 20:43:09 +02:00
1f7e3a96af Constants
- Segmented into sections based on rfc
- Added a few new constants from RFC2812
- `RPL_BOUNCE` (`005`) is a numeric response to note as it has key-value pairs associated with it
2023-03-15 20:34:36 +02:00
7c8208182f Client
- Added TODOs for comments
2023-03-15 20:24:05 +02:00
672b8fee64 Client
- Added some TODOs for comments
2023-03-15 20:23:30 +02:00
681dfc042c Client
- Added TODO where response code handling needs to go
2023-03-15 20:07:10 +02:00
supremestdoggo
1fe990ac36 Minor edits 2023-03-15 12:43:10 -04:00
supremestdoggo
93ada2077b Change color functions 2023-03-15 12:33:31 -04:00
supremestdoggo
937494bfb0 Move formatting.d and add formatting functions 2023-03-15 12:26:12 -04:00
supremestdoggo
e785fbf8b6
Merge branch 'deavmi:master' into master 2023-03-15 12:16:44 -04:00
2a50c8efbb Unit tests
- Switch back to my IPv6-only server for testing
2023-03-15 17:15:25 +02:00
a42d913236 Receiver
- Parse all messages into a `Message` array (`SList`)
- If a PING is found then we put it aside and check if we have one and then reply
- The PING is removed and all normal messages remain and then get EVenty events triggered for them for `IRCEvent`
2023-03-15 17:13:30 +02:00
512eff727b Client
- Use freenode to test with for a little
2023-03-15 16:57:52 +02:00
f0ae335419 Receiver
- Documented a bug with the PING detection (#13)
2023-03-15 16:51:46 +02:00
44cce182ae ConnectionInfo
- Set default `fakeLag` to `1`
- Added `getFakeLag()` and `setFakeLag()`

Client

- Added `getConnInfo()` to return the client's associated `ConnectionInfo`

Sender

- Use the fakelag configured by user
2023-03-15 16:32:49 +02:00
044625194d Client
- Updated unittests to not use `command(Message)`
2023-03-15 08:56:56 +02:00
a00294989d Client
- Unittest now uses IPv6 accessible IRC server
- Placed any unittest-related imports into a `version(unittest) { ... }` block
2023-03-15 08:53:51 +02:00
9f6ab528c2 Client
- Updated header documentation for `sendMessage(Message)`
2023-03-15 08:47:40 +02:00
e4e1aaf0f4 Unit tests
- Updated unit test with some TODOs
2023-03-15 08:46:38 +02:00
75155795fa Client
- Updated `command(Message)` to use `sendMessage(Message)`
- Updated the `PongSignal` event handler to use `sendMessage(Message)` when sending the pong back
- Make `quit()` use the new `sendMessage(Message)`
- Disabled old `sendMessage(string)`
2023-03-15 08:43:45 +02:00
2b25f4933a Client
- Both variants of `channelMessage(..., ...)` now use `sendMessage(Message)`
2023-03-15 08:39:38 +02:00
52dbd12a24 Client
- `directMessage(string, string[])` now uses `sendMessage(Message)`
- `directMessage(string, string)` now uses `sendMessage(Message)`
2023-03-15 08:36:39 +02:00
4690c5a6c3 Client
- Updated `joinChannel(string)` to use `sendMessage(Message)`
- Added TODO relating to implementing `joinChannels(string[])`
- `leaveChannel(string[])` now uses the new `sendMessage(Message)`
- `leaveChannel(string)` now uses the new `sendMessage(Message)`
2023-03-15 08:32:14 +02:00
11dbd1a96f Client
- Fixed compilation error by adding missing `encodeMessage(string)` call
- If the encoded message (CRLF included) is over 512 bytes then throw an exception

Exceptions

- Added new `ErrorType` enum member
2023-03-15 08:24:56 +02:00
256369abc5 Client
- Implememted `sendMessage(Message)`
2023-03-15 08:19:07 +02:00
12883f93db Client
- Added a TODO
- Removed now-completed TODO
2023-03-14 23:58:22 +02:00
1f1796930d Messages
- Removed implicit `static`
- Added documentation to `ubyte[] encodeMessage(string)`
2023-03-14 23:57:40 +02:00
f4a2a75094 Formatting
- Added module `formatting` to hold formatting subroutines and constants

Package

- Publically import `birchwood.protocol.formatting`
2023-03-14 23:30:19 +02:00
supremestdoggo
7198a2dec6 Add missing semicolons 2023-03-13 15:03:38 -04:00
supremestdoggo
464773daa8 Edit colors and add more control codes 2023-03-13 14:58:49 -04:00
supremestdoggo
8c8c226742 Create formatting.d 2023-03-13 14:46:39 -04:00
d27843c842 Client
- When sending a pong back log its pong ID
2023-03-11 15:49:36 +02:00
1bdc68774f Client
- Fixed a possible bug whereby the `Receiver` and `Sender` may exit on start as they get to their `client.running` read before the main thread gets to setting `running = true`
2023-03-11 15:15:11 +02:00
40e7a3b2b9 Client
- Cleaned up comments
2023-03-11 15:13:18 +02:00
97220b7f99 Client
- Added some missing comments
2023-03-11 15:11:32 +02:00
269aaf0018 Client
- Removed unused import
- Added comment for future work
- Fixed typo

Receiver

- Added commented out code for future work

Sender

- Added commented out code for future work
2023-03-11 15:09:45 +02:00
f30fc6b18c Receiver
- On call to `rq(byte[])` by the `Client` thread wake up the `Receiver` thread
- Added a TODO about the first call to `notifyAll()`
- Added a `wait()` call
- Removed `yield()` calls

Sender

- On call to `sq(byte[])` by the `Client` thread wake up the `Sender` thread
- Added a TODO about the first call to `notifyAll()`
- Added a `wait()` call
- Removed `yield()` calls

Client

- Ensure we wake up the `Receiver` and `Sender` threads such that they don't hang on their calls to `wait()`
- Added a TODO comment
2023-03-10 21:19:14 +02:00
3e5113f4a1 Client
- Removed unneeded import
2023-03-10 17:26:28 +02:00
e3b2be121b Receiver
- Instead of locking, processing a potential pong and ONE normal message and then unlocking, now we process all messages we have
2023-03-10 17:26:06 +02:00
9d7682bfdb Events
- Moved `IRCEventType`, `IRCEvent` and `PongEvent` to a new module `events`

Client

- Removed old `recvQueue`, `sendQueue`, their respective locks and threads
- Removed any initializations of the aforementioned
- Added calls to start the `ReceiverThread` and `SenderThread` on call to `connect()`
- Updated `disconnect()`, `sendMessage(string)` and `receiveQ(ubyte[])` to use the new `ReceiverThread` and `SenderThread`

Receiver

- Added missing import
2023-03-09 18:36:41 +02:00
d89fe0fd06 Sender
- Added `sq` (send queue append) method

Receive

- Added `rq` (receive queue append) method
2023-03-09 15:47:52 +02:00
b5e1b4065f Client
- Added TODOs

Exceptions

- Added TODO
2023-03-09 15:40:20 +02:00
d75d5407fd Client
- Updated imports
- Moved `IRCEvent`, `IRCEventType` and `PongEvent` outside of the `Client` class
- Made `engine`, `running` and `socket` package-level accessible

Package

- Fixed package for `client`

Main package

- Updated public imports for the `birchwood` package
2023-03-09 15:34:01 +02:00
586b80edbc ConnInfo
- Moved `conninfo` module to its own package `config`
2023-03-09 15:32:17 +02:00
32817d4134 Receiver
- Fixed conflicting symbol name `Event` arising from the use of `Eventy` and `libsnooze`
- Initialize the libsnooze event
- Initialize the queue mutex
- Set the thread's worker function

Sender

- Fixed conflicting symbol name `Event` arising from the use of `Eventy` and `libsnooze`
- Initialize the libsnooze event
- Initialize the queue mutex
- Set the thread's worker function

Protocol

- Moved module `message` to new package `protocol`
- Moved module `constants` to new package `protocol`
2023-03-09 15:31:30 +02:00
a006057c7f Merge branch 'master' into perf_rework 2023-03-09 14:35:27 +02:00
d8908338c5 Client
- Fixed bug with `directMessage(string, string[])` when more than one user in a multi-case was passed in

Unit tests

- Added two more unit tests relating to direct messages
- Namely testing out two scenarios for `directMessage(string, string[])`
2023-03-09 14:34:53 +02:00
50876ff231 Receiver
- Added missing `dur` import

Sender

- Added missing `dur` import

Exceptions

- Moved exceptions to its own module

Core/Client

- Renamed to `client`

Package

- Updated import for `client` module
- Added import of `BirchwoodException`
- Added import of `ConnectionInfo`

Conninfo

- Moved `ConnectionInfo` to its own module
2023-03-09 14:27:45 +02:00
8e9790a518 ReceiverThread
- Copied across `recvHandlerFunc()` from `Client`

SenderThread

- Copied across `sendHandlerFunc()` from `Client`
2023-03-09 11:30:51 +02:00
86cc450a37 SenderThread
- Renamed the field `receiveEvent` to `sendEvent`
2023-03-09 11:17:27 +02:00
3e25c70e37 Receiver
- Added a constructor for `ReceiverThread`

Sender

- Added a constructor for `SenderThread`
2023-03-09 11:16:53 +02:00
175138f91e Merge branch 'master' into perf_rework 2023-03-09 11:12:03 +02:00
802fd9823d Client
- Fixed bug whereby the leaving of multiple channels broke after the first channel in `leaveChannel(string[])`

Unit tests

- Test leaving multiple channels, a single channel (singular) and a single channel (multi)
2023-03-09 11:11:44 +02:00
b49c98484c Merge branch 'master' into perf_rework 2023-03-09 08:46:51 +02:00
7a9bc642ea Unit tests
- Corrected comment
2023-03-09 08:46:28 +02:00
8a0961a16c Merge branch 'master' into perf_rework 2023-03-09 08:45:49 +02:00
35ce86478d Unit tests
- Test `directMessage(string, string)` (so singular) to send to myself
- Adding such a test will test the direct message receive handler which helps us a lot in increasing code coverage
2023-03-09 08:44:09 +02:00
5155912bdd Unit tests
- Added a unit test for the (single) `channelMessage(string, string)`
2023-03-09 08:40:42 +02:00
fe91adde0a Client
- Fixed bug in `channelMessage(string, string[])` in the case where multiple channels were specified then the message would fail to send to the channels after the first one specified

Unit tests

- Disabled using `command(string, string, string)` to join a  channel, rather use `joinChannel(string)`
- Added tests for singular `channelMessage(string, string[])` and multiple `channelMessage(string, string[])`
2023-03-09 08:37:38 +02:00
a999482fc9 Receiver
- Added imports
- Added a receive queue with a corresponding mutex
- Added a field to hold the associated `Client` object

Send

- Added imports
- Added a send queue with a corresponding mutex
- Added a field to hold the associated `Client` object
2023-03-08 22:06:23 +02:00
8a9f48a3c7 Unit tests
- Don't use `command()` directly for joining channels but rather `joinChannel(string)`
- Added a test for multiple channel sending
2023-03-08 22:05:42 +02:00
1cd9b6b640 Merge branch 'master' into perf_rework 2023-03-08 20:19:10 +02:00
6f0a9e32ca Client
- Fixed bug within `channelMessage(string,string[])` which would leave the channel provided instead of sending the message provided to the the channel provided as it called `leaveChannel(channel[0])` instead of `channelMessage(string, string)`
2023-03-08 20:17:40 +02:00
72d473a5c4 Client
- Added comment to make this `Client` class abstract

Unit tests

- Added unit test to test `channelMessage(string, string[])`
2023-03-08 20:13:55 +02:00
ccff4017d6 Receiver
- Added a field of type `Event` to hold a libsnooze object representing when a new message has been received and is to be processed

Sender

- Added a field of type `Event` to hold a libsnooze object representing when a new message is to be sent and is to be processed
2023-03-08 17:40:22 +02:00
8e0854e5b5 Receiver
- Added stub class `ReceiverThread`

Sender

- Added stub class `SenderThread`
2023-03-08 17:36:05 +02:00
f32c8671c6 Receiver
- Added new module intended to be used for receiving data

Sender

- Added new module intended to be used for sending data
2023-03-08 17:32:03 +02:00
d0dd315e55 Packaging
- Re-worked the `birchwood.client` module into a package which publically imports the `birchwood.client.core` package
2023-03-08 17:30:39 +02:00
b9b2cb9c2e Client
- Disagnosed hot-loop causing high load average (and wasting run queue time with meaningless work)
- Offending functions are `sendHandlerFunc()` and `recvHandlerFunc()` and NOT eventy (as latest version doesn't do that
2023-03-08 17:24:41 +02:00
241f7753f5 Client
- Added TODOs where the Eventy calls must be temporarily removed (for now)
2023-03-08 17:19:21 +02:00
8812e247cb - Fixed unittest testing server address 2023-01-07 22:33:26 +02:00
b9b666ef6c Upgraded to new Eventy engine v0.4.0 2022-11-28 13:48:38 +02:00
f5b0fe5118 Added isValidText(string) method to return whether a given string is valid as in not containing any invalid illegal characters 2022-11-07 09:23:18 +02:00
3e01ef17d6 Added missing documentation header
Implemented `channelMessage(string, string[])` and `channelMessage(string, string)`
2022-11-06 11:38:02 +02:00
d7375b85a5 - Implemented directMessage(string, string[]) and removed the @disable annotation
- Implemented `directMessage(string,s tring)`
2022-11-06 11:08:47 +02:00
83e900834f Export messages.d 2022-11-05 23:26:21 +02:00
8e9e2daa3f This was NOT meant to be final! 2022-11-05 21:55:02 +02:00
035af34a31 - Implemented leaveChannel(string[]) and leaveChannel(string) 2022-11-05 20:42:31 +02:00
295562c7b4 Enabled unit tests to exit 2022-11-05 16:44:30 +02:00
1ad1c63d85 - Updated onGenericCommand() and onResponse() handlers to include the from field
- Implemented PRIVMSG handling for both channel and direct messages
2022-11-05 16:41:26 +02:00
b974da8151 Fixed bug which would have caused a possible crash? Well somewhere, I am not sure if thread spanwed is default in evwenty, in anyu case, fixed it 2022-11-05 16:31:19 +02:00
2fe16cab67 Cleaned up messages.d
Moved ReplyType to new module constants.d
2022-11-05 16:21:07 +02:00
4ebde0a0f7 - Added DNS resolution on hostnames 2022-11-05 13:07:13 +02:00
3f95a48186 - Disabled unimplemented methods with @disable
- Added ddoc headers to methods
2022-11-05 12:53:31 +02:00
919a0d09e9 - Added some documentation headers
- Removed uneeded TODO and FIXME
2022-11-05 12:41:52 +02:00
924ccbaacc - Calling quit() will now shutdown the whole client 2022-11-05 12:37:27 +02:00
fbf9ef9eb8 Fixed compilation error 2022-11-05 12:14:03 +02:00
729d3bc1c6 Implemented quit() command 2022-11-05 12:13:23 +02:00
6bdf6b4401 - Removed unused method ask()
- Removed unused public fields
- Quit message field been added to ConnectionInfo struct
2022-11-05 12:11:41 +02:00
441fd20302 - Removed testing code from processMessage(ubyte[])
- Implemented encode()
2022-11-05 12:10:51 +02:00
15d2fa2deb - Fixed a bug whereby an unsupported response code would cause a crash in the event handler
- Added a default response type (in case an unspported one comes in)
2022-11-03 17:05:27 +02:00
e2ba0bdb27 Client
- Moved the processing of command replies out or client.d and placed inside of messages.d
2022-11-02 18:55:30 +02:00
5f1d1b01fa Added following functionality:
- command(Message) - Let the user isssue a generic command
- joinChannel(string) - join the given channel
- When a numeric reply is received a Reply struct is now created containing a boolean indicating if there is an error, the ReplyType (as per the RFC) and the "params" (as a string), this is done via overriding the `onCommandReply(Reply)` method
- Added onGenericCommand(Message) - for when it doesn't have a special handler and is not a numeric reply (command response)
- Added special handler for private messages and channel messages (not used yet)
- WIP: PrivMesg handling

New types:

- Reply - response struct type
- ReplyType - the numeric response number
- Renamed Message fields
- Moved encode() and decode() into Message as static methods
2022-11-02 15:54:46 +02:00
a4b2862e81 New test shows the server name here could be anything so we have a working basic prototype (v0.0.1 onwards) 2022-11-01 14:08:04 +02:00
95366e941a Cleaned up 2022-11-01 13:58:42 +02:00
cbe41bff80 Eventy integration
- Fully integrated eventy
- PongEvent and IRCEvent along with respective GenericSignal and PingSignal handlers added
- Moved parsing of messages into Message class

Debugging

- Added dlog which always logs (for now, we should add a debug clause that enables it)
2022-11-01 13:41:39 +02:00
ce8dbd7f5e - Implemented Message type to hold messages
- Create IRCEvent type
- Print out information for handling of IRCEvent in the signal handler registered with Eventy
- Finished initial message parser (splits into `from`, `command` and `params`)
2022-10-31 19:24:10 +02:00
e4bb38c766 Implemented proof-of-concept eventy integration with a default event handler 2022-10-30 17:29:40 +02:00
6f20ef09fa Added initial working code 2022-10-30 16:59:50 +02:00
6c98959492 Initial commit 2022-10-29 18:04:00 +02:00