예제 #1
0
        public void RestorePlayer(int PID)
        {
            //delete from player deleted
            PlayerDeleted pd = PlayerDeleted.GetPlayerDeleted(PID);

            Database.Delete(Database.KalDB, pd);
            //set uid
            Player p = Player.GetPlayer(PID);

            p.UID = Account.UID;
            Database.Update(Database.KalDB, p);
        }
예제 #2
0
파일: Client.cs 프로젝트: Axovera/kalsharp
        /// <summary>
        /// Selects a Player
        /// </summary>
        /// <param name="playerId"></param>
        public void PlayerSelect(int PID)
        {
            if (Authenticated)
            {
                Player player = Player.GetPlayer(PID);
                Character = new Character(player, this);

                Send(new Packets.LoginAccepted());
                Send(new Packets.PlayerInfo(Character));
                Send(new Packets.SetCamera(Character, 0));
                Send(new Packets.CameraUpdate());
            }
        }
예제 #3
0
        public void DeletePlayer(int PID)
        {
            ServerConsole.WriteLine("Deleteing player {0}", MessageLevel.Message, PID);
            Player p = Player.GetPlayer(PID);

            //set uid to 0 to show player deleted.
            p.UID = 0;
            Database.Update(Database.KalDB, p);

            using (session = Database.KalDB.OpenSession())
            {
                using (ITransaction transaction = session.BeginTransaction())
                {
                    PlayerDeleted pd = new PlayerDeleted();
                    pd.PID         = PID;
                    pd.UID         = Account.UID;
                    pd.DeletedTime = DateTime.Now;

                    session.Save(pd);
                    transaction.Commit();
                }
            }
        }