RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

ACC - Central Memory

A_Li_N

Knight
ACC - Central Memory

Description
This plug-in for my ACC system is used to keep track of the various Modules one might install. A Module is used to store information about a system for a specific player/item. The easiest example I can think of would be a class system in the very lightest form. A class system puts each player into a class. Normally, this would require you to modify the playermobile.cs to implement a property and an enum of classes. With this system, you could create a 'Class' Module that keeps track of the information and is linked to that player.

This release is the core system. There are no Modules for it as of yet. The first one I will be releasing will be part of the Complete Spell System (of which, I have the core and distro spells working). As of right now, I am willing to bet there is no need to download this update. If you have this system already working in your server using an old version of Complete Spell System or any other systems made by others that require Central Memory, I'd suggest NOT upgrading, as those systems most likely have not been updated to use the latest release (since I'm only now releasing it)

If a better explanation of this system is required, please say so and I'll try to explain in more detail. Just know that this system is not required by anything that I know of yet, but will be soon.

Notes
Please see the notes in ACC Core post. Link below.
Testing done has been limited to my Complete Spell System core files and distro spells, which uses a Module to keep track of spell icon gump locations. I loaded the server, added an Icon, saved the server and reloaded, all worked well. If anyone grabs and uses this system with their own Module and it crashes due to this system, please post here or PM me the debug crash log.

Installation
Download and install ACC Core.
Download package.
Extract to your Customs folder (replace if updating)
Load server

Instructions on Use
To come...

Updates
2009-03-31 - Added a check in ModuleList.Get( Type ) to see if the ModuleList has that type of module before returning it.
2009-03-30 - IMPORTANT UPDATE - Added version to serialization. Follow notes in update post up update.
2009-03-27 - Updated to latest SVN (313). Many generics updates and gump fixes due to them.

ACC Collection Links
ACC Core
ACC Public Gates
ACC Complete Spell System
ACC Yard and Garden System
ACC Spellweaving, Bushido, Mysticism and Ninjitsu (tass23)
 

Attachments

  • Central Memory - 20090331-100736.rar
    5 KB · Views: 840

Thilgon

Sorceror
Quoting myself from ACC topic:
There is one thing only i wish about this system, and it is... a detailed guide lol
I mean, it has so many potentiality that it would be a waste not being able to use it ^_^

anyway, happy to see you around, love your scripts :)
 

A_Li_N

Knight
Thilgon;795099 said:
Quoting myself from ACC topic:
There is one thing only i wish about this system, and it is... a detailed guide lol
I mean, it has so many potentiality that it would be a waste not being able to use it ^_^

anyway, happy to see you around, love your scripts :)

I will give it a try to write out some real instructions for both and add them to the first post. It won't be until after I get the Complete Spell System 'updated' (Core + Distro + Druid = done and posting right now, 6 systems left to finish updating).

After the Complete Spell System is updated and working, I'm leaving it in the dust and actually going to start working on my Spell System 2.0 that was conceptualized way back when.
 

Thilgon

Sorceror
Thanks ;) doesn't matter how much time you get, it's your scripts and your time so... no pushing :)
I have an interesting idea that might involve this, if you don't mind about me using it... i was going to try it without your ACC (anyway, it's a long-term project), but i think i could handle it better using it... if i get to understand it lol :)
 

A_Li_N

Knight
Updated

2009-03-30
- Added version number to serialization methods.

Files Changed
All

To Update
If you have been using this system before and have saved:
  1. Extract files to overwrite the current files on your server.
  2. Open CentralMemory.cs
  3. Go to line 529 : int version = reader.ReadInt();
  4. Comment out that line by putting two slasshes in front of it : //int version = reader.ReadInt();
  5. Save file.
  6. Load the server, save the server.
  7. Un-comment that line by removing the two slashes. Save the file.
  8. Load the server, save the server.
  9. Good as gold.
If you are starting fresh (as in, you just extracted the RunUO server and are adding this system), extract the files, overwriting the current ones.
 

A_Li_N

Knight
Updated

2009-03-31
- Added a check in ModuleList.Get( Type ) to see if the ModuleList has that type of module before returning it.

Files Updated
ModuleList.cs

To Update
Overwrite current files with files from rar.
 

Prophet2005

Wanderer
Errors in ACC

Was wondering if you could help me with some errors

Code:
Errors:
 + Custom Scripts/Central Memory/CentralMemory.cs:
    CS0246: Line 20: The type or namespace name 'ACCGumpParams' could not be fou
nd (are you missing a using directive or an assembly reference?)
    CS0246: Line 32: The type or namespace name 'ACCSystem' could not be found (
are you missing a using directive or an assembly reference?)
    CS0246: Line 234: The type or namespace name 'ACCGumpParams' could not be fo
und (are you missing a using directive or an assembly reference?)
    CS0246: Line 385: The type or namespace name 'ACCGumpParams' could not be fo
und (are you missing a using directive or an assembly reference?)

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Server.Gumps;
using Server.Network;


namespace Server.ACC.CM
{
    public enum Pages
    {
        Home,
        ListMobiles,
        ListItems,
        ListModulesFor
    };

    public class CMGumpParams : ACCGumpParams
    {
        public Pages PageName;
        public Serial SelectedSerial;
        public int PageIndex;

        public CMGumpParams()
            : base()
        {
        }
    }

    public partial class CentralMemory : ACCSystem
    {
        internal static List<Type> m_Types = new List<Type>();
        private static Dictionary<Serial, ModuleList> m_DictionaryOfModuleLists = new Dictionary<Serial, ModuleList>();
        public static Dictionary<Serial, ModuleList> DictionaryOfModuleLists
        {
            get
            {
                return m_DictionaryOfModuleLists;
            }
        }

        public static void Configure()
        {
            ACC.RegisterSystem("Server.ACC.CM.CentralMemory");
        }

        public static bool Running
        {
            get { return ACC.SysEnabled("Server.ACC.CM.CentralMemory"); }
        }

        #region BasicOverrides
        public override string Name() { return "Central Memory"; }

        public override void Enable()
        {
            Console.WriteLine("{0} has just been enabled!", Name());
        }

        public override void Disable()
        {
            Console.WriteLine("{0} has just been disabled!", Name());
        }
        #endregion //BasicOverrides

