コード例 #1
0
        private void CompleteWalk(int savedX, int savedY)
        {
            Map.Update(savedX, savedY, TileContent.None);
            Map.Update(X, Y, Content);

            if (this is Aisling)
            {
                Client.Send(new ServerFormat0B
                {
                    Direction = Direction,
                    LastX     = (ushort)savedX,
                    LastY     = (ushort)savedY
                });

                Client.Send(new ServerFormat32());
            }

            //create format to send to all nearby users.
            var response = new ServerFormat0C
            {
                Direction = Direction,
                Serial    = Serial,
                X         = (short)savedX,
                Y         = (short)savedY
            };

            if (this is Monster)
            {
                var nearby = GetObjects <Aisling>(i => i.WithinRangeOf(this) && i.InsideView(this));
                if (nearby.Length > 0)
                {
                    foreach (var obj in nearby)
                    {
                        obj.Show(Scope.Self, response, nearby);
                    }
                }
            }

            if (this is Mundane)
            {
                var nearby = GetObjects <Aisling>(i => i.WithinRangeOf(this) && i.InsideView(this));
                if (nearby.Length > 0)
                {
                    foreach (var obj in nearby)
                    {
                        obj.Show(Scope.Self, response, nearby);
                    }
                }
            }


            if (this is Aisling)
            {
                Client.Aisling.Show(this is Aisling
                    ? Scope.NearbyAislingsExludingSelf
                    : Scope.NearbyAislings, response);
            }
        }
コード例 #2
0
 public virtual void Format0CHandler(ServerFormat0C format)
 {
 }