Results 1 to 2 of 2
  1. #1
    exofos's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    5
    Reputation
    10
    Thanks
    0
    My Mood
    Doh

    Post Terraria cooding problems

    When i try to debug my mod it says: "TypeIntializationException was unhandeled"
    What did i do wrong?
    Here's my code:


    namespace Terraria
    {
    using System;
    using System****;
    //using System.Windows.Forms;

    internal static class Program
    {
    private static void Main(string[] args)
    {
    Terraria.Main main = new Terraria.Main();
    try
    {
    for (int i = 0; i < args.Length; i++)
    {
    if ((args[i].ToLower() == "-port") || (args[i].ToLower() == "-p"))
    {
    i++;
    try
    {
    Netplay.serverPort = Convert.ToInt32(args[i]);
    }
    catch
    {
    }
    }
    if ((args[i].ToLower() == "-join") || (args[i].ToLower() == "-j"))
    {
    i++;
    try
    {
    main.AutoJoin(args[i]);
    }
    catch
    {
    }
    }
    if ((args[i].ToLower() == "-pass") || (args[i].ToLower() == "-password"))
    {
    i++;
    Netplay.password = args[i];
    main.AutoPass();
    }
    if (args[i].ToLower() == "-host")
    {
    main.AutoHost();
    }
    if (args[i].ToLower() == "-loadlib")
    {
    i++;
    string path = args[i];
    main.loadLib(path);
    }
    }
    //Steam.Init();
    // if (Steam.SteamInit)
    // {
    main.Run();
    // }
    // else
    // {
    // MessageBox.Show("Please launch the game from your Steam client.", "Error");
    //}
    }
    catch (Exception exception)
    {
    try
    {
    using (StreamWriter writer = new StreamWriter("client-crashlog.txt", true))
    {
    writer.WriteLine(DateTime.Now);
    writer.WriteLine(exception);
    writer.WriteLine("");
    }
    // MessageBox.Show(exception.ToString(), "Terraria: Error");
    }
    catch
    {
    }
    }
    finally
    {
    if (main != null)
    {
    main.Dispose();
    }
    }
    }
    }
    }
    Last edited by exofos; 02-22-2012 at 02:21 PM.

  2. #2
    noobsludgerz's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Posts
    36
    Reputation
    10
    Thanks
    823
    My Mood
    Amazed
    well to fix this goto: Pastebin.com - #1 paste tool since 2002! upload your code and paste the link here.

Similar Threads

  1. To All GunZ Down 02-07-06 PROBLEM
    By WertyRO in forum Gunz General
    Replies: 18
    Last Post: 02-09-2006, 07:41 PM
  2. Problem
    By lambda in forum Gunz General
    Replies: 3
    Last Post: 02-08-2006, 11:36 AM
  3. hacking problems
    By iwillkillyou in forum WarRock - International Hacks
    Replies: 11
    Last Post: 02-04-2006, 04:37 PM
  4. WPE problem...
    By styx23 in forum General Game Hacking
    Replies: 8
    Last Post: 01-18-2006, 07:51 PM
  5. Problem Wit Hacking Programs
    By f5awp in forum General Gaming
    Replies: 5
    Last Post: 01-10-2006, 05:44 AM

Tags for this Thread