| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A8 01 获得奖励信息 #tagMCGiveAwardInfo
|
| | |
|
| | | public class HA801_tagMCGiveAwardInfo : GameNetPackBasic {
|
| | | public byte EventLen;
|
| | | public string EventName;
|
| | | public uint Exp; // 奖励经验,求余亿部分
|
| | | public uint ExpPoint; // 奖励经验,整除亿部分
|
| | | public byte MoneyLen;
|
| | | public tagMCGiveAwardMoney[] MoneyList; // 奖励货币
|
| | | public byte ItemLen;
|
| | | public tagMCGiveAwardItem[] ItemList; // 奖励物品
|
| | | public ushort DataLen;
|
| | | public string DataEx; // 扩展信息,可由不同的Event自定义信息内容
|
| | |
|
| | | public HA801_tagMCGiveAwardInfo () {
|
| | | _cmd = (ushort)0xA801;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out EventLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out EventName, vBytes, NetDataType.Chars, EventLen);
|
| | | TransBytes (out Exp, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ExpPoint, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out MoneyLen, vBytes, NetDataType.BYTE);
|
| | | MoneyList = new tagMCGiveAwardMoney[MoneyLen];
|
| | | for (int i = 0; i < MoneyLen; i ++) {
|
| | | MoneyList[i] = new tagMCGiveAwardMoney();
|
| | | TransBytes (out MoneyList[i].MoneyType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out MoneyList[i].MoneyValue, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | TransBytes (out ItemLen, vBytes, NetDataType.BYTE);
|
| | | ItemList = new tagMCGiveAwardItem[ItemLen];
|
| | | for (int i = 0; i < ItemLen; i ++) {
|
| | | ItemList[i] = new tagMCGiveAwardItem();
|
| | | TransBytes (out ItemList[i].ItemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ItemList[i].Count, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ItemList[i].IsBind, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | TransBytes (out DataLen, vBytes, NetDataType.WORD);
|
| | | TransBytes (out DataEx, vBytes, NetDataType.Chars, DataLen);
|
| | | }
|
| | |
|
| | | public struct tagMCGiveAwardMoney {
|
| | | public byte MoneyType;
|
| | | public uint MoneyValue;
|
| | | }
|
| | |
|
| | | public struct tagMCGiveAwardItem {
|
| | | public uint ItemID;
|
| | | public uint Count;
|
| | | public byte IsBind;
|
| | | }
|
| | |
|
| | | }
|