| 76 | RString GetNetworkPassword(); |
| 77 | |
| 78 | RString GetIdentityText(const PlayerIdentity& identity); |
| 79 | |
| 80 | void CopyDirectoryStructure(const char* dst, const char* src) |
| 81 | { |
| 82 | char buffer[256]; |
| 83 | snprintf(buffer, sizeof(buffer), "%s\\*.*", src); |
| 84 | |
| 85 | _finddata_t info; |
| 86 | intptr_t h = _findfirst(buffer, &info); |
| 87 | if (h != -1) |
| 88 | { |
| 89 | do |
| 90 | { |
| 91 | if ((info.attrib & _A_SUBDIR) != 0) |
| 92 | { |
| 93 | // FIX - do not delete only current and parent directory |
| 94 | if (strcmp(info.name, ".") != 0 && strcmp(info.name, "..") != 0) |
| 95 | { |
| 96 | char srcNew[256]; |
| 97 | char dstNew[256]; |
| 98 | snprintf(srcNew, sizeof(srcNew), "%s\\%s", src, info.name); |
| 99 | snprintf(dstNew, sizeof(dstNew), "%s\\%s", dst, info.name); |
| 100 | CreateDirectory(dstNew, nullptr); |
| 101 | CopyDirectoryStructure(dstNew, srcNew); |
| 102 | } |
| 103 | } |
| 104 | else |
| 105 | { |
| 106 | char srcNew[256]; |
| 107 | char dstNew[256]; |
| 108 | snprintf(srcNew, sizeof(srcNew), "%s\\%s", src, info.name); |
| 109 | snprintf(dstNew, sizeof(dstNew), "%s\\%s", dst, info.name); |
| 110 | ::CopyFile(srcNew, dstNew, FALSE); |
| 111 | } |
| 112 | } while (_findnext(h, &info) == 0); |
| 113 | _findclose(h); |
| 114 | } |
| 115 | } |
| 116 | void RunInitScript() |
| 117 | { |
| 118 | RString initScript = GetMissionDirectory() + RString("init.sqs"); |
| 119 | if (QIFStreamB::FileExist(initScript)) |
| 120 | { |
no test coverage detected