1
0
Fork 0

[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!
@ -210,6 +219,8 @@ namespace Nibriboard.Client
Log.WriteLine($"[NibriClient#{Id}] Can't send a message as the client has disconnected."); Log.WriteLine($"[NibriClient#{Id}] Can't send a message as the client has disconnected.");
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 {