SwapPlayerInfo() static private method

static private SwapPlayerInfo ( [ p1, [ p2 ) : void
p1 [
p2 [
return void
        static void InfoSwapHandler(Player player, CommandReader cmd)
        {
            string p1Name = cmd.Next();
            string p2Name = cmd.Next();

            if (p1Name == null || p2Name == null)
            {
                CdInfoSwap.PrintUsage(player);
                return;
            }

            PlayerInfo p1 = PlayerDB.FindByPartialNameOrPrintMatches(player, p1Name);

            if (p1 == null)
            {
                return;
            }
            PlayerInfo p2 = PlayerDB.FindByPartialNameOrPrintMatches(player, p2Name);

            if (p2 == null)
            {
                return;
            }

            if (p1 == p2)
            {
                player.Message("InfoSwap: Please specify 2 different players.");
                return;
            }

            if (p1.IsOnline || p2.IsOnline)
            {
                player.Message("InfoSwap: Both players must be offline to swap info.");
                return;
            }

            if (!cmd.IsConfirmed)
            {
                player.Confirm(cmd, "InfoSwap: Swap stats of players {0}&S and {1}&S?", p1.ClassyName, p2.ClassyName);
            }
            else
            {
                PlayerDB.SwapPlayerInfo(p1, p2);
                player.Message("InfoSwap: Stats of {0}&S and {1}&S have been swapped.",
                               p1.ClassyName, p2.ClassyName);
            }
        }