コード例 #1
0
        public Player CreateCharacter(IConnection connection, PlayerData playerData)
        {
            Player player = new Player
            {
                PlayerData = playerData,
                Account    = connection.Account,
                Position   = new WorldPosition
                {
                    MapId = 101,
                    X     = 300.0F,
                    Y     = 1865.0F,
                    Z     = 15.0F,
                },
            };

            player.ServerId  = Properties.Settings.Default.SERVER_ID;
            player.GameStats = Global.Global.StatsService.InitStats(player);

            player.PlayerId = DataBasePlayer.SavePlayer(player, true);
            connection.Account.Players.Add(player);
            return(player);
        }
コード例 #2
0
        public void PlayerEndGame(Player player)
        {
            if (player.Ai != null)
            {
                player.Ai.Release();
                player.Ai = null;
            }

            AccountService.IdFactory.Release(player.Account.SessionID);

            DataBasePlayer.SavePlayer(player);
            DataBaseStorage.SavePlayerStorage(player.PlayerId, player.Inventory);
            DataBaseAbility.SavePlayerAbility(player, SkillType.Basic);
            DataBaseAbility.SavePlayerAbility(player, SkillType.Ascension);

            DataBaseSkill.SavePlayerSkill(player, SkillType.Basic);
            DataBaseSkill.SavePlayerSkill(player, SkillType.Ascension);
            DataBaseSkill.SavePlayerSkill(player, SkillType.Passive);

            DataBaseQuest.SavePlayerQuest(player);

            PlayersOnline.Remove(player);
        }