Official eMule-Board: Difference Between Csearch::file: And Csearch::findsource: - Official eMule-Board

Jump to content


Page 1 of 1

Difference Between Csearch::file: And Csearch::findsource:

#1 User is offline   Sebastian2 

  • Splendid Member
  • PipPipPipPip
  • Group: Members
  • Posts: 196
  • Joined: 18-November 02

Posted 14 December 2008 - 07:59 PM

Hello,

I now got a compiled version of emule without problems by using VS2003.

At the moment I try to understand how this whole thing works and Im at SearchManager.cpp. Whats the difference between CSearch::FILE: and CSearch::FINDSOURCE:? At first I would think the difference would be that the first is for filesearching and the second for finding sources for a file but the keyword-kademlia search seems to be at CSearch::KEYWORD:.

So I thought there where 2 searches related to a file. The search for files with CSearch::KEYWORD: and the search for sources for a file-hash with CSearch::FINDSOURCE:. So whats CSearch::FILE:?

Greetings!
Sebastian
0

#2 User is offline   tHeWiZaRdOfDoS 

  • Man, what a bunch of jokers...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5630
  • Joined: 28-December 02

Posted 15 December 2008 - 06:13 PM

CSearch::FINDSOURCE is used to find a specific source in the network (the buddy) and CSearch::FILE is used to find sources for a file. You can find out more about certain terms by simply searching the sourcecode for them.
0

#3 User is offline   Sebastian2 

  • Splendid Member
  • PipPipPipPip
  • Group: Members
  • Posts: 196
  • Joined: 18-November 02

Posted 20 December 2008 - 04:18 AM

Thanks for answering... Didnt get a mail about it I think. I will try that.

C++ isnt that hard to understand I think. Its like php coded in classes for me. Or at least its similar. Not so friendly like php for example brackets must be wrote in a new line in a for-construct but its understandable.

I will see how far I will come with your tip.

Greetings!
Sebastian
0

#4 User is offline   fox88 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 4974
  • Joined: 13-May 07

Posted 20 December 2008 - 12:31 PM

You better read something about C++ instead of guessing it's syntax. Brackets placement is a matter of personal tastes mostly... and readability of code.
0

#5 User is offline   Sebastian2 

  • Splendid Member
  • PipPipPipPip
  • Group: Members
  • Posts: 196
  • Joined: 18-November 02

Posted 20 December 2008 - 09:18 PM

Normally I write a for-construct in php this way:

for($count = 1; $count < $zahl; $count++){
echo $count,", ";
}

Its most clearly for me for the code.

c++ wants the bracket in the next line and cant work with the bracket in the first line. I meant such things.

And for the syntax I do read the syntax in the net when it comes to such a point. Like I did for the for-constructs.

I still think c++ is similar to php coded in classes. So mostly its not hard to see what the code is for. The problem is like with every project that someone else has coded to understand how all things work together. What means that var and this function and so on. So I think reading a book about c++ wouldnt bring me much. Because the basics are similar, the differences are little and can be read in the net and the rest is to understand the program itself. I think...

Greetings!
Sebastian
0

#6 User is offline   Tuxman 

  • lizzie and prog-rock fanatic
  • PipPipPipPipPipPipPip
  • Group: Validating
  • Posts: 2707
  • Joined: 26-July 04

Posted 20 December 2008 - 11:10 PM

View PostSebastian2, on Dec 20 2008, 10:18 PM, said:

c++ wants the bracket in the next line and cant work with the bracket in the first line.

:confused:
[ eMule beba ] :: v2.72 released, v3.00 in the works ...
- feel the lightweight! - featuring Snarl support, the Client Analyzer and tits!
Coded by a Golden eMule Award winner and most people's favorite modder!
..........................................
Music, not muzak:
Progressive Rock :: my last.fm profile
..........................................
eMule user since 0.28 ...
-[ ... and thanks for all the fish! ]-
0

#7 User is offline   bscabral 

  • "Dream" member
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 339
  • Joined: 25-December 02

Posted 21 December 2008 - 02:16 AM

No, C++ can handle bracket in same line , in 80000+ new lines, 95bi+ writespaces and go on...
IPB Image
IPB Image
0

#8 User is offline   Sebastian2 

  • Splendid Member
  • PipPipPipPip
  • Group: Members
  • Posts: 196
  • Joined: 18-November 02

Posted 21 December 2008 - 05:55 PM

Hm. I tried it again and it worked that way... So I only thought it was the bracket. Maybe the difference was that in

for (int index=0; index<number; index++)

the var index has to be initialized with its var-type.

So never mind. My fault... :)

Greetings!
Sebastian
0

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users