1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
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 Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include "aids_interface.h"
21 #include "ai_share/aids_messages.h"
23 using namespace NLMISC
;
24 using namespace NLNET
;
27 //---------------------------------------------------------------------------------
28 // service up and service down callbacks
30 static void cbServiceUp( const std::string
& serviceName
, NLNET::TServiceId serviceId
, void * )
32 if (serviceName
=="AIDS")
34 // send a message to the service to say 'I exist'
35 CMsgAIServiceUp().send(serviceId
);
36 // send messages to say which managers are up and running
40 static void cbServiceDown( const std::string
& serviceName
, NLNET::TServiceId serviceId
, void * )
45 //---------------------------------------------------------------------------------
46 // classic init() and release()
47 void CAIDSInterface::init()
49 // register the service up and service down callbacks
50 CUnifiedNetwork::getInstance()->setServiceUpCallback("AIDS", cbServiceUp
, 0);
51 CUnifiedNetwork::getInstance()->setServiceDownCallback( "AIDS", cbServiceDown
, 0);
54 void CAIDSInterface::release()
58 //---------------------------------------------------------------------------------
59 // send text messages back to the AIDS
60 void CAIDSInterface::info(const std::string
&s
)
62 string str
= string("AIS: %3d: INF: ")+s
;
63 CMsgAIFeedback(str
).send("AIDS");
66 void CAIDSInterface::debug(const std::string
&s
)
68 string str
= string("AIS: %3d: DBG: ")+s
;
69 CMsgAIFeedback(str
).send("AIDS");
72 void CAIDSInterface::warning(const std::string
&s
)
74 string str
= string("AIS: %3d: WRN: ")+s
;
75 CMsgAIFeedback(str
).send("AIDS");