Mercurial > hg > Database > jungle-sharp
comparison 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 |
comparison
equal
deleted
inserted
replaced
19:0865819106cf | 20:1f99e150f336 |
---|---|
1 using UnityEngine; | |
2 using System.Collections; | |
3 using MsgPack; | |
4 using System; | |
5 using JungleDB; | |
6 | |
7 public class NetworkPutAttributeOperationTest : MonoBehaviour { | |
8 | |
9 // Use this for initialization | |
10 void Start () { | |
11 byte[] value = System.Text.ASCIIEncoding.UTF8.GetBytes("test"); | |
12 NetworkPutAttributeOperation op = new NetworkPutAttributeOperation("hoge", value); | |
13 | |
14 ObjectPacker pack = new ObjectPacker(); | |
15 // send this byte to server. | |
16 byte[] packValue = pack.Pack(op); | |
17 | |
18 ObjectPacker unpack = new ObjectPacker(); | |
19 NetworkPutAttributeOperation nOp = unpack.Unpack<NetworkPutAttributeOperation>(packValue); | |
20 print(System.Text.ASCIIEncoding.UTF8.GetString(nOp.getValue())); | |
21 print (nOp.getCommand()); | |
22 } | |
23 } |