ModTile documentation.

ModTile documentation.

--- patches/tModLoader/Terraria.ModLoader/ModTile.cs
+++ patches/tModLoader/Terraria.ModLoader/ModTile.cs
@@ -9,18 +9,27 @@
 {
 	public class ModTile
 	{
+		/// <summary>
+		/// The mod which has added this type of ModTile.
+		/// </summary>
 		public Mod mod
 		{
 			get;
 			internal set;
 		}

+		/// <summary>
+		/// The name of this type of tile.
+		/// </summary>
 		public string Name
 		{
 			get;
 			internal set;
 		}

+		/// <summary>
+		/// The internal ID of this type of tile.
+		/// </summary>
 		public ushort Type
 		{
 			get;
@@ -28,31 +37,91 @@
 		}

 		internal string texture;
+		/// <summary>
+		/// The default type of sound made when this tile is hit. Defaults to 0.
+		/// </summary>
 		public int soundType = 0;
+		/// <summary>
+		/// The default style of sound made when this tile is hit. Defaults to 1.
+		/// </summary>
 		public int soundStyle = 1;
+		/// <summary>
+		/// The default type of dust made when this tile is hit. Defaults to 0.
+		/// </summary>
 		public int dustType = 0;
+		/// <summary>
+		/// The default type of item dropped when this tile is killed. Defaults to 0, which means no item.
+		/// </summary>
 		public int drop = 0;
+		/// <summary>
+		/// The height of a group of animation frames for this tile. Defaults to 0, which disables animations.
+		/// </summary>
 		public int animationFrameHeight = 0;
+		/// <summary>
+		/// A multiplier describing how much this block resists harvesting. Higher values will make it take longer to harvest. Defaults to 1f.
+		/// </summary>
 		public float mineResist = 1f;
+		/// <summary>
+		/// The minimum pickaxe power required for pickaxes to mine this block. Defaults to 0.
+		/// </summary>
 		public int minPick = 0;
+		/// <summary>
+		/// Whether or not the smart cursor function is disabled when the cursor hovers above this tile. Defaults to false.
+		/// </summary>
 		public bool disableSmartCursor = false;
+		/// <summary>
+		/// An array of the IDs of tiles that this tile can be considered as when looking for crafting stations.
+		/// </summary>
 		public int[] adjTiles = new int[0];
+		/// <summary>
+		/// The ID of the tile that this door transforms into when it is closed. Defaults to -1, which means this tile isn't a door.
+		/// </summary>
 		public int closeDoorID = -1;
+		/// <summary>
+		/// The ID of the tile that this door transforms into when it is opened. Defaults to -1, which means this tile isn't a door.
+		/// </summary>
 		public int openDoorID = -1;
+		/// <summary>
+		/// The default name of this chest that is displayed when this 2x2 chest is open. Defaults to the empty string, which means that this tile isn't a chest. Setting this field will make the tile behave like a chest (meteors will avoid it, tiles underneath cannot be mined, etc.), but you will have to manually give it storage capabilities yourself. (See the ExampleMod for something you can copy/paste.)
+		/// </summary>
 		public string chest = "";
+		/// <summary>
+		/// The ID of the item that drops when this chest is destroyed. Defaults to 0. Honestly, this is only really used when the chest limit is reached on a server.
+		/// </summary>
 		public int chestDrop = 0;
+		/// <summary>
+		/// Same as chest, except use this if your block is a dresser (has a size of 3x2 instead of 2x2).
+		/// </summary>
 		public string dresser = "";
+		/// <summary>
+		/// The ID of the item that drops when this dresser is destroyed. Defaults to 0. Honestly, this is only really used when the chest limit is reached on a server.
+		/// </summary>
 		public int dresserDrop = 0;
+		/// <summary>
+		/// Whether or not this tile is a valid spawn point. Defaults to false. If you set this to true, you will still have to manually set the spawn yourself in the RightClick hook.
+		/// </summary>
 		public bool bed = false;
+		/// <summary>
+		/// Whether or not this tile behaves like a torch. If you are making a torch tile, then setting this to true is necessary in order for tile placement, tile framing, and the item's smart selection to work properly.
+		/// </summary>
 		public bool torch = false;
+		/// <summary>
+		/// Whether or not this tile is a sapling, which can grow into a modded tree or palm tree.
+		/// </summary>
 		public bool sapling = false;

+		/// <summary>
+		/// A convenient method for adding this tile's Type to the given array. This can be used with the arrays in TileID.Sets.RoomNeeds.
+		/// </summary>
 		public void AddToArray(ref int[] array)
 		{
 			Array.Resize(ref array, array.Length + 1);
 			array[array.Length - 1] = Type;
 		}

+		/// <summary>
+		/// Adds an entry to the minimap for this tile with the given color and display name. This should be called in SetDefaults.
+		/// </summary>
 		public void AddMapEntry(Color color, string name = "")
 		{
 			if (!MapLoader.initialized)
@@ -66,6 +135,9 @@
 			}
 		}

+		/// <summary>
+		/// Adds an entry to the minimap for this tile with the given color, default display name, and display name function. The parameters for the function are the default display name, x-coordinate, and y-coordinate. This should be called in SetDefaults.
+		/// </summary>
 		public void AddMapEntry(Color color, string name, Func<string, int, int, string> nameFunc)
 		{
 			if (!MapLoader.initialized)
@@ -79,177 +151,363 @@
 			}
 		}

