Skip to content

Commit cf267e3

Browse files
(/usr/share/games/fortunes/science)
% The solution to a problem changes the nature of the problem. -- Peer
1 parent cbc5df8 commit cf267e3

File tree

2 files changed

+119
-2
lines changed

2 files changed

+119
-2
lines changed

Cargo.lock

Lines changed: 117 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rustpad-server/src/rustpad.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use tokio::sync::{broadcast, Notify};
1313
use warp::ws::{Message, WebSocket};
1414

1515
use crate::{database::PersistedDocument, ot::transform_index};
16-
1716
/// The main object representing a collaborative session.
1817
pub struct Rustpad {
1918
/// State modified by critical sections of the code.
@@ -31,6 +30,7 @@ pub struct Rustpad {
3130
/// Shared state involving multiple users, protected by a lock.
3231
#[derive(Default)]
3332
struct State {
33+
live_users: u128,
3434
operations: Vec<UserOperation>,
3535
text: String,
3636
language: Option<String>,
@@ -118,6 +118,7 @@ impl From<PersistedDocument> for Rustpad {
118118
let rustpad = Self::default();
119119
{
120120
let mut state = rustpad.state.write();
121+
state.live_users += 1;
121122
state.text = document.text;
122123
state.language = document.language;
123124
state.operations.push(UserOperation {

0 commit comments

Comments
 (0)