1 | /* |
---|
2 | * Copyright (C) 2005-2008,2007 MaNGOS <http://www.mangosproject.org/> |
---|
3 | * |
---|
4 | * This program is free software; you can redistribute it and/or modify |
---|
5 | * it under the terms of the GNU General Public License as published by |
---|
6 | * the Free Software Foundation; either version 2 of the License, or |
---|
7 | * (at your option) any later version. |
---|
8 | * |
---|
9 | * This program is distributed in the hope that it will be useful, |
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | * GNU General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU General Public License |
---|
15 | * along with this program; if not, write to the Free Software |
---|
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
17 | */ |
---|
18 | |
---|
19 | /** \file |
---|
20 | \ingroup u2w |
---|
21 | */ |
---|
22 | |
---|
23 | #include "Common.h" |
---|
24 | #include "WorldSocket.h" |
---|
25 | #include "WorldSocketMgr.h" |
---|
26 | #include "Policies/SingletonImp.h" |
---|
27 | |
---|
28 | INSTANTIATE_SINGLETON_1( WorldSocketMgr ); |
---|
29 | |
---|
30 | /// WorldSocketMgr constructor |
---|
31 | WorldSocketMgr::WorldSocketMgr() |
---|
32 | { |
---|
33 | } |
---|
34 | |
---|
35 | /// Add a WorldSocket to the set |
---|
36 | void WorldSocketMgr::AddSocket(WorldSocket *s) |
---|
37 | { |
---|
38 | m_sockets.insert(s); |
---|
39 | } |
---|
40 | |
---|
41 | /// Remove a WorldSocket to the set |
---|
42 | void WorldSocketMgr::RemoveSocket(WorldSocket *s) |
---|
43 | { |
---|
44 | m_sockets.erase(s); |
---|
45 | } |
---|
46 | |
---|
47 | /// Triggers an 'update' to all sockets in the set |
---|
48 | void WorldSocketMgr::Update(time_t diff) |
---|
49 | { |
---|
50 | SocketSet::iterator i; |
---|
51 | for(i = m_sockets.begin(); i != m_sockets.end(); i++) |
---|
52 | { |
---|
53 | (*i)->Update(diff); |
---|
54 | } |
---|
55 | } |
---|