+		/// <summary>
+		/// Allows this tile to grow the given modded tree.
+		/// </summary>
+		/// <param name="tree">The ModTree.</param>
 		public void SetModTree(ModTree tree)
 		{
 			TileLoader.trees[Type] = tree;
 		}

+		/// <summary>
+		/// Allows this tile to grow the given modded palm tree.
+		/// </summary>
+		/// <param name="palmTree">The ModPalmTree</param>
 		public void SetModPalmTree(ModPalmTree palmTree)
 		{
 			TileLoader.palmTrees[Type] = palmTree;
 		}

+		/// <summary>
+		/// Allows this tile to grow the given modded cactus.
+		/// </summary>
+		/// <param name="cactus">The ModCactus</param>
 		public void SetModCactus(ModCactus cactus)
 		{
 			TileLoader.cacti[Type] = cactus;
 		}

+		/// <summary>
+		/// Allows you to modify the name and texture path of this tile when it is autoloaded. Return true to autoload this tile. When a tile is autoloaded, that means you do not need to manually call Mod.AddTile. By default returns the mod's autoload property.
+		/// </summary>
+		/// <param name="name">The internal name.</param>
+		/// <param name="texture">The texture path.</param>
+		/// <returns>Whether or not to autoload this tile.</returns>
 		public virtual bool Autoload(ref string name, ref string texture)
 		{
 			return mod.Properties.Autoload;
 		}

+		/// <summary>
+		/// Allows you to set the properties of this tile. Many properties are stored as arrays throughout Terraria's code.
+		/// </summary>
 		public virtual void SetDefaults()
 		{
 		}

+		/// <summary>
+		/// Allows you to override some default properties of this tile, such as Main.tileNoSunLight and Main.tileObsidianKill.
+		/// </summary>
 		public virtual void PostSetDefaults()
 		{
 		}

+		/// <summary>
+		/// Allows you to customize which sound you want to play when the tile at the given coordinates is hit. Return false to stop the game from playing its default sound for the tile. Returns true by default.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual bool KillSound(int i, int j)
 		{
 			return true;
 		}

+		/// <summary>
+		/// Allows you to change how many dust particles are created when the tile at the given coordinates is hit.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void NumDust(int i, int j, bool fail, ref int num)
 		{
 		}

+		/// <summary>
+		/// Allows you to modify the default type of dust created when the tile at the given coordinates is hit. Return false to stop the default dust (the type parameter) from being created. Returns true by default.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual bool CreateDust(int i, int j, ref int type)
 		{
 			type = dustType;
 			return true;
 		}

+		/// <summary>
+		/// Allows you to modify the chance the tile at the given coordinates has of spawning a certain critter when the tile is killed.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void DropCritterChance(int i, int j, ref int wormChance, ref int grassHopperChance, ref int jungleGrubChance)
 		{
 		}

+		/// <summary>
+		/// Allows you to customize which items the tile at the given coordinates drops. Remember that the x, y (i, j) coordinates are in tile coordinates, you will need to multiply them by 16 if you want to drop an item using them. Return false to stop the game from dropping the tile's default item. Returns true by default. Please note that this hook currently only works for 1x1 tiles.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual bool Drop(int i, int j)
 		{
 			return true;
 		}

+		/// <summary>
+		/// Allows you to determine whether or not the tile at the given coordinates can be hit by anything. Returns true by default. blockDamaged currently has no use.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual bool CanKillTile(int i, int j, ref bool blockDamaged)
 		{
 			return true;
 		}

+		/// <summary>
+		/// Allows you to determine what happens when the tile at the given coordinates is killed or hit with a pickaxe. Fail determines whether the tile is mined, effectOnly makes it so that only dust is created, and noItem stops items from dropping.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem)
 		{
 		}

+		/// <summary>
+		/// This hook is called exactly once whenever a block encompassing multiple tiles is destroyed. You can use it to make your multi-tile block drop a single item, for example.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void KillMultiTile(int i, int j, int frameX, int frameY)
 		{
 		}

