MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / server_object

Method server_object

ogsr_engine/COMMON_AI/object_item_script.cpp:28–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28ObjectFactory::SERVER_BASE_CLASS* CObjectItemScript::server_object(LPCSTR section) const
29{
30 typedef ObjectFactory::SERVER_SCRIPT_BASE_CLASS SERVER_SCRIPT_BASE_CLASS;
31 typedef ObjectFactory::SERVER_BASE_CLASS SERVER_BASE_CLASS;
32 SERVER_SCRIPT_BASE_CLASS* object;
33
34 // try {
35 luabind::object* instance = 0;
36 // try {
37 instance = xr_new<luabind::object>((luabind::object)(m_server_creator(section)));
38 //}
39 // catch(std::exception& e) {
40 // Msg ("Exception [%s] raised while creating server object from section [%s]", e.what(),section);
41 // return (0);
42 //}
43 // catch(...) {
44 // Msg ("Exception raised while creating server object from section [%s]",section);
45 // return (0);
46 //}
47
48 object = luabind::object_cast<ObjectFactory::SERVER_SCRIPT_BASE_CLASS*>(*instance, luabind::adopt<luabind::result>());
49 xr_delete(instance);
50 //}
51 // catch(std::exception& e) {
52 // Msg ("Exception [%s] raised while casting and adopting script server object from section [%s]", e.what(),section);
53 // return (0);
54 //}
55 // catch(...) {
56 // Msg ("Exception raised while creating script server object from section [%s]", section);
57 // return (0);
58 //}
59
60 R_ASSERT(object);
61 SERVER_BASE_CLASS* o = object->init();
62 R_ASSERT(o);
63 return (o);
64}
65
66CObjectItemScript::CObjectItemScript(luabind::object client_creator, luabind::object server_creator, const CLASS_ID& clsid, LPCSTR script_clsid) : inherited(clsid, script_clsid)
67{

Callers 1

F_entity_CreateFunction · 0.45

Calls 2

xr_deleteFunction · 0.85
initMethod · 0.45

Tested by

no test coverage detected