/// <inheritdoc /> public GameObject Create(PlayerEntityCreationContext context) { GameObject gameObject = DecoratedFactory.Create(context); GuidToSessionMappable.Add(context.EntityGuid, context.SessionContext.ZoneSession); ConnectionIdToControllingEntityMap.Add(context.SessionContext.ConnectionId, context.EntityGuid); InterestCollection playerInterestCollection = new InterestCollection(); //directly add ourselves so we don't become interest in ourselves after spawning playerInterestCollection.Add(context.EntityGuid); //We just create our own manaul interest collection here. GuidToInterestCollectionMappable.Add(context.EntityGuid, playerInterestCollection); //We don't need to touch the gameobject, we can just return it. return(gameObject); }
protected override void OnEventFired(object source, PlayerSessionClaimedEventArgs args) { GuidToSessionMappable.AddObject(args.EntityGuid, args.SessionContext.ZoneSession); ConnectionServiceMappable.AddObject(args.EntityGuid, args.SessionContext.Connection); }