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 "nel/misc/command.h"
21 #include "nel/misc/path.h"
24 #include "game_share/container_property_receiver.h"
25 #include "game_share/msg_brick_service.h"
30 #include "actor_manager.h"
32 #include "../src/agent_game/combat_interface.h"
34 using namespace NLMISC
;
35 using namespace NLNET
;
37 using namespace AGS_TEST
;
40 CAgsTest
* pAgsTest
= NULL
;
45 TUnifiedCallbackItem CallbackArray
[] =
50 //---------------------------------------------------
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
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 //---------------------------------------------------
84 //---------------------------------------------------
85 bool CAgsTest::update (void)
90 //---------------------------------------------------
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 ****************************************************************
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 //---------------------------------------------------
140 /****************************************************************\
141 ****************************************************************
143 ****************************************************************
144 \****************************************************************/
145 NLNET_SERVICE_MAIN (CAgsTest
, "AgG", "ags_test_service", 0, CallbackArray
, "", "")
149 //-------------------------------------------------------------------------