private void OnCharInfo(cmdGAME_ANSWER_CHAR_INFO d) { if(d.GetAck()==1) { WebLog.Log (d); model.GACI_charinfo = d; EndConnectTime=Time.time; proxy.LobbyEnterLobby(); } else{} }
public static void DeserializeGAME_ANSWER_CHAR_INFO (byte[] bytes) { cmdGAME_ANSWER_CHAR_INFO pk = new cmdGAME_ANSWER_CHAR_INFO (); pk.Make (bytes [0], bytes [1]); if (pk.GetAck () == 0) { } else if (pk.GetAck () == 1) { //初始化偏移 int ReadOffset = 2; pk.info.cid = System.BitConverter.ToInt32 (bytes, ReadOffset); ReadOffset += sizeof(int); pk.info.skincolor = bytes [ReadOffset]; ReadOffset += sizeof(byte); pk.info.avatarno = bytes [ReadOffset]; ReadOffset += sizeof(byte); pk.info.faceIndex = System.BitConverter.ToInt32 (bytes, ReadOffset); ReadOffset += sizeof(int); pk.info.hair = System.BitConverter.ToInt32 (bytes, ReadOffset); ReadOffset += sizeof(int); pk.info.upper = System.BitConverter.ToInt32 (bytes, ReadOffset); ReadOffset += sizeof(int); pk.info.lower = System.BitConverter.ToInt32 (bytes, ReadOffset); ReadOffset += sizeof(int); pk.info.shoes = System.BitConverter.ToInt32 (bytes, ReadOffset); ReadOffset += sizeof(int); pk.info.speed = bytes [ReadOffset]; ReadOffset += sizeof(byte); pk.info.strength = bytes [ReadOffset]; ReadOffset += sizeof(byte); pk.info.agility = bytes [ReadOffset]; ReadOffset += sizeof(byte); pk.info.technic = bytes [ReadOffset]; ReadOffset += sizeof(byte); /* for (int i=0; i<Constant.MAX_EQUIP_SLOT; i++) { pk.equips [i].i_no = System.BitConverter.ToInt32 (bytes, ReadOffset); ReadOffset += sizeof(int); pk.equips [i].item_id = System.BitConverter.ToInt32 (bytes, ReadOffset); ReadOffset += sizeof(int); pk.equips [i].slot = bytes [ReadOffset]; ReadOffset += sizeof(byte); pk.equips [i].socket_cnt = bytes [ReadOffset]; ReadOffset += sizeof(byte); for (int j=0; j<Constant.MAX_SOCKET_NUM; j++) { pk.equips [i].sockets [j] = bytes [ReadOffset]; ReadOffset += sizeof(byte); } pk.equips [i].stock = System.BitConverter.ToInt16 (bytes, ReadOffset); ReadOffset += sizeof(short); pk.equips [i].restMinute = System.BitConverter.ToInt32 (bytes, ReadOffset); ReadOffset += sizeof(int); pk.equips [i].cid = System.BitConverter.ToInt32 (bytes, ReadOffset); ReadOffset += sizeof(int); pk.equips [i].utility_id = System.BitConverter.ToInt32 (bytes, ReadOffset); ReadOffset += sizeof(int); }*/ } OnRecDta<cmdGAME_ANSWER_CHAR_INFO> dlg = Singletons.GET<LobbyService> ().OnLobbyCharInfo; if (dlg != null) { dlg (pk); } }