case ActivateEffects.Create: //portals
{
short objType;
if (!XmlData*****ToType.TryGetValue(eff.Id, out objType))
break;// object not found, ignore
var entity = Entity.Resolve(objType);
entity.Move(X, Y);
int TimeoutTime = 20;
Owner.EnterWorld(entity);
World w = RealmManager.GetWorld(Owner.Id); //can't use Owner here, as it goes out of scope
w.Timers.Add(new WorldTimer(TimeoutTime * 1000, (world, t) => //default portal close time * 1000
{
try
{
w.LeaveWorld(entity);
}
catch //couldn't remove portal, Owner became null. Should be fixed with RealmManager implementation
{
Console.WriteLine("Couldn't despawn portal.");
}
}));
} break;



