Add infos into target window
[ryzomcore.git] / ryzom / server / src / ags_test / ags_test.cpp
blobefb418d90899384490e4b054b0d67da537060af4
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 // Nel Misc
20 #include "nel/misc/command.h"
21 #include "nel/misc/path.h"
23 // Game share
24 #include "game_share/container_property_receiver.h"
25 #include "game_share/msg_brick_service.h"
27 // Local includes
28 #include "ags_test.h"
29 #include "actor.h"
30 #include "actor_manager.h"
32 #include "../src/agent_game/combat_interface.h"
34 using namespace NLMISC;
35 using namespace NLNET;
36 using namespace std;
37 using namespace AGS_TEST;
40 CAgsTest* pAgsTest = NULL;
42 /**
43 * CallbackArray
45 TUnifiedCallbackItem CallbackArray[] =
47 { "AZERTY", NULL },
50 //---------------------------------------------------
51 // Service Init :
52 //
53 //---------------------------------------------------
54 void CAgsTest::init (void)
56 // Load the sheet id lookup table
58 // Initialise the actor manager
59 CActorManager::init();
61 // For windows speed update
62 setUpdateTimeout(100);
64 // keep the pointer on class if need use a methode
65 pAgsTest = this;
67 // init the Tick Event Handler
68 CTickEventHandler::init( serviceUpdate, cbSync );
70 // initialise the property receiver set
71 CContainerPropertyReceiver::initPropertyReceiver();
73 // init the combat interface
74 CCombatInterface::init();
76 // Init callback for service up / down
77 CUnifiedNetwork::getInstance()->setServiceUpCallback ("*", cbServiceUp, NULL);
78 CUnifiedNetwork::getInstance()->setServiceDownCallback( string("*"), cbServiceDown, 0);
81 //---------------------------------------------------
82 // Service update :
83 //
84 //---------------------------------------------------
85 bool CAgsTest::update (void)
87 return true;
90 //---------------------------------------------------
91 // Service release :
92 //
93 //---------------------------------------------------
94 void CAgsTest::release (void)
96 CContainerPropertyReceiver::releaseAllPropertiesManagers();
99 //---------------------------------------------------
100 // Service update : Call at every ticks
102 //---------------------------------------------------
103 void CAgsTest::serviceUpdate(void)
105 CActorManager::update();
108 /****************************************************************\
109 ****************************************************************
110 Callback functions
111 ****************************************************************
112 \****************************************************************/
113 // Callback called at service connexion
114 void cbServiceUp( const string& serviceName, uint16 serviceId, void * )
116 /*if (serviceName==std::string("EGS"))
117 CActorManager::reconnectEGS((uint8)serviceId);
119 if (serviceName==std::string("IOS"))
120 CActorManager::reconnectIOS((uint8)serviceId);
122 if (serviceName==std::string("GPMS"))
123 CActorManager::reconnectGPMS((uint8)serviceId);*/
126 // Callback called at service down
127 void cbServiceDown( const string& serviceName, uint16 serviceId, void * )
131 //---------------------------------------------------
132 // cbSync, for service init with current time/tick if needed
134 //---------------------------------------------------
135 void cbSync()
137 } // cbSync //
140 /****************************************************************\
141 ****************************************************************
142 Service register
143 ****************************************************************
144 \****************************************************************/
145 NLNET_SERVICE_MAIN (CAgsTest, "AgG", "ags_test_service", 0, CallbackArray, "", "")
149 //-------------------------------------------------------------------------