GalvaoBueno,
Banido por desrespeitar as regras descaradamente.
Por ellendil, 15 de ago. de 2007 em Linguagens de Programação
info
Grupo: Herói
Registrado: 09/07/05
Posts: 1.1k
Reputação: +110
Char no Tibia: Fedrick

GalvaoBueno,
Banido por desrespeitar as regras descaradamente.
@The ChaosEvolutions é uma versão que usa como base CVS ainda.
Estava vendo mais de perto o código, e creio que dá para fazer em LUA também, não armazenando em um XML todo organizado, mas, quem for avançado em LUA, pode fazer um XML Reader, é muito fácil e muito útil.
sim sim, apesar de eu ser péssimo com lua, da sim ja li algo sobre isso, mas eu penso mais na praticidade pra editar (pra mim é mais pratico xml do que lua) ^^. E também, so carrega quando tem alteração grande, não e carregado a cada teleport pois ja ta na memoria ne, então agiliza ![]()
info
Grupo: Campones
Registrado: 13/05/07
Posts: 24
Reputação: 0
Char no Tibia: GoGo Criar /s

Muito bom vai me ajudar bastante vlw
info
Grupo: Visconde
Registrado: 10/06/06
Posts: 338
Reputação: +6
Char no Tibia: Setyte Berseker

@TheChaos
Verdade, a SVN agora está removendo além disso TUDO de XML do OpenTibia, com a revdbsystem, depois dá uma conferida.
A propósito, gostaria de ter uma conversa com você, adicione-me no MSN: ntsonline@30gigs.com
É eu vi sabado isso. Tava fuçando a RoadMap ja que eu to bem afastado e conferi.
To sem acesso até ao email do msn, onde eu trabalho é bloqueado por proxy, depois mando email com o 'funcional'
ta dando esse erro...
../commands.h:84: error: `Teleports' was not declared in this scope../commands.h:84: error: template argument 2 is invalid
../commands.h:84: error: template argument 4 is invalid
../commands.h:84: error: ISO C++ forbids declaration of `TeleportMap' with no type
make.exe: *** [../admin.o] Error 1
Execução terminada
to usando devland 0.96b..jah tentei no evolutions tbm mesmo erro =/ ajuda ae queria muito usar isso!
Tenha certeza de que isso ta no lugar certo no seu commands.h
Depois de:
struct s_defcommands{char *name;
CommandFunc f;
};
Adicione:
struct Teleports{
Position dest;
std::string name;
};
tenho certeza sim...jah fiz umas 10vez mais...e sempre o mesmo 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 2
// 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, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//////////////////////////////////////////////////////////////////////
#ifndef __OTSERV_COMMANDS_H__
#define __OTSERV_COMMANDS_H__
#include <string>
#include <map>
#include "creature.h"
class Game;
struct Command;
struct s_defcommands;
struct Teleports;
class Commands{
public:
Commands():game(NULL),loaded(false){};
Commands(Game* igame);
bool loadXml(const std::string& _datadir);
bool isLoaded(){return loaded;}
bool reload();
bool exeCommand(Creature* creature, const std::string& cmd);
static ReturnValue placeSummon(Creature* creature, const std::string& name);
void playerEditCommands(Player* player, Item* item, const std::string& text);
bool loadTeleportsXml(const std::string& _datadir);
void reloadTeleports(bool loadxml);
bool saveTeleportXml(const std::string& text);
void redoTeleportMap();
protected:
Game* game;
bool loaded;
std::string datadir;
//commands
bool placeNpc(Creature* creature, const std::string& cmd, const std::string& param);
bool placeMonster(Creature* creature, const std::string& cmd, const std::string& param);
bool placeSummon(Creature* creature, const std::string& cmd, const std::string& param);
bool broadcastMessage(Creature* creature, const std::string& cmd, const std::string& param);
bool banPlayer(Creature* creature, const std::string& cmd, const std::string& param);
bool teleportMasterPos(Creature* creature, const std::string& cmd, const std::string& param);
bool teleportHere(Creature* creature, const std::string& cmd, const std::string& param);
bool teleportToTown(Creature* creature, const std::string& cmd, const std::string& param);
bool teleportTo(Creature* creature, const std::string& cmd, const std::string& param);
bool createItemById(Creature* creature, const std::string& cmd, const std::string& param);
bool createItemByName(Creature* creature, const std::string& cmd, const std::string& param);
bool subtractMoney(Creature* creature, const std::string& cmd, const std::string& param);
bool reloadInfo(Creature* creature, const std::string& cmd, const std::string& param);
bool testCommand(Creature* creature, const std::string& cmd, const std::string& param);
bool getInfo(Creature* creature, const std::string& cmd, const std::string& param);
bool closeServer(Creature* creature, const std::string& cmd, const std::string& param);
bool openServer(Creature* creature, const std::string& cmd, const std::string& param);
bool onlineList(Creature* creature, const std::string& cmd, const std::string& param);
bool teleportNTiles(Creature* creature, const std::string& cmd, const std::string& param);
bool kickPlayer(Creature* creature, const std::string& cmd, const std::string& param);
//bool exivaPlayer(Creature* creature, const std::string& cmd, const std::string& param);
bool setHouseOwner(Creature* creature, const std::string& cmd, const std::string& param);
bool sellHouse(Creature* creature, const std::string& cmd, const std::string& param);
bool getHouse(Creature* creature, const std::string& cmd, const std::string& param);
bool bansManager(Creature* creature, const std::string& cmd, const std::string& param);
bool serverInfo(Creature* creature, const std::string& cmd, const std::string& param);
bool forceRaid(Creature* creature, const std::string& cmd, const std::string& param);
bool setSpeed(Creature* creature, const std::string& cmd, const std::string& param);
bool addDescription(Creature* creature, const std::string& cmd, const std::string& param);
bool outfitChanger(Creature*creature, const std::string& cmd, const std::string& param);
bool commandsXmlEditor(Creature* creature, const std::string& cmd, const std::string& param);
bool teleportManager(Creature* creature, const std::string& cmd, const std::string& param);
//table of commands
static s_defcommands defined_commands[];
typedef std::map<std::string,Command*> CommandMap;
CommandMap commandMap;
typedef std::map<std::string,Teleports*> TeleportMap;
TeleportMap teleportMap;
};
typedef bool (Commands::*CommandFunc)(Creature*,const std::string&,const std::string&);
struct Command{
CommandFunc f;
int32_t accesslevel;
bool loaded;
std::string name;
};
struct s_defcommands{
char *name;
CommandFunc f;
};
struct Teleports{
Position dest;
std::string name;
};
#endif
Esse é o meu commands.h, da uma olhada.
Editado Setembro 20 por TheChaos
agora deu esse erro
=/../protocol80.cpp: In member function `void Protocol80::parseTextWindow(NetworkMessage&)':../protocol80.cpp:1258: error: `commands' undeclared (first use this function)
../protocol80.cpp:1258: error: (Each undeclared identifier is reported only once for each function it appears in.)
make.exe: *** [../protocol80.o] Error 1
Execução terminada
Vc não copiou o meu inteiro pro seu não né???
Ahuehae era só pra ver a parte em negrito ^^'.
info
Grupo: Banidos
Registrado: 29/08/07
Posts: 1
Reputação: 0
[removido]
Editado Agosto 30 por Under