Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    nivlac's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    20
    Reputation
    10
    Thanks
    216

    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.
    <b>Downloadable Files</b> Downloadable Files

  2. The Following 133 Users Say Thank You to nivlac For This Useful Post:

    12MIRZA12 (03-11-2015),256325 (06-16-2014),3APA3A.UA (03-31-2015),3vil4lex (10-28-2014),840blaizet (02-24-2015),asafgb (05-24-2015),asdffan941 (07-18-2014),Azias (05-06-2015),bdfzchen (11-25-2015),Bl00DGuY (02-16-2015),BlackHatJack (06-29-2014),BlizzIce (11-19-2014),BlueAchenar (04-23-2015),Cameron9456 (09-26-2014),cebul (07-04-2014),CEKPETHO (06-02-2015),chintu771996 (04-08-2015),chrispontium (07-04-2014),CraYel (05-17-2014),CryADsisAM (08-26-2014),Daimoth (03-17-2015),DarkLynx108 (12-22-2014),Darkprince01 (05-17-2014),Demonic Robot (02-17-2015),dimababin (05-26-2014),djtedo (06-24-2014),dkrekd3033 (07-05-2014),drag0043 (03-16-2015),e975798 (02-10-2015),episodka (07-09-2015),Expfighter (01-04-2015),firehart (05-16-2014),five--three (09-06-2015),Genesis_ (05-19-2015),Grab1447 (01-13-2015),grappigegovert (01-13-2015),gulsen (02-03-2015),Hangen (08-28-2014),henzycuong1 (06-23-2014),hotdex (07-06-2015),Huehueuheuheuhe (05-18-2014),hugo0boss1 (05-15-2014),Ignika (09-04-2014),incarn (09-11-2014),inforGames (06-06-2015),iruril (07-02-2014),itsblacksidez (11-09-2014),jamocochoco56 (10-02-2014),janosicek (07-31-2014),jcheringer (05-26-2014),JEXXX (02-06-2015),jimbojoni (04-02-2015),jrbc1 (04-06-2015),Juanmaster (06-13-2014),Klouph (03-17-2015),Knasynikow47 (11-24-2014),KoishiR (09-20-2016),Kurada (11-02-2014),Kyle873 (05-15-2014),L L (05-15-2014),L95 (07-21-2016),ladizslaw (06-10-2014),Lauraa441 (11-05-2014),leonardo88 (07-17-2014),lexkymbeth (10-18-2014),lol1g (10-13-2014),LOL6989 (04-05-2015),Loleris2 (08-19-2014),lorandy (06-29-2014),Maj_Orange_Juice (06-11-2014),mart804m (09-06-2014),martinx09 (08-06-2014),matthiasguy1 (03-15-2015),mchammah (05-18-2014),Megavenon2000 (09-04-2014),Mieof (06-01-2014),min2202 (10-27-2014),Mineboy101 (07-13-2014),minjae360 (11-14-2014),misterb98 (06-30-2014),morongshu (05-16-2014),MrRatermat (02-24-2015),nickexe (07-08-2015),NightDog (06-24-2014),Ninja1115 (06-22-2014),nuckerdude (05-25-2015),olidergamer (11-24-2014),oosoup (12-14-2014),Paradox25 (01-14-2015),pepsi_cola (05-30-2015),philippe9020 (03-02-2017),Pokemeister (12-29-2014),ponddarkZ (06-02-2014),pretemders (10-02-2014),qabriel (05-17-2014),REBEL_JAKE16 (03-21-2015),Red06660 (03-22-2023),rEFRWFGwefwef (07-01-2014),Retalyx (12-29-2014),retep998 (07-01-2014),Reuged (03-24-2015),ring2u (05-15-2014),rjsdlf0410 (12-01-2014),rrockru (03-08-2015),sargentkibbles (08-06-2014),sinand99 (01-13-2015),Sinjut (04-11-2015),Someone123456 (06-04-2015),SPanjul666 (09-20-2014),Spavid04 (06-16-2015),ssob0oguh (12-18-2014),Steelio (06-01-2014),stefan720 (07-28-2014),StrongCod3r (05-29-2015),stupidgame (07-31-2014),SupTo (04-23-2015),Tanthalas (10-14-2014),Teleporter (05-16-2014),theraptor2002 (06-29-2014),totoplop (11-17-2014),tulipan213 (06-22-2014),Turbokanake3 (05-27-2014),tygra91 (03-07-2015),uploader1135 (06-29-2014),webmilio (06-26-2014),WeeGoody (07-27-2014),whynotmakeanaccount (05-08-2015),wmfrhhh (12-24-2014),WolfGangS (07-11-2014),wsc4027 (11-11-2014),Xplodin (08-18-2014),xxoasisxx (06-27-2014),zenki210 (05-15-2014)

  3. #2
    Jim's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Location
    Summoner's Rift
    Posts
    4,250
    Reputation
    860
    Thanks
    1,556
    My Mood
    Psychedelic
    Looks clean,

    /Approved.
    Need a friend? Private Message
    Need a Middleman? Add me on Skype: HERE or Copy & Search >> 'aussie_sniperx'
    ---------------








    Ex-sections:
    DayZ
    OFPS
    OMMORPG
    M.A.T
    OSPFPS
    Battleon

  4. The Following User Says Thank You to Jim For This Useful Post:

    nivlac (05-15-2014)

  5. #3
    Kyle873's Avatar
    Join Date
    Oct 2012
    Gender
    male
    Posts
    7
    Reputation
    10
    Thanks
    1
    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.
    Last edited by Kyle873; 05-16-2014 at 12:24 PM.

  6. #4
    nivlac's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    20
    Reputation
    10
    Thanks
    216
    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.
    Last edited by nivlac; 05-16-2014 at 04:56 PM.

  7. The Following User Says Thank You to nivlac For This Useful Post:

    Teleporter (05-16-2014)

  8. #5
    Teleporter's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    65
    nivlac, thank You very much!

  9. #6
    morongshu's Avatar
    Join Date
    Mar 2014
    Gender
    male
    Posts
    7
    Reputation
    10
    Thanks
    0
    Also.the mouse scroll doesn't work,can't use it to change hotbar items.

  10. #7
    morongshu's Avatar
    Join Date
    Mar 2014
    Gender
    male
    Posts
    7
    Reputation
    10
    Thanks
    0
    I've found another bug:Mini-map doesn't save,it refreshes every time when I join.

  11. #8
    morongshu's Avatar
    Join Date
    Mar 2014
    Gender
    male
    Posts
    7
    Reputation
    10
    Thanks
    0
    I've found another bug:Mini-map doesn't save,it refreshes every time when I join.

  12. #9
    Teleporter's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    65
    morongshu
    It's Your problem. On my computer scroll work well.
    About mini-map, fix slightly is above.

  13. #10
    foobar37's Avatar
    Join Date
    Nov 2013
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    1
    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?

  14. The Following User Says Thank You to foobar37 For This Useful Post:

    Hiz0r (08-14-2014)

  15. #11
    nivlac's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    20
    Reputation
    10
    Thanks
    216
    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.

  16. #12
    mortemluna's Avatar
    Join Date
    Jul 2014
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0
    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?

  17. #13
    stupidgame's Avatar
    Join Date
    Jul 2014
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    Nice source bro.

    gotta try it out now.

  18. #14
    Ahl's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    /modcp
    Posts
    16,599
    Reputation
    3219
    Thanks
    5,383
    My Mood
    Angelic
    Wow the bump...
    News Force Head Editor from 09/14/2018 - 03/02/2020
    Publicist from 11/23/2017 - 06/07/2019
    Global Moderator since 09/24/2017
    Minion+ from 04/16/2017 - 09/24/2017
    Market Place Minion from 04/16/2017 - 09/24/2017
    Minecraft Minion from 02/23/2017 - 09/24/2017
    Realm of the Mad God Minion from 11/06/2016 - 09/24/2017

    Middleman from 09/14/2016 - 09/24/2017
    News Force Editor from 08/23/2016 - 09/14/2018
    News Force (Section of the Week) from 03/21/2016 - 07/17/2017
    News Force (User News) from 10/18/2015 - 09/14/2018

    Donator since 03/16/2015
    Realm of the Mad God Editor from 05/20/2014 - 07/08/2014
    Member since 12/23/2012


    Rep Power: 82

  19. #15
    stupidgame's Avatar
    Join Date
    Jul 2014
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    I hope there have "v1.2.4.1 TerrariaServer" source....

Page 1 of 2 12 LastLast

Similar Threads

  1. [Source Code] Terraria 1.2.1.2 Source
    By nivlac in forum Terraria Hacks
    Replies: 17
    Last Post: 12-13-2013, 10:18 PM
  2. Terraria 1.2.1.1 Source
    By chatrat12 in forum Terraria Hacks
    Replies: 5
    Last Post: 10-28-2013, 07:11 PM
  3. [Source Code] Terraria 1.2.0.1 Source Code
    By Teleporter in forum Terraria Hacks
    Replies: 31
    Last Post: 10-07-2013, 02:16 AM
  4. [Request] Terraria 1.1.2 Server Source Code
    By Shadon1nja in forum Terraria Hacks
    Replies: 2
    Last Post: 08-02-2012, 07:44 AM
  5. [Source Code] Terraria Server 1.1.1 Source
    By Xenoxiluna in forum Terraria Hacks
    Replies: 4
    Last Post: 01-09-2012, 04:33 AM