Commit Graph

21 Commits

Author SHA1 Message Date
Mikhail 09abdd5346 Use vectors and commands 2024-05-23 18:02:35 +02:00
Nikita Vilunov 26720a2a08 core: separate the model from the logic implementation (#66)
This separates the core in two layers – the model objects and the `LavinaCore` service. Service is responsible for implementing the application logic and exposing it as core's public API to projections, while the model objects will be independent of each other and responsible only for managing and owning in-memory data.

The model objects include:
1. `Storage` – the open connection to the SQLite DB.
2. `PlayerRegistry` – creates, stores refs to, and stops player actors.
3. `RoomRegistry` – manages active rooms.
4. `DialogRegistry` – manages active dialogs.
5. `Broadcasting` – manages subscriptions of players to rooms on remote cluster nodes.
6. `LavinaClient` – manages HTTP connections to remote cluster nodes.
7. `ClusterMetadata` – read-only configuration of the cluster metadata, i.e. allocation of entities to nodes.

As a result:
1. Model objects will be fully independent of each other, e.g. it's no longer necessary to provide a `Storage` to all registries, or to provide `PlayerRegistry` and `DialogRegistry` to each other.
2. Model objects will no longer be `Arc`-wrapped; instead the whole `Services` object will be `Arc`ed and provided to projections.
3. The public API of `lavina-core` will be properly delimited by the APIs of `LavinaCore`, `PlayerConnection` and so on.
4. `LavinaCore` and `PlayerConnection` will also contain APIs of all features, unlike it was previously with `RoomRegistry` and `DialogRegistry`. This is unfortunate, but it could be improved in future.

Reviewed-on: lavina/lavina#66
2024-05-13 14:32:45 +00:00
Nikita Vilunov d1a72e7978 move repo methods into submodules and clean up warnings 2024-05-10 23:50:34 +02:00
Nikita Vilunov 8ac64ba8f5 get rid of storage usages in projections 2024-05-05 19:24:23 +02:00
homycdev abe9a26925 irc: implement WHOIS command (#43)
Reviewed-on: lavina/lavina#43
Co-authored-by: homycdev <abdulkhamid98@gmail.com>
Co-committed-by: homycdev <abdulkhamid98@gmail.com>
2024-05-05 17:21:40 +00:00
Nikita Vilunov 25605322a0 player shutdown API (#58)
Reviewed-on: lavina/lavina#58
2024-04-29 17:24:43 +00:00
Nikita Vilunov 4ff09ea05f tracing otlp exporter and instrumentation annotations (#57)
Resolves #56

Reviewed-on: lavina/lavina#57
2024-04-26 10:16:23 +00:00
Nikita Vilunov 799da8366c basic dialog implementation with irc and xmpp support (#53)
Reviewed-on: lavina/lavina#53
2024-04-23 16:26:40 +00:00
Nikita Vilunov d805061d5b refactor auth logic into a common module (#54)
Reviewed-on: lavina/lavina#54
2024-04-23 10:10:10 +00:00
Nikita Vilunov 12d30ca5c2 irc: implement server-time capability for incoming messages (#52)
Spec: https://ircv3.net/specs/extensions/server-time
Reviewed-on: lavina/lavina#52
2024-04-21 21:00:44 +00:00
Nikita Vilunov ddb348bee9 refactor lavina core by grouping public services into a new LavinaCore struct.
this will be useful in future when additional services will be introduced and passed as dependencies
2024-04-21 19:45:50 +02:00
Nikita Vilunov 048660624d irc: support registration with different order of NICK/USER/CAP END commands (#51)
Resolves #33

Reviewed-on: lavina/lavina#51
2024-04-16 11:35:14 +00:00
Nikita Vilunov 0105a5b710 persistent memberships (#49)
Reviewed-on: lavina/lavina#49
2024-04-15 09:06:10 +00:00
Nikita Vilunov d436631450 improve docs and split command handlers into methods (#40) 2024-03-26 16:26:31 +00:00
homycdev 4b1958b5ae irc: remove hardcoded text from welcome messages
- use server name in welcome message
- use app version of crate in app_version field

Reviewed-on: lavina/lavina#35
Co-authored-by: homycdev <abdulkhamid98@gmail.com>
Co-committed-by: homycdev <abdulkhamid98@gmail.com>
2024-03-15 00:54:55 +00:00
JustTestingV c6fb74a848 termination usage for stopping the socket connection gracefully (#34)
Reviewed-on: lavina/lavina#34
Co-authored-by: JustTestingV <JustTestingV@gmail.com>
Co-committed-by: JustTestingV <JustTestingV@gmail.com>
2024-02-18 16:46:29 +00:00
G1ng3r 7ff9ffdcf7 irc: send ERR_SASLFAIL reply for auth fails (#30)
Reviewed-on: lavina/lavina#30
Co-authored-by: G1ng3r <saynulanude@gmail.com>
Co-committed-by: G1ng3r <saynulanude@gmail.com>
2024-02-06 23:08:14 +00:00
Nikita Vilunov cefd6f8df0 irc: basic implementation of PLAIN SASL auth #8 (#28)
Reviewed-on: lavina/lavina#28
2023-12-08 02:47:09 +00:00
Nikita Vilunov f0b38545bf new irc integration tests (#25) 2023-10-09 11:35:41 +00:00
Nikita Vilunov 1a1136187e sanitize IRC parsing (#23) 2023-10-04 18:27:43 +00:00
Nikita Vilunov 854a244dbc split irc proejction into a separate crate (#18) 2023-09-30 23:34:35 +00:00