OutdatedTerraria 1.2.4.1 Source

Posts 1–15 of 21 · Page 1 of 2
Terraria 1.2.4.1 Source
Virus Scans
https://www.virustotal.com/en/file/e...is/1400194329/
https://www.metascan-online.com/en/s...d6ab5c58ed98a7

Notes
  • You'll need to provide your own "steam_api.dll" and "Content" files/folders, which can be found in Steam\SteamApps\common\Terraria. If you will also be testing "Host & Play" within the client, you will also need to clone over your "TerrariaServer.exe" file.
  • Something not working in the code? Search the whole project for "//EDIT:" as that is how I prefix certain lines that may be needed in the future, but at the time are/were causing an error.
Terraria 1.2.4.1_mpgh.net.zip1.1 MB · 1,533 downloads Clean
Looks clean,

/Approved.
Has anybody else been getting InvalidOperationExceptions, particularly with calls in Draw()? A few examples:

Code:
System.InvalidOperationException: Cannot call Present when a render target is active.
   at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Present(tagRECT* pSource, tagRECT* pDest, HWND__* hOverride)
   at Microsoft.Xna.Framework.GraphicsDeviceManager.Microsoft.Xna.Framework.IGraphicsDeviceManager.EndDraw()
   at Microsoft.Xna.Framework.Game.EndDraw()
   at Microsoft.Xna.Framework.Game.DrawFrame()
   at Microsoft.Xna.Framework.Game.Tick()
   at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
   at Microsoft.Xna.Framework.GameHost.OnIdle()
   at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
   at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
   at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at Microsoft.Xna.Framework.WindowsGameHost.Run()
   at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
   at Microsoft.Xna.Framework.Game.Run()
   at Terraria.Program.Main(String[] args) in Program.cs:line 74
Code:
System.InvalidOperationException: The render target must not be set on the device when it is used as a texture.
   at Microsoft.Xna.Framework.Graphics.TextureCollection.set_Item(Int32 index, Texture value)
   at Microsoft.Xna.Framework.Graphics.SpriteBatch.RenderBatch(Texture2D texture, SpriteInfo[] sprites, Int32 offset, Int32 count)
   at Microsoft.Xna.Framework.Graphics.SpriteBatch.Flush()
   at Microsoft.Xna.Framework.Graphics.SpriteBatch.End()
   at Terraria.Main.Draw(GameTime gameTime) in c:\*******\TerraMod\Terraria\Main.cs:line 41186
   at Microsoft.Xna.Framework.Graphics.TextureCollection.set_Item(Int32 index, Texture value)
   at Microsoft.Xna.Framework.Graphics.SpriteBatch.RenderBatch(Texture2D texture, SpriteInfo[] sprites, Int32 offset, Int32 count)
   at Microsoft.Xna.Framework.Graphics.SpriteBatch.Flush()
   at Microsoft.Xna.Framework.Graphics.SpriteBatch.End()
   at Terraria.Main.Draw(GameTime gameTime) in Main.cs:line 41186
Code:
System.InvalidOperationException: Begin cannot be called again until End has been successfully called.
   at Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix)
   at Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(SpriteSortMode sortMode, BlendState blendState)
   at Terraria.Main.DrawToMap_Section(Int32 secX, Int32 secY) in c:\*******\TerraMod\Terraria\Main.cs:line 34045
   at Terraria.Main.Draw(GameTime gameTime) in c:\*******\TerraMod\Terraria\Main.cs:line 39347
   at Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix)
   at Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin(SpriteSortMode sortMode, BlendState blendState)
   at Terraria.Main.DrawToMap_Section(Int32 secX, Int32 secY) in c:\*******\TerraMod\Terraria\Main.cs:line 34045
   at Terraria.Main.Draw(GameTime gameTime) in Main.cs:line 39347
It's hard to figure out where these stem from when the drawing code is such an epic clusterfuck of spaghetti. :/

edit:
Also, apparently when joining servers, the automap file is corrupted.
Note: This is a fix, I suggest you read it
(Sorry for forcing your attention to this if you've already fixed this)

Quote Originally Posted by Kyle873 View Post
edit:
Also, apparently when joining servers, the automap file is corrupted.
Shoot! I forgot to fix that. Sadly, it's also been over 24 hours so I can't update the OP so I'll post the fix right here.

Go in to Map.cs and navigate over to the saveMap method (should be around line 2344 on an unedited Map.cs).

A few lines down (like 40) you'll see the following:

Code:
using (BinaryWriter binaryWriter = new BinaryWriter(fileStream))
Under that you have around 10 lines of "binaryWriter.Write". In the bottom few, you'll see numbers. Cast only the numbers to shorts. You'll end up with the following:

Code:
binaryWriter.Write(Main.curRelease);
binaryWriter.Write(Main.worldName);
binaryWriter.Write(Main.worldID);
binaryWriter.Write(Main.maxTilesY);
binaryWriter.Write(Main.maxTilesX);
binaryWriter.Write((short)340);
binaryWriter.Write((short)172);
binaryWriter.Write((short)3);
binaryWriter.Write((short)256);
binaryWriter.Write((short)256);
binaryWriter.Write((short)256);
That should fix the map saving bug.

----------

Other than that, I tried to look through the errors you, Kyle, posted, but unfortunately didn't find anything. Sorry.
nivlac, thank You very much!
Also.the mouse scroll doesn't work,can't use it to change hotbar items.
I've found another bug:Mini-map doesn't save,it refreshes every time when I join.
morongshu
It's Your problem. On my computer scroll work well.
About mini-map, fix slightly is above.
I've found another bug:Mini-map doesn't save,it refreshes every time when I join.
Fix of "frozen" waterfalls... Bug caused by missing declaration of num21 in WaterfallManager.DrawWaterfall()
Code:
				int num16 = 0;
				int num17 = 0;
				int num18 = 0;
				int num19 = 0;
				int num20 = 0;
				int num21; //Looks like it was missing...
				int num22;
And below we must remove declaration
Code:
					if (!Main.drewLava && this.waterfalls[i].stopAtStep != 0)
					{
						/*!FIX int */num21 = 32 * this.slowFrame;
						goto IL_3FA;
					}
Code:
						else if (num12 == 2 && Main.drewLava)
						{
							goto IL_1879;
						}
                        			/*!FIX int */num21 = 32 * this.regularFrame;
						goto IL_3FA;
And before drawing...
Code:
								Main.dust[num55].velocity *= 0f;
							}
						}
						//int num21 = 0;     //Waterfalls was stuck on 0 frame...
						if (num15 == 0 && num36 != 0 && num16 == 1 && num17 != num18)
						{
							num36 = 0;
							num17 = num18;
nivlac, can you say what is your "modified version of ILSpy"? It's your mod or I can find it somewhere in public?
Quote Originally Posted by foobar37 View Post
nivlac, can you say what is your "modified version of ILSpy"? It's your mod or I can find it somewhere in public?
It's composed mostly of a two public edits and then some minor messings for my own readability. I don't know where, but somewhere on this forum I know I saw a link to an edited version of ILSpy along with another fix on that page. I just combined the two and now I have some nice terraria code.
I can't get it to work... I am using visual studio. Steam_api.dll is in the folder, but it says it can't find it. help?
Nice source bro.

gotta try it out now.
Wow the bump...
I hope there have "v1.2.4.1 TerrariaServer" source....
Posts 1–15 of 21 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Talk with us