Commit Graph

79 Commits

Author SHA1 Message Date
Tristan B. Velloza Kildaire 8f8a5e7662 Command
- Added a protected and final method `repack` which does  aruntime type-lookup-based encode of all the object's fields (based on its runtime type which is registered earlier)

CommandType

- Added `AUTH_COMMAND` and `LINK_REQUEST` members

Test

- Removed `repack()` method
- Made class final

Test (unittest)

- Improved unittest
2023-10-08 16:46:35 +02:00
Tristan B. Velloza Kildaire d455e8fc58 NopMessage
- Make `repack()` private
- Any setter fields, like `setTestField(string)`, now call `repack()` afterwards
2023-10-02 21:45:41 +02:00
Tristan B. Velloza Kildaire 473321e696 NopMessage
` Added `repack()` field to re-set the encoded data to the data of the `NopMessage`'s fields again
2023-10-02 21:36:54 +02:00
Tristan B. Velloza Kildaire 566e0cfaab Command
- Added a new final method `setEncoded(byte[])` which can be used to set the `Command`'s data field
- Documented `getEncoded()`
2023-10-02 21:33:05 +02:00
Tristan B. Velloza Kildaire a624be4a00 NopMessage
- Fixed `setTestField(string)` to not return
2023-10-02 20:55:03 +02:00
Tristan B. Velloza Kildaire 0fe4bb08d2 NopMessage
- Added `setTestField(string testField)`
2023-10-02 20:50:14 +02:00
Tristan B. Velloza Kildaire 401d7106b3 TestMessage
- Renamed to `NopMessage`
2023-10-02 20:23:17 +02:00
Tristan B. Velloza Kildaire 2f081b0d1a - Restructured module layout
- `TestMessage` now has a `toString()` override
2023-05-05 23:51:33 +02:00
Tristan B. Velloza Kildaire f230be0df7 - Added a `decode(byte[])` method (static) which returns a `BaseMessage` fully decoded 2023-05-05 09:51:54 +02:00
Tristan B. Velloza Kildaire 9783d28ba0 - Fixed `dub.json` 2023-05-05 09:48:20 +02:00
Tristan B. Velloza Kildaire 42489dfe70 - Only require at least version `1.0.4` of `msgpack-d` 2023-05-05 09:47:27 +02:00
Tristan B. Velloza Kildaire 41afd5326c - Added member `SPACER` to enum `CommandType` for testing 2023-05-05 09:46:58 +02:00
Tristan B. Velloza Kildaire 64ba57778a - Proper encoding/decoding 2023-05-05 09:45:57 +02:00
Tristan B. Velloza Kildaire 8810c1c369 Tools (package)
- Fixed the type passed to MessagePack's `unpack` method
2023-05-04 20:12:40 +02:00
Tristan B. Velloza Kildaire 7244117775 - Added `decodeTo!(T)(byte[])` 2023-05-04 19:46:42 +02:00
Tristan B. Velloza Kildaire dc135bbe6a TestMessage
- Created a testing message class which is a kind-of `C2SMessage`
- It has some fields such that we can see them being serialized

Unit tests

- Test serialization and deserialization of `TestMessage`
2023-05-04 19:11:10 +02:00
Tristan B. Velloza Kildaire 7f6f1db5ff C2SMessage
- Made this class `abstract`
2023-05-04 19:10:22 +02:00
Tristan B. Velloza Kildaire f08a15eeee Base
- Moved the import to the inside of `encode()` because we could make this serialization independent for future changes if we ever wanted to move away from MessagePack
2023-05-04 19:10:03 +02:00
Tristan B. Velloza Kildaire 3db2c5be5f Base
- Added an `encode()` method which will encode the message into a `byte[]` using MessagePack
2023-05-04 19:08:34 +02:00
Tristan B. Velloza Kildaire e6d13a99ce Merge branch 'master' of github.com:renaissanceorg/davinci 2023-03-26 12:08:54 +02:00
Tristan B. Velloza Kildaire 527b19b76f Server
- Added base `S2SMessage` representing the base message type for all server-to-server messages

Client

- Added base `C2SMessage` representing the base message type for all client-to-server messages
2023-03-26 12:08:02 +02:00
Tristan B. Velloza Kildaire a916300321
Create README.md 2023-03-26 11:43:06 +02:00
Tristan B. Velloza Kildaire e2ded51da6
Create d.yml 2023-03-26 11:42:07 +02:00
Tristan B. Velloza Kildaire 73ef4e15b3 Package (davinci)
- Added package module which publically imports `BaseMessage` and `MessageType`
2023-03-25 18:40:16 +02:00
Tristan B. Velloza Kildaire becd50a1ab Base
- Added documentation to `MessageType`
- Import `msgpack`
2023-03-25 18:39:31 +02:00
Tristan B. Velloza Kildaire eb15bd461e BaseMessage
- Added a constructor which takes in the `MessageType` and sets it
- Added a getter to receive the `MessageType`
2023-03-25 18:02:30 +02:00
Tristan B. Velloza Kildaire bbc2c4f343 - Moved module `davinci.base` to `davinci.base.base`
- Added type `BaseMessage` with a field `messageType`
- Added enum `MessageType` with members `CLIENT_TO_SERVER` and `SERVER_TO_SERVER`
2023-03-25 17:51:27 +02:00
Tristan B. Velloza Kildaire 8d32163318 - Added `msgpack-d` as a dependency
- Added `base` module
2023-03-25 17:23:15 +02:00
Tristan B. Velloza Kildaire 44a2dcd083 - Added dub package description
- Added `.gitignore`
2023-03-25 17:06:39 +02:00