Esempio n. 1
0
        public ServerMessage RelativeHeightmap(Room Room)
        {
            try
            {
                StringBuilder thatMessage = new StringBuilder();
                ServerMessage Message = new ServerMessage(Outgoing.FloorHeightMap); // P
                string[] array = this.string_1.Split(new char[]
			{
				Convert.ToChar(13)
			});
                for (int i = 0; i < this.int_5; i++)
                {
                    if (i > 0)
                    {
                        array[i] = array[i].Substring(1);
                    }
                    for (int j = 0; j < this.int_4; j++)
                    {
                        string text = array[i].Substring(j, 1).Trim().ToLower();
                        if (this.DoorX == j && this.DoorY == i)
                        {
                            text = string.Concat((int)this.double_0);
                        }
                        else if (Room.method_93(j, i).Count > 0)
                         {
                             int Korkeus = 0;
                             List<RoomItem> list = Room.method_93(j, i);

                             foreach (RoomItem @class in Room.Hashtable_0.Values)
                             {
                                 if (@class.GetX == j && @class.Int32_1 == i)
                                 {
                                     if ([email protected]().Stackable)
                                     {
                                         text = "X";
                                         continue;
                                     }
                                     Korkeus = Korkeus + Convert.ToInt32(@class.Double_1);
                                  
                                 }
                                 Dictionary<int, AffectedTile> dictionary = Room.method_94(@class.GetBaseItem().Length, @class.GetBaseItem().Width, @class.GetX, @class.Int32_1, @class.int_3);
                                 foreach (AffectedTile current in dictionary.Values)
                                 {
                                     if (current.Int32_0 == j && current.Int32_1 == i)
                                     {
                                         if ([email protected]().Stackable)
                                         {
                                             text = "X";
                                             continue;
                                         }
                                         Korkeus = Korkeus + Convert.ToInt32(@class.Double_1);
                                     }
                                 }
                                 text = Korkeus.ToString();
                             }

                               
                           
                             
                         }
                        
                        thatMessage.Append(text);
                    }
                    thatMessage.Append(string.Concat(Convert.ToChar(13)));
                }
                Message.AppendString(thatMessage.ToString());
               /* using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\filut\testit.txt", true))
                {
                    file.WriteLine(Message.ToString());
                }*/
                return Message;
            }
            catch (Exception ex)
            {
                Logging.LogRoomError(ex.ToString());
                return null;
            }
        }