ServerDebug.cs
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**********************
********LAVID**********
*******VLibras*********
*------------------------------------------------------------------------
*Description:
*Server gets pts from Core (client) by TCP connection
*and runs the animations until a final tag is found.
*------------------------------------------------------------------------
*Author: Claudiomar Araujo # claudiomar.araujo@lavid.ufpb.br
*------------------------------------------------------------------------
***********************/
using UnityEngine;
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Collections.Generic;
public class ServerDebug {
private bool isReady = false;
private PlayerManager manager;
public ServerDebug(PlayerManager manager)
{
this.manager = manager;
}
public bool IsNotReady {
get { return !isReady; }
}
/**
* Starts receiving of glosa and time from server.
* Stops when receive "FINALIZE".
*/
public void StartCommunication()
{
List<string> messages = new List<string>() {
"TESTE#1000", "TEST2'#2000", "FINALIZE"
};
Debug.Log("S.SC()");
foreach (string text in messages)
{
Message message = new Message(text);
Debug.Log("S.SC(): Received: " + message.Text);
if (message.Text.Equals("FINALIZE"))
{
isReady = true;
break;
}
else manager.enqueueMessage(message);
}
Debug.Log("S.SC(): END");
}
}