public async void Handle(IGluonSession session, NotifyLotRoommateChange packet) { //recieved from a lot server to notify of another lot's roommate change. using (var da = DAFactory.Get()) { var lot = da.Lots.Get(packet.LotId); if (lot == null) { return; //lot missing } DataService.Invalidate <FSO.Common.DataService.Model.Lot>(lot.location); //if online, notify the lot var lotOwned = da.LotClaims.GetByLotID(lot.lot_id); if (lotOwned != null) { var lotServer = LotServers.GetLotServerSession(lotOwned.owner); if (lotServer != null) { //immediately notify lot of new roommate lotServer.Write(packet); } } else { //try force the lot open //we don't need to send any packets in this case - the lot fully restores object ownership from db. var result = await Lots.TryFindOrOpen(lot.location, 0, NullSecurityContext.INSTANCE); } } }
public void Handle(IGluonSession session, NotifyLotRoommateChange request) { Lots.NotifyRoommateChange(request.LotId, request.AvatarId, request.ReplaceId, request.Change); }