Exemplo n.º 1
0
 public static CustomWorld Home(Player player)
 {
     var acc = player.Client.Account;
     var world = new CustomWorld(acc.Name + "'s Home", null);
     if (acc.Home == null)
     {
         using (var stream = typeof(RealmManager).Assembly.GetManifestResourceStream("wServer.realm.worlds.defaultHome.wmap"))
         {
             world.Data = new byte[stream.Length];
             stream.Read(world.Data, 0, world.Data.Length);
         }
         acc.Home = world.Data;
         player.Manager.Data.AddPendingAction(db =>
         {
             db.CreateHome(acc, world.Data);
         });
     }
     else
     {
         world.Data = acc.Home;
     }
     return world;
 }
Exemplo n.º 2
0
        public static CustomWorld Home(Player player)
        {
            var acc   = player.Client.Account;
            var world = new CustomWorld(acc.Name + "'s Home", null);

            if (acc.Home == null)
            {
                using (var stream = typeof(RealmManager).Assembly.GetManifestResourceStream("wServer.realm.worlds.defaultHome.wmap"))
                {
                    world.Data = new byte[stream.Length];
                    stream.Read(world.Data, 0, world.Data.Length);
                }
                acc.Home = world.Data;
                player.Manager.Data.AddPendingAction(db =>
                {
                    db.CreateHome(acc, world.Data);
                });
            }
            else
            {
                world.Data = acc.Home;
            }
            return(world);
        }