+		/// <summary>
+		/// Whether or not the tile at the given coordinates can be killed by an explosion (ie. bombs). Returns true by default; return false to stop an explosion from destroying it.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual bool CanExplode(int i, int j)
 		{
 			return true;
 		}

+		/// <summary>
+		/// Allows you to make things happen when this tile is within a certain range of the player (around the same range water fountains and music boxes work). The closer parameter is whether or not the tile is within the range at which things like campfires and banners work.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void NearbyEffects(int i, int j, bool closer)
 		{
 		}

+		/// <summary>
+		/// Allows you to determine how much light this block emits. Make sure you set Main.tileLighted[Type] to true in SetDefaults for this to work.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
 		{
 		}

+		/// <summary>
+		/// Allows you to determine whether this block glows red when the given player has the Dangersense buff.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual bool Dangersense(int i, int j, Player player)
 		{
 			return false;
 		}

+		/// <summary>
+		/// Allows you to determine whether or not the tile will draw itself flipped in the world.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void SetSpriteEffects(int i, int j, ref SpriteEffects spriteEffects)
 		{
 		}

+		/// <summary>
+		/// Allows you to customize the position in which this tile is drawn. Width refers to the width of one frame of the tile, offsetY refers to how many pixels below its actual position the tile should be drawn, and height refers to the height of one frame of the tile. By default the values will be set to the values you give this tile's TileObjectData. If this tile has no TileObjectData then they will default to 16, 0, and 16, respectively.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height)
 		{
 		}

+		/// <summary>
+		/// Allows you to animate your tile. Use frameCounter to keep track of how long the current frame has been active, and use frame to change the current frame.
+		/// </summary>
 		public virtual void AnimateTile(ref int frame, ref int frameCounter)
 		{
 		}

+		/// <summary>
+		/// Allows you to draw things behind the tile at the given coordinates. Return false to stop the game from drawing the tile normally. Returns true by default.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual bool PreDraw(int i, int j, SpriteBatch spriteBatch)
 		{
 			return true;
 		}

+		/// <summary>
+		/// Allows you to make stuff happen whenever the tile at the given coordinates is drawn. For example, creating dust or changing the color the tile is drawn in.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor)
 		{
 		}

+		/// <summary>
+		/// Allows you to draw things in front of the tile at the given coordinates. This can also be used to do things such as creating dust.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void PostDraw(int i, int j, SpriteBatch spriteBatch)
 		{
 		}

+		/// <summary>
+		/// Allows you to choose which minimap entry the tile at the given coordinates will use. 0 is the first entry added by AddMapEntry, 1 is the second entry, etc. Returns 0 by default.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual ushort GetMapOption(int i, int j)
 		{
 			return 0;
 		}

+		/// <summary>
+		/// Called whenever the world randomly decides to update this tile in a given tick. Useful for things such as growing or spreading.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void RandomUpdate(int i, int j)
 		{
 		}

+		/// <summary>
+		/// Called whenever this tile updates due to being placed or being next to a tile that is changed. Return false to stop the game from carrying out its default TileFrame operations. Returns true by default.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
 		{
 			return true;
 		}

+		/// <summary>
+		/// Allows you to stop this tile from being placed at the given coordinates. Return false to block the tile from being placed. Returns true by default.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual bool CanPlace(int i, int j)
 		{
 			return true;
 		}

+		/// <summary>
+		/// Allows you to make something happen when this tile is right-clicked by the player.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void RightClick(int i, int j)
 		{
 		}

+		/// <summary>
+		/// Allows you to make something happen when the mouse hovers over this tile. Useful for showing item icons or text on the mouse.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void MouseOver(int i, int j)
 		{
 		}

+		/// <summary>
+		/// Allows you to make something happen when the mouse hovers over this tile, even when the player is far away. Useful for showing what's written on signs, etc.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void MouseOverFar(int i, int j)
 		{
 		}

+		/// <summary>
+		/// Allows you to determine whether the given item can become selected when the cursor is hovering over this tile and the auto selection hotkey is pressed.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual bool AutoSelect(int i, int j, Item item)
 		{
 			return false;
 		}

+		/// <summary>
+		/// Allows you to make something happen when a wire current passes through this tile.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual void HitWire(int i, int j)
 		{
 		}

+		/// <summary>
+		/// Allows you to control how hammers slope this tile. Return true to allow it to slope normally. Returns true by default.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
 		public virtual bool Slope(int i, int j)
 		{
 			return true;
 		}

+		/// <summary>
+		/// Whether or not this tile creates dust when the player walks on it. Returns false by default.
+		/// </summary>
 		public virtual bool HasWalkDust()
 		{
 			return false;
 		}

