Jump to content
Close

Recommended Posts

Quando eo estava compilando deo Esse Erro 

 

////////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
////////////////////////////////////////////////////////////////////////
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////
#include "otpch.h"
 
#include "itemattributes.h"
#include "fileloader.h"
 
ItemAttributes::ItemAttributes(const ItemAttributes& o)
{
if(o.attributes)
attributes = new AttributeMap(*o.attributes);
}
 
void ItemAttributes::createAttributes()
{
if(!attributes)
attributes = new AttributeMap;
}
 
void ItemAttributes::eraseAttribute(const char* key)
{
if(!attributes)
return;
 
AttributeMap::iterator it = attributes->find(key);
if(it != attributes->end())
attributes->erase(it);
}
 
void ItemAttributes::setAttribute(const char* key, boost::any value)
{
createAttributes();
(*attributes)[key].set(value);
}
 
void ItemAttributes::setAttribute(const char* key, const std::string& value)
{
createAttributes();
(*attributes)[key].set(value);
}
 
void ItemAttributes::setAttribute(const char* key, int32_t value)
{
createAttributes();
(*attributes)[key].set(value);
}
 
void ItemAttributes::setAttribute(const char* key, float value)
{
createAttributes();
(*attributes)[key].set(value);
}
 
void ItemAttributes::setAttribute(const char* key, bool value)
{
createAttributes();
(*attributes)[key].set(value);
}
 
boost::any ItemAttributes::getAttribute(const char* key) const
{
if(!attributes)
return boost::any();
 
AttributeMap::iterator it = attributes->find(key);
if(it != attributes->end())
return it->second.get();
 
return boost::any();
}
 
std::string ItemAttributes::getStringAttribute(const std::string& key, bool &ok) const
{
if(!attributes)
{
ok = false;
return std::string();
}
 
AttributeMap::iterator it = attributes->find(key);
if(it != attributes->end())
return it->second.getString(ok);
 
ok = false;
return std::string();
}
 
int32_t ItemAttributes::getIntegerAttribute(const std::string& key, bool &ok) const
{
if(!attributes)
{
ok = false;
return 0;
}
 
AttributeMap::iterator it = attributes->find(key);
if(it != attributes->end())
return it->second.getInteger(ok);
 
ok = false;
return 0;
}
 
float ItemAttributes::getFloatAttribute(const std::string& key, bool &ok) const
{
if(!attributes)
{
ok = false;
return 0.0;
}
 
AttributeMap::iterator it = attributes->find(key);
if(it != attributes->end())
return it->second.getFloat(ok);
 
ok = false;
return 0.0;
}
 
bool ItemAttributes::getBooleanAttribute(const std::string& key, bool &ok) const
{
if(!attributes)
{
ok = false;
return false;
}
 
AttributeMap::iterator it = attributes->find(key);
if(it != attributes->end())
return it->second.getBoolean(ok);
 
ok = false;
return false;
}
 
ItemAttribute& ItemAttribute::operator=(const ItemAttribute& o)
{
if(&o == this)
return *this;
 
m_data = o.m_data;
return *this;
}
 
std::string ItemAttribute::getString(bool &ok) const
{
if(m_data.type() != typeid(std::string))
{
ok = false;
return std::string();
}
 
ok = true;
return boost::any_cast<std::string>(m_data);
}
 
int32_t ItemAttribute::getInteger(bool &ok) const
{
if(m_data.type() != typeid(int32_t))
{
ok = false;
return 0;
}
 
ok = true;
return boost::any_cast<int32_t>(m_data);
}
 
float ItemAttribute::getFloat(bool &ok) const
{
if(m_data.type() != typeid(float))
{
ok = false;
return 0.0;
}
 
ok = true;
return boost::any_cast<float>(m_data);
}
 
bool ItemAttribute::getBoolean(bool &ok) const
{
if(m_data.type() != typeid(bool))
{
ok = false;
return false;
}
 
ok = true;
return boost::any_cast<bool>(m_data);
}
 
