Connected to # of hubs

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

Moderator: Moderators

Locked
xforx
Posts: 7
Joined: 2003-12-10 09:15

Connected to # of hubs

Post by xforx » 2003-12-10 09:20

How can I check the number of currently connected hubs in DCpp, I guess there is some function that returns this, given that Hubs get this information somehow from the client I guess since there is no central server, alas I havn't been able to find it.

Thanks.

Twink
Posts: 436
Joined: 2003-03-31 23:31
Location: New Zealand

Post by Twink » 2003-12-10 17:46

Client has a static member called connections (or something like that) which has a count of the different types of hubs ur connected to (op, reg, and guest)

Pommes
Posts: 1
Joined: 2003-12-26 18:05

Post by Pommes » 2003-12-26 18:13

I didn't find it, can you be more precise (or how does it spell?)?

psf8500
Posts: 23
Joined: 2003-03-04 18:51
Contact:

Post by psf8500 » 2003-12-26 19:51

Code: Select all

struct Counts {
		Counts(long n = 0, long r = 0, long o = 0) : normal(n), registered(r), op(o) { };
		long normal;
		long registered;
		long op;
		bool operator !=(const Counts& rhs) { return normal != rhs.normal || registered != rhs.registered || op != rhs.op; };
	};

	static Counts counts;

....

static string getCounts() {
		char buf[128];
		return string(buf, sprintf(buf, "%ld/%ld/%ld", counts.normal, counts.registered, counts.op));
	}
from client.h

Locked