[FIX] AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Client.ViewModels
|
|||||||
public Color color;
|
public Color color;
|
||||||
public double[][] buffer;
|
public double[][] buffer;
|
||||||
public int pos = 0;
|
public int pos = 0;
|
||||||
public int maxLines = 1;
|
public int maxLines = 50;
|
||||||
public Queue<double[][]> linesQueue;
|
public Queue<double[][]> linesQueue;
|
||||||
private Timer queueTimer;
|
private Timer queueTimer;
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ namespace Client.ViewModels
|
|||||||
public void BeginGame()
|
public void BeginGame()
|
||||||
{
|
{
|
||||||
|
|
||||||
queueTimer = new Timer(500);
|
queueTimer = new Timer(50);
|
||||||
queueTimer.Start();
|
queueTimer.Start();
|
||||||
queueTimer.Elapsed += sendArrayFromQueue;
|
queueTimer.Elapsed += sendArrayFromQueue;
|
||||||
data.Client.SendMessage(JSONConvert.ConstructGameStartData(data.Lobby.ID));
|
data.Client.SendMessage(JSONConvert.ConstructGameStartData(data.Lobby.ID));
|
||||||
@@ -149,7 +149,7 @@ namespace Client.ViewModels
|
|||||||
{
|
{
|
||||||
Debug.WriteLine("[GAME] sending canvas data...");
|
Debug.WriteLine("[GAME] sending canvas data...");
|
||||||
double[][] temp = linesQueue.Dequeue();
|
double[][] temp = linesQueue.Dequeue();
|
||||||
data.Client.SendMessage(JSONConvert.GetMessageToSend(JSONConvert.CANVAS, JSONConvert.ConstructDrawingCanvasData(temp,color)));
|
data.Client.SendMessage(JSONConvert.ConstructDrawingCanvasData(temp,color));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -173,16 +173,13 @@ namespace SharedClientServer
|
|||||||
canvasType = CANVAS_WRITING,
|
canvasType = CANVAS_WRITING,
|
||||||
coords = buffer,
|
coords = buffer,
|
||||||
color = colorToSend
|
color = colorToSend
|
||||||
}); ;
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int GetCanvasMessageType(byte[] payload)
|
public static int GetCanvasMessageType(byte[] json)
|
||||||
{
|
{
|
||||||
dynamic json = JsonConvert.DeserializeObject(Encoding.UTF8.GetString(payload));
|
dynamic d = JsonConvert.DeserializeObject(Encoding.UTF8.GetString(json));
|
||||||
var temp = Convert.FromBase64String(json);
|
return d.canvasType;
|
||||||
string fdasf = System.Text.Encoding.UTF8.GetString(temp);
|
|
||||||
int cType = temp.canvasType;
|
|
||||||
return cType;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double[][] getCoordinates(byte[] payload)
|
public static double[][] getCoordinates(byte[] payload)
|
||||||
|
|||||||
Reference in New Issue
Block a user