        #region Methods
        public static void Flush()
        {
            List<Serial> RemoveList = new List<Serial>();

            foreach (Serial s in m_DictionaryOfModuleLists.Keys)
            {
                if (s.IsItem)
                {
                    Item i = World.FindItem(s);
                    if (i == null || i.Deleted)
                        RemoveList.Add(s);
                }
                else if (s.IsMobile)
                {
                    Mobile m = World.FindMobile(s);
                    if (m == null || m.Deleted)
                        RemoveList.Add(s);
                }

                if (m_DictionaryOfModuleLists[s].Count == 0)
                    RemoveList.Add(s);
            }

            foreach (Serial s in RemoveList)
            {
                Remove(s);
            }

            RemoveList.Clear();

            Console.Write("Flushed...");
        }

        public static bool Contains(Serial ser)
        {
            return m_DictionaryOfModuleLists.ContainsKey(ser);
        }

        public static bool ContainsModule(Serial ser, Type type)
        {
            if (Contains(ser))
            {
                if (m_DictionaryOfModuleLists[ser] != null)
                    return m_DictionaryOfModuleLists[ser].Contains(type);
            }
            return false;
        }

        public static void Add(Serial ser)
        {
            if (Contains(ser))
                return;

            m_DictionaryOfModuleLists.Add(ser, new ModuleList(ser));
        }

        public static void Add(Serial ser, ModuleList list)
        {
            m_DictionaryOfModuleLists[ser] = list;
        }

        public static void AddModule(Module mod)
        {
            if (!m_DictionaryOfModuleLists.ContainsKey(mod.Owner))
                Add(mod.Owner);

            m_DictionaryOfModuleLists[mod.Owner].Add(mod);
        }

        public static void AddModule(Serial ser, Type type)
        {
            if (!m_DictionaryOfModuleLists.ContainsKey(ser))
                Add(ser);

            m_DictionaryOfModuleLists[ser].Add(type);
        }

        public static void ChangeModule(Serial ser, Module mod)
        {
            if (!m_DictionaryOfModuleLists.ContainsKey(ser))
                Add(ser);

            m_DictionaryOfModuleLists[ser].Change(mod);
        }

        public static void AppendModule(Serial ser, Module mod, bool negatively)
        {
            if (!m_DictionaryOfModuleLists.ContainsKey(ser))
                Add(ser);
            else if (!ContainsModule(ser, mod.GetType()))
            {
                AddModule(mod);
                return;
            }
            else
            {
                m_DictionaryOfModuleLists[ser].Append(mod, negatively);
            }
        }

        public static void Remove(Serial ser)
        {
            m_DictionaryOfModuleLists.Remove(ser);
        }

        public static void RemoveModule(Serial ser, Module mod)
        {
            if (m_DictionaryOfModuleLists.ContainsKey(ser))
                m_DictionaryOfModuleLists[ser].Remove(mod);
        }

        public static void RemoveModule(Serial ser, Type type)
        {
            if (m_DictionaryOfModuleLists.ContainsKey(ser))
                m_DictionaryOfModuleLists[ser].Remove(type);
        }

        public static Module GetModule(Serial ser, Type type)
        {
            if (m_DictionaryOfModuleLists.ContainsKey(ser))
                return m_DictionaryOfModuleLists[ser].Get(type);

            return null;
        }

        public static List<Mobile> GetMobiles()
        {
            List<Mobile> list = new List<Mobile>();
            foreach (Serial s in m_DictionaryOfModuleLists.Keys)
            {
                if (s.IsMobile)
                {
                    Mobile m = World.FindMobile(s);
                    if (m != null && !m.Deleted)
                        list.Add(m);
                }
            }

            return list;
        }

        public static List<Item> GetItems()
        {
            List<Item> list = new List<Item>();
            foreach (Serial s in m_DictionaryOfModuleLists.Keys)
            {
                if (s.IsItem)
                {
                    Item i = World.FindItem(s);
                    if (i != null && !i.Deleted)
                        list.Add(i);
                }
            }

            return list;
        }
        #endregion //Methods

        private CMGumpParams Params;
        private List<Mobile> m_MobileList;
        private List<Item> m_ItemList;
        private List<Module> m_ModuleList;
        private Module m_Module;

