mirror of
https://github.com/sbrl/Nibriboard.git
synced 2018-01-10 21:33:49 +00:00
[server] Add ExcecptionMessage
This commit is contained in:
parent
c4947474cd
commit
e8beaec1c3
3 changed files with 52 additions and 0 deletions
37
Nibriboard/Client/Messages/ExceptionMessage.cs
Normal file
37
Nibriboard/Client/Messages/ExceptionMessage.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
namespace Nibriboard.Client.Messages
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a tantrum thrown by either the server or the client.
|
||||
/// Both act like 2 year olds, apparently :P
|
||||
/// </summary>
|
||||
public class ExceptionMessage : Message
|
||||
{
|
||||
/// <summary>
|
||||
/// The number code associated with this exception.
|
||||
/// </summary>
|
||||
public uint Code = 0;
|
||||
/// <summary>
|
||||
/// The error message.
|
||||
/// </summary>
|
||||
public string Message = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new ExceptionMessage.
|
||||
/// </summary>
|
||||
/// <param name="inCode">The exception code.</param>
|
||||
/// <param name="inMessage">The exception message.</param>
|
||||
public ExceptionMessage(uint inCode, string inMessage)
|
||||
{
|
||||
Code = inCode;
|
||||
Message = inMessage;
|
||||
}
|
||||
/// <summary>
|
||||
/// Creates a new ExceptionMessage.
|
||||
/// </summary>
|
||||
/// <param name="inMessage">The exception message.</param>
|
||||
public ExceptionMessage(string inMessage) : this(0, inMessage)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -265,6 +265,20 @@ namespace Nibriboard.Client
|
|||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
/// <summary>
|
||||
/// Handles an incoming plane change request.
|
||||
/// </summary>
|
||||
protected Task handlePlaneChangeMessage(PlaneChangeMessage message)
|
||||
{
|
||||
if(manager.SpaceManager[message.NewPlaneName] == default(Plane))
|
||||
throw new NotImplementedException(); // todo create a new plane here
|
||||
|
||||
message.IsOK = true;
|
||||
|
||||
Send(message);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles an incoming cursor position message from the client..
|
||||
|
|
|
@ -91,6 +91,7 @@
|
|||
<Compile Include="Client\Messages\HeartbeatMessage.cs" />
|
||||
<Compile Include="Client\Messages\ChunkUpdateMessage.cs" />
|
||||
<Compile Include="Client\Messages\PlaneChangeMessage.cs" />
|
||||
<Compile Include="Client\Messages\ExceptionMessage.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="ClientFiles\index.html" />
|
||||
|
|
Loading…
Reference in a new issue