1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Adding locations to world omniporter

Discussion in 'Script Support' started by Walter Gress, Feb 9, 2019.

  1. Walter Gress
    Offline

    Gold Donator

    Joined:
    Oct 22, 2016
    Messages:
    103
    Likes Received:
    0
    Hey
    I'm trying to add to the world omniporter script to add my own custom locations but it keeps throwing a serialization error:


    Code (C#):
    1.                                                                                           Server is running in DEBUG mode.                                                                                                                                                                                                                                                                                                                                    
    2. [VitaNexCore]:
    3. [VitaNexCore]: Compile action started...
    4. [VitaNexCore]: Compiling Services...
    5. [VitaNexCore]: Compiling Modules...
    6. [VitaNexCore]: Compile action completed in 0.01 seconds
    7. [VitaNexCore]:
    8. [VitaNexCore]: Configure action started...
    9. [VitaNexCore]: Configuring Services...
    10. [VitaNexCore]: Configuring Modules...
    11. [VitaNexCore]: Configure action completed in 0.49 seconds
    12. Regions: Loading...done
    13. World: Loading...
    14. An error was encountered while loading a saved object
    15. - Type: Server.Items.WorldOmniporter
    16. - Serial: 0x40053513
    17. Delete the object? (y/n)
    18. After pressing return an exception will be thrown and the server will terminate.
    19.  
    20. Error:
    21. System.Exception: Load failed (items=True, mobiles=False, guilds=False, data=False, type=Server.Items.WorldOmniporter, serial=0x40053513) ---> System.Exception: ***** Bad serialize on Server.Items.WorldOmniporter *****
    22.    at Server.World.Load() in c:\Users\Ted Gress\Desktop\ServUO-master reboot\ServUO-master\ServUO-master\Server\World.cs:line 645
    23.    --- End of inner exception stack trace ---
    24.    at Server.World.Load() in c:\Users\Ted Gress\Desktop\ServUO-master reboot\ServUO-master\ServUO-master\Server\World.cs:line 864
    25.    at Server.Core.Main(String[] args) in c:\Users\Ted Gress\Desktop\ServUO-master reboot\ServUO-master\ServUO-master\Server\Main.cs:line 556
    26. This exception is fatal, press return to exit
    27.  
     
  2. Neshoba
    Offline

    Neshoba Member

    Joined:
    Feb 1, 2016
    Messages:
    316
    Likes Received:
    17
    what did You add ?? are you adding to shard facets or to a custom map ?/
     
  3. Walter Gress
    Offline

    Gold Donator

    Joined:
    Oct 22, 2016
    Messages:
    103
    Likes Received:
    0
    I just added locations in Malas and Trammel.
     
  4. Neshoba
    Offline

    Neshoba Member

    Joined:
    Feb 1, 2016
    Messages:
    316
    Likes Received:
    17
    these 3 lines are missing something ,, post script and Il see if I can see anything causing it
     
  5. Walter Gress
    Offline

    Gold Donator

    Joined:
    Oct 22, 2016
    Messages:
    103
    Likes Received:
    0
    Code (C#):
    1. Server.World line 645
    2.  
    3.  
    4.             if (!failedMobiles && File.Exists(ItemDataPath))
    5.             {
    6.                 using (FileStream bin = new FileStream(ItemDataPath, FileMode.Open, FileAccess.Read, FileShare.Read))
    7.                 {
    8.                     BinaryFileReader reader = new BinaryFileReader(new BinaryReader(bin));
    9.  
    10.                     for (int i = 0; i < items.Count; ++i)
    11.                     {
    12.                         ItemEntry entry = items[i];
    13.                         Item item = entry.Item;
    14.  
    15.                         if (item != null)
    16.                         {
    17.                             reader.Seek(entry.Position, SeekOrigin.Begin);
    18.  
    19.                             try
    20.                             {
    21.                                 m_LoadingType = entry.TypeName;
    22.                                 item.Deserialize(reader);
    23.  
    24.                                 if (reader.Position != (entry.Position + entry.Length))
    25.                                 {
    26.                                     throw new Exception(String.Format("***** Bad serialize on {0} *****", item.GetType()));
    27.                                 }
    28.                             }
    29.                             catch (Exception e)
    30.                             {
    31.                                 items.RemoveAt(i);
    32.  
    33.                                 failed = e;
    34.                                 failedItems = true;
    35.                                 failedType = item.GetType();
    36.                                 failedTypeID = entry.TypeID;
    37.                                 failedSerial = item.Serial;
    38.  
    39.                                 break;
    40.                             }
    41.                         }
    42.                     }
    43.  
    44.                     reader.Close();
    45.                 }
    46.  
    47. Main 556
    48.  
    49. [code]ScriptCompiler.Invoke("Configure");
    50.  
    51.             Region.Load();
    52.             World.Load();
    53.  
    54.             ScriptCompiler.Invoke("Initialize");
    55.  
    56.             MessagePump messagePump = MessagePump = new MessagePump();
    57.  
    58.             _TimerThread.Start();
    59.  
    60.             foreach (Map m in Map.AllMaps)
    61.             {
    62.                 m.Tiles.Force();
    63.             }
    64.  
    65.             NetState.Initialize();
    66.  
    67.             EventSink.InvokeServerStarted();
    68.  
    }
    [/code]

    Line 864
    Code (C#):
    1.  
    2.             EventSink.InvokeWorldLoad();
    3.  
    4.             m_Loading = false;
    5.  
    6.             ProcessSafetyQueues();
    7.  
    8.             foreach (Item item in m_Items.Values)
    9.             {
    10.                 if (item.Parent == null)
    11.                 {
    12.                     item.UpdateTotals();
    13.                 }
    14.  
    15.                 item.ClearProperties();
    16.             }
    17.  
    18.             foreach (Mobile m in m_Mobiles.Values)
    19.             {
    20.                 m.UpdateRegion(); // Is this really needed?
    21.                 m.UpdateTotals();
    22.  
    23.                 m.ClearProperties();
    24.             }
    25.  
    26.             foreach (SaveData saveData in _Data.Values)
    27.             {
    28.                 saveData.Prep();
    29.             }
    30.  
    31.             watch.Stop();
    32.  
    33.             Utility.PushColor(ConsoleColor.Green);
    34.             Console.WriteLine(
    35.                 "...done ({1} items, {2} mobiles, {3} customs) ({0:F2} seconds)",
    36.                 watch.Elapsed.TotalSeconds,
    37.                 m_Items.Count,
    38.                 m_Mobiles.Count,
    39.                 _Data.Count);
    40.             Utility.PopColor();
    41.         }
     
Similar Threads: Adding locations
Forum Title Date
Script Support Adding line to check if items are locked down into basehouse Yesterday at 11:28 AM
General Discussion Adding Newer Client Artwork to older client Monday at 12:58 PM
Script Support Adding custom graphics with FIddler and Pandoras Box Feb 13, 2019
ServUO Discussion Adding a facet Feb 8, 2019
ServUO Discussion Adding Quests to MLQuest Feb 4, 2019
Script Support Adding skills using Fiddler Feb 4, 2019
Script Support Adding a value to defcrafting? Jan 30, 2019