bool ItemAttributes::unserializeMap(PropStream& stream)
{
uint16_t n;
if(!stream.getShort(n))
return true;
 
createAttributes();
while(n--)
{
std::string key;
if(!stream.getString(key))
return false;
 
ItemAttribute attr;
if(!attr.unserialize(stream))
return false;
 
(*attributes)[key] = attr;
}
 
return true;
}
 
void ItemAttributes::serializeMap(PropWriteStream& stream) const
{
stream.addShort((uint16_t)std::min((size_t)0xFFFF, attributes->size()));
AttributeMap::const_iterator it = attributes->begin();
for(int32_t i = 0; it != attributes->end() && i <= 0xFFFF; ++it, ++i)
{
std::string key = it->first;
if(key.size() > 0xFFFF)
stream.addString(key.substr(0, 0xFFFF));
else
stream.addString(key);
 
it->second.serialize(stream);
}
}
 
bool ItemAttribute::unserialize(PropStream& stream)
{
uint8_t type = 0;
stream.getByte(type);
switch(type)
{
case STRING:
{
std::string v;
if(!stream.getLongString(v))
return false;
 
set(v);
break;
}
case INTEGER:
{
uint32_t v;
if(!stream.getLong(v))
return false;
 
set((int32_t)v);
break;
}
case FLOAT:
{
float v;
if(!stream.getFloat(v))
return false;
 
set(v);
break;
}
case BOOLEAN:
{
uint8_t v;
if(!stream.getByte(v))
return false;
 
set(v != 0);
}
}
 
return true;
}
 
void ItemAttribute::serialize(PropWriteStream& stream) const
{
bool ok;
if(m_data.type() == typeid(std::string))
{
stream.addByte((uint8_t)STRING);
stream.addLongString(getString(ok));
}
else if(m_data.type() == typeid(int32_t))
{
stream.addByte((uint8_t)INTEGER);
stream.addLong(getInteger(ok));
}
else if(m_data.type() == typeid(float))
{
stream.addByte((uint8_t)FLOAT);
stream.addLong(getFloat(ok));
}
else if(m_data.type() == typeid(bool))
{
stream.addByte((uint8_t)BOOLEAN);
stream.addByte(getBoolean(ok));
}
else
std::clog << "[itemAttribute::serialize]: Invalid data type." << std::endl;
}

 

 

Alguem me ajuda por favor . do rep ++


Share this post


Link to post
Share on other sites

Quando eo estava compilando deo Esse Erro 

 

////////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
////////////////////////////////////////////////////////////////////////
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////
#include "otpch.h"
 
#include "itemattributes.h"
#include "fileloader.h"
 
ItemAttributes::ItemAttributes(const ItemAttributes& o)
{
if(o.attributes)
attributes = new AttributeMap(*o.attributes);
}
 
void ItemAttributes::createAttributes()
{
if(!attributes)
attributes = new AttributeMap;
}
 
void ItemAttributes::eraseAttribute(const char* key)
{
if(!attributes)
return;
 
AttributeMap::iterator it = attributes->find(key);
if(it != attributes->end())
attributes->erase(it);
}
 
void ItemAttributes::setAttribute(const char* key, boost::any value)
{
createAttributes();
(*attributes)[key].set(value);
}
 
void ItemAttributes::setAttribute(const char* key, const std::string& value)
{
createAttributes();
(*attributes)[key].set(value);
}
 
void ItemAttributes::setAttribute(const char* key, int32_t value)
{
createAttributes();
(*attributes)[key].set(value);
}
 
void ItemAttributes::setAttribute(const char* key, float value)
{
createAttributes();
(*attributes)[key].set(value);
}
 
void ItemAttributes::setAttribute(const char* key, bool value)
{
createAttributes();
(*attributes)[key].set(value);
}
 
boost::any ItemAttributes::getAttribute(const char* key) const
{
if(!attributes)
return boost::any();
 
AttributeMap::iterator it = attributes->find(key);
if(it != attributes->end())
return it->second.get();
 
return boost::any();
}
 
std::string ItemAttributes::getStringAttribute(const std::string& key, bool &ok) const
{
if(!attributes)
{
ok = false;
return std::string();
}
 
AttributeMap::iterator it = attributes->find(key);
if(it != attributes->end())
return it->second.getString(ok);
 
ok = false;
return std::string();
}
 
