protected override bool Process(Player player, RealmTime time, string[] args)
        {
            if (player.Owner is Vault || player.Owner is PetYard)
            {
                player.SendInfo("You cant summon in this world.");
                return false;
            }
            foreach (KeyValuePair<string, Client> i in player.Manager.Clients)
            {
                if (i.Value.Player.Name.EqualsIgnoreCase(args[0]))
                {
                    Packet pkt;
                    if (i.Value.Player.Owner == player.Owner)
                    {
                        i.Value.Player.Move(player.X, player.Y);
                        pkt = new GotoPacket
                        {
                            ObjectId = i.Value.Player.Id,
                            Position = new Position(player.X, player.Y)
                        };
                        i.Value.Player.UpdateCount++;
                        player.SendInfo("Player summoned!");
                    }
                    else
                    {
                        pkt = new ReconnectPacket
                        {
                            GameId = player.Owner.Id,
                            Host = "",
                            IsFromArena = false,
                            Key = player.Owner.PortalKey,
                            KeyTime = -1,
                            Name = player.Owner.Name,
                            Port = -1
                        };
                        player.SendInfo("Player will connect to you now!");
                    }

                    i.Value.SendPacket(pkt);

                    return true;
                }
            }
            player.SendError(string.Format("Player '{0}' could not be found!", args));
            return false;
        }
Exemplo n.º 2
0
 public void Reconnect(ReconnectPacket pkt)
 {
     Manager.Logic.AddPendingAction(t =>
     {
         Save();
         SendPacket(pkt);
     }, PendingPriority.Destruction);
 }
Exemplo n.º 3
0
 public void Reconnect(ReconnectPacket pkt)
 {
     log.InfoFormat("Reconnecting client @ {0} to {1}...", skt.RemoteEndPoint, pkt.Name);
     Manager.Logic.AddPendingAction(t =>
     {
         if (Player != null)
             Player.SaveToCharacter();
         Save();
         Manager.Disconnect(this);
         SendPacket(pkt);
     }, PendingPriority.Destruction);
 }
Exemplo n.º 4
0
 public void Reconnect(ReconnectPacket pkt)
 {
     Manager.Logic.AddPendingAction(t =>
     {
         if (Player != null)
             Player.SaveToCharacter();
         Save();
         Manager.Disconnect(this);
         SendPacket(pkt);
     }, PendingPriority.Destruction);
 }
Exemplo n.º 5
0
 public void Reconnect(ReconnectPacket pkt)
 {
     try
     {
         log.InfoFormat("Reconnecting client @ {0} to {1}...", skt.RemoteEndPoint, pkt.Name);
     }
     catch
     {
     }
     if (Player != null)
         Player.ApplyConditionEffect(new ConditionEffect
         {
             DurationMS = -1,
             Effect = ConditionEffectIndex.Invincible
         });
     Manager.Logic.AddPendingAction(t =>
     {
         reconnected = true;
         if (Player != null)
         {
             World world = Manager.GetWorld(pkt.GameId);
             if (Player.Party != null && Player.Party.World != world && pkt.GameId != World.VAULT_ID)
             {
                 if (Player.Party.Leader == Player)
                     Player.Party.World = world;
                 else
                     Player.Party.RemoveMember(Player);
             }
             if(Player.Party != null && Player.Party.World == world && Player.Party.Leader != Player)
                 Player.Party.Members.Remove(Player);
             Player.SaveToCharacter();
         }
         Save();
         Manager.Disconnect(this);
         SendPacket(pkt);
     }, PendingPriority.Destruction);
 }