summaryrefslogtreecommitdiff
path: root/src/servers.cpp
blob: c334b5c910e708c1aec1284a4b88d7daa0f649f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*

$Log$
Revision 1.2  2003/01/26 23:53:03  brain
Modified documentation for base classes
Added base classes

Revision 1.1  2003/01/26 20:15:03  brain
Added server classes for linking


*/

#include "inspircd_config.h" 
#include "servers.h"
#include "inspircd.h"
#include <stdio.h>
#include <map.h>

serverrec::serverrec()
{
	leaf.clear();
	strcpy(name,"");
	pingtime = 0;
	linktype = LINK_ACTIVE;
	lastping = time(NULL);
	usercount_i = usercount = opercount = version = 0;
	hops_away = 1;
	connected_at = time(NULL);
	jupiter = false;
	fd = 0;
}

 
serverrec::~serverrec()
{
}

serverrec::serverrec(char* n, int link_t,  long ver, bool jupe)
{
	leaf.clear();
	strcpy(name,n);
	linktype = link_t;
	lastping = time(NULL);
	usercount_i = usercount = opercount = 0;
	version = ver;
	hops_away = 1;
	connected_at = time(NULL);
	jupiter = jupe;
	fd = 0;
}

void serverrec::AddLeaf(serverrec *child)
{
	leaf[child->name] = child;
}

void serverrec::DelLeaf(string n)
{
	server_list::iterator i = leaf.find(n);

	if (i != leaf.end())
		leaf.erase(i);
}