-
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.
dat2json, ...: Adding a (broken) standalone
dat2json_cli
.
It currently does not build with Bazel, and crashes when built with `make`. Tolerable for merging of the branch, however: issue can be addressed later. A useful side effect is that more useless GUI-dependencies have been removed, such as an attempt to load graphics in `objects.cpp`.
- Loading branch information
Showing
6 changed files
with
181 additions
and
10 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 | ||
CFLAGS=-DCLI_ONLY -DLOGIN_ONLY -DHAVE_GMP_H=1 | ||
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 -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: $(OBJS) yatc_cli.o objects.o | ||
g++ yatc_cli.o $(OBJS) objects.o -lSDL -lgmp -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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
////////////////////////////////////////////////////////////////////// | ||
// 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) { | ||
auto i = Objects::getInstance(); | ||
if (argc != 3) { | ||
fprintf(stderr, "usage: %s datfile jsonfile\n", argv[0]); | ||
return 1; | ||
} | ||
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