Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / server / src / ai_service / aids_interface.cpp
blobcd55134a60549818f7b07a78a0ea7fcb5bdf0028
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
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 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/>.
19 #include "stdpch.h"
20 #include "aids_interface.h"
21 #include "ai_share/aids_messages.h"
23 using namespace NLMISC;
24 using namespace NLNET;
25 using namespace std;
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");