-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
256 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ SDL_gfx-2.0.24/ | |
*.o | ||
yatc | ||
yatc_cli | ||
dat2json_cli | ||
Tibia.pic | ||
Tibia.dat | ||
Tibia.spr | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
CXXFLAGS=-DCLI_ONLY -DLOGIN_ONLY -DHAVE_GMP_H=1 | ||
CXXFLAGS=-DCLI_ONLY -DLOGIN_ONLY -DHAVE_GMP_H=1 -fPIE | ||
CFLAGS=-DCLI_ONLY -DLOGIN_ONLY -DHAVE_GMP_H=1 -fPIE | ||
OBJS=yatc_cli.o ../net/connection.o ../net/networkmessage.o ../debugprint.o ../util.o notifications.o ../gamecontent/creature.o ../gamecontent/container.o ../gamecontent/globalvars.o ../gamecontent/inventory.o ../gamecontent/map.o creatureui.o thingui.o distanceui.o effectui.o objects.o ../net/protocolconfig.o ../net/rsa.o ../net/encryption.o ../net/protocollogin.o | ||
yatc_cli: $(OBJS) | ||
g++ $(OBJS) -lSDL -lgmp -fPIE -o yatc_cli | ||
OBJS=../net/connection.o ../net/networkmessage.o ../debugprint.o ../util.o notifications.o ../gamecontent/creature.o ../gamecontent/container.o ../gamecontent/globalvars.o ../gamecontent/inventory.o ../gamecontent/map.o creatureui.o thingui.o distanceui.o effectui.o ../net/protocolconfig.o ../net/rsa.o ../net/encryption.o ../net/protocollogin.o | ||
all: yatc_cli dat2json_cli | ||
yatc_cli: yatc_cli.o $(OBJS) objects.o | ||
g++ yatc_cli.o $(OBJS) objects.o -lSDL -lgmp -fPIE -o yatc_cli | ||
dat2json_cli: $(OBJS) dat2json_cli.o ../objects.o ../options.o ../confighandler.o | ||
g++ dat2json_cli.o ../objects.o ../options.o ../confighandler.o $(OBJS) -lSDL -lgmp -o dat2json_cli | ||
clean: | ||
rm $(OBJS) yatc_cli | ||
rm $(OBJS) yatc_cli yatc_cli.o dat2json_cli dat2json_cli.o ../objects.o objects.o ../options.o ../confighandler.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
////////////////////////////////////////////////////////////////////// | ||
// Yet Another Tibia Client | ||
////////////////////////////////////////////////////////////////////// | ||
// CLI version. | ||
////////////////////////////////////////////////////////////////////// | ||
// 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. | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
#include <string> | ||
#include <iostream> | ||
#include <fstream> | ||
#include "../util.h" | ||
#include "../objects.h" | ||
#include "../options.h" | ||
#include "../net/connection.h" | ||
|
||
#if BAZEL_BUILD && WIN32 | ||
#include <SDL/SDL.h> // Give SDL a chance to rename main() for sake of SDL_main. | ||
#endif | ||
|
||
std::string g_recordfilename="debugrecord.rec"; | ||
|
||
unsigned int g_frameTime = 0; | ||
unsigned int g_frameDiff = 0; | ||
Connection *g_connection = NULL; | ||
|
||
int main(int argc, char** argv) { | ||
yatc_fopen_init(argv[0]); | ||
ClientVersion_t proto = CLIENT_VERSION_854; | ||
auto i = Objects::getInstance(); | ||
if (argc != 3) { | ||
fprintf(stderr, "usage: %s datfile jsonfile\n", argv[0]); | ||
return 1; | ||
} | ||
std::cout << "Warning: In case of crash after this line check you put Tibia.{dat,spr,pic} in CWD." << std::endl << std::flush; | ||
ProtocolConfig::getInstance().setServerType(SERVER_OTSERV); | ||
ProtocolConfig::getInstance().setVersion(CLIENT_OS_WIN, proto); | ||
ProtocolConfig::getInstance().setVersionOverride(CLIENT_VERSION_AUTO); | ||
i->loadDat(argv[1]); | ||
|
||
std::ofstream outFile; | ||
outFile.open(argv[2]); | ||
i->asJSON(outFile); | ||
outFile.close(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters