Postado Março 20, 2016 9 anos Em 20/03/2016 em 15:43, poweriso disse: No install.php do site, remova: if($installIP != $_SERVER['REMOTE_ADDR']) { echo('In file <b>install.txt</b> must be your IP!<br />In file is:<br /><b>' . $installIP . '</b><br />Your IP is:<br /><b>' . $_SERVER['REMOTE_ADDR'] . '</b>'); exit; }
Postado Março 20, 2016 9 anos Autor Em 20/03/2016 em 15:49, Azhaurn disse: No install.php do site, remova: if($installIP != $_SERVER['REMOTE_ADDR']) { echo('In file <b>install.txt</b> must be your IP!<br />In file is:<br /><b>' . $installIP . '</b><br />Your IP is:<br /><b>' . $_SERVER['REMOTE_ADDR'] . '</b>'); exit; } Ok. Porém passando essa pagina ele me pede o caminho do diretório, ao selecioná-lo ele me apresenta: Mostrar conteúdo oculto Check server configurationFile config.lua loaded from C:/config.lua and it's not valid TFS config.lua file. Go to STEP 1 - select other directory. If it's your config.lua file from TFS contact with acc. maker author. Como devo proceder?
Postado Março 20, 2016 9 anos Autor Em 20/03/2016 em 15:58, Azhaurn disse: @poweriso Qual seu config.lua? Posta aqui pra dar uma olhada Mostrar conteúdo oculto worldType = "pvp" hotkeyAimbotEnabled = true protectionLevel = 100 killsToRedSkull = 3 killsToBlackSkull = 6 pzLocked = 60000 removeChargesFromRunes = false timeToDecreaseFrags = 24 * 60 * 60 * 1000 whiteSkullTime = 15 * 60 * 1000 stairJumpExhaustion = 2000 experienceByKillingPlayers = false expFromPlayersLevelRange = 75 ip = "morterapvp.ddns.net" bindOnlyGlobalAddress = false loginProtocolPort = 7171 gameProtocolPort = 7172 statusProtocolPort = 7171 maxPlayers = 800 motd = "Bem Vindo ao Mortera PVP!" onePlayerOnlinePerAccount = false allowClones = false serverName = "LKing" statusTimeout = 5000 replaceKickOnLogin = true maxPacketsPerSecond = 25 enableLiveCasting = true liveCastPort = 7173 deathLosePercent = -1 housePriceEachSQM = 10000 houseRentPeriod = "never" timeBetweenActions = 200 timeBetweenExActions = 1000 mapName = "forgotten" mapAuthor = "Igor" marketOfferDuration = 30 * 24 * 60 * 60 premiumToCreateMarketOffer = false checkExpiredMarketOffersEachMinutes = 60 maxMarketOffersAtATimePerPlayer = 100 mysqlHost = "127.0.0.1" mysqlUser = "root" mysqlPass = "igor1996@" mysqlDatabase = "otserver" mysqlPort = 3306 mysqlSock = "" passwordType = "sha1" allowChangeOutfit = true freePremium = true kickIdlePlayerAfterMinutes = 720 maxMessageBuffer = 4 emoteSpells = false classicEquipmentSlots = false rateExp = 10000 rateSkill = 250 rateLoot = 17 rateMagic = 150 rateSpawn = 1 deSpawnRange = 2 deSpawnRadius = 50 staminaSystem = false warnUnsafeScripts = true convertUnsafeScripts = true defaultPriority = "high" startupDatabaseOptimization = false ownerName = "" ownerEmail = "" url = "https://morterapvp.ddns.net/" location = "Brazil" Vale salientar que peguei o server completo do próprio site TK, sendo 10.90; Em 20/03/2016 em 16:00, poweriso disse: Mostrar conteúdo oculto Mostrar conteúdo oculto worldType = "pvp" hotkeyAimbotEnabled = true protectionLevel = 100 killsToRedSkull = 3 killsToBlackSkull = 6 pzLocked = 60000 removeChargesFromRunes = false timeToDecreaseFrags = 24 * 60 * 60 * 1000 whiteSkullTime = 15 * 60 * 1000 stairJumpExhaustion = 2000 experienceByKillingPlayers = false expFromPlayersLevelRange = 75 ip = "morterapvp.ddns.net" bindOnlyGlobalAddress = false loginProtocolPort = 7171 gameProtocolPort = 7172 statusProtocolPort = 7171 maxPlayers = 800 motd = "Bem Vindo ao Mortera PVP!" onePlayerOnlinePerAccount = false allowClones = false serverName = "LKing" statusTimeout = 5000 replaceKickOnLogin = true maxPacketsPerSecond = 25 enableLiveCasting = true liveCastPort = 7173 deathLosePercent = -1 housePriceEachSQM = 10000 houseRentPeriod = "never" timeBetweenActions = 200 timeBetweenExActions = 1000 mapName = "forgotten" mapAuthor = "Igor" marketOfferDuration = 30 * 24 * 60 * 60 premiumToCreateMarketOffer = false checkExpiredMarketOffersEachMinutes = 60 maxMarketOffersAtATimePerPlayer = 100 mysqlHost = "127.0.0.1" mysqlUser = "root" mysqlPass = "igor1996@" mysqlDatabase = "otserver" mysqlPort = 3306 mysqlSock = "" passwordType = "sha1" allowChangeOutfit = true freePremium = true kickIdlePlayerAfterMinutes = 720 maxMessageBuffer = 4 emoteSpells = false classicEquipmentSlots = false rateExp = 10000 rateSkill = 250 rateLoot = 17 rateMagic = 150 rateSpawn = 1 deSpawnRange = 2 deSpawnRadius = 50 staminaSystem = false warnUnsafeScripts = true convertUnsafeScripts = true defaultPriority = "high" startupDatabaseOptimization = false ownerName = "" ownerEmail = "" url = "https://morterapvp.ddns.net/" location = "Brazil" Vale salientar que peguei o server completo do próprio site TK, sendo 10.90; Problema resolvido com esse config.lua Mostrar conteúdo oculto -- The Forgotten Server Config -- Account manager accountManager = true namelockManager = true newPlayerChooseVoc = false newPlayerSpawnPosX = 95 newPlayerSpawnPosY = 117 newPlayerSpawnPosZ = 7 newPlayerTownId = 1 newPlayerLevel = 1 newPlayerMagicLevel = 0 generateAccountNumber = false -- Unjustified kills -- NOTE: *Banishment and *BlackSkull variables are >summed up< -- (dailyFragsToRedSkull + dailyFragsToBanishment) with their -- *RedSkull equivalents. -- Auto banishing works only if useBlackSkull set to negative. -- advancedFragList is not advised if you use huge frags -- requirements. redSkullLength = 30 * 24 * 60 * 60 blackSkullLength = 45 * 24 * 60 * 60 dailyFragsToRedSkull = 3 weeklyFragsToRedSkull = 5 monthlyFragsToRedSkull = 10 dailyFragsToBlackSkull = dailyFragsToRedSkull weeklyFragsToBlackSkull = weeklyFragsToRedSkull monthlyFragsToBlackSkull = monthlyFragsToRedSkull dailyFragsToBanishment = dailyFragsToRedSkull weeklyFragsToBanishment = weeklyFragsToRedSkull monthlyFragsToBanishment = monthlyFragsToRedSkull blackSkulledDeathHealth = 40 blackSkulledDeathMana = 0 useBlackSkull = true useFragHandler = true advancedFragList = false -- Banishments -- violationNameReportActionType 1 = just a report, 2 = name lock, 3 = player banishment -- killsBanLength works only if useBlackSkull option is disabled. notationsToBan = 3 warningsToFinalBan = 4 warningsToDeletion = 5 banLength = 7 * 24 * 60 * 60 killsBanLength = 7 * 24 * 60 * 60 finalBanLength = 30 * 24 * 60 * 60 ipBanishmentLength = 1 * 24 * 60 * 60 broadcastBanishments = true maxViolationCommentSize = 200 violationNameReportActionType = 2 autoBanishUnknownBytes = false -- Battle -- NOTE: showHealingDamageForMonsters inheritates from showHealingDamage. -- loginProtectionPeriod is the famous Tibia anti-magebomb system. -- deathLostPercent set to nil enables manual mode. worldType = "pvp" protectionLevel = 1 pvpTileIgnoreLevelAndVocationProtection = true pzLocked = 60 * 1000 huntingDuration = 60 * 1000 criticalHitChance = 7 criticalHitMultiplier = 1 displayCriticalHitNotify = false removeWeaponAmmunition = true removeWeaponCharges = true removeRuneCharges = true whiteSkullTime = 15 * 60 * 1000 noDamageToSameLookfeet = false showHealingDamage = false showHealingDamageForMonsters = false fieldOwnershipDuration = 5 * 1000 stopAttackingAtExit = false oldConditionAccuracy = false loginProtectionPeriod = 10 * 1000 deathLostPercent = 10 stairhopDelay = 2 * 1000 pushCreatureDelay = 2 * 1000 deathContainerId = 1987 gainExperienceColor = 215 addManaSpentInPvPZone = true squareColor = 0 allowFightback = true -- Connection config worldId = 0 ip = "127.0.0.1" bindOnlyConfiguredIpAddress = false loginPort = 7171 gamePort = 7172 adminPort = 7171 statusPort = 7171 loginTries = 10 retryTimeout = 5 * 1000 loginTimeout = 60 * 1000 maxPlayers = 1000 motd = "Welcome to the Forgotten Server!" displayOnOrOffAtCharlist = false onePlayerOnlinePerAccount = true allowClones = false serverName = "Forgotten" loginMessage = "Welcome to the Forgotten Server!" statusTimeout = 5 * 60 * 1000 replaceKickOnLogin = true forceSlowConnectionsToDisconnect = false loginOnlyWithLoginServer = false premiumPlayerSkipWaitList = false -- Database -- NOTE: sqlFile is used only by sqlite database, and sqlKeepAlive by mysql database. -- To disable sqlKeepAlive such as mysqlReadTimeout use 0 value. sqlType = "sqlite" sqlHost = "localhost" sqlPort = 3306 sqlUser = "root" sqlPass = "" sqlDatabase = "theforgottenserver" sqlFile = "forgottenserver.s3db" sqlKeepAlive = 0 mysqlReadTimeout = 10 mysqlWriteTimeout = 10 encryptionType = "plain" -- Deathlist deathListEnabled = true deathListRequiredTime = 1 * 60 * 1000 deathAssistCount = 19 maxDeathRecords = 5 -- Guilds ingameGuildManagement = true levelToFormGuild = 8 premiumDaysToFormGuild = 0 guildNameMinLength = 4 guildNameMaxLength = 20 -- Highscores highscoreDisplayPlayers = 15 updateHighscoresAfterMinutes = 60 -- Houses buyableAndSellableHouses = true houseNeedPremium = true bedsRequirePremium = true levelToBuyHouse = 1 housesPerAccount = 0 houseRentAsPrice = false housePriceAsRent = false housePriceEachSquare = 1000 houseRentPeriod = "never" houseCleanOld = 0 guildHalls = false -- Item usage timeBetweenActions = 200 timeBetweenExActions = 1000 hotkeyAimbotEnabled = true -- Map -- NOTE: storeTrash costs more memory, but will perform alot faster cleaning. mapName = "map" mapAuthor = "Komic" randomizeTiles = true storeTrash = true cleanProtectedZones = true mailboxDisabledTowns = "-1" -- Process -- NOTE: defaultPriority works only on Windows and niceLevel on *nix -- coresUsed are seperated by comma cores ids used by server process, -- default is -1, so it stays untouched (automaticaly assigned by OS). defaultPriority = "high" niceLevel = 5 coresUsed = "-1" -- Startup optimizeDatabaseAtStartup = true removePremiumOnInit = true confirmOutdatedVersion = false -- Spells formulaLevel = 5.0 formulaMagic = 1.0 bufferMutedOnSpellFailure = false spellNameInsteadOfWords = false emoteSpells = false -- Outfits allowChangeOutfit = true allowChangeColors = true allowChangeAddons = true disableOutfitsForPrivilegedPlayers = false addonsOnlyPremium = true -- Miscellaneous -- NOTE: promptExceptionTracerErrorBox works only with precompiled support feature, -- called "exception tracer" (__EXCEPTION_TRACER__ flag). dataDirectory = "data/" bankSystem = true displaySkillLevelOnAdvance = false promptExceptionTracerErrorBox = true separateViplistPerCharacter = false maximumDoorLevel = 500 maxMessageBuffer = 4 -- Saving-related -- useHouseDataStorage usage may be found at README. saveGlobalStorage = true useHouseDataStorage = false storePlayerDirection = false -- Loot -- monsterLootMessage 0 to disable, 1 - only party, 2 - only player, 3 - party or player (like Tibia's) checkCorpseOwner = true monsterLootMessage = 3 monsterLootMessageType = 25 -- Ghost mode ghostModeInvisibleEffect = false ghostModeSpellEffects = true -- Limits idleWarningTime = 14 * 60 * 1000 idleKickTime = 15 * 60 * 1000 expireReportsAfterReads = 1 playerQueryDeepness = 2 maxItemsPerPZTile = 0 maxItemsPerHouseTile = 0 -- Premium-related freePremium = false premiumForPromotion = true -- Blessings -- NOTE: blessingReduction* regards items/containers loss. -- eachBlessReduction is how much each bless reduces the experience/magic/skills loss. blessingOnlyPremium = true blessingReductionBase = 30 blessingReductionDecreament = 5 eachBlessReduction = 8 -- Rates -- NOTE: experienceStages configuration is located in data/XML/stages.xml. -- rateExperienceFromPlayers 0 to disable. experienceStages = false rateExperience = 5.0 rateExperienceFromPlayers = 0 rateSkill = 3.0 rateMagic = 3.0 rateLoot = 2.0 rateSpawn = 1 -- Monster rates rateMonsterHealth = 1.0 rateMonsterMana = 1.0 rateMonsterAttack = 1.0 rateMonsterDefense = 1.0 -- Experience from players -- NOTE: min~Threshold* set to 0 will disable the minimum threshold: -- player will gain experience from every lower leveled player. -- max~Threshold* set to 0 will disable the maximum threshold: -- player will gain experience from every higher leveled player. minLevelThresholdForKilledPlayer = 0.9 maxLevelThresholdForKilledPlayer = 1.1 -- Stamina -- NOTE: Stamina is stored in miliseconds, so seconds are multiplied by 1000. -- rateStaminaHits multiplies every hit done a creature, which are later -- multiplied by player attack speed. -- rateStaminaGain is divider of every logged out second, eg: -- 60000 / 3 = 20000 milliseconds, what gives 20 stamina seconds for 1 minute being logged off. -- rateStaminaThresholdGain is divider for the premium stamina. -- staminaRatingLimit* is in minutes. rateStaminaLoss = 1 rateStaminaGain = 3 rateStaminaThresholdGain = 12 staminaRatingLimitTop = 41 * 60 staminaRatingLimitBottom = 14 * 60 rateStaminaAboveNormal = 1.5 rateStaminaUnderNormal = 0.5 staminaThresholdOnlyPremium = true -- Party -- NOTE: experienceShareLevelDifference is float number. -- experienceShareLevelDifference is highestLevel * value experienceShareRadiusX = 30 experienceShareRadiusY = 30 experienceShareRadiusZ = 1 experienceShareLevelDifference = 2 / 3 extraPartyExperienceLimit = 20 extraPartyExperiencePercent = 5 experienceShareActivity = 2 * 60 * 1000 -- Global save -- NOTE: globalSaveHour means like 03:00, not that it will save every 3 hours, -- if you want such a system please check out data/globalevents/globalevents.xml. globalSaveEnabled = false globalSaveHour = 8 shutdownAtGlobalSave = true cleanMapAtGlobalSave = false -- Spawns deSpawnRange = 2 deSpawnRadius = 50 -- Summons maxPlayerSummons = 2 teleportAllSummons = false teleportPlayerSummons = false -- Status ownerName = "" ownerEmail = "@otland.net" url = "http://otland.net/" location = "Europe" displayGamemastersWithOnlineCommand = false -- Logs -- NOTE: This kind of logging does not work in GUI version. -- For such, please compile the software with __GUI_LOGS__ flag. adminLogsEnabled = false displayPlayersLogging = true prefixChannelLogs = "" runFile = "" outLogName = "" errorLogName = "" truncateLogsOnStartup = false Pessoal, estou com um Erro Diferente. Podem me ajudar? Add samples to DB:Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\classes\player.php on line 36 PLAYER.PHP Mostrar conteúdo oculto <?php if(!defined('INITIALIZED')) exit; class Player extends ObjectData { const LOADTYPE_ID = 'id'; const LOADTYPE_NAME = 'name'; const LOADTYPE_ACCOUNT_ID = 'account_id'; public static $table = 'players'; public $data = array('name' => null, 'world_id' => null, 'group_id' => null, 'account_id' => null, 'level' => null, 'vocation' => null, 'health' => null, 'healthmax' => null, 'experience' => null, 'lookbody' => null, 'lookfeet' => null, 'lookhead' => null, 'looklegs' => null, 'looktype' => null, 'lookaddons' => null, 'maglevel' => null, 'mana' => null, 'manamax' => null, 'manaspent' => null, 'soul' => null, 'town_id' => null, 'posx' => null, 'posy' => null, 'posz' => null, 'conditions' => null, 'cap' => null, 'sex' => null, 'lastlogin' => null, 'lastip' => null, 'save' => null, 'skull' => null, 'skulltime' => null, 'rank_id' => null, 'guildnick' => null, 'lastlogout' => null, 'blessings' => null, 'balance' => null, 'stamina' => null, 'direction' => null, 'loss_experience' => null, 'loss_mana' => null, 'loss_skills' => null, 'loss_containers' => null, 'loss_items' => null, 'premend' => null, 'online' => null, 'marriage' => null, 'promotion' => null, 'deleted' => null, 'description' => null, 'create_ip' => null, 'create_date' => null, 'comment' => null, 'hide_char' => null, 'signature' => null); public static $fields = array('id', 'name', 'world_id', 'group_id', 'account_id', 'level', 'vocation', 'health', 'healthmax', 'experience', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons', 'maglevel', 'mana', 'manamax', 'manaspent', 'soul', 'town_id', 'posx', 'posy', 'posz', 'conditions', 'cap', 'sex', 'lastlogin', 'lastip', 'save', 'skull', 'skulltime', 'rank_id', 'guildnick', 'lastlogout', 'blessings', 'balance', 'stamina', 'direction', 'loss_experience', 'loss_mana', 'loss_skills', 'loss_containers', 'loss_items', 'premend', 'online', 'marriage', 'promotion', 'deleted', 'description', 'create_ip', 'create_date', 'comment', 'hide_char', 'signature'); public static $skillFields = array('player_id', 'skillid', 'value', 'count'); public $items; public $storages; public $skills; public $account; public $rank; public function __construct($search_text = null, $search_by = self::LOADTYPE_ID) { if($search_text != null) $this->load($search_text, $search_by); } public function load($search_text, $search_by = self::LOADTYPE_ID) { if(in_array($search_by, self::$fields)) $search_string = $this->getDatabaseHandler()->fieldName($search_by) . ' = ' . $this->getDatabaseHandler()->quote($search_text); else new Error_Critic('', 'Wrong Player search_by type.'); $fieldsArray = array(); foreach(self::$fields as $fieldName) $fieldsArray[] = $this->getDatabaseHandler()->fieldName($fieldName); $this->data = $this->getDatabaseHandler()->query('SELECT ' . implode(', ', $fieldsArray) . ' FROM ' . $this->getDatabaseHandler()->tableName(self::$table) . ' WHERE ' . $search_string)->fetch(); } public function loadById($id) { $this->load($id, self::LOADTYPE_ID); } public function loadByName($name) { $this->load($name, self::LOADTYPE_NAME); } public function save($forceInsert = false) { if(!isset($this->data['id']) || $forceInsert) { $keys = array(); $values = array(); foreach(self::$fields as $key) if($key != 'id') { $keys[] = $this->getDatabaseHandler()->fieldName($key); $values[] = $this->getDatabaseHandler()->quote($this->data[$key]); } $this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName(self::$table) . ' (' . implode(', ', $keys) . ') VALUES (' . implode(', ', $values) . ')'); $this->setID($this->getDatabaseHandler()->lastInsertId()); } else { $updates = array(); foreach(self::$fields as $key) $updates[] = $this->getDatabaseHandler()->fieldName($key) . ' = ' . $this->getDatabaseHandler()->quote($this->data[$key]); $this->getDatabaseHandler()->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . implode(', ', $updates) . ' WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id'])); } } public function getItems($forceReload = false) { if(!isset($this->items) || $forceReload) $this->items = new ItemsList($this->getID()); return $this->items; } public function saveItems() { if(isset($this->items)) { // if any script changed ID of player, function should save items with new player id $this->items->setPlayerId($this->getID()); $this->items->save(); } else new Error_Critic('', 'Player::saveItems() - items not loaded, cannot save'); } public function loadStorages() { $this->storages = array(); // load all $storages = $this->getDatabaseHandler()->query('SELECT ' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . $this->getDatabaseHandler()->fieldName('key') . ', ' . $this->getDatabaseHandler()->fieldName('value') . ' FROM ' .$this->getDatabaseHandler()->tableName('player_storage') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']))->fetchAll(); foreach($storages as $storage) { $this->storages[$storage['key']] = $storage['value']; } } public function saveStorages() { if(isset($this->storages)) { $this->getDatabaseHandler()->query('DELETE FROM ' .$this->getDatabaseHandler()->tableName('player_storage') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id'])); foreach($this->storages as $key => $value) { //save each $this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName('player_storage') . ' (' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . $this->getDatabaseHandler()->fieldName('key') . ', ' . $this->getDatabaseHandler()->fieldName('value') . ', ) VALUES (' . $this->getDatabaseHandler()->quote($this->data['id']) . ', ' . $this->getDatabaseHandler()->quote($key) . ', ' . $this->getDatabaseHandler()->quote($value) . ')'); } } else new Error_Critic('', 'Player::saveStorages() - storages not loaded, cannot save'); } public function getStorage($key) { if(!isset($this->storages)) { $this->loadStorages(); } if(isset($this->storages[$key])) return $this->storages[$key]; else return null; } public function getStorages() { if(!isset($this->storages)) { $this->loadStorages(); } return $this->storages; } public function setStorage($key, $value) { if(!isset($this->storages)) { $this->loadStorages(); } $this->storages[$key] = $value; } public function removeStorage($key) { if(!isset($this->storages)) { $this->loadStorages(); } if(isset($this->storages[$key])) unset($this->storages[$key]); } public function loadSkills() { $fieldsArray = array(); foreach(self::$skillFields as $fieldName) $fieldsArray[] = $this->getDatabaseHandler()->fieldName($fieldName); $skills = $this->getDatabaseHandler()->query('SELECT ' . implode(', ', $fieldsArray) . ' FROM ' . $this->getDatabaseHandler()->fieldName('player_skills') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()))->fetchAll(); $this->skills = array(); foreach($skills as $skill) $this->skills[$skill['skillid']] = $skill; } public function getSkills($forceReload = false) { if(!isset($this->skills) || $forceReload) $this->loadSkills(); return $this->skills; } public function getSkill($id, $forceReload = false) { if(!isset($this->skills) || $forceReload) $this->loadSkills(); if(isset($this->skills[$id])) return $this->skills[$id]['value']; else new Error_Critic('', 'Player::getSkill() - Skill ' . htmlspecialchars($id) . ' does not exist'); } public function setSkill($id, $value) { $this->skills[$id]['value'] = $value; } public function getSkillCount($id, $forceReload = false) { if(!isset($this->skills) || $forceReload) $this->loadSkills(); if(isset($this->skills[$id])) return $this->skills[$id]['count']; else new Error_Critic('', 'Player::getSkillCount() - Skill ' . htmlspecialchars($id) . ' does not exist'); } public function setSkillCount($id, $count) { $this->skills[$id]['count'] = $count; } public function saveSkills() { if(isset($this->skills)) { $this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName('player_skills') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID())); if(count($this->skills) > 0) { $keys = array(); foreach(self::$skillFields as $key) $keys[] = $this->getDatabaseHandler()->fieldName($key); $query = 'INSERT INTO ' . $this->getDatabaseHandler()->tableName('player_skills') . ' (' . implode(', ', $keys) . ') VALUES '; foreach($this->skills as $skill) { $fieldValues = array(); foreach(self::$skillFields as $key) if($key != 'player_id') $fieldValues[] = $this->getDatabaseHandler()->quote($skill[$key]); else $fieldValues[] = $this->getDatabaseHandler()->quote($this->getID()); $this->getDatabaseHandler()->query($query . '(' . implode(', ', $fieldValues) . ')'); } } } else new Error_Critic('', 'Player::saveSkills() - skills not loaded, cannot save'); } public function loadAccount() { $this->account = new Account($this->getAccountID()); } public function getAccount($forceReload = false) { if(!isset($this->account) || $forceReload) $this->loadAccount(); return $this->account; } public function setAccount($account) { $this->account = $account; $this->setAccountID($account->getID()); } public function loadRank() { $this->rank = new GuildRank($this->getRankID()); } public function getRank($forceReload = false) { if(!isset($this->rank) || $forceReload) $this->loadRank(); if($this->data['rank_id'] == 0) { return null; } return $this->rank; } public function setRank($rank = null) { if(isset($rank)) { $this->rank = $rank; $this->setRankID($rank->getID()); } else { $this->rank = new GuildRank(); $this->setRankID(0); } } public function hasGuild() { return $this->getRank()->isLoaded(); } public function removeGuildInvitations() { $this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName('guild_invites') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID())); } public function unban() { $bans = new DatabaseList('Ban'); $filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_PLAYER); $filterValue = new SQL_Filter(new SQL_Field('value'), SQL_Filter::EQUAL, $this->data['id']); $filterActive = new SQL_Filter(new SQL_Field('active'), SQL_Filter::EQUAL, 1); $filter = new SQL_Filter($filterType, SQL_Filter::CRITERIUM_AND, $filterValue); $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterActive); $bans->setFilter($filter); foreach($bans as $ban) { $ban->setActive(0); $ban->save(); } } public function isBanned() { $bans = new DatabaseList('Ban'); $filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_PLAYER); $filterParam = new SQL_Filter(new SQL_Field('param'), SQL_Filter::EQUAL, Ban::PLAYERBAN_BANISHMENT); $filterValue = new SQL_Filter(new SQL_Field('value'), SQL_Filter::EQUAL, $this->data['id']); $filterActive = new SQL_Filter(new SQL_Field('active'), SQL_Filter::EQUAL, 1); $filter = new SQL_Filter($filterType, SQL_Filter::CRITERIUM_AND, $filterValue); $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterActive); $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterParam); $bans->setFilter($filter); $isBanned = false; foreach($bans as $ban) { if($ban->getExpires() <= 0 || $ban->isExpires() > time()) $isBanned = true; } return $isBanned; } public function isNamelocked() { $bans = new DatabaseList('Ban'); $filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_PLAYER); $filterParam = new SQL_Filter(new SQL_Field('param'), SQL_Filter::EQUAL, Ban::PLAYERBAN_LOCK); $filterValue = new SQL_Filter(new SQL_Field('value'), SQL_Filter::EQUAL, $this->data['id']); $filterActive = new SQL_Filter(new SQL_Field('active'), SQL_Filter::EQUAL, 1); $filter = new SQL_Filter($filterType, SQL_Filter::CRITERIUM_AND, $filterValue); $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterActive); $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterParam); $bans->setFilter($filter); return (count($bans) > 0); } public function delete() { $this->db->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . $this->getDatabaseHandler()->fieldName('deleted') . ' = 1 WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id'])); unset($this->data['id']); } /* * default tfs 0.3.6 fields */ public function setID($value){$this->data['id'] = $value;} public function getID(){return $this->data['id'];} public function setAccountID($value){$this->data['account_id'] = $value;} public function getAccountID(){return $this->data['account_id'];} public function setWorldID($value){$this->data['world_id'] = $value;} public function getWorldID(){return $this->data['world_id'];} public function setName($value){$this->data['name'] = $value;} public function getName(){return $this->data['name'];} public function setGroupID($value){$this->data['group_id'] = $value;} public function getGroupID(){return $this->data['group_id'];} public function setVocation($value){$this->data['vocation'] = $value;} public function getVocation(){return $this->data['vocation'];} public function setPromotion($value){$this->data['promotion'] = $value;} public function getPromotion(){return $this->data['promotion'];} public function setLevel($value){$this->data['level'] = $value;} public function getLevel(){return $this->data['level'];} public function setExperience($value){$this->data['experience'] = $value;} public function getExperience(){return $this->data['experience'];} public function setHealth($value){$this->data['health'] = $value;} public function getHealth(){return $this->data['health'];} public function setHealthMax($value){$this->data['healthmax'] = $value;} public function getHealthMax(){return $this->data['healthmax'];} public function setMana($value){$this->data['mana'] = $value;} public function getMana(){return $this->data['mana'];} public function setManaMax($value){$this->data['manamax'] = $value;} public function getManaMax(){return $this->data['manamax'];} public function setMagLevel($value){$this->data['maglevel'] = $value;} public function getMagLevel(){return $this->data['maglevel'];} public function setManaSpent($value){$this->data['manaspent'] = $value;} public function getManaSpent(){return $this->data['manaspent'];} public function setSex($value){$this->data['sex'] = $value;} public function getSex(){return $this->data['sex'];} public function setTown($value){$this->data['town_id'] = $value;} public function getTown(){return $this->data['town_id'];} public function setPosX($value){$this->data['posx'] = $value;} public function getPosX(){return $this->data['posx'];} public function setPosY($value){$this->data['posy'] = $value;} public function getPosY(){return $this->data['posy'];} public function setPosZ($value){$this->data['posz'] = $value;} public function getPosZ(){return $this->data['posz'];} public function setCapacity($value){$this->data['cap'] = $value;} public function getCapacity(){return $this->data['cap'];} public function setSoul($value){$this->data['soul'] = $value;} public function getSoul(){return $this->data['soul'];} public function setConditions($value){$this->data['conditions'] = $value;} public function getConditions(){return $this->data['conditions'];} public function setLastIP($value){$this->data['lastip'] = $value;} public function getLastIP(){return $this->data['lastip'];} public function setLastLogin($value){$this->data['lastlogin'] = $value;} public function getLastLogin(){return $this->data['lastlogin'];} public function setLastLogout($value){$this->data['lastlogout'] = $value;} public function getLastLogout(){return $this->data['lastlogout'];} public function setSkull($value){$this->data['skull'] = $value;} public function getSkull(){return $this->data['skull'];} public function setSkullTime($value){$this->data['skulltime'] = $value;} public function getSkullTime(){return $this->data['skulltime'];} public function setRankID($value){$this->data['rank_id'] = $value;} public function getRankID(){return $this->data['rank_id'];} public function setGuildNick($value){$this->data['guildnick'] = $value;} public function getGuildNick(){return $this->data['guildnick'];} public function setSave($value = 1){$this->data['save'] = (int) $value;} public function getSave(){return $this->data['save'];} public function setBlessings($value){$this->data['blessings'] = $value;} public function getBlessings(){return $this->data['blessings'];} public function setBalance($value){$this->data['balance'] = $value;} public function getBalance(){return $this->data['balance'];} public function setStamina($value){$this->data['stamina'] = $value;} public function getStamina(){return $this->data['stamina'];} public function setDirection($value){$this->data['direction'] = $value;} public function getDirection(){return $this->data['direction'];} public function setLossExperience($value){$this->data['loss_experience'] = $value;} public function getLossExperience(){return $this->data['loss_experience'];} public function setLossMana($value){$this->data['loss_mana'] = $value;} public function getLossMana(){return $this->data['loss_mana'];} public function setLossSkills($value){$this->data['loss_skills'] = $value;} public function getLossSkills(){return $this->data['loss_skills'];} public function setLossContainers($value){$this->data['loss_containers'] = $value;} public function getLossContainers(){return $this->data['loss_containers'];} public function setLossItems($value){$this->data['loss_items'] = $value;} public function getLossItems(){return $this->data['loss_items'];} public function setOnline($value){$this->data['online'] = (int) $value;} public function getOnline(){return (bool) $this->data['online'];} public function setMarriage($value){$this->data['marriage'] = $value;} public function getMarriage(){return $this->data['marriage'];} public function setDeleted($value){$this->data['deleted'] = (int) $value;} public function isDeleted(){return (bool) $this->data['deleted'];} public function setDescription($value){$this->data['description'] = $value;} public function getDescription(){return $this->data['description'];} public function setLookBody($value){$this->data['lookbody'] = $value;} public function getLookBody(){return $this->data['lookbody'];} public function setLookFeet($value){$this->data['lookfeet'] = $value;} public function getLookFeet(){return $this->data['lookfeet'];} public function setLookHead($value){$this->data['lookhead'] = $value;} public function getLookHead(){return $this->data['lookhead'];} public function setLookLegs($value){$this->data['looklegs'] = $value;} public function getLookLegs(){return $this->data['looklegs'];} public function setLookType($value){$this->data['looktype'] = $value;} public function getLookType(){return $this->data['looktype'];} public function setLookAddons($value){$this->data['lookaddons'] = $value;} public function getLookAddons(){return $this->data['lookaddons'];} /* * Custom AAC fields * create_ip , INT, default 0 * create_date , INT, default 0 * hide_char , INT, default 0 * comment , TEXT, default '' */ public function setCreateIP($value){$this->data['create_ip'] = $value;} public function getCreateIP(){return $this->data['create_ip'];} public function setCreateDate($value){$this->data['create_date'] = $value;} public function getCreateDate(){return $this->data['create_date'];} public function setHidden($value){$this->data['hide_char'] = (int) $value;} public function isHidden(){return (bool) $this->data['hide_char'];} public function setComment($value){$this->data['comment'] = $value;} public function getComment(){return $this->data['comment'];} /* * for compability with old scripts */ public function setGroup($value){$this->setGroupID($value);} public function getGroup(){return $this->getGroupID();} public function setWorld($value){$this->setWorldID($value);} public function getWorld(){return $this->getWorldID();} public function isOnline(){return $this->getOnline() == 1;} public function getCreated(){return $this->getCreateDate();} public function setCreated($value){$this->setCreateDate($value);} public function setCap($value){$this->setCapacity($value);} public function getCap(){return $this->getCapacity();} public function isSaveSet(){return $this->getSave();} public function unsetSave(){$this->setSave(0);} public function getTownId(){return $this->getTown();} public function getHideChar(){return $this->isHidden();} public function find($name){$this->loadByName($name);} } Fico no aguardo.
Postado Janeiro 20, 2017 8 anos @Azhaurn me ajuda moço eu coloquei true e deu isso Query:SELECT `accounts`.`flag`, `players`.`name`, `players`.`vocation`, `players`.`level`, `players`.`skull`, `players`.`looktype`, `players`.`lookaddons`, `players`.`lookhead`, `players`.`lookbody`, `players`.`looklegs`, `players`.`lookfeet` FROM `accounts`, `players`, `players_online` WHERE `players`.`id` = `players_online`.`player_id` AND `accounts`.`id` = `players`.`account_id` ORDER BY `name` SQLSTATE:42S22 Driver code:1054 Error message:Unknown column 'accounts.flag' in 'field list'
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.