Ejemplo n.º 1
0
 public EntityData UpdateEntity(AUT_WH.MajorDomoProtocol.EntityUpdate _update)
 {
     if (m_entityUidMap.TryGetValue(_update.EntityUID, out EntityData entity))
     {
         // do not update own clients' entities
         if (entity.ClientUID != m_clientUID)
         {
             entity.ReadEntityUpdate(_update);
         }
     }
     else
     {
         Debug.LogWarningFormat(
             "Trying to update invalid server entity with UID={0}",
             _update.EntityUID);
     }
     return(entity);
 }
Ejemplo n.º 2
0
 public void ReadEntityUpdate(AUT_WH.MajorDomoProtocol.EntityUpdate _update)
 {
     // go through the update list
     for (int valueIdx = 0; valueIdx < _update.ValuesLength; valueIdx++)
     {
         // search by value index
         var         valueUpdate = _update.Values(valueIdx).Value;
         EntityValue value       = GetValue((byte)valueUpdate.Index);
         if (value != null)
         {
             // is this the correct type?
             if (value.Type == valueUpdate.Type)
             {
                 // read value and remember if this changed it
                 m_updated |= value.ReadEntityValue(valueUpdate);
                 // Debug.Log("updated " + Name + "/" + value.Name + ":" + updated);
             }
         }
     }
 }