Skip to content

Commit

Permalink
Fixed case sensitivity in Generic message registration.
Browse files Browse the repository at this point in the history
* Fixed some KeyNotFound exceptions
  • Loading branch information
pallarim committed Nov 11, 2010
1 parent c0cf973 commit c451e3d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ModularRex/RexParts/EntityComponentModule.cs
Expand Up @@ -120,9 +120,9 @@ private void HandleNewClient(OpenSim.Framework.Client.IClientCore client)
if (client.TryGet<NaaliClientView>(out naali))
{
naali.OnBinaryGenericMessage += new OpenSim.Region.ClientStack.LindenUDP.LLClientView.BinaryGenericMessage(HandleGenericBinaryMessage);
naali.AddGenericPacketHandler("ecstring", HandleEcStringGenericMessage);
naali.AddGenericPacketHandler("ecremove", HandleEcRemoveGenericMessage);
naali.AddGenericPacketHandler("ecsync", HandleEcSyncGenericMessage);
naali.AddGenericPacketHandler("ECString", HandleEcStringGenericMessage);
naali.AddGenericPacketHandler("ECRemove", HandleEcRemoveGenericMessage);
naali.AddGenericPacketHandler("ECSync", HandleEcSyncGenericMessage);

SendAllData(naali);
}
Expand Down Expand Up @@ -236,7 +236,7 @@ private void HandleEcRemoveGenericMessage(object sender, string method, List<str

private void SaveLocal(ECData component)
{
if (m_entity_components[component.EntityID] == null)
if (!m_entity_components.ContainsKey(component.EntityID))
{
m_entity_components[component.EntityID] = new Entity(component.EntityID);
}
Expand Down Expand Up @@ -299,7 +299,7 @@ public bool SaveECData(object sender, ECData component)
try
{
bool save = true;
if (m_ec_update_callbacks[component.ComponentType] != null)
if (m_ec_update_callbacks.ContainsKey(component.ComponentType) && m_ec_update_callbacks[component.ComponentType] != null)
{
save = m_ec_update_callbacks[component.ComponentType](sender, ref component);
}
Expand Down Expand Up @@ -328,7 +328,7 @@ public bool RemoveECData(object sender, ECData component)
try
{
bool remove = true;
if (m_ec_remove_callbacks[component.ComponentType] != null)
if (m_ec_update_callbacks.ContainsKey(component.ComponentType) && m_ec_remove_callbacks[component.ComponentType] != null)
{
remove = m_ec_remove_callbacks[component.ComponentType](sender, component.EntityID, component.ComponentType, component.ComponentName);
}
Expand Down

0 comments on commit c451e3d

Please sign in to comment.