Esempio n. 1
0
        public void UpdateDisplay()
        {
            //construct display Format for dispatching out.
            var response = new ServerFormat33(this, Aisling);

            //Display Aisling to self.
            Aisling.Show(Scope.Self, response);

            //Display Aisling to everyone else nearby.
            if (Aisling.Flags.HasFlag(AislingFlags.Dead))
            {
                //only show to clients who can see ghosts.
                var nearby = GetObjects <Aisling>(i => i.WithinRangeOf(Aisling) && i.Client.CanSeeGhosts());
                Aisling.Show(Scope.NearbyAislingsExludingSelf, response, nearby);
            }
            else
            {
                Aisling.Show(Scope.NearbyAislingsExludingSelf, response);
            }
        }
 public virtual void Format33Handler(ServerFormat33 format)
 {
 }
        public GameClient UpdateDisplay()
        {
            var response = new ServerFormat33(this, Aisling);

            Aisling.Show(Scope.Self, response);

            var nearbyAislings = Aisling.AislingsNearby();

            if (nearbyAislings.Any())
            {
                var myplayer = Aisling;
                foreach (var otherplayer in nearbyAislings)
                {
                    if (myplayer.Serial == otherplayer.Serial)
                    {
                        continue;
                    }

                    if (!myplayer.Dead && !otherplayer.Dead)
                    {
                        if (myplayer.Invisible)
                        {
                            otherplayer.ShowTo(myplayer);
                        }
                        else
                        {
                            myplayer.ShowTo(otherplayer);
                        }

                        if (otherplayer.Invisible)
                        {
                            myplayer.ShowTo(otherplayer);
                        }
                        else
                        {
                            otherplayer.ShowTo(myplayer);
                        }
                    }
                    else
                    {
                        if (myplayer.Dead)
                        {
                            if (otherplayer.CanSeeGhosts())
                            {
                                myplayer.ShowTo(otherplayer);
                            }
                        }

                        if (otherplayer.Dead)
                        {
                            if (myplayer.CanSeeGhosts())
                            {
                                otherplayer.ShowTo(myplayer);
                            }
                        }
                    }
                }
            }

            return(this);
        }