| 85 | } |
| 86 | |
| 87 | void DecodeKeyIndexDat(const CFileDataIO& file) |
| 88 | { |
| 89 | uint32_t version; |
| 90 | uint32_t numKeys; |
| 91 | uint32_t numSource; |
| 92 | uint32_t numName; |
| 93 | uint8_t tagCount; |
| 94 | |
| 95 | cout << "Version : " << (version = file.ReadUInt32()); |
| 96 | cout << "\nSaveTime: " << CTimeT(file.ReadUInt32()); |
| 97 | cout << "\nID : " << file.ReadUInt128(); |
| 98 | cout << "\nnumKeys : " << (numKeys = file.ReadUInt32()) << '\n'; |
| 99 | for (uint32_t ik = 0; ik < numKeys; ik++) { |
| 100 | Kademlia::CUInt128 keyID = file.ReadUInt128(); |
| 101 | bool identified = false; |
| 102 | cout << "\tKeyID : " << keyID; |
| 103 | cout << "\n\tnumSource: " << (numSource = file.ReadUInt32()) << '\n'; |
| 104 | for (uint32_t is = 0; is < numSource; is++) { |
| 105 | cout << "\t\tSourceID: " << file.ReadUInt128(); |
| 106 | cout << "\n\t\tnumName : " << (numName = file.ReadUInt32()) << '\n'; |
| 107 | for (uint32_t iN = 0; iN < numName; iN++) { |
| 108 | cout << "\t\t\tLifeTime : " << CTimeT(file.ReadUInt32()) << '\n'; |
| 109 | if (version >= 3) { |
| 110 | uint32_t count; |
| 111 | cout << "\t\t\tnameCount: " << (count = file.ReadUInt32()) << '\n'; |
| 112 | for (uint32_t i = 0; i < count; i++) { |
| 113 | wxString name = file.ReadString(true, 2); |
| 114 | cout << "\t\t\t\t{ " << MakePrintableString(name); |
| 115 | cout << ", " << file.ReadUInt32() << " }\n"; |
| 116 | wxString keyword; |
| 117 | if (!identified && IdentifyKeyword(keyID, name, keyword)) { |
| 118 | cout << "\tKeyword: " << MakePrintableString(keyword) << '\n'; |
| 119 | identified = true; |
| 120 | } |
| 121 | } |
| 122 | cout << "\t\t\tipCount : " << (count = file.ReadUInt32()) << '\n'; |
| 123 | for (uint32_t i = 0; i < count; i++) { |
| 124 | cout << "\t\t\t\t{ " << CKadIP(file.ReadUInt32()); |
| 125 | cout << ", " << CTimeT(file.ReadUInt32()) << " }\n"; |
| 126 | } |
| 127 | } |
| 128 | cout << "\t\t\ttagCount : " << (uint32)(tagCount = file.ReadUInt8()) << '\n'; |
| 129 | for (uint32_t it = 0; it < tagCount; it++) { |
| 130 | CTag *tag = file.ReadTag(); |
| 131 | cout << "\t\t\t\t" << *tag << '\n'; |
| 132 | delete tag; |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | void DecodeSourceIndexDat(const CFileDataIO& file) |
| 140 | { |
no test coverage detected