Commit ff419a92fc9b1deff279573cbfc34b56f797a978

Authored by Imanol-Mikel Barba Sabariego
1 parent cf8d9372

Minor styling

Showing 1 changed file with 10 additions and 12 deletions
mcplayerstat.c
... ... @@ -22,18 +22,19 @@ void printInventory(TagList *inv) {
22 22 }
23 23 }
24 24  
  25 +/*
  26 + * int playerGameType
  27 + * int XpLevel
  28 + * list(compound) Inventory
  29 + * list(compound) EnderItems
  30 + * list(float) Pos
  31 + */
25 32 int parseMCPlayerFile(const char* filename) {
26 33 unsigned int pos = 0;
27 34 void* data;
28 35  
29 36 ssize_t dblen = loadDB(filename, &data);
30 37 if(dblen > 0) {
31   - // int playerGameType
32   - // int XpLevel
33   - // list(compound) Inventory
34   - // list(compound) EnderItems
35   - // list(float) Pos
36   -
37 38 Tag t;
38 39 pos = parseTag((data + pos),&t);
39 40 if(pos != dblen) {
... ... @@ -50,7 +51,7 @@ int parseMCPlayerFile(const char* filename) {
50 51 printf("playerGameType: %s\n",(playerGameType == 0 ? "Survival" : (playerGameType == 1 ? "Creative" : (playerGameType == 2 ? "Adventure" : (playerGameType == 3 ? "Spectator" : "UNKNOWN")))));
51 52 } else if (!strncmp(node.name,"XpLevel",node.nameLength)) {
52 53 int xpLevel = *((uint32_t*)node.payload);
53   - printf("XpLevel: %u\n",xpLevel);
  54 + printf("XpLevel: %u\n",xpLevel);
54 55 }
55 56 } else if(node.type == TAG_LIST) {
56 57 TagList* l = (TagList*)node.payload;
... ... @@ -73,10 +74,7 @@ int parseMCPlayerFile(const char* filename) {
73 74 free(data);
74 75 return 0;
75 76 }
76   -
77   -
78   -
79   -
  77 + return -1;
80 78 }
81 79  
82 80 int main(int argc, char** argv) {
... ... @@ -86,4 +84,4 @@ int main(int argc, char** argv) {
86 84 }
87 85  
88 86 return parseMCPlayerFile(argv[1]);
89   -}
90 87 \ No newline at end of file
  88 +}
... ...