Attempting to update Spawn Editor Program Code

Discussion in 'Software: tools, applications and coding' started by Dian, Jan 9, 2015.

  1. Dian

    Dian Administrator

    I am trying to get the source I have to the XML Spawn Editor program fixed, at least able to compile under 4.5 framework.

    This is a code block that is causing problems and the errors. I entered the line number in the code block for reference. This is code that was done last in 2006 at the latest, so was using Framework 1.1 or 2.0 at best, Id say. Any help would be great, then maybe move on to the next :)

    Error 73 Invalid expression term '}' C:\Ancient Legends\Tools\SpawnEditor2 src\SpawnEditor2\SpawnEditor2\SpawnEditor.cs 3111 5 SpawnEditor2
    Error 74 ; expected C:\Ancient Legends\Tools\SpawnEditor2 src\SpawnEditor2\SpawnEditor2\SpawnEditor.cs 3111 6 SpawnEditor2
    Error 75 Syntax error, '(' expected C:\Ancient Legends\Tools\SpawnEditor2 src\SpawnEditor2\SpawnEditor2\SpawnEditor.cs 3113 5 SpawnEditor2
    Error 76 Syntax error, 'while' expected C:\Ancient Legends\Tools\SpawnEditor2 src\SpawnEditor2\SpawnEditor2\SpawnEditor.cs 3113 5 SpawnEditor2
    Error 77 Invalid expression term 'finally' C:\Ancient Legends\Tools\SpawnEditor2 src\SpawnEditor2\SpawnEditor2\SpawnEditor.cs 3114 4 SpawnEditor2


    Code:
    public static Type FindRunUOType(string name)
         {
           if (name == null)
           {
             return null;
           }
           Type type = null;
           string lower = name.ToLower();
           if (SpawnEditor.typeHash.Contains(lower))
           {
             return (Type)SpawnEditor.typeHash[lower];
           }
           IEnumerator enumerator = SpawnEditor.AssemblyList.GetEnumerator();
           try
           {
             do
             {
               if (!enumerator.MoveNext())
               {
                 break;
               }
               Type[] types = ((Assembly)enumerator.Current).GetTypes();
               if (types == null)
               {
                 continue;
               }
               int num = 0;
               while (num < (int)types.Length)
               {
                 if (!types[num].Name.ToLower().Equals(lower))
                 {
                   num++;
                 }
                 else
                 {
                   type = types[num];
                   goto Label0;
                 }
               }
                           Label0:
    line 3111        }
                           while (type == null);
    line 3113       }
    line 3114       finally
                           {
             IDisposable disposable = enumerator as IDisposable;
             if (disposable != null)
             {
               disposable.Dispose();
             }
           }
           SpawnEditor.typeHash.Add(lower, type);
           return type;
         }
     
  2. Ce Jayce

    Ce Jayce Administrator Staff Member JustUO Developer Gold Star Member

    Try this, only made a slight change, not sure if it will actually make any difference what so ever but can't test it my end. Worth a shot. :p

    Code:
    public static Type FindRunUOType(string name)
         {
           if (name == null)
           {
             return null;
           }
           Type type = null;
           string lower = name.ToLower();
           if (SpawnEditor.typeHash.Contains(lower))
           {
             return (Type)SpawnEditor.typeHash[lower];
           }
           IEnumerator enumerator = SpawnEditor.AssemblyList.GetEnumerator();
           try
           {
             do
             {
               if (!enumerator.MoveNext())
               {
                 break;
               }
               Type[] types = ((Assembly)enumerator.Current).GetTypes();
               if (types == null)
               {
                 continue;
               }
               int num = 0;
               while (num < (int)types.Length)
               {
                 if (!types[num].Name.ToLower().Equals(lower))
                 {
                   num++;
                 }
                 else
                 {
                   type = types[num];
                   goto Label0;
                 }
               }
                           Label0:
          } while (type == null);
                          
           }
         catch
            {}
          
             IDisposable disposable = enumerator as IDisposable;
             if (disposable != null)
             {
               disposable.Dispose();
             }
           SpawnEditor.typeHash.Add(lower, type);
           return type;
         }
     
  3. Dian

    Dian Administrator

    It gives roughly same results. Catch is invalid expression term.

    I am almost thinking that a couple dll's may need to be rebuilt as well for this to work. Frustrating, this is such a great program for world spawning with xml spawners. I am about to search out someone to pay to fix this program really. Its that important to me.

    Thanks.
     
  4. qbradq

    qbradq Renowned Member

    Can you make a GitHub repo for the code, or post it somewhere so I can? I'd love to fix the program. I was thinking about writing a new spawn editing utility because I was not aware the source code for this was available.

    Edit: Found the thread regarding Spawn Editor 2 source code. I'll have a crack at it.
     
    Last edited: Dec 23, 2015
    • Like Like x 1

Share This Page