20
|
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 }
|