Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.poczta.onet.pl:25 (Se produjo un error durante el intento de conexi�n ya que la parte conectada no respondi� adecuadamente tras un periodo de tiempo, o bien se produjo un error en la conexi�n establecida ya que el host conectado no ha podido responder. ) in C:\xampp\htdocs\phpmailer\class.smtp.php on line 105
What server use account name? I use TFS 0.2 rc 16 - 8.31 server and don't have any problem.
$this->data['id'] = $number;
$this->data['name'] = $name;
$reg_account->save();
$reg_account->setCustomField("name", $number);
TFS 0.3a3 is using "account --> name" for login into Tibia 8.31 client. Ill post you an small fix right now. This fix will just put "account --> id" into the "name" field.
The next Code adds the account number to the name field also. This should help everyone who has the same problem like me.
In "pot" folder open "OTS_Account.php" and find:
and behind/under this you may add:Code:$this->data['id'] = $number;
In root open "createaccount.php" and find:Code:$this->data['name'] = $name;
and behind/under this you may add:Code:$reg_account->save();
Code:$reg_account->setCustomField("name", $number);
This should fix the loginproblem with accounts created with acc.maker 0.3.1a for Tfs 0.3a3 and Tibia 8.31!
Baba
Virgel
Database error - can't connect to MySQL database. Possible reasons:
1. MySQL server is not running on host.
2. MySQL user, password, database or host isn't configured in: C:/Documents and Settings/XXXX/Escritorio/XXXXXX/config.lua .
3. MySQL user, password, database or host is wrong.
[25/10/2008 16:58:24] Lua Script Error: [CreatureScript Interface]
[25/10/2008 16:58:24] data/creaturescripts/scripts/login.lua
[25/10/2008 16:58:24] luaAddEvent(). callback parameter should be a function.
[25/10/2008 16:58:24] Reloaded all.
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
SQL_COMUNICATION_INTERVAL = SQL_interval * 1000
function onLogin(cid)
registerCreatureEvent(cid, "PlayerKill")
if (InitArenaScript ~= 0) then
InitArenaScript = 1
-- make arena rooms free
for i = 42300, 42309 do
setGlobalStorageValue(i, 0)
setGlobalStorageValue(i+100, 0)
end
end
-- if he did not make full arena 1 he must start from zero
if getPlayerStorageValue(cid, 42309) < 1 then
for i = 42300, 42309 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 2 he must start from zero
if getPlayerStorageValue(cid, 42319) < 1 then
for i = 42310, 42319 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 3 he must start from zero
if getPlayerStorageValue(cid, 42329) < 1 then
for i = 42320, 42329 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42355) == -1 then
setPlayerStorageValue(cid, 42355, 0) -- did not arena level
end
setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
setPlayerStorageValue(cid, 42352, 0) -- is not in arena
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end
if(InitShopComunication == 0) then
local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, {})
InitShopComunication = eventServ
end
function sql_communication(parameters)
local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';")
if(result_plr:getID() ~= -1) then
while(true) do
id = tonumber(result_plr:getDataInt("id"))
action = tostring(result_plr:getDataString("action"))
delete = tonumber(result_plr:getDataInt("delete_it"))
cid = getPlayerByName(tostring(result_plr:getDataString("name")))
if isPlayer(cid) == TRUE then
local itemtogive_id = tonumber(result_plr:getDataInt("param1"))
local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
local container_id = tonumber(result_plr:getDataInt("param3"))
local container_count = tonumber(result_plr:getDataInt("param4"))
local add_item_type = tostring(result_plr:getDataString("param5"))
local add_item_name = tostring(result_plr:getDataString("param6"))
local received_item = 0
local full_weight = 0
if add_item_type == 'container' then
container_weight = getItemWeightById(container_id, 1)
if isItemRune(itemtogive_id) == TRUE then
items_weight = container_count * getItemWeightById(itemtogive_id, 1)
else
items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)
end
full_weight = items_weight + container_weight
else
full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
if isItemRune(itemtogive_id) == TRUE then
full_weight = getItemWeightById(itemtogive_id, 1)
else
full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
end
end
local free_cap = getPlayerFreeCap(cid)
if full_weight <= free_cap then
if add_item_type == 'container' then
local new_container = doCreateItemEx(container_id, 1)
local iter = 0
while iter ~= container_count do
doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
iter = iter + 1
end
received_item = doPlayerAddItemEx(cid, new_container)
else
local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
received_item = doPlayerAddItemEx(cid, new_item)
end
if received_item == RETURNVALUE_NOERROR then
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.')
db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
end
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
end
end
if not(result_plr:next()) then
break
end
end
result_plr:free()
end
local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, parameters)
end
<?php
$i = 0;
$playersDeaths = $SQL->query('SELECT `players`.`name`, `player_deaths`.`player_id`, `player_deaths`.`time`, `player_deaths`.`level`, `player_deaths`.`killed_by` FROM `players`, `player_deaths` WHERE `players`.`id` = `player_deaths`.`player_id` ORDER BY `time` DESC LIMIT '.$config['site']['last_deaths_limit'])->fetchAll();
$main_content .= '<table border="0" cellspacing="1" cellpadding="4" width="100%">';
$main_content .= '<tr bgcolor="'.$config['site']['vdarkborder'].'"><td colspan="2"><b><font color="white">Latest Deaths</font></b></td></tr>';
foreach($playersDeaths as $deads)
{
$i++;
$bgcolor = ($i % 2) ? $config['site']['darkborder'] : $config['site']['lightborder'];
if(is_numeric($deads['killed_by']))
{
$character = new OTS_Player;
$character->load($deads['killed_by']);
if($character->isLoaded())
$main_content .= '<tr bgcolor="'.$bgcolor.'"><td width="3%">'.$i.'.</td><td><a href="index.php?subtopic=characters&name='.$deads['name'].'">'.$deads['name'].'</a> killed at level <b>'.$deads['level'].'</b> by <a href="index.php?subtopic=characters&name='.$character->getName().'">'.$character->getName().'</a>.</td></tr>';
else
$main_content .= '<tr bgcolor="'.$bgcolor.'"><td colspan="2">Unknown or deleted player.</td></tr>';
}
else
$main_content .= '<tr bgcolor="'.$bgcolor.'"><td width="3%">'.$i.'.</td><td><a href="index.php?subtopic=characters&name='.$deads['name'].'">'.$deads['name'].'</a> killed at level <b>'.$deads['level'].'</b> by '.$deads['killed_by'].'.</td></tr>';
}
$main_content .= '</table>';
?>
<?PHP
$name = stripslashes(ucwords(strtolower(trim($_REQUEST['name']))));
if(empty($name)) {
$main_content .= 'Here you can get detailed information about a certain player on '.$config['server']['serverName'].'.<BR> <FORM ACTION="index.php?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
}
else
{
if(check_name($name)) {
$player = $ots->createObject('Player');
$player->find($name);
if($player->isLoaded()) {
$account = $player->getAccount();
//check is premy account
if($account->getCustomField("premdays") == 0) {
$account_status = '<b><span class="red">Free Account</span></b>';
}
else
{
$account_status = '<b><span class="green">Premium Account</span></b>';
}
//set sex name
if($player->getSex() == 0)
$sex = 'female';
else
$sex = 'male';
$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Character Information</B></TD></TR>';
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=20%>Name:</TD><TD>'.$player->getName().'</TD></TR>';
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Sex:</TD><TD>'.$sex.'</TD></TR>';
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Profession:</TD><TD>'.$config_vocations[$player->getVocation()].'</TD></TR>';
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Level:</TD><TD>'.$player->getLevel().'</TD></TR>';
if($config['site']['show_mlvl'] == 1)
{
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Magic Level:</TD><TD>'.$player->getMagLevel().'</TD></TR>';
}
if(!empty($towns_list[$player->getTownId()]))
{
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Residence:</TD><TD>'.$towns_list[$player->getTownId()].'</TD></TR>';
}
$rank_of_player = $player->getRank();
if(!empty($rank_of_player))
{
$guild_name = $rank_of_player->getGuild()->getName();
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Guild membership:</TD><TD>'.$rank_of_player->getName().' of the <a href="index.php?subtopic=guilds&action=show&guild='.$guild_name.'">'.$guild_name.'</a></TD></TR>';
}
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$lastlogin = $player->getLastLogin();
if(empty($lastlogin))
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Last login:</TD><TD>Never logged in.</TD></TR>';
else
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Last login:</TD><TD>'.date("j F Y, g:i a", $lastlogin).'</TD></TR>';
if($config['site']['show_creationdate'] == 1)
{
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Created:</TD><TD>'.date("j F Y, g:i a", $player->getCustomField("created")).'</TD></TR>';
}
$comment = $player->getCustomField("comment");
$newlines = array("\r\n", "\n", "\r");
$comment_with_lines = str_replace($newlines, '<br />', $comment, $count);
if($count < 50)
$comment = $comment_with_lines;
if(!empty($comment))
{
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD VALIGN=top>Comment:</TD><TD>'.$comment.'</TD></TR>';
}
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Account*Status:</TD><TD>'.$account_status.'</TD></TR></TABLE>';
//deaths list
$player_deaths = $SQL->query("SELECT `time`, `level`, `killed_by` FROM `player_deaths` WHERE `player_id` = '".$player->getId()."' ORDER BY `time` DESC")->fetchAll();
$number_of_players_deaths = 0;
$main_content .= '<br><table border=0 cellspacing=1 cellpadding=4 width=100%><tr bgcolor='.$config['site']['vdarkborder'].'><td colspan=2 class=white><b>Deaths</b></td></tr>';
foreach($player_deaths as $deads)
{
$number_of_players_deaths++;
$bgcolor = ($number_of_players_deaths % 2) ? $config['site']['darkborder'] : $config['site']['lightborder'];
if(is_numeric($deads['killed_by']))
{
$killer = new OTS_Player;
$killer->load($deads['killed_by']);
if($killer->isLoaded())
$dead_add_content .= '<tr bgcolor="'.$bgcolor.'"><td width="20%">'.date("j M Y, H:i", $deads['time']).'</td><td>killed at level '.$deads['level'].' by <a href="index.php?subtopic=characters&name='.$killer->getName().'">'.$killer->getName().'</a>.</td></tr>';
else
$dead_add_content .= '<tr bgcolor="'.$bgcolor.'"><td colspan="2">Unknown or deleted player.</td></tr>';
}
else
$dead_add_content .= '<tr bgcolor="'.$bgcolor.'"><td width="20%">'.date("j M Y, H:i", $deads['time']).'</td><td>killed at level '.$deads['level'].' by '.$deads['killed_by'].'.</td></tr>';
}
$dead_add_content .= '</table>';
if($number_of_players_deaths > 0)
$main_content .= $dead_add_content;
if($player->getCustomField("hide_char") != 1) {
//account info
$main_content .= '<br><TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Account Information</B></TD></TR><TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Real name:</TD><TD>'.$account->getCustomField("rlname").'</TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD WIDTH=20%>Location:</TD><TD>'.$account->getCustomField("location").'</TD></TR><TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Created:</TD><TD>'.date("j F Y, g:i a", $account->getCustomField("created")).'</TD></TR></TABLE>';
//char list table
$main_content .= '<br><TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=4 CLASS=white><B>Characters</B></TD></TR>
<TR BGCOLOR='.$config['site']['darkborder'].'><TD><B>Name</B></TD><TD><B>Level</B></TD><TD><b>Status</b></TD><TD><B>*</B></TD></TR>';
//for each player on account
$account_players = $account->getPlayersList();
$account_players->orderBy('name');
$player_number = 0;
foreach($account_players as $player_list)
{
if($player_list->getCustomField("hide_char") != 1)
{
$player_number++;
if(is_int($player_number / 2))
$bgcolor = $config['site']['darkborder'];
else
$bgcolor = $config['site']['lightborder'];
if($player_list->getCustomField("online") == 0)
$player_list_status = '<font color="red">Offline</font>';
else
$player_list_status = '<font color="green">Online</font>';
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=72%><NOBR>'.$player_number.'.*'.$player_list->getName().'</NOBR></TD><TD WIDTH=20%>'.$player_list->getLevel().' '.$config_vocations[$player_list->getVocation()].'</TD><TD WIDTH="8%"><b>'.$player_list_status.'</b></TD><TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="index.php?subtopic=characters" METHOD=post><TR><TD><INPUT TYPE=hidden NAME=name VALUE="'.$player_list->getName().'"><INPUT TYPE=image NAME="View '.$player_list->getName().'" ALT="View '.$player_list->getName().'" SRC="'.$layout_name.'/images/buttons/sbutton_view.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></FORM></TABLE></TD></TR>';
}
}
$main_content .= '</TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>';
//end of char list table
}
//show search form
$main_content .= '<BR><BR><FORM ACTION="index.php?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
$main_content .= '</TABLE>';
}
else
{
$search_errors[] = 'Character <b>'.$name.'</b> does not exist.';
//gracz nie istnieje - komunikat
}
}
else
{
$search_errors[] = 'This name contains invalid letters. Please use only A-Z, a-z and space.';
//niepoprawne imie gracza
}
if(!empty($search_errors)) {
$main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
foreach($search_errors as $search_error)
$main_content .= '<li>'.$search_error;
$main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>';
$main_content .= '<BR><FORM ACTION="index.php?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
}
}
?>