        #region Gump
        public override void Gump(Mobile from, Gump gump, ACCGumpParams subParams)
        {
            gump.AddButton(190, 40, 2445, 2445, 101, GumpButtonType.Reply, 0);
            gump.AddLabel(204, 42, 1153, "List Mobiles");
            gump.AddButton(310, 40, 2445, 2445, 102, GumpButtonType.Reply, 0);
            gump.AddLabel(331, 42, 1153, "List Items");
            gump.AddButton(430, 40, 2445, 2445, 103, GumpButtonType.Reply, 0);
            gump.AddLabel(450, 42, 1153, "List Types");
            //			gump.AddButton( 190, 70, 2445, 2445, 104, GumpButtonType.Reply, 0 );
            //			gump.AddLabel(  208, 72, 1153, "Add Module" );
            //			gump.AddButton( 310, 70, 2445, 2445, 105, GumpButtonType.Reply, 0 );
            //			gump.AddLabel(  326, 72, 1153, "Edit Module" );
            //			gump.AddButton( 430, 70, 2445, 2445, 106, GumpButtonType.Reply, 0 );
            //			gump.AddLabel(  439, 72, 1153, "Delete Module" );

            if (subParams == null || !(subParams is CMGumpParams))
            {
                gump.AddHtml(215, 15, 300, 25, "<basefont size=7 color=white><center>Central Memory</center></font>", false, false);
                gump.AddHtml(140, 95, 450, 250, "<basefont color=white><center>Welcome to the Central Memory Admin Gump!</center><br>With this gump, you can see a list of all entries that the CM contains.  You can add new Modules or modify or delete existing Modules.<br><br>Make your selection from the top buttons, either List Mobiles or Items.  This will bring up a list of all Mobiles or Items that the CM is keeping track of.<br><br>You may then select one of the entries to list the Modules that are stored to that entry.  You can then add, modify or remove modules to that entry.</font>", false, false);
                return;
            }

            Params = subParams as CMGumpParams;

            switch ((int)Params.PageName)
            {
                #region ListMobiles
                case (int)Pages.ListMobiles:
                    gump.AddLabel(120, 95, 1153, "Listing all Mobiles:");

                    m_MobileList = GetMobiles();
                    if (m_MobileList == null || m_MobileList.Count == 0)
                        return;

                    if (Params.PageIndex < 0)
                        Params.PageIndex = 0;


                    if (Params.PageIndex > 0)
                        gump.AddButton(120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0);
                    if ((Params.PageIndex + 1) * 21 <= m_MobileList.Count)
                        gump.AddButton(540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0);

                    for (int i = Params.PageIndex * 21, r = 0, c = 0; i < m_MobileList.Count; i++)
                    {
                        if (m_MobileList[i] == null)
                            continue;
                        gump.AddButton(120 + c * 155, 125 + r * 30, 2501, 2501, 1000 + i, GumpButtonType.Reply, 0);
                        gump.AddLabel(130 + c * 155, 126 + r * 30, 1153, (m_MobileList[i].Name == null ? m_MobileList[i].Serial.ToString() : m_MobileList[i].Name));
                    }

                    break;
                #endregion //ListMobiles

                #region ListItems
                case (int)Pages.ListItems:
                    gump.AddLabel(120, 95, 1153, "Listing all Items:");

                    m_ItemList = GetItems();
                    if (m_ItemList == null || m_ItemList.Count == 0)
                        return;

                    if (Params.PageIndex < 0)
                        Params.PageIndex = 0;

                    if (Params.PageIndex > 0)
                        gump.AddButton(120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0);
                    if ((Params.PageIndex + 1) * 21 <= m_ItemList.Count)
                        gump.AddButton(540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0);

                    for (int i = Params.PageIndex * 21, r = 0, c = 0; i < m_ItemList.Count; i++)
                    {
                        if (m_ItemList[i] == null)
                            continue;
                        gump.AddButton(120 + c * 155, 125 + r * 30, 2501, 2501, 1000 + i, GumpButtonType.Reply, 0);
                        gump.AddLabel(130 + c * 155, 126 + r * 30, 1153, (m_ItemList[i].Name == null ? m_ItemList[i].Serial.ToString() : m_ItemList[i].Name));
                    }

                    break;
                #endregion //ListItems

                #region ListModulesFor
                case (int)Pages.ListModulesFor:
                    if (!m_DictionaryOfModuleLists.ContainsKey(Params.SelectedSerial))
                    {
                        gump.AddLabel(120, 95, 1153, "This entity no longer exists in the Central Memory!");
                        return;
                    }

                    if (m_DictionaryOfModuleLists[Params.SelectedSerial] == null || m_DictionaryOfModuleLists[Params.SelectedSerial].Count == 0)
                    {
                        gump.AddLabel(120, 95, 1153, "This entity has no Modules!");
                        Remove(Params.SelectedSerial);
                        return;
                    }

                    string name = "";
                    if (Params.SelectedSerial.IsMobile)
                        name = World.FindMobile(Params.SelectedSerial).Name;
                    else if (Params.SelectedSerial.IsItem)
                        name = World.FindItem(Params.SelectedSerial).Name;

                    if (name == null || name.Length == 0)
                        name = Params.SelectedSerial.ToString();

                    gump.AddLabel(120, 95, 1153, String.Format("Listing all Modules for {0}:", name));

                    m_ModuleList = m_DictionaryOfModuleLists[Params.SelectedSerial].GetListOfModules();

                    if (m_ModuleList == null || m_ModuleList.Count == 0)
                        return;

                    if (Params.PageIndex < 0)
                        Params.PageIndex = 0;
                    if (Params.PageIndex * 21 >= m_ModuleList.Count)
                        Params.PageIndex = m_ModuleList.Count - 21;

                    if (Params.PageIndex > 0)
                        gump.AddButton(120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0);
                    if ((Params.PageIndex + 1) * 21 <= m_ModuleList.Count)
                        gump.AddButton(540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0);

                    gump.AddButton(331, 332, 4008, 4009, 106, GumpButtonType.Reply, 0);

                    for (int i = Params.PageIndex * 21, r = 0, c = 0; i < m_ModuleList.Count; i++)
                    {
                        if (m_ModuleList[i] == null)
                            continue;

                        gump.AddButton(120 + c * 155, 125 + r * 30, 2501, 2501, 1000 + i, GumpButtonType.Reply, 0);
                        gump.AddLabel(130 + c * 155, 126 + r * 30, 1153, (m_ModuleList[i].Name().Length == 0 ? m_ModuleList[i].Owner.ToString() : m_ModuleList[i].Name()));
                    }

                    break;
                #endregion //ListModulesFor
            }
        }

        public override void Help(Mobile from, Gump gump)
        {
        }

        /* ID's
        101   = Button	List Mobiles
        102   = Button	List Items
        103   = Button	List Types
        104   = Button	Previous
        105   = Button	Next
        106   = Button	Back to List
        1000+ = Button	Selections
         */
        public override void OnResponse(NetState state, RelayInfo info, ACCGumpParams subParams)
        {
            if (!Running || info.ButtonID == 0)
                return;

            if (subParams is CMGumpParams)
                Params = subParams as CMGumpParams;

            CMGumpParams newParams = new CMGumpParams();

            //Switch to List Mobiles
            if (info.ButtonID == 101)
            {
                newParams.PageName = Pages.ListMobiles;
            }

            //Switch to List Items
            else if (info.ButtonID == 102)
            {
                newParams.PageName = Pages.ListItems;
            }

            //Previous Page
            else if (info.ButtonID == 104)
            {
                newParams.PageIndex = Params.PageIndex - 1;
            }

            //Next Page
            else if (info.ButtonID == 105)
            {
                newParams.PageIndex = Params.PageIndex + 1;
            }

            //Back to List
            else if (info.ButtonID == 106)
            {
                newParams.PageName = Pages.Home;
            }

            //Select Item from List
            else if (info.ButtonID >= 1000)
            {
                int selectedID = info.ButtonID - 1000;

                if (selectedID < 0 || selectedID >= m_DictionaryOfModuleLists.Count)
                    return;

                switch ((int)Params.PageName)
                {
                    //Change page to List Modules with serial of selected item
                    case (int)Pages.ListItems:
                        {
                            if (selectedID < 0 || selectedID >= m_ItemList.Count)
                                return;

                            newParams.PageName = Pages.ListModulesFor;
                            newParams.SelectedSerial = m_ItemList[selectedID].Serial;
                            newParams.PageIndex = 0;

                            break;
                        }
                    //Change page to List Modules with serial of selected mobile
                    case (int)Pages.ListMobiles:
                        {
                            if (selectedID < 0 || selectedID >= m_MobileList.Count)
                                return;

                            newParams.PageName = Pages.ListModulesFor;
                            newParams.SelectedSerial = m_MobileList[selectedID].Serial;
                            newParams.PageIndex = 0;
                            break;
                        }
                    //Open the Edit Module Gump 
                    //Not implemented yet
                    case (int)Pages.ListModulesFor:
                        {
                            if (selectedID < 0 || selectedID >= m_ModuleList.Count)
                                return;

                            if (m_ModuleList[selectedID] == null)
                                return;

                            Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback(SendEMG), state.Mobile);
                            break;
                        }
                }
            }