int32_t ItemAttributes::getIntegerAttribute(const std::string& key, bool &ok) const
{
if(!attributes)
{
ok = false;
return 0;
}
 
AttributeMap::iterator it = attributes->find(key);
if(it != attributes->end())
return it->second.getInteger(ok);
 
ok = false;
return 0;
}
 
float ItemAttributes::getFloatAttribute(const std::string& key, bool &ok) const
{
if(!attributes)
{
ok = false;
return 0.0;
}
 
AttributeMap::iterator it = attributes->find(key);
if(it != attributes->end())
return it->second.getFloat(ok);
 
ok = false;
return 0.0;
}
 
bool ItemAttributes::getBooleanAttribute(const std::string& key, bool &ok) const
{
if(!attributes)
{
ok = false;
return false;
}
 
AttributeMap::iterator it = attributes->find(key);
if(it != attributes->end())
return it->second.getBoolean(ok);
 
ok = false;
return false;
}
 
ItemAttribute& ItemAttribute::operator=(const ItemAttribute& o)
{
if(&o == this)
return *this;
 
m_data = o.m_data;
return *this;
}
 
std::string ItemAttribute::getString(bool &ok) const
{
if(m_data.type() != typeid(std::string))
{
ok = false;
return std::string();
}
 
ok = true;
return boost::any_cast<std::string>(m_data);
}
 
int32_t ItemAttribute::getInteger(bool &ok) const
{
if(m_data.type() != typeid(int32_t))
{
ok = false;
return 0;
}
 
ok = true;
return boost::any_cast<int32_t>(m_data);
}
 
float ItemAttribute::getFloat(bool &ok) const
{
if(m_data.type() != typeid(float))
{
ok = false;
return 0.0;
}
 
ok = true;
return boost::any_cast<float>(m_data);
}
 
bool ItemAttribute::getBoolean(bool &ok) const
{
if(m_data.type() != typeid(bool))
{
ok = false;
return false;
}
 
ok = true;
return boost::any_cast<bool>(m_data);
}
 
bool ItemAttributes::unserializeMap(PropStream& stream)
{
uint16_t n;
if(!stream.getShort(n))
return true;
 
createAttributes();
while(n--)
{
std::string key;
if(!stream.getString(key))
return false;
 
ItemAttribute attr;
if(!attr.unserialize(stream))
return false;
 
(*attributes)[key] = attr;
}
 
return true;
}
 
void ItemAttributes::serializeMap(PropWriteStream& stream) const
{
stream.addShort((uint16_t)std::min((size_t)0xFFFF, attributes->size()));
AttributeMap::const_iterator it = attributes->begin();
for(int32_t i = 0; it != attributes->end() && i <= 0xFFFF; ++it, ++i)
{
std::string key = it->first;
if(key.size() > 0xFFFF)
stream.addString(key.substr(0, 0xFFFF));
else
stream.addString(key);
 
it->second.serialize(stream);
}
}
 
bool ItemAttribute::unserialize(PropStream& stream)
{
uint8_t type = 0;
stream.getByte(type);
switch(type)
{
case STRING:
{
std::string v;
if(!stream.getLongString(v))
return false;
 
set(v);
break;
}
case INTEGER:
{
uint32_t v;
if(!stream.getLong(v))
return false;
 
set((int32_t)v);
break;
}
case FLOAT:
{
float v;
if(!stream.getFloat(v))
return false;
 
set(v);
break;
}
case BOOLEAN:
{
uint8_t v;
if(!stream.getByte(v))
return false;
 
set(v != 0);
}
}
 
return true;
}
 
void ItemAttribute::serialize(PropWriteStream& stream) const
{
bool ok;
if(m_data.type() == typeid(std::string))
{
stream.addByte((uint8_t)STRING);
stream.addLongString(getString(ok));
}
else if(m_data.type() == typeid(int32_t))
{
stream.addByte((uint8_t)INTEGER);
stream.addLong(getInteger(ok));
}
else if(m_data.type() == typeid(float))
{
stream.addByte((uint8_t)FLOAT);
stream.addLong(getFloat(ok));
}
else if(m_data.type() == typeid(bool))
{
stream.addByte((uint8_t)BOOLEAN);
stream.addByte(getBoolean(ok));
}
else
std::clog << "[itemAttribute::serialize]: Invalid data type." << std::endl;
}

 

 