+		/// <summary>
+		/// Allows you to modify the dust created when the player walks on this tile. The makeDust parameter is whether or not to make dust; you can randomly set this to false to reduce the amount of dust produced.
+		/// </summary>
+		/// <param name="dustType"></param>
+		/// <param name="makeDust"></param>
+		/// <param name="color"></param>
 		public virtual void WalkDust(ref int dustType, ref bool makeDust, ref Color color)
 		{
 		}

+		/// <summary>
+		/// Allows you to change the style of waterfall that passes through or over this type of tile.
+		/// </summary>
+		/// <param name="style"></param>
 		public virtual void ChangeWaterfallStyle(ref int style)
 		{
 		}

+		/// <summary>
+		/// Allows this tile to support a sapling that can eventually grow into a tree. The type of the sapling should be returned here. Returns -1 by default. The style parameter will determine which sapling is chosen if multiple sapling types share the same ID; even if you only have a single sapling in an ID, you must still set this to 0.
+		/// </summary>
+		/// <param name="style"></param>
+		/// <returns></returns>
 		public virtual int SaplingGrowthType(ref int style)
 		{
 			return -1;
 		}

+		/// <summary>
+		/// Allows you to do something when this tile is placed.
+		/// </summary>
+		/// <param name="i">The x position in tile coordinates.</param>
+		/// <param name="j">The y position in tile coordinates.</param>
+		/// <param name="item">The item used to place this tile.</param>
 		public virtual void PlaceInWorld(int i, int j, Item item)
 		{
 		}


Fix velocity transmission on collision

Fix velocity transmission on collision

--- Client/GameObject.cs
+++ Client/GameObject.cs
@@ -178,6 +178,7 @@
             // apply minimum translation vector to resolve collision
             this.position += normal * penetration;
             this.velocity += normal * penetration;
+            this.changed |= ObjectProperty.Position | ObjectProperty.Velocity;
         }

 #if DEBUG


Update tests to reflect less filters in scrubber

--- src/tests/SharpRaven.UnitTests/Logging/LogScrubberTests.cs
+++ src/tests/SharpRaven.UnitTests/Logging/LogScrubberTests.cs
@@ -68,17 +68,9 @@

         [Test]
-        public void Filters_ContainSocialSecurityFilter()
-        {
-            Assert.That(this.scrubber.Filters.OfType<SocialSecurityFilter>().ToArray(),
-                        Has.Length.EqualTo(1));
-        }
-
-
-        [Test]
         public void Filters_HasExpectedCount()
         {
-            Assert.That(this.scrubber.Filters, Has.Count.EqualTo(3));
+            Assert.That(this.scrubber.Filters, Has.Count.EqualTo(2));
         }


SystemTray

SystemTray

--- BashStart/Program.cs
+++ BashStart/Program.cs
@@ -15,9 +15,31 @@
         private static void Main()
         {
             Start();
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new Form1());
+
+            var menuItem = new MenuItem
+            {
+                Index = 0,
+                Text = "E&xit",
+            };
+
+            menuItem.Click += (o, e) => Application.Exit();
+
+            var contextMenu = new ContextMenu(new[] { menuItem });
+
+            var home = Environment.GetEnvironmentVariable("USERPROFILE");
+            Environment.CurrentDirectory = home;
+
+            var icon = new NotifyIcon
+            {
+                Icon = new System.Drawing.Icon($@"{home}\AppData\Local\lxss\bash.ico"),
+                ContextMenu = contextMenu,
+                Text = "StartServer",
+                Visible = true,
+            };
+
+            Application.ApplicationExit += (o, e) => icon.Visible = false;
+
+            Application.Run();
         }

         private static void Start()


add unit test.

add unit test.

--- tests/Avalonia.Base.UnitTests/Layout/LayoutManagerTests.cs
+++ tests/Avalonia.Base.UnitTests/Layout/LayoutManagerTests.cs
@@ -2,6 +2,7 @@
 using System.Linq;
 using Avalonia.Controls;
 using Avalonia.Layout;
+using Avalonia.Threading;
 using Xunit;

 namespace Avalonia.Base.UnitTests.Layout
@@ -421,5 +422,22 @@
             Assert.Equal(new Size(200, 200), control.Bounds.Size);
             Assert.Equal(new Size(200, 200), control.DesiredSize);
         }
+
+        [Fact]
+        public void LayoutManager_Execute_Layout_Pass_Should_Clear_Queued_LayoutPasses()
+        {
+            var control = new LayoutTestControl();
+            var root = new LayoutTestRoot { Child = control };
+
+            int layoutCount = 0;
+            root.LayoutUpdated += (sender, args) => layoutCount++;
+
+            root.LayoutManager.InvalidateArrange(control);
+            root.LayoutManager.ExecuteInitialLayoutPass();
+
+            Dispatcher.UIThread.RunJobs(DispatcherPriority.Layout);
+
+            Assert.Equal(1, layoutCount);
+        }
     }
 }


Added BufferValueWriter.ToArray()

Added BufferValueWriter.ToArray()

--- BufferValueWriter.cs
+++ BufferValueWriter.cs
@@ -232,6 +232,14 @@
 			this.position += count;
 		}

+		public byte[] ToArray()
+		{
+			byte[] value = new byte[Length];
+			Buff.BlockCopy (this.buffer, 0, value, 0, Length);
+
+			return value;
+		}
+
 		private byte[] buffer;
 		private int position;
 		private readonly bool resizing;


Added more data to the test program

Added more data to the test program

--- C3DE.Test/Program.cs
+++ C3DE.Test/Program.cs
@@ -10,6 +10,7 @@
 using System.Threading.Tasks;
 using System.Xml.Serialization;
 using Newtonsoft.Json;
+using C3DE.Components.Lights;

 namespace C3DE.Test
 {
@@ -25,19 +26,53 @@
         {
             base.Initialize();

-            var camera = new CameraPrefab("cam");
+            // Add a camera with a FPS controller
+            var camera = new CameraPrefab("camera");
+            camera.Setup(new Vector3(0, 2, -10), new Vector3(0, 0, 0), Vector3.Up);
             Add(camera);

-            var material = new SimpleMaterial(this);
-            material.MainTexture = GraphicsHelper.CreateCheckboardTexture(Color.Blue, Color.Red);
+            // And a light
+            var lightPrefab = new LightPrefab("light", LightType.Directional);
+            Add(lightPrefab);
+            lightPrefab.Light.Direction = new Vector3(1, 1, 0);
+            lightPrefab.Light.DiffuseColor = Color.LightSkyBlue;
+            lightPrefab.Light.Intensity = 1.5f;
+            lightPrefab.EnableShadows = true;
+
+            // Finally a terrain
+            var terrainMat = new TerrainMaterial(scene);
+
+            var terrain = new TerrainPrefab("terrain");
+            scene.Add(terrain);
+            terrain.LoadHeightmap("Textures/heightmap");
+            terrain.Renderer.Material = terrainMat;
+            terrain.Transform.Translate(-terrain.Width >> 1, -10, -terrain.Depth >> 1);
+            var map = terrain.GenerateWeightMap();
+
+            terrainMat.WeightTexture = map;
+            terrainMat.Tiling = new Vector2(4);
+
+            // With water !
+            var water = new WaterPrefab("water");
+            scene.Add(water);
+
+            Screen.ShowCursor = true;
+
+            // Don't miss the Skybox ;)
+            RenderSettings.Skybox.Generate();
+
+            // And fog
+            RenderSettings.FogDensity = 0.0085f;
+            RenderSettings.FogMode = FogMode.Exp2;

             //XMLSerialization("camera.xml", camera);
             JSONSerialization("camera.json", camera);

+            //XMLSerialization("ligth.xml", lightPrefab);
+            JSONSerialization("ligth.json", lightPrefab);
+
             //XMLSerialization("material.xml", material);
-            JSONSerialization("material.json", material);
-
-
+            JSONSerialization("material.json", terrainMat);
         }

         public override void Update()
@@ -47,11 +82,6 @@
             JSONSerialization("scene.json", this);

             Application.Quit();
-        }
-
-        private void StartSerialization()
-        {
-
         }

         private void XMLSerialization(string path, ISerializable obj)


Adding tests for AddRangeToSortedSetWithScores

--- tests/NServiceKit.Redis.Tests/RedisClientSortedSetTests.cs
+++ tests/NServiceKit.Redis.Tests/RedisClientSortedSetTests.cs
@@ -58,7 +58,33 @@
 			Assert.That(members, Is.EquivalentTo(storeMembers));
 		}

-		[Test]
+        [Test]
+        public void Can_AddRangeToSortedSetWithScores_and_GetAllFromSet()
+        {
+            var count = Redis.AddRangeToSortedSetWithScores(SetId, storeMembers.Select(x => new KeyValuePair<string, double>(x, 1)).ToList());
+            Assert.AreEqual(storeMembers.Count, count);
+
+            var members = Redis.GetAllItemsFromSortedSet(SetId);
+            Assert.That(members, Is.EquivalentTo(storeMembers));
+        }
+
+        [Test]
+        public void Can_AddRangeToSortedSetWithScores_and_GetAllWithScoresFromSortedSet()
+        {
+            uint i = 0;
+            var count = Redis.AddRangeToSortedSetWithScores(SetId, storeMembers.Select(x => new KeyValuePair<string, double>(x, i++)).ToList());
+            Assert.AreEqual(storeMembers.Count, count);
+
+            var members = Redis.GetAllWithScoresFromSortedSet(SetId);
+            i = 0;
+            foreach(var member in storeMembers)
+            {
+                Assert.IsTrue(members.ContainsKey(member));
+                Assert.AreEqual(i++, members[member]);
+            }
+        }
+
+        [Test]
 		public void AddToSet_without_score_adds_an_implicit_lexical_order_score()
 		{
 			storeMembers.ForEach(x => Redis.AddItemToSortedSet(SetId, x));


allow for non app uploaded files to display

closes #46

--- api/Modules/AttachmentModule.cs
+++ api/Modules/AttachmentModule.cs
@@ -1,5 +1,4 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
 using System.Linq;
 using System.Net.Http;
 using daq_api.Models;
@@ -53,15 +52,33 @@

                 formUrl = new FormUrlEncodedContent(queryParams);
                 querystringContent = await formUrl.ReadAsStringAsync();
-
+
                 var files = response.Result.AttachmentGroups[0].AttachmentInfos
-                    .Select(x => new {
-                        name = x.Name.Split('x')[2],
+                    .Select(x => new
+                    {
+                        name = GetDisplayName(x.Name),
                         url = string.Format("{0}/{1}/attachments/{2}?{3}", Request.Query["url"], _.featureId.ToString(), x.Id, querystringContent)
                     });

                 return Response.AsJson(new[] {files});
             };
         }
+
+        private static string GetDisplayName(string filename)
+        {
+            if (!filename.StartsWith("x"))
+            {
+                return filename;
+            }
+
+            var parts = filename.Split('x');
+
+            if (parts.Length < 3 || parts[1].Length == 0)
+            {
+                return filename;
+            }
+
+            return parts[2];
+        }
     }
-}
+}


Set MoveCamer to false for GameCommands

Set MoveCamer to false for GameCommands

--- CC-X/CC-X/Program.cs
+++ CC-X/CC-X/Program.cs
@@ -363,7 +363,7 @@
         //Assigns keyboard input to corresponding main character logic.
         private void GameCommands(float timeStep)
         {
-            MoveCamera = true;
+            MoveCamera = false;
             if (Input.GetKeyDown(Key.Up)) { CameraNode.Translate(Vector3.UnitZ * timeStep * 2); MainChar.Translate(-Vector3.UnitZ * timeStep * 2); PlayAnimation(MainChar, "Swat/Swat_SprintFwd.ani"); }
             else if (Input.GetKeyDown(Key.Down)) { CameraNode.Translate(-Vector3.UnitZ * timeStep * 2); MainChar.Translate(Vector3.UnitZ * timeStep * 2); PlayAnimation(MainChar, "Swat/Swat_SprintBwd.ani"); }
             else if (Input.GetKeyDown(Key.Left)) { CameraNode.Translate(-Vector3.UnitX * timeStep * 2); MainChar.Translate(Vector3.UnitX * timeStep * 2); PlayAnimation(MainChar, "Swat/Swat_SprintLeft.ani"); }


Clean using

Clean using

--- Counter/IDocument.cs
+++ Counter/IDocument.cs
@@ -1,7 +1,4 @@
-using System;
-using System.IO;
-
-namespace Counter
+namespace Counter
 {
 	internal interface IDocument
 	{


more clear log message

more clear log message

--- CommonMode.cs
+++ CommonMode.cs
@@ -51,7 +51,8 @@

                 Logger.Log(LogMessage.SeverityType.Info, "End of diagnostic section.");
             } catch(Exception ex) {
-                Logger.Log(LogMessage.SeverityType.Error, "Failed to log diagnostic information.", ex);
+                Logger.Log(LogMessage.SeverityType.Error,
+                    "Failed to log diagnostic information. This could happen if configuration is invalid or integration package is incomplete, for example, some of required DLL files are missing.", ex);
             }
         }


add correct html title

add correct html title

--- app/Views/Shared/_Layout.cshtml
+++ app/Views/Shared/_Layout.cshtml
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-    <title>@ViewData["Title"] - aspMVC2</title>
+    <title>Sage Accounting API Sample App - C#</title>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">


Added OwaInboxUrl configuration option for manually specifying the inbox
URL to redirect to after Owa AuthN.

Added patch by Ryan Herring (Centenary College) to propely encoded password
for prior to Post to Owa.

--- CasOwaAuthHandler.cs
+++ CasOwaAuthHandler.cs
@@ -25,6 +25,7 @@
 using System.IO;
 using System.Configuration;
 using System.Net.Security;
+using System.Text;

 namespace CasOwa
 {
@@ -74,6 +75,11 @@
         static string OwaAuthPath = "/auth/owaauth.dll";

         /// <summary>
+        /// OWA Inbox Redirect after authentication
+        /// </summary>
+        static string OwaInboxUrl;
+
+                /// <summary>
         /// Bootstrap configuration from Web.conf.
         /// </summary>
         static CasOwaAuthHandler()
@@ -105,6 +111,8 @@

             OwaOptionalFormFields = ConfigurationManager.AppSettings.Get("CasOwa.OwaOptionalFormFields") ?? OwaOptionalFormFields;

+            OwaInboxUrl = ConfigurationManager.AppSettings.Get("CasOwa.OwaInboxUrl");
+
             // This is setting is neccesary when using untrusted certificates, typically in a development or testing.
             var skipOwaUrlCertificateValidation = ConfigurationManager.AppSettings.Get("CasOwa.skipOwaUrlCertificateValidation");
             if (!String.IsNullOrEmpty(skipOwaUrlCertificateValidation) && bool.Parse(skipOwaUrlCertificateValidation))
@@ -164,11 +172,10 @@
                 throw new HttpException(500, "Received response from " + clearPassRequest + ", but cas:credientials IsNullOrEmpty.  Check CAS server logs for errors.  Make sure SSL certs are trusted.");
             }

-
             // POST username/password to owaauth.dll to get sessionid and cadata cookies
             var owaAuthFormFields = "destination=" + OwaUrl
                                   + "&username=" + user.Identity.Name
-                                  + "&password=" + clearPass
+                                  + "&password=" + HttpUtility.UrlEncode(clearPass, Encoding.ASCII)
                                   + OwaOptionalFormFields;
             var postData = System.Text.Encoding.UTF8.GetBytes(owaAuthFormFields);
             var request = (HttpWebRequest)WebRequest.Create(OwaUrl + OwaAuthPath);
@@ -213,7 +220,17 @@
             {
                 context.Response.Cookies.Add(new HttpCookie(cookie.Name, cookie.Value));
             }
-            context.Response.Redirect(response.GetResponseHeader("Location"));
+
+            string redirectUrl;
+            if (String.IsNullOrEmpty(OwaInboxUrl))
+            {
+                redirectUrl = response.GetResponseHeader("Location");
+            }
+            else
+            {
+                redirectUrl = OwaInboxUrl;
+            }
+            context.Response.Redirect(redirectUrl);
          }
      }
 }


Actually use the damage argument

Actually use the damage argument

--- Chraft/Net/Client.cs
+++ Chraft/Net/Client.cs
@@ -292,7 +292,7 @@
         {

             //event start
-            EntityDamageEventArgs entevent = new EntityDamageEventArgs(_Player, Convert.ToInt16(args[0]), null, cause);
+            EntityDamageEventArgs entevent = new EntityDamageEventArgs(_Player, Convert.ToInt16(DamageAmount), null, cause);
             _Player.Server.PluginManager.CallEvent(Event.ENTITY_DAMAGE, entevent);
             if (_Player.GameMode == 1) { entevent.EventCanceled = true; }
             if (entevent.EventCanceled) return;
@@ -317,7 +317,7 @@
                 case DamageCause.Fall:
                     if (args.Length > 0)
                     {
-                        _Player.Health -= Convert.ToInt16(args[0]);
+                        _Player.Health -= Convert.ToInt16(DamageAmount);
                     }
                     break;
                 case DamageCause.Fire:


Remove SpriteBatch Begin/End from ConsoleLrs

--- Client/ConsoleLrs.cs
+++ Client/ConsoleLrs.cs
@@ -14,8 +14,6 @@
     internal sealed class ConsoleLrs : Console {

         protected override void OnDraw(SpriteBatch spriteBatch) {
-            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
-
             int gridSize = MathHelper.Min(SDGame.Inst.GameWidth, SDGame.Inst.GameHeight) - 128;
             Vector2 gridPos = new Vector2(SDGame.Inst.GameWidth / 2 - gridSize / 2, SDGame.Inst.GameHeight / 2 - gridSize / 2);

@@ -35,8 +33,6 @@
                     new Vector2(mouseMapX, mouseMapY)),
                 new Vector2(Input.MouseX, Input.MouseY + 50),
                 Color.LightYellow);
-
-            spriteBatch.End();
         }

         protected override void OnUpdate(GameTime gameTime) {}


Color3 Vec

Color3 Vec

--- GLR_Simple.cs
+++ GLR_Simple.cs
@@ -165,6 +165,11 @@
         public static void Color3(float v1, float v2, float v3)
         {
             GL.Color3(v1, v2, v3);
+        }
+
+        public static void Color3(Vector3 vector3)
+        {
+            GL.Color3(vector3);
         }

         public static void DeleteLists(int list, int range)


Speed up favorties

Speed up favorties

