private OperationResponse ItemOperationAttachInterestArea( Item item, AttachInterestArea operation, InterestArea interestArea, SendParameters sendParameters) { if (item.Disposed) { return(operation.GetOperationResponse((int)ReturnCode.ItemNotFound, "ItemNotFound")); } lock (interestArea.SyncRoot) { interestArea.Detach(); interestArea.AttachToItem(item); interestArea.UpdateInterestManagement(); } // use item channel to ensure that this event arrives before any move or subscribe events OperationResponse response = operation.GetOperationResponse(MethodReturnValue.Ok); sendParameters.ChannelId = Settings.ItemEventChannel; this.Peer.SendOperationResponse(response, sendParameters); operation.OnComplete(); return(null); }
private static OperationResponse ItemOperationAddInterestArea(Item item, AddInterestArea operation, InterestArea interestArea) { if (item.Disposed) { return(operation.GetOperationResponse((int)ReturnCode.ItemNotFound, "ItemNotFound")); } lock (interestArea.SyncRoot) { interestArea.AttachToItem(item); interestArea.ViewDistanceEnter = operation.ViewDistanceEnter; interestArea.ViewDistanceExit = operation.ViewDistanceExit; interestArea.UpdateInterestManagement(); } operation.OnComplete(); return(operation.GetOperationResponse(MethodReturnValue.Ok)); }
public MmoActorOperationHandler(PeerBase peer, World world, InterestArea interestArea) : base(peer, world) { this.AddInterestArea(interestArea); }
public RequestItemExitMessage(InterestArea interestArea) { this.InterestArea = interestArea; }
public bool TryGetInterestArea(byte interestAreaId, out InterestArea interestArea) { return(this.interestAreas.TryGetValue(interestAreaId, out interestArea)); }
public void AddInterestArea(InterestArea interestArea) { this.interestAreas.Add(interestArea.Id, interestArea); }
public void AddInterestArea(InterestArea interestArea) { log.InfoFormat("interest area add"); this.interestAreas.Add(interestArea.Id, interestArea); }