Introduce the ability of creating rooms on the server
This commit is contained in:
parent
0b1e372d11
commit
ebb5ffcedc
12 changed files with 302 additions and 128 deletions
|
@ -151,6 +151,7 @@ impl Server {
|
|||
|
||||
server
|
||||
.add_request_handler(Server::ping)
|
||||
.add_request_handler(Server::create_room)
|
||||
.add_request_handler(Server::register_project)
|
||||
.add_request_handler(Server::unregister_project)
|
||||
.add_request_handler(Server::join_project)
|
||||
|
@ -593,6 +594,16 @@ impl Server {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
async fn create_room(
|
||||
self: Arc<Server>,
|
||||
request: TypedEnvelope<proto::CreateRoom>,
|
||||
response: Response<proto::CreateRoom>,
|
||||
) -> Result<()> {
|
||||
let room_id = self.store().await.create_room(request.sender_id)?;
|
||||
response.send(proto::CreateRoomResponse { id: room_id })?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn register_project(
|
||||
self: Arc<Server>,
|
||||
request: TypedEnvelope<proto::RegisterProject>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue