1
0
mirror of https://github.com/deavmi/birchwood synced 2024-09-20 19:43:18 +02:00
Commit Graph

89 Commits

Author SHA1 Message Date
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
66cd409234 Package (protocol)
- Make `ReplyType` available
2023-03-15 21:29:07 +02:00
7c8208182f Client
- Added TODOs for comments
2023-03-15 20:24:05 +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
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