示例#1
0
 public override void Init(World owner)
 {
     Random rand = new System.Random();
     int x, y;
     do
     {
         x = rand.Next(0, owner.Map.Width);
         y = rand.Next(0, owner.Map.Height);
     } while (owner.Map[x, y].Region != TileRegion.Spawn);
     Move(x + 0.5f, y + 0.5f);
     tiles = new byte[owner.Map.Width, owner.Map.Height];
     fames = new FameCounter(this);
     SetNewbiePeriod();
     base.Init(owner);
 }
示例#2
0
文件: Player.cs 项目: Club559/Mining
 public override void Init(World owner)
 {
     Random rand = new System.Random();
     int x, y;
     do
     {
         x = rand.Next(0, owner.Map.Width);
         y = rand.Next(0, owner.Map.Height);
     } while (owner.Map[x, y].Region != TileRegion.Spawn);
     Move(x + 0.5f, y + 0.5f);
     tiles = new byte[owner.Map.Width, owner.Map.Height];
     fames = new FameCounter(this);
     SetNewbiePeriod();
     if (!psr.CheckAccountInUse(AccountId))
         base.Init(owner);
     else
         psr.Disconnect();
     if(psr.Character.Pet >= 0)
         GivePet((short)psr.Character.Pet);
     try { SendAccountList(Locked, LOCKED_LIST_ID); }
     catch { }
     try { SendAccountList(Ignored, IGNORED_LIST_ID); }
     catch { }
 }
示例#3
0
 public override void Init(World owner)
 {
     var rand = new Random();
     int x, y;
     do
     {
         x = rand.Next(0, owner.Map.Width);
         y = rand.Next(0, owner.Map.Height);
     } while (owner.Map[x, y].Region != TileRegion.Spawn);
     Move(x + 0.5f, y + 0.5f);
     tiles = new byte[owner.Map.Width, owner.Map.Height];
     fames = new FameCounter(this);
     SetNewbiePeriod();
     if (!psr.CheckAccountInUse(AccountId))
         base.Init(owner);
     else
         psr.Disconnect();
     if (psr.ConnectedBuild != psr.clientVer)
     {
         psr.Disconnect();
         psr.SendPacket(new TextBoxPacket
         {
             Title = "Outdated Client!",
             Message =
                 "You are running an outdated client version.\nGet or play the latest one on the\n<a href='rotmg.amaymon.com'>web client</a>.",
             Button1 = "Okay"
         });
         ApplyConditionEffect(new[]
         {
             new ConditionEffect
             {
                 Effect = ConditionEffectIndex.Paralyzed,
                 DurationMS = int.MaxValue
             }
         });
     }
     if (psr.Character.Pet >= 0)
         GivePet((short)psr.Character.Pet);
     try
     {
         SendAccountList(Locked, LOCKED_LIST_ID);
     }
     catch
     {
     }
     try
     {
         SendAccountList(Ignored, IGNORED_LIST_ID);
     }
     catch
     {
     }
 }
示例#4
0
 public override void Init(World owner)
 {
     var rand = new Random();
     int x, y;
     do
     {
         x = rand.Next(0, owner.Map.Width);
         y = rand.Next(0, owner.Map.Height);
     } while (owner.Map[x, y].Region != TileRegion.Spawn);
     Move(x + 0.5f, y + 0.5f);
     tiles = new byte[owner.Map.Width, owner.Map.Height];
     fames = new FameCounter(this);
     SetNewbiePeriod();
     if (!psr.CheckAccountInUse(AccountId))
         base.Init(owner);
     else
         psr.Disconnect();
     if (psr.Character.Pet >= 0)
         GivePet((short) psr.Character.Pet);
     try
     {
         SendAccountList(Locked, LOCKED_LIST_ID);
     }
     catch
     {
     }
     try
     {
         SendAccountList(Ignored, IGNORED_LIST_ID);
     }
     catch
     {
     }
     if (!psr.ConnectedBuild.StartsWith(psr.clientVer))
     {
         psr.SendPacket(new TextBoxPacket
         {
             Title = "Outdated Client!",
             Message =
                 "You are running an outdated client version.\nGet or play the latest one on the\nup-to-date <u><a href='http://forum.zerorealms.com'>web client</a></u>.",
             Button1 = "Okay"
         });
         psr.Disconnect();
     }
 }
示例#5
0
        public override void Init(World owner)
        {
            Owner = owner;
            Move(0.5f, 0.5f);
            tiles = new byte[owner.Map.Width, owner.Map.Height];
            SetNewbiePeriod();
            base.Init(owner);
            tiles = new byte[owner.Map.Width, owner.Map.Height];
            fames = new FameCounter(this);
            if (client.Character.Pet >= 0)
                GivePet((ushort)client.Character.Pet);

            SendAccountList(Locked, Client.LOCKED_LIST_ID);
            SendAccountList(Ignored, Client.IGNORED_LIST_ID);

            CanNexus = Owner.AllowNexus;
            UpdateCount++;

            /*WorldTimer pingTimer = null;
            owner.Timers.Add(pingTimer = new WorldTimer(PING_PERIOD, (w, t) =>
            {
                if (Client.Stage == ProtocalStage.Ready)
                {
                    Client.SendPacket(new PingPacket {Serial = pingSerial++});
                    pingTimer.Reset();
                    Manager.Logic.AddPendingAction(_ => w.Timers.Add(pingTimer), PendingPriority.Creation);
                }
            }));*/
        }