Commit Graph

19 Commits

Author SHA1 Message Date
Nikita Vilunov 4e8eb09184 reduce usage of unwraps (#70)
Reviewed-on: lavina/lavina#70
2024-06-04 21:54:57 +00: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 6749103726 scalability: initial support for remote rooms (#61)
Reviewed-on: lavina/lavina#61
2024-05-10 20:44:24 +00:00
Nikita Vilunov 8ac64ba8f5 get rid of storage usages in projections 2024-05-05 19:24:23 +02:00
Mikhail adf1d8c14c xmpp: Implement Message Archive Management stub for XEP-0313 (#60)
https://xmpp.org/extensions/xep-0313.html
Reviewed-on: lavina/lavina#60
Co-authored-by: Mikhail <mikhail@liamets.dev>
Co-committed-by: Mikhail <mikhail@liamets.dev>
2024-05-05 15:12:58 +00:00
Nikita Vilunov a87f7c9d73 xmpp: extract common fragments of integration tests into functions 2024-04-29 23:56:18 +02:00
Nikita Vilunov 31f9da9b05 xmpp: fix incorrect auth test 2024-04-29 19:13:32 +02:00
Nikita Vilunov 8ec9ecfe2c xmpp: handle incorrect credentials by replying with an error 2024-04-28 17:11:29 +02:00
Nikita Vilunov a047d55ab5 xmpp: handle correctly unavailable self-presence and improve basic test scenario 2024-04-28 15:43:22 +02:00
Nikita Vilunov ec49489ef1 validate that rooms and dialogs are owned exclusively on shutdown 2024-04-23 19:18:46 +02:00
Nikita Vilunov d305f5bf77 argon2-based password hashing (#55)
Reviewed-on: lavina/lavina#55
2024-04-23 16:31:00 +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 0105a5b710 persistent memberships (#49)
Reviewed-on: lavina/lavina#49
2024-04-15 09:06:10 +00:00
Nikita Vilunov 57b6af8732 xmpp: configurable server hostname (#47)
Reviewed-on: lavina/lavina#47
2024-04-15 00:33:26 +00:00
Nikita Vilunov 0944c449ca xmpp: in integration tests extract server startup code 2024-04-13 02:32:41 +02:00
Nikita Vilunov adece11fef xmpp: make xml-headers optional in the c2s stream 2024-04-06 22:37:27 +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
Nikita Vilunov 68c342aa44 xmpp: a basic integration test scenario (#26)
Reviewed-on: lavina/lavina#26
2023-10-13 20:06:40 +00:00