Alguem me ajuda por favor . do rep ++

Cadê o erro?


Share this post


Link to post
Share on other sites

erro quando compilando.

[build error] [obi//otserv.o] error1


Share this post


Link to post
Share on other sites

Por favor, especifique mais seu problema para entender melhor qual tipo de erro você encontrou na compilação !


Share this post


Link to post
Share on other sites

Cara durante essa compilação é possível eu passar uma tfs 0.4 para versão 10.37/10.35 ?




Medalhas:
1, 2

Qo5DnNn.png

stonedshowoff2_zpsf5409854.png

Share this post


Link to post
Share on other sites

Excelente Natanel, com certeza ajudará muitas pessoas que querem compilar novas sources.



YDmXTU2.png

 

Entenda tudo sobre VPS, DEDICADOS & HOSPEDAGENS. => Clique aqui

Global Full Download 10.9x - TFS 1.2/FERUMBRAS/KRAILOS. => Clique aqui

 

Muitos querem aquilo que você tem, 
mas vão desistir quando souberem o preço que você pagou.

 

skype-favicon.png lu.lukinha

message-16.png absolute@lnetworks.com.br

Share this post


Link to post
Share on other sites

Até onde eu sei, só dá pra compila TFS 1.0 com Microsoft Visual Studio 2013.

Aqui tem um tutorial para TFS 1.0 


http://www.tibiaking.com/forum/topic/30906-tutorial-compilando-tfs-v10-com-msvc-2013/



[10.98] Projeto Alunia 2017 - Yourots Custom (Download)

 

Share this post


Link to post
Share on other sites

Obrigado amigo mas não consigo instalar o msvt pede requerimentos do pc como internet explorer 10 e não tem pra versão do meu windows que é windows 7 64 bits . Ja tentei instalar o internet explorer pra windows 7 sp1 mas deu erro .


Share this post


Link to post
Share on other sites

Não consigo compilar :/

 

64 bits, trunk.r3884, virgem sem nada editado, alguém pode me ajudar?

 

 


../otserv.cpp:32:25: error: openssl/rsa.h: No such file or directory
../otserv.cpp:33:24: error: openssl/bn.h: No such file or directory
../otserv.cpp:34:25: error: openssl/err.h: No such file or directory
../otserv.cpp:88: error: expected constructor, destructor, or type conversion before '*' token
 
../otserv.cpp: In function 'void otserv(StringVec, ServiceManager*)':
../otserv.cpp:546: error: 'g_RSA' was not declared in this scope
../otserv.cpp:546: error: 'RSA_new' was not declared in this scope
 
../otserv.cpp:548: error: 'BN_dec2bn' was not declared in this scope
../otserv.cpp:556: error: 'RSA_check_key' was not declared in this scope
 
../otserv.cpp:561: error: 'ERR_load_crypto_strings' was not declared in this scope
../otserv.cpp:562: error: 'ERR_get_error' was not declared in this scope
../otserv.cpp:562: error: 'ERR_error_string' was not declared in this scope
 
mingw32-make: *** [obj//otserv.o] Error 1
 

Edited by caiohp (see edit history)

Idéias são à prova de balas.

xS0NYx here

"Ser ateu é viver em razão de fatos, não de crenças; É aproveitar essa vida, não desperdiça-la na esperança de viver outra; É fazer o bem de coração, não por devoção. Ser ate, simplesmente, um ser livre."

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


Open Tibia Server

Quer aprender a criar seu próprio servidor de Tibia? Então está no lugar certo, aqui você encontrará milhares de tutorias, scripts, códigos, mapas e utilitários para que você possa fazer o seu próprio servidor de Tibia partindo do zero.

Redes Sociais

Anuncie no Tibia King

Precisa de mais visibilidade em seus projetos? Quer publicidade para o seu servidor? Anuncie no Tibia King e faça sua divulgação, possuímos centenas de acessos simultâneos e milhares diários, com certeza será a sua solução! A publicação do seu anuncio é instantânea!

×
×
  • Create New...