void TestFunc1() { ItemPackMsg msg = new ItemPackMsg(); msg.Items = new List <ItemMsg>(); ItemMsg item = new ItemMsg(); item.ID = 1; item.Name = "无忧草"; msg.Items.Add(item); item = new ItemMsg(); item.ID = 2; item.Name = "大力丸"; item.Attribs = new List <int>(); item.Attribs.Add(11); item.Attribs.Add(12); msg.Items.Add(item); item = new ItemMsg(); item.ID = 3; item.Name = "回生丸"; msg.Items.Add(item); CSerialize ar = new CSerialize(SerializeType.write); msg.Serialize(ar); FCLibHelper.fc_serialize_msg_call(0, "TestSerialize.ReceiveItemMsg", ar.GetBuffer(), 0, ar.GetBufferSize(), true); }
void TestFunc2() { ItemPack2 msg = new ItemPack2(); msg.Items = new Dictionary <int, ItemMsg>(); msg.Names = new Dictionary <int, string>(); ItemMsg item = new ItemMsg(); item.ID = 1; item.Name = "无忧草"; msg.Items[item.ID] = item; msg.Names[item.ID] = item.Name; item = new ItemMsg(); item.ID = 2; item.Name = "大力丸"; item.Attribs = new List <int>(); item.Attribs.Add(11); item.Attribs.Add(12); msg.Items[item.ID] = item; msg.Names[item.ID] = item.Name; CSerialize ar = new CSerialize(SerializeType.write); msg.Serialize(ar); FCLibHelper.fc_serialize_msg_call(0, "TestSerialize.ReceiveItemMsg2", ar.GetBuffer(), 0, ar.GetBufferSize(), true); }
void TestFunc0() { LoginMsg msg = new LoginMsg(); msg.szUserName = "******"; msg.szPassword = "******"; msg.nPlatType = 1; msg.szPlatName = "时空机"; CSerialize ar = new CSerialize(SerializeType.write); msg.Serialize(ar); FCLibHelper.fc_serialize_msg_call(0, "TestSerialize.ReceiveLoginMsg", ar.GetBuffer(), 0, ar.GetBufferSize(), true); }