# Added initial support for players and population counters in new simulation system, plus various infrastructure improvements.

Merge from 22b478ffed8d.
Pure scripted interface definitions.
Entity creation from scripts.
Improved messaging system.
Messages on entity deletion.
Basic player entities.
Player ownership.
Bug fixes.

This was SVN commit r7281.
This commit is contained in:
Ykkrosh
2010-01-22 20:03:14 +00:00
parent 33882ab698
commit 4fed9b8242
57 changed files with 1312 additions and 207 deletions
@@ -46,15 +46,16 @@ void CComponentTypeScript::Deinit(const CSimContext& UNUSED(context))
m_ScriptInterface.CallFunctionVoid(m_Instance, "Deinit");
}
void CComponentTypeScript::HandleMessage(const CSimContext& UNUSED(context), const CMessage& msg)
void CComponentTypeScript::HandleMessage(const CSimContext& UNUSED(context), const CMessage& msg, bool global)
{
const char* name = msg.GetScriptHandlerName();
const char* name = global ? msg.GetScriptGlobalHandlerName() : msg.GetScriptHandlerName();
CScriptVal msgVal = msg.ToJSVal(m_ScriptInterface);
// TODO: repeated conversions are exceedingly inefficient. Should
// cache this once per message (if it's used by >= 1 scripted component)
m_ScriptInterface.CallFunctionVoid(m_Instance, name, msgVal);
if (!m_ScriptInterface.CallFunctionVoid(m_Instance, name, msgVal))
LOGERROR(L"Script message handler %hs failed", name);
}
void CComponentTypeScript::Serialize(ISerializer& serialize)