            state.Mobile.SendGump(new ACCGump(state.Mobile, this.ToString(), newParams));
        }

        private void SendEMG(object state)
        {
            Mobile m = state as Mobile;
            if (m == null || m.Deleted || m_Module == null)
                return;

            m.SendMessage("Sent EMG for {0}", m_Module.Name());
            //m.SendGump( new EditModuleGump( m_Module ) );
        }
        #endregion //Gump

        public override void Save(GenericWriter idx, GenericWriter tdb, GenericWriter writer)
        {
            Flush();

            List<Module> fullList = new List<Module>();
            foreach (ModuleList ml in m_DictionaryOfModuleLists.Values)
            {
                foreach (Module m in ml.Values)
                {
                    fullList.Add(m);
                }
            }

            writer.Write((int)0); //Version

            idx.Write((int)fullList.Count);
            foreach (Module m in fullList)
            {
                Type t = m.GetType();
                long start = writer.Position;
                idx.Write((int)m.m_TypeRef);
                idx.Write((int)m.Owner);
                idx.Write((long)start);

                m.Serialize(writer);

                idx.Write((int)(writer.Position - start));
            }

            tdb.Write((int)m_Types.Count);
            for (int i = 0; i < m_Types.Count; ++i)
                tdb.Write(((Type)m_Types[i]).FullName);
        }

        public override void Load(BinaryReader idx, BinaryReader tdb, BinaryFileReader reader)
        {
            object[] ctorArgs = new object[1];
            Type[] ctorTypes = new Type[1] { typeof(Serial) };
            List<ModuleEntry> modules = new List<ModuleEntry>();
            m_DictionaryOfModuleLists = new Dictionary<Serial, ModuleList>();

            int version = reader.ReadInt();

            int count = tdb.ReadInt32();
            ArrayList types = new ArrayList(count);
            for (int i = 0; i < count; ++i)
            {
                string typeName = tdb.ReadString();
                Type t = ScriptCompiler.FindTypeByFullName(typeName);
                if (t == null)
                {
                    Console.WriteLine("Type not found: {0}, remove?", typeName);
                    if (Console.ReadKey(true).Key == ConsoleKey.Y)
                    {
                        types.Add(null);
                        continue;
                    }
                    throw new Exception(String.Format("Bad type '{0}'", typeName));
                }

                ConstructorInfo ctor = t.GetConstructor(ctorTypes);
                if (ctor != null)
                    types.Add(new object[] { ctor, null });
                else
                    throw new Exception(String.Format("Type '{0}' does not have a serialization constructor", t));
            }

            int moduleCount = idx.ReadInt32();

            for (int i = 0; i < moduleCount; ++i)
            {
                int typeID = idx.ReadInt32();
                int serial = idx.ReadInt32();
                long pos = idx.ReadInt64();
                int length = idx.ReadInt32();

                object[] objs = (object[])types[typeID];
                if (objs == null)
                    continue;

                Module m = null;
                ConstructorInfo ctor = (ConstructorInfo)objs[0];
                string typeName = (string)objs[1];

                try
                {
                    ctorArgs[0] = (Serial)serial;
                    m = (Module)(ctor.Invoke(ctorArgs));
                }
                catch
                {
                }

                if (m != null)
                {
                    modules.Add(new ModuleEntry(m, typeID, typeName, pos, length));
                    AddModule(m);
                }
            }

            bool failedModules = false;
            Type failedType = null;
            Exception failed = null;
            int failedTypeID = 0;

            for (int i = 0; i < modules.Count; ++i)
            {
                ModuleEntry entry = modules[i];
                Module m = entry.Module;

                if (m != null)
                {
                    reader.Seek(entry.Position, SeekOrigin.Begin);

                    try
                    {
                        m.Deserialize(reader);

                        if (reader.Position != (entry.Position + entry.Length))
                            throw new Exception(String.Format("Bad serialize on {0}", m.GetType()));
                    }
                    catch (Exception e)
                    {
                        modules.RemoveAt(i);

                        failed = e;
                        failedModules = true;
                        failedType = m.GetType();
                        failedTypeID = entry.TypeID;

                        break;
                    }
                }
            }

            if (failedModules)
            {
                Console.WriteLine("An error was encountered while loading a Module of Type: {0}", failedType);
                Console.WriteLine("Remove this type of Module? (y/n)");
                if (Console.ReadLine() == "y")
                {
                    for (int i = 0; i < modules.Count; )
                    {
                        if (((ModuleEntry)modules[i]).TypeID == failedTypeID)
                            modules.RemoveAt(i);
                        else
                            ++i;
                    }

                    SaveIndex<ModuleEntry>(modules);
                }

                Console.WriteLine("After pressing return an exception will be thrown and the server will terminate");
                Console.ReadLine();

                throw new Exception(String.Format("Load failed (type={0})", failedType), failed);
            }
        }

        private void SaveIndex<T>(List<T> list) where T : IEntityMod
        {
            string path = "";
            if (CentralMemory.Running)
            {
                if (!Directory.Exists("ACC Backups/Central Memory/"))
                    Directory.CreateDirectory("ACC Backups/Central Memory/");
                path = "ACC Backups/Central Memory/Central Memory.idx";
            }
            else
            {
                if (!Directory.Exists("Saves/ACC/Central Memory/"))
                    Directory.CreateDirectory("Saves/ACC/Central Memory/");
                path = "Saves/ACC/Central Memory/Central Memory.idx";
            }

            using (FileStream idx = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None))
            {
                BinaryWriter idxWriter = new BinaryWriter(idx);

                idxWriter.Write(list.Count);
                for (int i = 0; i < list.Count; ++i)
                {
                    T e = list[i];

                    idxWriter.Write(e.TypeID);
                    idxWriter.Write(e.Serial);
                    idxWriter.Write(e.Position);
                    idxWriter.Write(e.Length);
                }

                idxWriter.Close();
            }
        }

        private interface IEntityMod
        {
            Serial Serial { get; }
            int TypeID { get; }
            long Position { get; }
            int Length { get; }
        }

        private sealed class ModuleEntry : IEntityMod
        {
            private Module m_Module;
            private int m_TypeID;
            private string m_TypeName;
            private long m_Position;
            private int m_Length;

            public Module Module { get { return m_Module; } }
            public Serial Serial { get { return m_Module == null ? Serial.MinusOne : m_Module.Owner; } }
            public int TypeID { get { return m_TypeID; } }
            public string TypeName { get { return m_TypeName; } }
            public long Position { get { return m_Position; } }
            public int Length { get { return m_Length; } }

            public ModuleEntry(Module module, int typeID, string typeName, long pos, int length)
            {
                m_Module = module;
                m_TypeID = typeID;
                m_TypeName = typeName;
                m_Position = pos;
                m_Length = length;
            }
        }
    }
}

Thanks
 

A_Li_N

Knight
Prophet2005;821851 said:
I did but I guess but i put it in the backup. Sorry about the stupid question for such an easy fix. Thank you.

NP, as long as it's working for you and there's no work for me to do :D
Enjoy!
 

giric

Sorceror
*EDIT: Just remove and replace both ACC and Central Memory with fresh copies.. Yes, I'm a sleep deprived idiot ;)


Apologies for posting in an old thread, but I'm having these errors:

Code:
Errors:
 + Customs/Systems/Alien's Systems/Central Memory/CentralMemory.cs:
    CS0115: Line 199: 'Server.ACC.CM.CentralMemory.Gump(Server.Mobile, Server.Gumps.Gump, object[])': no suitable method found to override
    CS0115: Line 357: 'Server.ACC.CM.CentralMemory.OnResponse(Server.Network.NetState, Server.Gumps.RelayInfo, object[])': no suitable method found to override
[COLOR="Blue"]    
    CS0534: Line 11: 'Server.ACC.CM.CentralMemory' does not implement inherited abstract member 'Server.ACC.ACCSystem.Gump(Server.Mobile, Server.Gumps.Gump, Server.ACC.ACCGumpParams)'
    CS0534: Line 11: 'Server.ACC.CM.CentralMemory' does not implement inherited abstract member 'Server.ACC.ACCSystem.OnResponse(Server.Network.NetState, Server.Gumps.RelayInfo, Server.ACC.ACCGumpParams)'[/COLOR]
Scripts: One or more scripts failed to compile or no script files were found.
and here is a copy of my CentralMemory.cs file: (Line 11 highlighted)
Code:
using System;
using System.Collections;
using System.IO;
using System.Reflection;
using Server.Gumps;
using Server.Network;


namespace Server.ACC.CM
{
	[COLOR="Blue"]public class CentralMemory : ACCSystem[/COLOR]	{
		internal static ArrayList m_Types = new ArrayList();
		private  static Hashtable m_Modules = new Hashtable();
		public   static Hashtable Modules{ get{ return m_Modules; } }

		public override string Name(){ return "Central Memory"; }

		public static void Configure()
		{
			ACC.RegisterSystem( "Server.ACC.CM.CentralMemory" );
		}

		public static bool Running
		{
			get{ return ACC.SysEnabled( "Server.ACC.CM.CentralMemory" ); }
		}

		public override void Enable()
		{
			Console.WriteLine( "{0} has just been enabled!", Name() );
		}

		public override void Disable()
		{
			Console.WriteLine( "{0} has just been disabled!", Name() );
		}

		public static void Flush()
		{
			ArrayList RemoveList = new ArrayList();

			foreach( DictionaryEntry de in m_Modules )
			{
				if( ((Serial)de.Key).IsItem )
				{
					Item i = World.FindItem( (Serial)de.Key );
					if( i == null || i.Deleted )
						RemoveList.Add( (Serial)de.Key );
				}
				else if( ((Serial)de.Key).IsMobile )
				{
					Mobile m = World.FindMobile( (Serial)de.Key );
					if( m == null || m.Deleted )
						RemoveList.Add( (Serial)de.Key );
				}

				if( ((ModuleList)de.Value).Count == 0 )
					RemoveList.Add( (Serial)de.Key );
			}

			foreach( Serial s in RemoveList )
			{
				Remove( s );
			}

			RemoveList.Clear();

			Console.Write( "Flushed..." );
		}

		public static bool Contains( Serial ser )
		{
			return m_Modules.ContainsKey( ser );
		}

		public static bool ContainsModule( Serial ser, Type type )
		{
			ModuleList mod = (ModuleList)m_Modules[ser];
			if( mod != null )
				return mod.Contains( type );
			return false;
		}

		public static void Add( Serial ser )
		{
			if( m_Modules.ContainsKey( ser ) )
				return;

			m_Modules.Add( ser, new ModuleList( ser ) );
		}

		public static void Add( Serial ser, ModuleList list )
		{
			m_Modules[ser] = list;
		}

		public static void AddModule( Module mod )
		{
			if( !m_Modules.ContainsKey( mod.Owner ) )
				Add( mod.Owner );

			((ModuleList)m_Modules[ mod.Owner ]).Add( mod );
		}

		public static void AddModule( Serial ser, Type type )
		{
			if( !m_Modules.ContainsKey( ser ) )
				Add( ser );

			((ModuleList)m_Modules[ ser ]).Add( type );
		}

		public static void ChangeModule( Serial ser, Module mod )
		{
			if( !m_Modules.ContainsKey( ser ) )
				Add( ser );

			((ModuleList)m_Modules[ ser ]).Change( mod );
		}

		public static void AppendModule( Serial ser, Module mod, bool negatively )
		{
			if( !m_Modules.ContainsKey( ser ) )
				Add( ser );
			else if( !ContainsModule( ser, mod.GetType() ) )
			{
				AddModule( mod );
				return;
			}
			else
			{
				((ModuleList)m_Modules[ ser ]).Append( mod, negatively );
			}
		}

		public static void Remove( Serial ser )
		{
			m_Modules.Remove( ser );
		}

		public static void RemoveModule( Serial ser, Module mod )
		{
			if( m_Modules.ContainsKey( ser ) )
				((ModuleList)m_Modules[ ser ]).Remove( mod );
		}

		public static void RemoveModule( Serial ser, Type type )
		{
			if( m_Modules.ContainsKey( ser ) )
				((ModuleList)m_Modules[ ser ]).Remove( type );
		}

		public static Module GetModule( Serial ser, Type type )
		{
			if( m_Modules.ContainsKey( ser ) )
				return ((ModuleList)m_Modules[ ser ]).Get( type );

			return null;
		}

		public static ArrayList GetMobiles()
		{
			ArrayList list = new ArrayList();
			foreach( DictionaryEntry de in m_Modules )
			{
				if( ((Serial)de.Key).IsMobile )
				{
					Mobile m = World.FindMobile( (Serial)de.Key );
					if( m != null && !m.Deleted )
						list.Add( m );
				}
			}

			return list;
		}

		public static ArrayList GetItems()
		{
			ArrayList list = new ArrayList();
			foreach( DictionaryEntry de in m_Modules )
			{
				if( ((Serial)de.Key).IsItem )
				{
					Item i = World.FindItem( (Serial)de.Key );
					if( i != null && !i.Deleted )
						list.Add( i );
				}
			}

			return list;
		}

		private object[] Params;
		private ArrayList e_List;
		private ArrayList m_List;
		private Module    m_Module;

		public override void Gump( Mobile from, Gump gump, object[] subParams )
		{
			gump.AddButton( 190, 40, 2445, 2445, 101, GumpButtonType.Reply, 0 );
			gump.AddLabel(  204, 42, 1153, "List Mobiles" );
			gump.AddButton( 310, 40, 2445, 2445, 102, GumpButtonType.Reply, 0 );
			gump.AddLabel(  331, 42, 1153, "List Items" );
			gump.AddButton( 430, 40, 2445, 2445, 103, GumpButtonType.Reply, 0 );
			gump.AddLabel(  450, 42, 1153, "List Types" );
//			gump.AddButton( 190, 70, 2445, 2445, 104, GumpButtonType.Reply, 0 );
//			gump.AddLabel(  208, 72, 1153, "Add Module" );
//			gump.AddButton( 310, 70, 2445, 2445, 105, GumpButtonType.Reply, 0 );
//			gump.AddLabel(  326, 72, 1153, "Edit Module" );
//			gump.AddButton( 430, 70, 2445, 2445, 106, GumpButtonType.Reply, 0 );
//			gump.AddLabel(  439, 72, 1153, "Delete Module" );

			if( subParams == null )
			{
				gump.AddHtml( 215, 15, 300,  25, "<basefont size=7 color=white><center>Central Memory</center></font>", false, false );
				gump.AddHtml( 140, 95, 450, 250, "<basefont color=white><center>Welcome to the Central Memory Admin Gump!</center><br>With this gump, you can see a list of all entries that the CM contains.  You can add new Modules or modify or delete existing Modules.<br><br>Make your selection from the top buttons, either List Mobiles or Items.  This will bring up a list of all Mobiles or Items that the CM is keeping track of.<br><br>You may then select one of the entries to list the Modules that are stored to that entry.  You can then add, modify or remove modules to that entry.</font>", false, false );
				return;
			}

			Params = subParams;

			if( subParams[0] is int && (int)subParams[0] == -2 )
			{//Mobiles
				gump.AddLabel( 120, 95, 1153, "Listing all Mobiles:" );

				e_List = GetMobiles();
				if( e_List == null || e_List.Count == 0 )
					return;

				int p = 0;
				if( subParams.Length == 2 && subParams[1] is int )
					p = (int)subParams[1];

				if( p < 0 )
					p = 0;


				if( p > 0 )
					gump.AddButton( 120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0 );
				if( (p+1)*21 <= e_List.Count )
					gump.AddButton( 540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0 );

				for( int i = p*21, r = 0, c = 0; i < e_List.Count; i++ )
				{
					Mobile m = (Mobile)e_List[i];
					if( m == null )
						continue;
					gump.AddButton( 120+c*155, 125+r*30, 2501, 2501, 1000+i, GumpButtonType.Reply, 0 );
					gump.AddLabel(  130+c*155, 126+r*30, 1153, (m.Name==null?m.Serial.ToString():m.Name) );
				}
			}

			else if( subParams[0] is int && (int)subParams[0] == -3 )
			{//Items
				gump.AddLabel( 120, 95, 1153, "Listing all Items:" );

				e_List = GetItems();
				if( e_List == null || e_List.Count == 0 )
					return;

				int p = 0;
				if( subParams.Length == 2 && subParams[1] is int )
					p = (int)subParams[1];

				if( p < 0 )
					p = 0;

				if( p > 0 )
					gump.AddButton( 120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0 );
				if( (p+1)*21 <= e_List.Count )
					gump.AddButton( 540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0 );

				for( int i = p*21, r = 0, c = 0; i < e_List.Count; i++ )
				{
					Item m = (Item)e_List[i];
					if( m == null )
						continue;
					gump.AddButton( 120+c*155, 125+r*30, 2501, 2501, 1000+i, GumpButtonType.Reply, 0 );
					gump.AddLabel(  130+c*155, 126+r*30, 1153, (m.Name==null?m.Serial.ToString():m.Name) );
				}
			}

			else if( subParams[0] is Serial )
			{//List the Modules for that serial
				Serial s = (Serial)subParams[0];
				if( !m_Modules.Contains( s ) )
				{
					gump.AddLabel( 120, 95, 1153, "This entity no longer exists in the Central Memory!" );
					return;
				}

				ModuleList ml = (ModuleList)m_Modules[s];
				if( ml == null || ml.Count == 0 )
				{
					gump.AddLabel( 120, 95, 1153, "This entity has no Modules!" );
					Remove( s );
					return;
				}

				string name = "";
				if( s.IsMobile )
					name = World.FindMobile( s ).Name;
				else if( s.IsItem )
					name = World.FindItem( s ).Name;

				if( name == null || name.Length == 0 )
					name = s.ToString();

				gump.AddLabel( 120, 95, 1153, String.Format( "Listing all Modules for {0}:", name ) );

				m_List = new ArrayList( ml.Values );
				if( m_List == null || m_List.Count == 0 )
					return;

				int p = 0;
				if( subParams.Length == 3 && subParams[2] is int )
					p = (int)subParams[2];

				if( p < 0 )
					p = 0;
				if( p*21 >= m_List.Count )
					p = m_List.Count-21;

				if( p > 0 )
					gump.AddButton( 120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0 );
				if( (p+1)*21 <= m_List.Count )
					gump.AddButton( 540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0 );

				gump.AddButton( 331, 332, 4008, 4009, 106, GumpButtonType.Reply, 0 );

				for( int i = p*21, r = 0, c = 0; i < m_List.Count; i++ )
				{
					Module m = (Module)m_List[i];
					if( m == null )
						continue;

					gump.AddButton( 120+c*155, 125+r*30, 2501, 2501, 1000+i, GumpButtonType.Reply, 0 );
					gump.AddLabel(  130+c*155, 126+r*30, 1153, (m.Name().Length==0?m.Owner.ToString():m.Name()) );
				}
			}
		}

		public override void Help( Mobile from, Gump gump )
		{
		}

/* ID's
101   = Button	List Mobiles
102   = Button	List Items
103   = Button	List Types
104   = Button	Previous
105   = Button	Next
106   = Button	Back to List
1000+ = Button	Selections
 */
		public override void OnResponse( NetState state, RelayInfo info, object[] subParams )
		{
			if( !Running || info.ButtonID == 0 )
				return;

			//List Mobiles
			if( info.ButtonID == 101 )
				subParams = new object[1]{-2};

			//List Items
			else if( info.ButtonID == 102 )
				subParams = new object[1]{-3};

			else if( info.ButtonID == 104 )
			{//Previous
				if( Params[0] is Serial && Params.Length == 3 && Params[2] is int )
					subParams = new object[3]{Params[0], Params[1], (int)Params[2]-1};
				else if( Params.Length == 2 && Params[1] is int )
					subParams = new object[2]{Params[0], (int)Params[1]-1};
			}

			else if( info.ButtonID == 105 )
			{//Next
				if( Params[0] is Serial && Params.Length == 3 && Params[2] is int )
					subParams = new object[3]{Params[0], Params[1], (int)Params[2]+1};
				else if( Params.Length == 2 && Params[1] is int )
					subParams = new object[2]{Params[0], (int)Params[1]+1};
			}

			else if( info.ButtonID == 106 && Params[0] is Serial )
			{//Back to List
				Serial s = (Serial)Params[0];
				if( s.IsMobile && Params.Length == 2 )
					subParams = new object[2]{-2, Params[1]};
				else if( s.IsItem && Params.Length == 2 )
					subParams = new object[2]{-3, Params[1]};
			}

			//Perform Selection
			else if( info.ButtonID >= 1000 )
			{
				if( subParams[0] is Serial )
				{
					if( info.ButtonID-1000 < 0 || info.ButtonID-1000 >= m_List.Count )
						return;

					if( m_List[info.ButtonID-1000] is Module )
					{
						Module m = m_List[info.ButtonID-1000] as Module;
						if( m == null )
							return;

						m_Module = m;
						Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( SendEMG ), state.Mobile );
					}
				}

				else
				{
					if( info.ButtonID-1000 < 0 || info.ButtonID-1000 >= e_List.Count )
						return;

					if( e_List[info.ButtonID-1000] is Mobile )
					{
						Mobile m = e_List[info.ButtonID-1000] as Mobile;
						if( m == null )
							return;
						subParams = new object[2]{m.Serial, 0};
					}
					else if( e_List[info.ButtonID-1000] is Item )
					{
						Item i = e_List[info.ButtonID-1000] as Item;
						if( i == null )
							return;
						subParams = new object[2]{i.Serial, 0};
					}
				}
			}

			state.Mobile.SendGump( new ACCGump( state.Mobile, this.ToString(), subParams ) );
		}

		private void SendEMG( object state)
		{
			Mobile m = state as Mobile;
			if( m == null || m.Deleted || m_Module == null )
				return;

			m.SendMessage( "Sent EMG for {0}", m_Module.Name() );
			//m.SendGump( new EditModuleGump( m_Module ) );
		}

		public override void Save( GenericWriter idx, GenericWriter tdb, GenericWriter writer )
		{
			Flush();

			ArrayList fullList = new ArrayList();
			foreach( ModuleList ml in m_Modules.Values )
			{
				foreach( Module m in ml.Values )
				{
					fullList.Add( m );
				}
			}

			idx.Write( (int)fullList.Count );
			foreach( Module m in fullList )
			{
				Type t = m.GetType();
				long start = writer.Position;
				idx.Write( (int)m.m_TypeRef );
				idx.Write( (int)m.Owner );
				idx.Write( (long)start );

				m.Serialize( writer );

				idx.Write( (int) (writer.Position - start) );
			}

			tdb.Write( (int)m_Types.Count );
			for( int i = 0; i < m_Types.Count; ++i )
				tdb.Write( ((Type)m_Types[i]).FullName );
		}

		public override void Load( BinaryReader idx, BinaryReader tdb, BinaryFileReader reader )
		{
			object[] ctorArgs = new object[1];
			Type[] ctorTypes = new Type[1]{ typeof( Serial ) };
			ArrayList modules = new ArrayList();
			m_Modules = new Hashtable();

			int count = tdb.ReadInt32();
			ArrayList types = new ArrayList( count );
			for( int i = 0; i < count; ++i )
			{
				string typeName = tdb.ReadString();
				Type t = ScriptCompiler.FindTypeByFullName( typeName );
				if( t == null )
				{
					Console.WriteLine( "Type not found: {0}, remove?", typeName );
					if( Console.ReadLine() == "y" )
					{
						types.Add( null );
						continue;
					}
					throw new Exception( String.Format( "Bad type '{0}'", typeName ) );
				}

				ConstructorInfo ctor = t.GetConstructor( ctorTypes );
				if( ctor != null )
					types.Add( new object[]{ ctor, null } );
				else
					throw new Exception( String.Format( "Type '{0}' does not have a serialization constructor", t ) );
			}

			int moduleCount = idx.ReadInt32();

			for( int i = 0; i < moduleCount; ++i )
			{
				int  typeID = idx.ReadInt32();
				int  serial = idx.ReadInt32();
				long pos    = idx.ReadInt64();
				int  length = idx.ReadInt32();

				object[] objs = (object[])types[typeID];
				if( objs == null )
					continue;

				Module m = null;
				ConstructorInfo ctor = (ConstructorInfo)objs[0];
				string typeName = (string)objs[1];

				try
				{
					ctorArgs[0] = (Serial)serial;
					m = (Module)(ctor.Invoke( ctorArgs ));
				}
				catch
				{
				}

				if( m != null )
				{
					modules.Add( new ModuleEntry( m, typeID, typeName, pos, length ) );
					AddModule( m );
				}
			}

			bool failedModules = false;
			Type failedType = null;
			Exception failed = null;
			int failedTypeID = 0;

			for( int i = 0; i < modules.Count; ++i )
			{
				ModuleEntry entry = (ModuleEntry)modules[i];
				Module m = (Module)entry.Object;

				if( m != null )
				{
					reader.Seek( entry.Position, SeekOrigin.Begin );

					try
					{
						m.Deserialize( reader );

						if( reader.Position != (entry.Position + entry.Length) )
							throw new Exception( String.Format( "Bad serialize on {0}", m.GetType() ) );
					}
					catch( Exception e )
					{
						modules.RemoveAt( i );

						failed = e;
						failedModules = true;
						failedType = m.GetType();
						failedTypeID = entry.TypeID;

						break;
					}
				}
			}

			if( failedModules )
			{
				Console.WriteLine( "An error was encountered while loading a Module of Type: {0}", failedType );
				Console.WriteLine( "Remove this type of Module? (y/n)" );
				if( Console.ReadLine() == "y" )
				{
					for( int i = 0; i < modules.Count; )
					{
						if( ((ModuleEntry)modules[i]).TypeID == failedTypeID )
							modules.RemoveAt( i );
						else
							++i;
					}

					SaveIndex( modules );
				}

				Console.WriteLine( "After pressing return an exception will be thrown and the server will terminate" );
				Console.ReadLine();

				throw new Exception( String.Format( "Load failed (type={0})", failedType ), failed );
			}
		}

		private void SaveIndex( ArrayList list )
		{
			string path = "";
			if( CentralMemory.Running )
			{
				if( !Directory.Exists( "ACC Backups/Central Memory/" ) )
					Directory.CreateDirectory( "ACC Backups/Central Memory/" );
				path = "ACC Backups/Central Memory/Central Memory.idx";
			}
			else
			{
				if( !Directory.Exists( "Saves/ACC/Central Memory/" ) )
					Directory.CreateDirectory( "Saves/ACC/Central Memory/" );
				path = "Saves/ACC/Central Memory/Central Memory.idx";
			}

			using ( FileStream idx = new FileStream( path, FileMode.Create, FileAccess.Write, FileShare.None ) )
			{
				BinaryWriter idxWriter = new BinaryWriter( idx );

				idxWriter.Write( list.Count );
				for( int i = 0; i < list.Count; ++i )
				{
					IEntityMod e = (IEntityMod)list[i];

					idxWriter.Write( e.TypeID );
					idxWriter.Write( e.Serial );
					idxWriter.Write( e.Position );
					idxWriter.Write( e.Length );
				}

				idxWriter.Close();
			}
		}

		private interface IEntityMod
		{
			Serial Serial{ get; }
			int TypeID{ get; }
			long Position{ get; }
			int Length{ get; }
			object Object{ get; }
		}

		private sealed class ModuleEntry : IEntityMod
		{
			private Module m_Module;
			private int m_TypeID;
			private string m_TypeName;
			private long m_Position;
			private int m_Length;

			public object Object{ get{ return m_Module; } }
			public Serial Serial{ get{ return m_Module == null ? Serial.MinusOne : m_Module.Owner; } }
			public int TypeID{ get{ return m_TypeID; } }
			public string TypeName{ get{ return m_TypeName; } }
			public long Position{ get{ return m_Position; } }
			public int Length{ get{ return m_Length; } }

			public ModuleEntry( Module module, int typeID, string typeName, long pos, int length )
			{
				m_Module = module;
				m_TypeID = typeID;
				m_TypeName = typeName;
				m_Position = pos;
				m_Length = length;
			}
		}
	}
}
I am using 2.0 Final, ACC is installed, and this is the response... I am trying to install the 'Complete Spells' and 'Player Gates' packages.

I have highlighted what seems (to me) to be the cause of these errors. If anyone can point me in the right direction for fixing this, I'd be most appreciative.

Giric (who has recently returned to the UO Community after a very long attack of the dreaded "Real Life Syndrome".)
 

jamesreg

Sorceror
I seem to have complied ok except am getting this in when I load server

Code:
Loading ACC...
- Loading Central MemoryFailed. Exception: System.IO.EndOfStreamException: Unab
le to read beyond the end of the stream.
  at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
  at System.IO.BinaryReader.ReadInt32()
  at Server.ACC.CM.CentralMemory.Load(BinaryReader idx, BinaryReader tdb, Binar
yFileReader reader)
  at Server.ACC.ACCSystem.StartLoad(String path)
  at Server.ACC.ACC.Load()
Linguistics translation words successfully loaded.

Any ideas what the problem is
 

Lokai

Knight
I seem to have complied ok except am getting this in when I load server

Code:
Loading ACC...
- Loading Central MemoryFailed. Exception: System.IO.EndOfStreamException: Unab
le to read beyond the end of the stream.
  at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
  at System.IO.BinaryReader.ReadInt32()
  at Server.ACC.CM.CentralMemory.Load(BinaryReader idx, BinaryReader tdb, Binar
yFileReader reader)
  at Server.ACC.ACCSystem.StartLoad(String path)
  at Server.ACC.ACC.Load()
Linguistics translation words successfully loaded.

Any ideas what the problem is

Did you get the ACC Core loaded first?
 

jamesreg

Sorceror
i took out the central memory and reloaded with the core and first time i tried to log after compile success i get this
and then it tries to get me to delete all my mobiles and items
Code:
RunUO Version 2.1, Build 4517.24330
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
.NET Framework: 4.0.30319.269
Time: 5/17/2012 2:49:16 PM
Mobiles: 74103
Items: 283698
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
  at Server.Network.NetState.Receive_Process(SocketAsyncEventArgs e) in c:\Users\Charito\Desktop\Orb SVN (1)\Orb SVN\Server\Network\NetState.cs:line 716
  at Server.Network.NetState.Receive_Completion(Object sender, SocketAsyncEventArgs e) in c:\Users\Charito\Desktop\Orb SVN (1)\Orb SVN\Server\Network\NetState.cs:line 693
  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
  at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationSuccess(SocketError socketError, Int32 bytesTransferred, SocketFlags flags)
  at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
  at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
 
Top