From 3202c30cb83a90d13b95a9607624560924f95581 Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Sun, 2 Feb 2020 19:20:27 -0600 Subject: [PATCH] doing some networking --- Assets/Scripts/Networking.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Assets/Scripts/Networking.cs b/Assets/Scripts/Networking.cs index a0b3c60..50c13bb 100644 --- a/Assets/Scripts/Networking.cs +++ b/Assets/Scripts/Networking.cs @@ -91,7 +91,16 @@ public class Networking : ScriptableObject { Debug.LogFormat("Readbuffer count: {0} offset: {1}", readBuffer.Count, readBuffer.Offset); string msg = Encoding.UTF8.GetString(readBuffer.Array, 0, result.Count); string[] parts = msg.Split(new char[]{' '}, 2); + if (parts.Length != 2) { + Debug.LogFormat("dunno how to handle this msg: {0}", msg); + return; + } Debug.LogFormat("first: {0} second: {1}", parts[0], parts[1]); + switch (parts[0]) { + + default: + break; + } } private void autoDisconnect() {