DimitriKovarsk
New Member
- Joined
- Jun 19, 2016
- Messages
- 26
- Reaction score
- 0
Hello guys, I'm a rookie on server creation. To be honest, it is my second. I got a problem here.
First of all, I intend to host my server to my friends, not to put in a 24/7 dedicated host. And I'm using a gesior accmaker with the Uniform Server Zero instead of Xampp.
Well, I created three NO-IP ip addresses to use with my old 10.x client. Now, my friends asked to upgrade it to the new 11 client. The problem is, when I edited the 10.x client, it was easy, a 17 letters ip and a 19 letters ip address.
Now, it is just one IP address located on loginWebService. I don't know what IP I should put there so my friends could connect into my server and I don't know even what IP I should put inside my config.lua.
FYI, I have all necessary ports already opened.
I don't know what kind of documents you need to help me solve this problem, but I'm sending my login.php (located in C:\Users\xxxxx\Downloads\UniServerZ\www) and my config.lua.
First of all, I intend to host my server to my friends, not to put in a 24/7 dedicated host. And I'm using a gesior accmaker with the Uniform Server Zero instead of Xampp.
Well, I created three NO-IP ip addresses to use with my old 10.x client. Now, my friends asked to upgrade it to the new 11 client. The problem is, when I edited the 10.x client, it was easy, a 17 letters ip and a 19 letters ip address.
Now, it is just one IP address located on loginWebService. I don't know what IP I should put there so my friends could connect into my server and I don't know even what IP I should put inside my config.lua.
FYI, I have all necessary ports already opened.
I don't know what kind of documents you need to help me solve this problem, but I'm sending my login.php (located in C:\Users\xxxxx\Downloads\UniServerZ\www) and my config.lua.
PHP:
<?php
/**
* Created by Notepad++.
* User: Malucooo - Erick Nunes
* Remaked of login.php by JLCVP and parts of login.php by Monteiro. Thanks for both!
* Date: 18/09/17
* Time: 03:01
*/
require 'config/config.php';
// comment to show E_NOTICE [undefinied variable etc.], comment if you want make script and see all errors
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);
// true = show sent queries and SQL queries status/status code/error message
define('DEBUG_DATABASE', false);
define('INITIALIZED', true);
if (!defined('ONLY_PAGE'))
define('ONLY_PAGE', true);
// check if site is disabled/requires installation
include_once('./system/load.loadCheck.php');
// fix user data, load config, enable class auto loader
include_once('./system/load.init.php');
// DATABASE
include_once('./system/load.database.php');
if (DEBUG_DATABASE)
Website::getDBHandle()->setPrintQueries(true);
// DATABASE END
/*error example:
{
"errorCode":3,
"errorMessage":"Account name or password is not correct."
}*/
# Declare variables with array structure
$characters = array();
$playerData = array();
$data = array();
$isCasting = false;
# error function
function sendError($msg){
$ret = array();
$ret["errorCode"] = 3;
$ret["errorMessage"] = $msg;
die(json_encode($ret));
}
# getting infos
$request = file_get_contents('php://input');
$result = json_decode($request, true);
# account infos
$accountName = $result["accountname"];
$password = $result["password"];
# game port
$port = 7172;
# check if player wanna see cast list
if (strtolower($accountName) == "cast")
$isCasting = true;
if ($isCasting) {
$casts = $SQL->query("SELECT `player_id` FROM `live_casts`")->fetchAll();
if (count($casts[0]) == 0)
sendError("There is no live casts right now!");
foreach($casts as $cast) {
$character = new Player();
$character->load($cast['player_id']);
if ($character->isLoaded()) {
$char = array("worldid" => 0, "name" => $character->getName(), "ismale" => (($character->getSex() == 1) ? true : false), "tutorial" => false);
$characters[] = $char;
}
}
$port = 7173;
$lastLogin = 0;
$premiumAccount = true;
$timePremium = 0;
} else {
$account = new Account();
$account->find($accountName);
if (!$account->isLoaded())
sendError("Failed to get account. Try again!");
if ($account->getPassword() != Website::encryptPassword($password))
sendError("The password for this account is wrong. Try again!");
foreach($account->getPlayersList() as $character) {
$char = array("worldid" => 0, "name" => $character->getName(), "ismale" => (($character->getSex() == 1) ? true : false), "tutorial" => false);
$characters[] = $char;
}
$lastLogin = $account->getLastLogin();
$premiumAccount = ($account->isPremium()) ? true : false;
$timePremium = time() + ($account->getPremDays() * 86400);
}
$session = array(
"fpstracking" => false,
"isreturner" => true,
"returnernotification" => false,
"showrewardnews" => false,
"sessionkey" => $accountName . "\n" . $password,
"lastlogintime" => $lastLogin,
"ispremium" => $premiumAccount,
"premiumuntil" => $timePremium,
"status" => "active"
);
$world = array(
"id" => 0,
"name" => $config['server']['serverName'],
"externaladdress" => $config['server']['ip'],
"externalport" => $port,
"previewstate" => 0,
"location" => "BRA",
"anticheatprotection" => false
);
//Survey by: Cjaker
$survey = array(
"id" => rand(0, 999999),
"invitationtext" => "Querido tibiano, obrigado por usar OTX, a base mais atualizada do Tibia Global.\n'Mensagem dita por Cjaker'.",
"invitationtoken" => "1751f1beddf001e1d36dee78ace974",
"endtimestamp" => 1510614000
);
// https://limesurvey.cipsoft.com/index.php/survey/index/sid/527875/lang-en?token=1751f1beddf001e1d36dee78ace974
// token=invitationtoken
// o endtimestamp acima é o tempo convertido em unix timestamp, onde o mesmo é o prazo que irá acabar o survey!
$worlds = array($world);
$data["session"] = $session;
$playerData["worlds"] = $worlds;
$playerData["characters"] = $characters;
$data["playdata"] = $playerData;
$data["survey"] = $survey;
echo json_encode($data);
Lua:
-- Combat settings
-- NOTE: valid values for worldType are: "pvp", "no-pvp" and "pvp-enforced"
worldType = "pvp"
hotkeyAimbotEnabled = true
protectionLevel = 7
pzLocked = 60 * 1000
removeChargesFromRunes = false
removeChargesFromPotions = false
removeWeaponAmmunition = false
removeWeaponCharges = false
timeToDecreaseFrags = 24 * 60 * 60 * 1000
whiteSkullTime = 15 * 60 * 1000
stairJumpExhaustion = 2 * 1000
experienceByKillingPlayers = false
expFromPlayersLevelRange = 75
dayKillsToRedSkull = 3
weekKillsToRedSkull = 5
monthKillsToRedSkull = 10
redSkullDuration = 30
blackSkullDuration = 45
orangeSkullDuration = 7
-- Connection Config
-- NOTE: maxPlayers set to 0 means no limit
ip = "myIPV4gotItFromCMD"
bindOnlyGlobalAddress = false
loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
maxPlayers = 0
motd = "Welcome to The OTXServer Global!"
onePlayerOnlinePerAccount = true
allowClones = false
serverName = "OTXServer-Global"
statusTimeout = 5 * 1000
replaceKickOnLogin = true
maxPacketsPerSecond = 25
-- Version Manual
clientVersionMin = 1100
clientVersionMax = 1157
clientVersionStr = "11.57"
-- Depot Limit
freeDepotLimit = 2000
premiumDepotLimit = 10000
depotBoxes = 17
-- GameStore
gamestoreByModules = true
-- Casting System
enableLiveCasting = true
liveCastPort = 7173
-- Expert Pvp Config
expertPvp = false
-- Deaths
-- NOTE: Leave deathLosePercent as -1 if you want to use the default
-- death penalty formula. For the old formula, set it to 10. For
-- no skill/experience loss, set it to 0.
deathLosePercent = -1
-- Houses
-- NOTE: set housePriceEachSQM to -1 to disable the ingame buy house functionality
housePriceEachSQM = 1000
houseRentPeriod = "daily"
-- Item Usage
timeBetweenActions = 200
timeBetweenExActions = 1000
-- Map
-- NOTE: set mapName WITHOUT .otbm at the end
mapName = "realmap"
mapAuthor = "Cipsoft"
-- Market
marketOfferDuration = 30 * 24 * 60 * 60
premiumToCreateMarketOffer = true
checkExpiredMarketOffersEachMinutes = 60
maxMarketOffersAtATimePerPlayer = 100
-- MySQL
mysqlHost = "127.0.0.1"
mysqlUser = "root"
mysqlPass = "mypass"
mysqlDatabase = "global"
mysqlPort = 3306
mysqlSock = ""
passwordType = "sha1"
-- Misc.
allowChangeOutfit = true
freePremium = true
kickIdlePlayerAfterMinutes = 15
idleWarningTime = 10 * 60 * 1000
idleKickTime = 15 * 60 * 1000
maxMessageBuffer = 4
emoteSpells = false
classicEquipmentSlots = false
allowWalkthrough = true
coinPacketSize = 1
coinImagesURL = "http://localhost/images/store/"
classicAttackSpeed = false
-- Rates
-- NOTE: rateExp is not used if you have enabled stages in data/XML/stages.xml
rateExp = 1
rateSkill = 50
rateLoot = 3
rateMagic = 25
rateSpawn = 1
-- Monster rates
rateMonsterHealth = 1.0
rateMonsterAttack = 1.0
rateMonsterDefense = 1.0
-- Monsters
deSpawnRange = 2
deSpawnRadius = 50
-- Stamina
staminaSystem = true
-- Scripts
warnUnsafeScripts = true
convertUnsafeScripts = true
-- Startup
-- NOTE: defaultPriority only works on Windows and sets process
-- priority, valid values are: "normal", "above-normal", "high"
defaultPriority = "high"
startupDatabaseOptimization = true
-- Status server information
ownerName = "Malucooo"
ownerEmail = "[email protected]"
url = "http://www.facebook.com/erick.nunes.75"
location = "Brazil"