mirror of
https://github.com/sbrl/Nibriboard.git
synced 2018-01-10 21:33:49 +00:00
[server] Start sorting out chunk synchronisation
This commit is contained in:
parent
f3c2806243
commit
b2be6e590b
11 changed files with 46 additions and 7 deletions
25
Nibriboard/Client/Messages/ChunkUpdateMessage.cs
Normal file
25
Nibriboard/Client/Messages/ChunkUpdateMessage.cs
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
using Nibriboard.RippleSpace;
|
||||||
|
|
||||||
|
namespace Nibriboard.Client.Messages
|
||||||
|
{
|
||||||
|
public class ChunkUpdateMessage : Message
|
||||||
|
{
|
||||||
|
List<Chunk> Chunks = new List<Chunk>();
|
||||||
|
|
||||||
|
public ChunkUpdateMessage()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new ChunkUpdateMessaage containing the given list of chunks.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="chunks">Chunks.</param>
|
||||||
|
public ChunkUpdateMessage(params Chunk[] chunks)
|
||||||
|
{
|
||||||
|
Chunks = new List<Chunk>(chunks);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
using RippleSpace;
|
using Nibriboard.RippleSpace;
|
||||||
|
|
||||||
namespace Nibriboard.Client.Messages
|
namespace Nibriboard.Client.Messages
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
namespace Nibriboard.Client.Messages
|
namespace Nibriboard.Client.Messages
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a message that is passed between the client and server - in either direction.
|
||||||
|
/// </summary>
|
||||||
public class Message
|
public class Message
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -9,7 +9,7 @@ using IotWeb.Common.Http;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SBRL.Utilities;
|
using SBRL.Utilities;
|
||||||
using Nibriboard.Client.Messages;
|
using Nibriboard.Client.Messages;
|
||||||
using RippleSpace;
|
using Nibriboard.RippleSpace;
|
||||||
|
|
||||||
namespace Nibriboard.Client
|
namespace Nibriboard.Client
|
||||||
{
|
{
|
||||||
|
@ -273,5 +273,13 @@ namespace Nibriboard.Client
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sends variable list of chunks to this client.
|
||||||
|
/// </summary>
|
||||||
|
protected async Task SendChunks(params ChunkReference[] chunkRefs)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace Nibriboard.Client
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The ripple space manager that this client manager is connected to.
|
/// The ripple space manager that this client manager is connected to.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public RippleSpaceManager SpaceManager;
|
public RippleSpaceManager SpaceManager { get; private set; }
|
||||||
|
|
||||||
private ClientSettings clientSettings;
|
private ClientSettings clientSettings;
|
||||||
public List<NibriClient> Clients = new List<NibriClient>();
|
public List<NibriClient> Clients = new List<NibriClient>();
|
||||||
|
@ -46,7 +46,7 @@ namespace Nibriboard.Client
|
||||||
clientSettings = inClientSettings;
|
clientSettings = inClientSettings;
|
||||||
canceller = inCancellationToken;
|
canceller = inCancellationToken;
|
||||||
|
|
||||||
spaceManager = inSpaceManager;
|
SpaceManager = inSpaceManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -85,6 +85,7 @@
|
||||||
<Compile Include="Client\Messages\ShutdownMessage.cs" />
|
<Compile Include="Client\Messages\ShutdownMessage.cs" />
|
||||||
<Compile Include="Client\Messages\IdleDisconnectMessage.cs" />
|
<Compile Include="Client\Messages\IdleDisconnectMessage.cs" />
|
||||||
<Compile Include="Client\Messages\HeartbeatMessage.cs" />
|
<Compile Include="Client\Messages\HeartbeatMessage.cs" />
|
||||||
|
<Compile Include="Client\Messages\ChunkUpdateMessage.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="ClientFiles\index.html" />
|
<EmbeddedResource Include="ClientFiles\index.html" />
|
||||||
|
|
|
@ -55,7 +55,7 @@ namespace Nibriboard
|
||||||
// Websocket setup
|
// Websocket setup
|
||||||
clientManager = new NibriClientManager(
|
clientManager = new NibriClientManager(
|
||||||
clientSettings,
|
clientSettings,
|
||||||
|
planeManager,
|
||||||
clientManagerCanceller.Token
|
clientManagerCanceller.Token
|
||||||
);
|
);
|
||||||
httpServer.AddWebSocketRequestHandler(
|
httpServer.AddWebSocketRequestHandler(
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Security.Policy;
|
using System.Security.Policy;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Nibriboard.RippleSpace
|
namespace Nibriboard.RippleSpace
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -4,7 +4,7 @@ using SBRL.Utilities;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SBRL.Utilities.Solutions;
|
using SBRL.Utilities.Solutions;
|
||||||
|
|
||||||
namespace RippleSpace
|
namespace Nibriboard.RippleSpace
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a client's state at a particular point in time.
|
/// Represents a client's state at a particular point in time.
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Nibriboard.RippleSpace
|
namespace Nibriboard.RippleSpace
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Security.Policy;
|
|
||||||
namespace Nibriboard.RippleSpace
|
namespace Nibriboard.RippleSpace
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in a new issue