--- Controls/Gamelist.cs
+++ Controls/Gamelist.cs
@@ -49,6 +49,7 @@
         private Info _currentInfo = null;
         private string _currentInfoText = "";
         private int infoRow = 0;
+        private DatabaseManager dbm;

         public static event GameListChanged GameListChanged;

@@ -215,6 +216,7 @@
             RowHeight = 18;
             LargeIconSize = new Size(32, 32);
             SmallIconSize = new Size(16, 16);
+
         }

         #endregion
@@ -333,29 +335,28 @@
             _gamesFavorites = new Games();
             _countFavorites = 0;
             if (File.Exists(Settings.Default.favorites_ini))
-            {
-                using (var dbm = new DatabaseManager())
-                {
-                    string[] favs = File.ReadAllLines(Settings.Default.favorites_ini);
-                    foreach (string s in favs) //Some of the lines are not favorites, just ignores them.
-                    {
-                        try
+            {
+
+                string[] favs = File.ReadAllLines(Settings.Default.favorites_ini);
+                foreach (string s in favs) //Some of the lines are not favorites, just ignores them.
+                {
+                    if (s == "") continue;
+                    try
+                    {
+                        Game game = new Game(dbm.GetMachineByName(s));
+                        if (game != null)
                         {
-                            Game game = new Game(dbm.GetMachineByName(s));
-                            if (game != null)
-                            {
-                                Game g = game.Copy();
-                                g.Name = "fav_" + g.Name;
-                                g.IsFavorite = true;
-                                _gamesFavorites.TryAdd(g.Name, g);
-                            }
+                            Game g = game.Copy();
+                            g.Name = "fav_" + g.Name;
+                            g.IsFavorite = true;
+                            _gamesFavorites.TryAdd(g.Name, g);
                         }
-                        catch (Exception)
-                        {
-                            //Not a game, do nothing.
-                        }
-                    }
-                }
+                    }
+                    catch (Exception)
+                    {
+                        //Not a game, do nothing.
+                    }
+                }

                 //Sorts out the list by description alphabetically and filters it according to what the user set.
@@ -867,6 +868,7 @@
         internal void LoadGames(Games games)
         {
             _games = games;
+            dbm = new DatabaseManager();
         }

 #endregion


Replace the licence text in Form1.cs to the top

--- DriverForAI/Form1.cs
+++ DriverForAI/Form1.cs
@@ -1,4 +1,19 @@
-using System;
+/*
+    **************************************************************************
+    * Judge for AI ("Connect Five" game).                                 	 *
+    *                                                                     	 *
+    * This program should be used for Connect Five Competition.            	 *
+    * Connect Five is the game like Connect Four; for more information see   *
+    * http://www.math.spbu.ru/user/chernishev/connectfive/connectfive.html   *
+    *                                                                     	 *
+    * Author: Gleb Zakharov                                               	 *
+    * Email: <last name><first name>i@gmail.com                         	   *
+    * Year: 2015                                                        	   *
+    * See the LICENSE.txt file in the project root for more information.     *
+    **************************************************************************
+*/
+
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
@@ -12,20 +27,6 @@

 namespace DriverForAI
 {
-    /*
-    **************************************************************************
-    * Judge for AI ("Connect Five" game).                               	 *
-    *                                                                   	 *
-    * This program should be used for Connect Five Competition.          	 *
-    * Connect Five is the game like Connect Four; for more information see   *
-    * http://www.math.spbu.ru/user/chernishev/connectfive/connectfive.html   *
-    *                                                                   	 *
-    * Author: Gleb Zakharov                                              	 *
-    * Email: <last name><first name>i@gmail.com                         	 *
-    * Year: 2015                                                        	 *
-    * See the LICENSE.txt file in the project root for more information.     *
-    **************************************************************************
-   */
     public partial class Form1 : Form
     {
         public static Int32 currentGame = 0;


Added a Cursor Offset to the TapToPlace script

--- Assets/HoloToolkit/Input/Scripts/Interactions/TapToPlace.cs
+++ Assets/HoloToolkit/Input/Scripts/Interactions/TapToPlace.cs
@@ -38,6 +38,9 @@
         [Tooltip("Setting this to true will allow this behavior to control the DrawMesh property on the spatial mapping.")]
         public bool AllowMeshVisualizationControl = true;

+        [Tooltip("Amount model should be offset from the placement position.")]
+        public Vector3 centerOffset;
+
         private Interpolator interpolator;

         /// <summary>
@@ -96,6 +99,7 @@
             Transform cameraTransform = CameraCache.Main.transform;

             Vector3 placementPosition = GetPlacementPosition(cameraTransform.position, cameraTransform.forward, DefaultGazeDistance);
+            placementPosition += centerOffset;

             // Here is where you might consider adding intelligence
             // to how the object is placed.  For example, consider