Commit 76620b0b66c51ccbb0bcab90f01c4a6f0573ff18
1 parent
68012fb0
Exists in
devel
Adds debug server
Showing
2 changed files
with
75 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,63 @@ |
| 1 | +/********************** | |
| 2 | +********LAVID********** | |
| 3 | +*******VLibras********* | |
| 4 | +*------------------------------------------------------------------------ | |
| 5 | +*Description: | |
| 6 | +*Server gets pts from Core (client) by TCP connection | |
| 7 | +*and runs the animations until a final tag is found. | |
| 8 | +*------------------------------------------------------------------------ | |
| 9 | +*Author: Claudiomar Araujo # claudiomar.araujo@lavid.ufpb.br | |
| 10 | +*------------------------------------------------------------------------ | |
| 11 | +***********************/ | |
| 12 | + | |
| 13 | +using UnityEngine; | |
| 14 | +using System; | |
| 15 | +using System.IO; | |
| 16 | +using System.Net; | |
| 17 | +using System.Net.Sockets; | |
| 18 | +using System.Collections.Generic; | |
| 19 | + | |
| 20 | +public class ServerDebug { | |
| 21 | + | |
| 22 | + private bool isReady = false; | |
| 23 | + private PlayerManager manager; | |
| 24 | + | |
| 25 | + public ServerDebug(PlayerManager manager) | |
| 26 | + { | |
| 27 | + this.manager = manager; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public bool IsNotReady { | |
| 31 | + get { return !isReady; } | |
| 32 | + } | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * Starts receiving of glosa and time from server. | |
| 36 | + * Stops when receive "FINALIZE". | |
| 37 | + */ | |
| 38 | + public void StartCommunication() | |
| 39 | + { | |
| 40 | + List<string> messages = new List<string>() { | |
| 41 | + "TESTE#1000", "TEST2'#2000", "FINALIZE" | |
| 42 | + }; | |
| 43 | + | |
| 44 | + Debug.Log("S.SC()"); | |
| 45 | + | |
| 46 | + foreach (string text in messages) | |
| 47 | + { | |
| 48 | + Message message = new Message(text); | |
| 49 | + | |
| 50 | + Debug.Log("S.SC(): Received: " + message.Text); | |
| 51 | + | |
| 52 | + if (message.Text.Equals("FINALIZE")) | |
| 53 | + { | |
| 54 | + isReady = true; | |
| 55 | + break; | |
| 56 | + } | |
| 57 | + else manager.enqueueMessage(message); | |
| 58 | + } | |
| 59 | + | |
| 60 | + Debug.Log("S.SC(): END"); | |
| 61 | + } | |
| 62 | + | |
| 63 | +} | |
| 0 | 64 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,12 @@ |
| 1 | +fileFormatVersion: 2 | |
| 2 | +guid: e7a0444f46906424a9edd021650e6cd0 | |
| 3 | +timeCreated: 1469631182 | |
| 4 | +licenseType: Pro | |
| 5 | +MonoImporter: | |
| 6 | + serializedVersion: 2 | |
| 7 | + defaultReferences: [] | |
| 8 | + executionOrder: 0 | |
| 9 | + icon: {instanceID: 0} | |
| 10 | + userData: | |
| 11 | + assetBundleName: | |
| 12 | + assetBundleVariant: | ... | ... |