Tech help

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
ZPoc
Posts: 2
Joined: 2003-02-26 15:24
Contact:

Tech help

Post by ZPoc » 2003-02-26 15:33

.

This is for our network, and we want to allow music videos, but not full movies, I want the client to only list files that are below 75 meg.

I know it should be in the shareManager.cpp, and possibly in
"ShareManager::Directory* ShareManager::buildTree..."
But I can't seem to get it to work.. Can someone please point me in the right direction or pass along the proper code?
Thanks,
Bobby

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Re: Tech help

Post by GargoyleMT » 2003-02-26 16:03

ZPoc wrote:This is for our network, and we want to allow music videos, but not full movies, I want the client to only list files that are below 75 meg.

I know it should be in the shareManager.cpp, and possibly in
"ShareManager::Directory* ShareManager::buildTree..."
But I can't seem to get it to work.. Can someone please point me in the right direction or pass along the proper code?
Hola Bobby.

I'm sure one of the kind ops will move this to the Programmer's Help section :-D

This'll probably do you just fine:

Code: Select all

--- ShareManager.cpp    Tue Feb 25 18:32:54 2003
+++ ShareManager.cpp.mod.cpp    Wed Feb 26 15:58:40 2003
@@ -250,11 +250,13 @@

                                        // Not a directory, assume it's a file...make sure we're not sharing the setting
s file...
                                        if(Util::stricmp(name.c_str(), "DCPlusPlus.xml") != 0 && name.find('$') == string::npos) {
+                                               if(((int64_t)data.nFileSizeLow | ((int64_t)data.nFileSizeHigh)<<32) <= 75 *1024*1024) {
                                                dir->addSearchType(getMask(name));
                                                dir->addType(getType(name));
                                                dir->files[name] = (int64_t)data.nFileSizeLow | ((int64_t)data.nFileSizeHigh)<<32;
                                                dir->size+=(int64_t)data.nFileSizeLow | ((int64_t)data.nFileSizeHigh)<<32;
                                        }
+                                       }
                                }
                        }
                } while(FindNextFile(hFind, &data));
I just copied the file size code from inside that if loop... it should work, but I haven't tested it. Your mileage may vary.

- Todd

aDe
Forum Moderator
Posts: 138
Joined: 2003-01-07 09:14
Location: SE
Contact:

Re: Tech help

Post by aDe » 2003-02-26 17:07

GargoyleMT wrote:I'm sure one of the kind ops will move this to the Programmer's Help section :-D
alrite.. :)

ZPoc
Posts: 2
Joined: 2003-02-26 15:24
Contact:

oops

Post by ZPoc » 2003-02-26 17:41

Todd, thanks for helping me out, can't belive I missed it.

Bobby

Ps, sorry for putting it in the wrong forum :(

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Re: Tech help

Post by GargoyleMT » 2003-02-26 17:45

aDe wrote:
GargoyleMT wrote:I'm sure one of the kind ops will move this to the Programmer's Help section :-D
alrite.. :)
PS. Thank you!

Locked