public final void unserialise(final byte[] data) { final ByteBuffer bb = ByteBuffer.wrap(data); this.m_id = bb.getInt(); this.m_order = bb.get(); this.m_gfx = bb.getInt(); final byte[] cdata = new byte[bb.getInt()]; bb.get(cdata); try { this.m_criterion = new String(cdata, "UTF-8").intern(); } catch (UnsupportedEncodingException e) { ScenarioBinaryStorable.m_logger.error((Object) "Exception", (Throwable) e); } this.m_success = (bb.get() == 1); this.m_itemId = bb.getInt(); this.m_itemQty = bb.getShort(); this.m_xp = bb.getInt(); this.m_kama = bb.getInt(); this.m_guildPoints = bb.getInt(); }
@Override public void build(final ByteBuffer bb, final int id, final short version) { this.setGlobalId(id); if (version == 1) { this.m_id = bb.getInt(); this.m_type = bb.get(); this.m_userType = bb.get(); this.m_autoTrigger = (bb.get() == 1); this.m_isChallenge = (bb.get() == 1); this.m_isChaos = (bb.get() == 1); this.m_duration = bb.getShort(); this.m_minUsers = bb.getShort(); this.m_maxUsers = bb.getShort(); final long time = bb.getLong(); if (time != 0L) { this.m_expirationDate = GameDate.fromLong(time); } else { this.m_expirationDate = null; } try { final byte[] bytes = new byte[bb.getInt()]; bb.get(bytes); this.m_params = new String(bytes, "UTF-8").intern(); } catch (UnsupportedEncodingException e) { ScenarioBinaryStorable.m_logger.error((Object) "Exception", (Throwable) e); } try { final int mappingLen = bb.getInt(); this.m_varMapping = new String[mappingLen]; for (int i = 0; i < mappingLen; ++i) { final byte[] bytes2 = new byte[bb.getInt()]; bb.get(bytes2); this.m_varMapping[i] = new String(bytes2, "UTF-8").intern(); } } catch (UnsupportedEncodingException e) { ScenarioBinaryStorable.m_logger.error((Object) "Exception", (Throwable) e); } try { final byte[] bytes = new byte[bb.getInt()]; bb.get(bytes); this.m_joinCriterion = new String(bytes, "UTF-8").intern(); final byte[] rewardEligibilityCriterion = new byte[bb.getInt()]; bb.get(rewardEligibilityCriterion); this.m_rewardEligibilityCriterion = new String(rewardEligibilityCriterion, "UTF-8").intern(); } catch (UnsupportedEncodingException e) { ScenarioBinaryStorable.m_logger.error((Object) "Exception", (Throwable) e); } for (int glen = bb.getInt(), i = 0; i < glen; ++i) { final byte[] gdata = new byte[bb.getInt()]; bb.get(gdata); final ActionGroupStorable g = new ActionGroupStorable(); g.unserialise(gdata); this.m_actionGroups.add(g); } for (int rlen = bb.getInt(), j = 0; j < rlen; ++j) { final byte[] rdata = new byte[bb.getInt()]; bb.get(rdata); final RewardStorable r = new RewardStorable(); r.unserialise(rdata); this.m_rewards.add(r); } } else { ScenarioBinaryStorable.m_logger.error( (Object) "Tentative de d\u00e9s\u00e9rialisation d'un objet avec une version non prise en charge"); } }