mirror of
https://github.com/sbrl/Nibriboard.git
synced 2018-01-10 21:33:49 +00:00
[server] Create planes that don't exist if the client requests one
This commit is contained in:
parent
fa7fbfd0ac
commit
2b36c9a09d
2 changed files with 3 additions and 3 deletions
|
@ -290,7 +290,7 @@ namespace Nibriboard.Client
|
||||||
{
|
{
|
||||||
// Create a new plane with the specified name if it doesn't exist already
|
// Create a new plane with the specified name if it doesn't exist already
|
||||||
if(manager.SpaceManager[message.NewPlaneName] == default(Plane))
|
if(manager.SpaceManager[message.NewPlaneName] == default(Plane))
|
||||||
throw new NotImplementedException("Plane creation hasn't been implemented yet"); // todo create a new plane here
|
manager.SpaceManager.CreatePlane(message.NewPlaneName);
|
||||||
|
|
||||||
// Remove the event listener from the old plane if there is indeed an old plane to remove it from
|
// Remove the event listener from the old plane if there is indeed an old plane to remove it from
|
||||||
if(CurrentPlane != null)
|
if(CurrentPlane != null)
|
||||||
|
@ -300,7 +300,7 @@ namespace Nibriboard.Client
|
||||||
// Attach a listener to the new plane
|
// Attach a listener to the new plane
|
||||||
CurrentPlane.OnChunkUpdate += handleChunkUpdateEvent;
|
CurrentPlane.OnChunkUpdate += handleChunkUpdateEvent;
|
||||||
|
|
||||||
// Tell the client that the switchove all went according to plan
|
// Tell the client that the switch over all went according to plan
|
||||||
message.IsOK = true;
|
message.IsOK = true;
|
||||||
Send(message);
|
Send(message);
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ namespace Nibriboard.RippleSpace
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="newPlaneName">The name of the new plane to create.</param>
|
/// <param name="newPlaneName">The name of the new plane to create.</param>
|
||||||
/// <returns>The newly created plane.</returns>
|
/// <returns>The newly created plane.</returns>
|
||||||
protected Plane CreatePlane(string newPlaneName)
|
public Plane CreatePlane(string newPlaneName)
|
||||||
{
|
{
|
||||||
if(this[newPlaneName] != null)
|
if(this[newPlaneName] != null)
|
||||||
throw new InvalidOperationException($"Error: A plane with the name '{newPlaneName}' already exists in this RippleSpaceManager.");
|
throw new InvalidOperationException($"Error: A plane with the name '{newPlaneName}' already exists in this RippleSpaceManager.");
|
||||||
|
|
Loading…
Reference in a new issue