//============================================================
// <T>反序列化数据区到内部数据。</T>
//
// @param pMemory 数据指针
// @param size 数据长度
// @param [out] length 读取长度
//============================================================
TBool TNetMessageBuffer::UnserializeMask(TAnyC* pMemory, TInt size, TInt* length){
   MO_ASSERT(pMemory);
   TByteC* pPtr = (TByteC*)pMemory;
   // 反序列化头数据
   TInt offset = 0;
   offset += _netHead.Unserialize(pPtr);
   TNetLength netLength = _netHead.Length();
   TNetHash netHash = _netHead.Hash();
   offset += _messageHead.Unserialize(pPtr + offset);
   TNetSerial messageSerial = _messageHead.Serial();
   TNetTick messageTick = _messageHead.Tick();
   // 获取数据
   TByteC* pData = pPtr + offset;
   TInt dataLength = netLength - offset;
   // 还原数据
   TByte buffer[MO_NETMESSAGE_MAXLENGTH];
   MaskData(buffer, MO_NETMESSAGE_MAXLENGTH, pData, dataLength, netHash);
   //TChar dump[MO_FS_DUMP_LENGTH];
   //MO_ERROR("Receive message data failure.\n%s",
   //      RByte::Dump(buffer, dataLength, dump, MO_FS_DUMP_LENGTH));
   // 检查哈希
   TNetHash hash = CalculateHash(messageSerial, messageTick, buffer, dataLength);
   if(netHash != hash){
      MO_WARN(TC("Unserialize message invalid hash. (head_hash=0x%08X, data_hash=0x%08X)"), netHash, hash);
      return EFalse;
   }
   // 设置数据
   if(dataLength > 0){
      memcpy(_buffer, buffer, dataLength);
   }
   _dataLength = dataLength;
   *length = netLength;
   return ETrue;
}
//============================================================
// <T>序列化内部数据到数据区。</T>
//
// @param pMessage 消息对象
//============================================================
TBool TNetMessageBuffer::Serialize(TAny* pMemory, TInt size, TInt* length){
   MO_ASSERT(pMemory);
   TByte* pPtr = (TByte*)pMemory;
   // 获得头长度
   TInt netCapacity = _netHead.Capacity();
   TInt messageCapacity = _messageHead.Capacity();
   TNetSerial messageSerial = _messageHead.Serial();
   TNetTick messageTick = _messageHead.Tick();
   TInt headCapacity = netCapacity + messageCapacity;
   TSize capacity = headCapacity + _dataLength;
   // 设置头信息
   TNetHash hash = CalculateHash(messageSerial, messageTick, _pData, _dataLength);
   _netHead.SetLength((TNetLength)capacity);
   _netHead.SetHash(hash);
   // 序列头信息
   _netHead.Serialize(pPtr);
   _messageHead.Serialize(pPtr + headCapacity);
   // 序列化数据
   if(_dataLength > 0){
      memcpy(pPtr + headCapacity, _pData, _dataLength);
   }
   // 设置序列化后大小
   *length = capacity;
   return ETrue;
}
Beispiel #3
0
void UIFont::SetOutline(bool On, const QColor &Color,  quint16 Size)
{
    m_hasOutline   = On;
    m_outlineColor = Color;
    m_outlineSize  = Size;
    CalculateHash();
}
//============================================================
// <T>压缩内部数据到数据区。</T>
//
// @param pMemory 数据指针
// @param size 数据长度
// @param [out] length 读取长度
//============================================================
TBool TNetMessageBuffer::Compress(TAny* pMemory, TInt size, TInt* pLength){
   MO_ASSERT(pMemory);
   TByte* pPtr = (TByte*)pMemory;
   // 获得头长度
   TInt netCapacity = _netHead.Capacity();
   TInt messageCapacity = _messageHead.Capacity();
   TNetSerial messageSerial = _messageHead.Serial();
   TNetTick messageTick = _messageHead.Tick();
   TInt headCapacity = netCapacity + messageCapacity;
   TSize capacity = headCapacity + _dataLength;
   // 设置头信息
   TNetHash hash = CalculateHash(messageSerial, messageTick, _pData, _dataLength);
   _netHead.SetLength((TNetLength)capacity);
   _netHead.SetHash(hash);
   // 序列头信息
   _netHead.Serialize(pPtr);
   _messageHead.Serialize(pPtr + headCapacity);
   // 压缩数据
   TInt length = 0;
   if(!RCompress::CompressRLE(pPtr + headCapacity, size, _pData, _dataLength, &length)){
      return EFalse;
   }
   // 设置序列化后大小
   *pLength = headCapacity + length;
   return ETrue;
}
Beispiel #5
0
void UIFont::SetImage(UIImage *Image)
{
    if (m_image)
        m_image->DownRef();
    m_image = Image;
    CalculateHash();
}
Beispiel #6
0
//============================================================
// <T>序列化路由数据到数据区。</T>
//
// @param pMemory 数据指针
// @param size 数据大小
// @param length 处理大小
//============================================================
TBool TNetRouter::SerializeRouter(TAny* pMemory, TInt size, TInt* length){
   MO_ASSERT(pMemory);
   TByte* pPtr = (TByte*)pMemory;
   // 获取头大小
   TInt netCapacity = _netHead.Capacity();
   TInt messageCapacity = _messageHead.Capacity();
   TNetSerial messageSerial = _messageHead.Serial();
   TNetTick messageTick = _messageHead.Tick();
   TInt routerCapacity = _routerHead.Capacity();
   TInt headCapacity = netCapacity + messageCapacity + routerCapacity;
   TInt capacity = headCapacity + _dataLength;
   TByte* pData = pPtr + headCapacity;
   // 设置头信息
   TNetHash hash = CalculateHash(messageSerial, messageTick, _pData, _dataLength);
   _netHead.SetLength((TNetLength)capacity);
   _netHead.SetProtocol(ENetProtocol_Router);
   _netHead.SetHash(hash);
   // 序列化头数据
   TInt offset = 0;
   offset += _netHead.Serialize(pPtr);
   offset += _messageHead.Serialize(pPtr + offset);
   offset += _routerHead.Serialize(pPtr + offset);
   if(_dataLength > 0){
      memcpy(pData, _pData, _dataLength);
   }
   // 设置序列化后大小
   *length = capacity;
   return ETrue;
}
//============================================================
// <T>反序列化数据区到内部数据。</T>
//
// @param pMemory 数据指针
// @param size 数据长度
// @param [out] length 读取长度
//============================================================
TBool TNetMessageBuffer::Unserialize(TAnyC* pMemory, TInt size, TInt* length){
   MO_ASSERT(pMemory);
   TByteC* pPtr = (TByteC*)pMemory;
   // 反序列化头数据
   TInt offset = 0;
   offset += _netHead.Unserialize(pPtr);
   offset += _messageHead.Unserialize(pPtr + offset);
   TNetSerial messageSerial = _messageHead.Serial();
   TNetTick messageTick = _messageHead.Tick();
   // 获取数据
   TNetLength netLength = _netHead.Length();
   TByteC* pData = pPtr + offset;
   TInt dataLength = netLength - offset;
   // 检查哈希
   TNetHash hash = CalculateHash(messageSerial, messageTick, pData, dataLength);
   if(_netHead.Hash() != hash){
      MO_WARN(TC("Unserialize message invalid hash. (head_hash=0x%08X, data_hash=0x%08X)"),
            _netHead.Hash(), hash);
      return EFalse;
   }
   // 设置数据
   if(dataLength > 0){
      memcpy(_buffer, pData, dataLength);
   }
   _dataLength = dataLength;
   *length = netLength;
   return ETrue;
}
Beispiel #8
0
// @todo MESH_REWORK Benchmark and test
// The uniform map can never grow beyond the limits of GL - so really, the
// map size is likely to be small; if retaining an unsorted map proves to be
// slow, then it should be changed to perform an insertion sort.
void UniformMap::Add( UniformPropertyMapping* newMap )
{
  UniformPropertyMapping::Hash nameHash = CalculateHash( newMap->uniformName );

  bool found = false;

  for( UniformMapIter iter = mUniformMaps.Begin() ;
       iter != mUniformMaps.End() ;
       ++iter )
  {
    UniformPropertyMapping* map = *iter;
    if( map->uniformNameHash == nameHash )
    {
      if( map->uniformName == newMap->uniformName )
      {
        found = true;
        // Mapping already exists - update it.
        map->propertyPtr = newMap->propertyPtr;
        break;
      }
    }
  }

  if( found == false )
  {
    // Take ownership of the new map
    mUniformMaps.PushBack(newMap);
  }

  MappingChanged();
}
Beispiel #9
0
void UniformMap::Remove( const std::string& uniformName )
{
  UniformPropertyMapping::Hash nameHash = CalculateHash( uniformName );

  bool found=false;

  for( UniformMapIter iter = mUniformMaps.Begin() ;
       iter != mUniformMaps.End() ;
       ++iter )
  {
    UniformPropertyMapping* map = *iter;
    if( map->uniformNameHash == nameHash )
    {
      if( map->uniformName == uniformName )
      {
        mUniformMaps.Erase( iter );
        found = true;
        break;
      }
    }
  }

  if( found )
  {
    MappingChanged();
  }
}
Beispiel #10
0
void UIFont::SetShadow(bool On, const QPoint &Offset, const QColor &Color, int FixedBlur)
{
    m_hasShadow    = On;
    m_shadowOffset = Offset;
    m_shadowColor  = Color;
    m_shadowFixedBlur = FixedBlur;
    CalculateHash();
}
Beispiel #11
0
//============================================================
void TNetMessageBuffer::Update(){
   TInt capacity = Capacity();
   TNetSerial messageSerial = _messageHead.Serial();
   TNetTick messageTick = _messageHead.Tick();
   TNetHash hash = CalculateHash(messageSerial, messageTick, _pData, _dataLength);
   _netHead.SetLength((TNetLength)capacity);
   _netHead.SetHash(hash);
}
Beispiel #12
0
void UIFont::SetSize(int Size)
{
    if (Size > -1)
    {
        m_face.setPixelSize(Size);
        CalculateHash();
    }
}
Beispiel #13
0
static void DoCalculation (HWND hwnd)
{
	INFOOFFSET infoIdx = GetSelectedStructure(hwnd);
	STRUCTINFO info;
	DWORD dwTotalPages = 0;
	char szNumber[50];

	// Verify all controls are within their limits.

	if (!VerifyAllNumericEditControls(hwnd, TRUE, TRUE))
		return;

	info.nIngresVersion= GetOIVers();

	GetDialogInfo (hwnd, &info);

	switch (infoIdx)
	{
		case STRUCT_HASH:
			dwTotalPages = CalculateHash(hwnd, &info);
			break;

		case STRUCT_ISAM:
			dwTotalPages = CalculateIsam(hwnd, &info);
			break;

		case STRUCT_HEAP:
			dwTotalPages = CalculateHeap(hwnd, &info);
			break;

		case STRUCT_BTREE:
			dwTotalPages = CalculateBtree(hwnd, &info);
			break;

		default:
			ASSERT(NULL);
	}

	if (dwTotalPages != (DWORD)-1)
	{
		// Update the results display

		double dBytes;

		my_dwtoa(dwTotalPages, szNumber, 10);
		Static_SetText(GetDlgItem(hwnd, IDC_INGRESPAGES), szNumber);

		dBytes = (double)dwTotalPages * (double)info.dwPageSize; // PS 
		sprintf (szNumber, "%.0f", dBytes);
		Static_SetText(GetDlgItem(hwnd, IDC_BYTES), szNumber);
	}
	else
	{
		SetCalcError(hwnd);
	}
}
Beispiel #14
0
void cSystemIrd2::ProcessEMM(int pid, int caid, const unsigned char *data)
{
  int prov=0; //XXX how to get provider here??

  int len=SCT_LEN(data);
  unsigned char *emm=AUTOMEM(len);

  cPlainKey *pk;
  if(!(pk=keys.FindKey('I',caid,KEYSET(prov,TYPE_IV,0),16))) {
    PRINTF(L_SYS_EMM,"missing %04x %02x IV key",caid,prov);
    return;
    }
  unsigned char EMM_IV[16];
  pk->Get(EMM_IV);

  for(int keyno=0; keyno<2; keyno++) {
    if(!(pk=keys.FindKey('I',caid,KEYSET(prov,TYPE_PMK,keyno),16))) {
      PRINTF(L_SYS_EMM,"missing %04x %02x MK%d key",caid,prov,keyno);
      continue;
      }
    unsigned char PMK[16];
    pk->Get(PMK);

    if(!(pk=keys.FindKey('I',caid,KEYSET(prov,TYPE_SEED,1),16))) {
      PRINTF(L_SYS_EMM,"missing %04x %02x EMM key",caid,prov);
      return;
      }
    unsigned char EMM_Seed[16];
    pk->Get(EMM_Seed);
    PrepareSeed(EMM_Seed,PMK);

    memcpy(emm,data,len);
    Decrypt(&emm[10],EMM_IV,EMM_Seed,len-10);
    NanoDecrypt(emm,16,len-8,PMK,EMM_IV);
    memmove(emm+6,emm+7,len-7); // removing padding byte
    if(CalculateHash(EMM_Seed,EMM_IV,emm+3,len-4)) {
      HEXDUMP(L_SYS_RAWEMM,emm,len,"Irdeto2 RAWEMM");
      for(int i=15; i<len-9;) {
        int l=NANOLEN(emm[i+1]);
        switch(emm[i]) {
          case 0x10:
          case 0x50:
            if(l==0x13 && i+l<=len-9) {
              FoundKey();
              if(keys.NewKey('I',caid,KEYSET(prov,TYPE_OP,emm[i+2]>>2),&emm[i+3],16)) NewKey();
              }
            break;
          }
        i+=l;
        }
      break;
      }
Beispiel #15
0
bool CzString::operator==	(unsigned int hash)
{
	if (Data == NULL)
		return false;

	if (!AutoHash)
		DataHash = CalculateHash(Data);

	if (DataHash == hash)
		return true;

	return false;
}
Beispiel #16
0
bool cSystemIrd2::ProcessECM(const cEcmInfo *ecm, unsigned char *data)
{
  int len=data[11];
  if(len!=0x28 || SCT_LEN(data)<len+12) {
    if(doLog) PRINTF(L_SYS_ECM,"bad ECM length");
    return false;
    }
  int prov=data[8];
  cPlainKey *pk;
  unsigned char ECM_IV[16];
  if(!(pk=keys.FindKey('I',ecm->caId,KEYSET(prov,TYPE_IV,0),16))) {
    if(doLog) PRINTF(L_SYS_KEY,"missing %04x %02x IV key",ecm->caId,prov);
    return false;
    }
  pk->Get(ECM_IV);

  unsigned char ECM_Seed[16];
  if(!(pk=keys.FindKey('I',ecm->caId,KEYSET(prov,TYPE_SEED,0),16))) {
    if(doLog) PRINTF(L_SYS_KEY,"missing %04x %02x ECM key",ecm->caId,prov);
    return false;
    }
  pk->Get(ECM_Seed);

  cKeySnoop ks(this,'I',ecm->caId,KEYSET(prov,TYPE_OP,data[9]));
  unsigned char key[16];
  if(!(pk=keys.FindKey('I',ecm->caId,KEYSET(prov,TYPE_OP,data[9]),16))) return false;
  pk->Get(key);
  PrepareSeed(ECM_Seed,key);

  data+=12;
  Decrypt(data,ECM_IV,ECM_Seed,len);
  int i=(data[0]&7)+1;
  NanoDecrypt(data,i,len-8,key,ECM_IV);
  if(CalculateHash(ECM_Seed,ECM_IV,data-6,len+6)) {
    HEXDUMP(L_SYS_RAWECM,data-12,len+12,"Irdeto2 RAWECM");
    while(i<len-8) {
      int l=NANOLEN(data[i+1]);
      switch(data[i]) {
        case 0x78:
          memcpy(cw,&data[i+4],16);
          ks.OK(pk);
          return true;
        }
      i+=l;
      }
    }
  else {
    if(doLog) PRINTF(L_SYS_ECM,"hash failed");
    }
  return false;
}
Beispiel #17
0
UIFont::UIFont()
  : TorcReferenceCounter(),
    m_brush(QColor(Qt::white)),
    m_hasShadow(false),
    m_shadowFixedBlur(0),
    m_hasOutline(false),
    m_outlineSize(0),
    m_relativeSize(0.0f),
    m_stretch(100),
    m_image(NULL),
    m_imageReady(false)
{
    CalculateHash();
}
Beispiel #18
0
//============================================================
// <T>解压缩数据区到内部数据。</T>
//
// @param pMemory 数据指针
// @param size 数据长度
// @param [out] length 读取长度
//============================================================
TBool TNetMessageBuffer::Uncompress(TAnyC* pMemory, TInt size, TInt* pLength, TBool masked, TBool checked){
   MO_ASSERT(pMemory);
   TByteC* pPtr = (TByteC*)pMemory;
   // 反序列化头数据
   TInt offset = 0;
   offset += _netHead.Unserialize(pPtr);
   offset += _messageHead.Unserialize(pPtr + offset);
   TNetHash netHash = _netHead.Hash();
   TBool compressed = _netHead.SignCompress();
   TNetSerial messageSerial = _messageHead.Serial();
   TNetTick messageTick = _messageHead.Tick();
   // 获取数据
   TNetLength netLength = _netHead.Length();
   TByteC* pData = pPtr + offset;
   TInt dataLength = netLength - offset;
   // 检查数据长度
   if((dataLength < 0) || (dataLength > MO_NETMESSAGE_MAXLENGTH)){
      return EFalse;
   }
   // 数据压缩
   if(compressed){
      // 解压缩数据
      TInt length = 0;
      if(!RCompress::Inflate(_buffer, MO_NETMESSAGE_MAXLENGTH, pData, dataLength, &length)){
         MO_WARN(TC("Inflate message failure. (data_ptr=0x%08X, data_length=0x%08X)"), pData, dataLength);
         return EFalse;
      }
      _dataLength = length;
   }else{
      MO_LIB_MEMORY_COPY(_buffer, MO_NETMESSAGE_MAXLENGTH, pData, dataLength);
      _dataLength = dataLength;
   }
   // 还原数据
   if(masked){
      MaskData(_buffer, MO_NETMESSAGE_MAXLENGTH, _buffer, _dataLength, netHash);
   }
   // 检查哈希
   if(checked){
      TNetHash hash = CalculateHash(messageSerial, messageTick, _buffer, _dataLength);
      if(netHash != hash){
         MO_WARN(TC("Unserialize message invalid hash. (head_hash=0x%08X, data_hash=0x%08X)"), netHash, hash);
         return EFalse;
      }
   }
   *pLength = _dataLength;
   return ETrue;
}
Beispiel #19
0
const PropertyInputImpl* UniformMap::Find( const std::string& uniformName )
{
  UniformPropertyMapping::Hash nameHash = CalculateHash( uniformName );

  for( UniformMapIter iter = mUniformMaps.Begin() ;
       iter != mUniformMaps.End() ;
       ++iter )
  {
    UniformPropertyMapping* map = *iter;
    if( map->uniformNameHash == nameHash )
    {
      if( map->uniformName == uniformName )
      {
        return map->propertyPtr;
      }
    }
  }
  return NULL;
}
Beispiel #20
0
//============================================================
// <T>反序列化数据区到路由数据。</T>
//
// @param pMemory 数据指针
// @param size 数据大小
// @param length 处理大小
//============================================================
TBool TNetRouter::UnserializeRouter(TAnyC* pMemory, TInt size, TInt* length){
   MO_ASSERT(pMemory);
   TByteC* pPtr = (TByteC*)pMemory;
   // 反序列化头数据
   TInt offset = 0;
   offset += _netHead.Unserialize(pPtr);
   TUint protocol = _netHead.Protocol();
   TNetSerial messageSerial = 0;
   TNetTick messageTick = 0;
   if(ENetProtocol_Message == (ENetProtocol_Message & protocol)){
      offset += _messageHead.Unserialize(pPtr + offset);
      messageSerial = _messageHead.Serial();
      messageTick = _messageHead.Tick();
   }
   if(ENetProtocol_Router == (ENetProtocol_Router & protocol)){
      offset += _routerHead.Unserialize(pPtr + offset);
   }
   TNetLength capacity = _netHead.Length();
   // 复制数据
   TByteC* pData = pPtr + offset;
   TInt dataLength = capacity - offset;
   // 验证哈希
   TNetHash hash = CalculateHash(messageSerial, messageTick, pData, dataLength);
   if(_netHead.Hash() != hash){
      MO_ERROR(TC("Unserialize router invalid hash. (head_hash=0x%08X, data_hash=0x%08X)"),
            _netHead.Hash(), hash);
      return EFalse;
   }
   // 设置返回
   if(dataLength > 0){
      memcpy(_buffer, pData, dataLength);
   }
   _dataLength = dataLength;
   *length = capacity;
   return ETrue;
}
Beispiel #21
0
void UIFont::SetRelativeSize(float Size)
{
    m_relativeSize = Size;
    CalculateHash();
}
Beispiel #22
0
void UIFont::SetFace(const QFont &Face)
{
    m_face = Face;
    CalculateHash();
}
Beispiel #23
0
void UIFont::SetColor(const QColor &Color)
{
    m_brush.setColor(Color);
    CalculateHash();
}
Beispiel #24
0
void UIFont::SetImageReady(bool Ready)
{
    m_imageReady = Ready;
    CalculateHash();
}
Beispiel #25
0
void UIFont::SetBrush(const QBrush &Brush)
{
    m_brush = Brush;
    CalculateHash();
}
Beispiel #26
0
void UIFont::SetOffset(const QPoint &Offset)
{
    m_offset = Offset;
    CalculateHash();
}
Beispiel #27
0
Item::Item(const rapidjson::Value &json) :
    name_(fixup_name(json["name"].GetString())),
    location_(ItemLocation(json)),
    typeLine_(fixup_name(json["typeLine"].GetString())),
    corrupted_(json["corrupted"].GetBool()),
    identified_(json["identified"].GetBool()),
    w_(json["w"].GetInt()),
    h_(json["h"].GetInt()),
    frameType_(json["frameType"].GetInt()),
    icon_(json["icon"].GetString()),
    sockets_cnt_(0),
    links_cnt_(0),
    sockets_({ 0, 0, 0, 0 }),
    json_(Util::RapidjsonSerialize(json)),
    has_mtx_(false),
    ilvl_(0)
{
    for (auto &mod_type : ITEM_MOD_TYPES) {
        text_mods_[mod_type] = std::vector<std::string>();
        if (json.HasMember(mod_type.c_str())) {
            auto &mods = text_mods_[mod_type];
            for (auto &mod : json[mod_type.c_str()])
                mods.push_back(mod.GetString());
        }
    }

    if (json.HasMember("note")) {
        note_ = json["note"].GetString();
    }

    if (json.HasMember("properties")) {
        for (auto prop_it = json["properties"].Begin(); prop_it != json["properties"].End(); ++prop_it) {
            auto &prop = *prop_it;
            std::string name = prop["name"].GetString();
            if (name == "Map Level")
                name = "Level";
            if (name == "Elemental Damage") {
                for (auto value_it = prop["values"].Begin(); value_it != prop["values"].End(); ++value_it)
                    elemental_damage_.push_back(std::make_pair((*value_it)[0].GetString(), (*value_it)[1].GetInt()));
            }
            else {
                if (prop["values"].Size())
                    properties_[name] = prop["values"][0][0].GetString();
            }

            ItemProperty property;
            property.name = name;
            property.display_mode = prop["displayMode"].GetInt();
            for (auto &value : prop["values"]) {
                ItemPropertyValue v;
                v.str = value[0].GetString();
                v.type = value[1].GetInt();
                property.values.push_back(v);
            }
            text_properties_.push_back(property);
        }
    }

    if (json.HasMember("requirements")) {
        for (auto &req : json["requirements"]) {
            std::string name = req["name"].GetString();
            std::string value = req["values"][0][0].GetString();
            requirements_[name] = std::atoi(value.c_str());
            ItemPropertyValue v;
            v.str = value;
            v.type = req["values"][0][1].GetInt();
            text_requirements_.push_back({ name, v });
        }
    }

    if (json.HasMember("sockets")) {
        ItemSocketGroup current_group = { 0, 0, 0, 0 };
        sockets_cnt_ = json["sockets"].Size();
        int counter = 0, prev_group = -1;
        for (auto &socket : json["sockets"]) {
            ItemSocket current_socket = { static_cast<unsigned char>(socket["group"].GetInt()), socket["attr"].GetString()[0] };
            text_sockets_.push_back(current_socket);
            if (prev_group != current_socket.group) {
                counter = 0;
                socket_groups_.push_back(current_group);
                current_group = { 0, 0, 0, 0 };
            }
            prev_group = current_socket.group;
            ++counter;
            links_cnt_ = std::max(links_cnt_, counter);
            switch (current_socket.attr) {
            case 'S':
                sockets_.r++;
                current_group.r++;
                break;
            case 'D':
                sockets_.g++;
                current_group.g++;
                break;
            case 'I':
                sockets_.b++;
                current_group.b++;
                break;
            case 'G':
                sockets_.w++;
                current_group.w++;
                break;
            }
        }
        socket_groups_.push_back(current_group);
    }

    CalculateHash(json);

    count_ = 1;
    if (properties_.find("Stack Size") != properties_.end()) {
        std::string size = properties_["Stack Size"];
        if (size.find("/") != std::string::npos) {
            size = size.substr(0, size.find("/"));
            count_ = std::stoi(size);
        }
    }

    has_mtx_ = json.HasMember("cosmeticMods");

    if (json.HasMember("ilvl"))
        ilvl_ = json["ilvl"].GetInt();

    GenerateMods(json);
}
Beispiel #28
0
void UIFont::SetStretch(int Stretch)
{
    m_stretch = Stretch;
    m_face.setStretch(m_stretch);
    CalculateHash();
}