Subversion Repositories tpanel

Rev

Rev 465 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 465 Rev 482
Line 1626... Line 1626...
1626
 
1626
 
1627
            realPath = dr.stripPath("AMXPanel", fname);
1627
            realPath = dr.stripPath("AMXPanel", fname);
1628
            realPath = TConfig::getProjectPath() + "/" + realPath;
1628
            realPath = TConfig::getProjectPath() + "/" + realPath;
1629
 
1629
 
1630
            if (dr.isFile(realPath))
1630
            if (dr.isFile(realPath))
1631
                len = dr.getFileSize(realPath);
1631
                len = static_cast<int>(dr.getFileSize(realPath));
1632
        }
1632
        }
1633
 
1633
 
1634
        MSG_DEBUG("0x0000/0x0100: Request directory " << fname);
1634
        MSG_DEBUG("0x0000/0x0100: Request directory " << fname);
1635
        snprintf((char *)&ftr.data.filetransfer.data[0], sizeof(ftr.data.filetransfer.data), "Syncing %d files ...", ftransfer.maxFiles);
1635
        snprintf((char *)&ftr.data.filetransfer.data[0], sizeof(ftr.data.filetransfer.data), "Syncing %d files ...", ftransfer.maxFiles);
1636
 
1636
 
Line 1665... Line 1665...
1665
            s.type = 0x0102;
1665
            s.type = 0x0102;
1666
 
1666
 
1667
            s.value = (dr.testDirectory(df.attr)) ? 1 : 0;  // Depends on type of entry
1667
            s.value = (dr.testDirectory(df.attr)) ? 1 : 0;  // Depends on type of entry
1668
            s.level = dr.getNumEntries();       // # entries
1668
            s.level = dr.getNumEntries();       // # entries
1669
            s.value1 = df.count;                // counter
1669
            s.value1 = df.count;                // counter
1670
            s.value2 = df.size;                 // Size of file
1670
            s.value2 = static_cast<uint32_t>(df.size);  // Size of file
1671
            s.value3 = df.date;                 // Last modification date (epoch)
1671
            s.value3 = static_cast<uint32_t>(df.date);  // Last modification date (epoch)
1672
            s.msg.assign(amxpath + "/" + df.name);
1672
            s.msg.assign(amxpath + "/" + df.name);
1673
            sendCommand(s);
1673
            sendCommand(s);
1674
        }
1674
        }
1675
 
1675
 
1676
        if (dr.getNumEntries() == 0)
1676
        if (dr.getNumEntries() == 0)
Line 1876... Line 1876...
1876
        if (!access(sndFileName.c_str(), R_OK))
1876
        if (!access(sndFileName.c_str(), R_OK))
1877
        {
1877
        {
1878
            struct stat s;
1878
            struct stat s;
1879
 
1879
 
1880
            if (stat(sndFileName.c_str(), &s) == 0)
1880
            if (stat(sndFileName.c_str(), &s) == 0)
1881
                len = s.st_size;
1881
                len = static_cast<int>(s.st_size);
1882
            else
1882
            else
1883
                len = 0;
1883
                len = 0;
1884
        }
1884
        }
1885
        else if (sndFileName.find("/version.xma") > 0)
1885
        else if (sndFileName.find("/version.xma") > 0)
1886
            len = 0x0015;
1886
            len = 0x0015;
Line 1906... Line 1906...
1906
 
1906
 
1907
        if (!access(sndFileName.c_str(), R_OK))
1907
        if (!access(sndFileName.c_str(), R_OK))
1908
        {
1908
        {
1909
            struct stat st;
1909
            struct stat st;
1910
            stat(sndFileName.c_str(), &st);
1910
            stat(sndFileName.c_str(), &st);
1911
            len = st.st_size;
1911
            len = static_cast<int>(st.st_size);
1912
            lenSnd = len;
1912
            lenSnd = len;
1913
            posSnd = 0;
1913
            posSnd = 0;
1914
            sndFile = fopen(sndFileName.c_str(), "r");
1914
            sndFile = fopen(sndFileName.c_str(), "r");
1915
 
1915
 
1916
            if (!sndFile)
1916
            if (!sndFile)
Line 1941... Line 1941...
1941
            }
1941
            }
1942
        }
1942
        }
1943
        else if (sndFileName.find("/version.xma") > 0)
1943
        else if (sndFileName.find("/version.xma") > 0)
1944
        {
1944
        {
1945
            s.msg.assign("<version>9</version>\n");
1945
            s.msg.assign("<version>9</version>\n");
1946
            len = s.msg.length();
1946
            len = static_cast<int>(s.msg.length());
1947
            posSnd = len;
1947
            posSnd = len;
1948
        }
1948
        }
1949
        else
1949
        else
1950
            len = 0;
1950
            len = 0;
1951
 
1951
 
Line 1972... Line 1972...
1972
        if (posSnd < lenSnd)
1972
        if (posSnd < lenSnd)
1973
        {
1973
        {
1974
            s.type = 0x0003;        // Next part of file
1974
            s.type = 0x0003;        // Next part of file
1975
 
1975
 
1976
            if ((posSnd + MAX_CHUNK) > lenSnd)
1976
            if ((posSnd + MAX_CHUNK) > lenSnd)
1977
                len = lenSnd - posSnd;
1977
                len = static_cast<int>(lenSnd - posSnd);
1978
            else
1978
            else
1979
                len = MAX_CHUNK;
1979
                len = MAX_CHUNK;
1980
 
1980
 
1981
            s.value1 = len;
1981
            s.value1 = len;
1982
 
1982