Mercurial > hg > Database > jungle-sharp
diff Test/jungle-network/operations/NetworkPutAttributeOperationTest.cs @ 20:1f99e150f336
fix folder and add Object Mapper.
author | Kazuma Takeda |
---|---|
date | Thu, 15 Dec 2016 22:52:48 +0900 |
parents | |
children | 1466993c104c |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Test/jungle-network/operations/NetworkPutAttributeOperationTest.cs Thu Dec 15 22:52:48 2016 +0900 @@ -0,0 +1,23 @@ +using UnityEngine; +using System.Collections; +using MsgPack; +using System; +using JungleDB; + +public class NetworkPutAttributeOperationTest : MonoBehaviour { + + // Use this for initialization + void Start () { + byte[] value = System.Text.ASCIIEncoding.UTF8.GetBytes("test"); + NetworkPutAttributeOperation op = new NetworkPutAttributeOperation("hoge", value); + + ObjectPacker pack = new ObjectPacker(); + // send this byte to server. + byte[] packValue = pack.Pack(op); + + ObjectPacker unpack = new ObjectPacker(); + NetworkPutAttributeOperation nOp = unpack.Unpack<NetworkPutAttributeOperation>(packValue); + print(System.Text.ASCIIEncoding.UTF8.GetString(nOp.getValue())); + print (nOp.getCommand()); + } +}