1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

[server+client] Compact messages a bit, and comfirm that IoTWeb is causing the invisible chunk issue

This commit is contained in:
Starbeamrainbowlabs 2017-08-05 22:04:51 +01:00
parent 03181dc54a
commit 69b7db4220
3 changed files with 13 additions and 3 deletions

View file

@ -197,7 +197,16 @@ namespace Nibriboard.Client
/// <param name="message">The message to send.</param> /// <param name="message">The message to send.</param>
public void Send(Message message) public void Send(Message message)
{ {
SendRaw(JsonConvert.SerializeObject(message)); try
{
string payload = JsonConvert.SerializeObject(message);
SendRaw(payload);
}
catch(Exception error)
{
Log.WriteLine("[NibriClient/#{0}] Error serialising message!", Id);
Log.WriteLine("[NibriClient/#{0}] {1}", Id, error);
}
} }
/// <summary> /// <summary>
/// Sends a raw string to the client. Don't use unnless you know what you're doing! /// Sends a raw string to the client. Don't use unnless you know what you're doing!
@ -211,6 +220,8 @@ namespace Nibriboard.Client
return false; return false;
} }
Log.WriteLine("[NibriClient/#{0}] Sending message with length {1}.", Id, message.Length);
client.Send(message); client.Send(message);
return true; return true;
} }

View file

@ -115,7 +115,7 @@ class ChunkCache
{ {
for (let chunkData of message.Chunks) { for (let chunkData of message.Chunks) {
let newChunkRef = new ChunkReference( let newChunkRef = new ChunkReference(
chunkData.Location.PlaneName, this.boardWindow.currentPlaneName,
chunkData.Location.X, chunkData.Location.X,
chunkData.Location.Y chunkData.Location.Y
); );

View file

@ -16,7 +16,6 @@ namespace Nibriboard.RippleSpace
/// The name of the plane that this reference is located on. /// The name of the plane that this reference is located on.
/// Mainly used by the serialisation system that sends things to the client. /// Mainly used by the serialisation system that sends things to the client.
/// </summary> /// </summary>
[JsonProperty]
public string PlaneName public string PlaneName
{ {
get { get {