1
0
Fork 0

[server] Create planes that don't exist if the client requests one

This commit is contained in:
Starbeamrainbowlabs 2017-04-16 15:54:29 +01:00
parent fa7fbfd0ac
commit 2b36c9a09d
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -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.");