mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
Deletion, wrangling parents a little bit
This commit is contained in:
parent
8729de1312
commit
e4f35b29bd
4 changed files with 60 additions and 10 deletions
|
|
@ -68,6 +68,15 @@ pub fn start(config: WebConfig) {
|
|||
// Did the client miss any messages since the last subscribe?
|
||||
{
|
||||
let messages = config.message_session.messages.read().unwrap();
|
||||
|
||||
if cursor > messages.len() as i32 {
|
||||
return json_response(SubscribeResponse {
|
||||
server_id: &server_id,
|
||||
messages: &[],
|
||||
message_cursor: messages.len() as i32 - 1,
|
||||
});
|
||||
}
|
||||
|
||||
if cursor < messages.len() as i32 - 1 {
|
||||
let new_messages = &messages[(cursor + 1) as usize..];
|
||||
let new_cursor = cursor + new_messages.len() as i32;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue