Beispiel #1
0
        /// <summary>
        /// Called by Phoenix.Initialize().
        /// </summary>
        /// <param name="param">Client directory.</param>
        internal static void Load(object param)
        {
            string dir = param.ToString();

            try {
                Trace.WriteLine("Loading ultima data files started..", "MulLib");

                tiledata = TileData.Load(Path.Combine(dir, "tiledata.mul"));
                hues     = Hues.Load(Path.Combine(dir, "hues.mul"));
                radarCol = RadarCol.Load(Path.Combine(dir, "radarcol.mul"));
                skills   = Skills.Load(Path.Combine(dir, "skills.idx"), Path.Combine(dir, "skills.mul"));
                art      = Art.Load(Path.Combine(dir, "artidx.mul"), Path.Combine(dir, "art.mul"), MulFileAccessMode.ReadOnly);
                multi    = Multi.Load(Path.Combine(dir, "multi.idx"), Path.Combine(dir, "multi.mul"), MulFileAccessMode.ReadOnly);

                Trace.WriteLine("Loading ultima data files finished.", "MulLib");
            }
            catch (Exception e) {
                string msg = String.Format("Unable to load ultima data files. Program will be terminated. Exception:\r\n{0}", e);
                Trace.WriteLine(msg, "MulLib");
                MessageBox.Show(msg, "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Core.Terminate();
            }

            try {
                SyncEvent.Invoke(Loaded, null, EventArgs.Empty);
            }
            catch (Exception e) {
                Trace.WriteLine("Unhandled exception in DataFiles.Loaded event. Exception:\r\n" + e.ToString(), "MulLib");
            }
        }
Beispiel #2
0
 private static void OnChanged(EventArgs e)
 {
     try
     {
         SyncEvent.Invoke(Changed, null, e);
     }
     catch (Exception e0)
     {
         System.Diagnostics.Trace.WriteLine(String.Format("Exception in LoginInfo.Changed event. Exception:\r\n{0}", e0), "Error");
     }
 }
Beispiel #3
0
            void color_Changed(object sender, EventArgs e)
            {
                SettingUInt16Entry color = (SettingUInt16Entry)sender;

                if (color.Value < DataFiles.Hues.MinIndex || color.Value > DataFiles.Hues.MaxIndex)
                {
                    color.Reset();
                }
                else
                {
                    SyncEvent.Invoke(Changed, sender, e);
                }
            }
Beispiel #4
0
 public void InvokeAsync(object sender, TEventArgs e)
 {
     SyncEvent.InvokeAsync(handlers, sender, e);
 }
Beispiel #5
0
 public void BeginInvoke(object sender, TEventArgs e)
 {
     SyncEvent.BeginInvoke(handlers, sender, e);
 }
Beispiel #6
0
 internal static void OnShuttingDown(EventArgs e)
 {
     SyncEvent.Invoke(ShuttingDown, null, e);
 }