1
0
Fork 0
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:
Starbeamrainbowlabs 2017-03-04 21:49:51 +00:00
parent f3c2806243
commit b2be6e590b
11 changed files with 46 additions and 7 deletions

View 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);
}
}
}

View file

@ -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
{ {

View file

@ -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>

View file

@ -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)
{
}
} }
} }

View file

@ -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>

View file

@ -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" />

View file

@ -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(

View file

@ -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>

View file

@ -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.

View file

@ -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>

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Security.Policy;
namespace Nibriboard.RippleSpace namespace Nibriboard.RippleSpace
{ {
/// <summary> /// <summary>