[svn] DynamicObject should only be visible for caster if it is not in distance. However, I do not think this will fix the bug that dynamic object update freezes the server.
--HG-- branch : trunk
This commit is contained in:
@@ -10,12 +10,12 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/// \addtogroup Trinityd
|
||||
@@ -51,7 +51,7 @@ void utf8print(const char* str)
|
||||
CharToOemBuffW(&wtemp_buf[0],&temp_buf[0],wtemp_len+1);
|
||||
printf(temp_buf);
|
||||
#else
|
||||
printf(str);
|
||||
printf(str);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ bool ChatHandler::HandleAccountDeleteCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleCharacterDeleteCommand(const char* args)
|
||||
@@ -126,18 +126,18 @@ bool ChatHandler::HandleCharacterDeleteCommand(const char* args)
|
||||
if(!*args)
|
||||
return false;
|
||||
|
||||
char *character_name_str = strtok((char*)args," ");
|
||||
char *character_name_str = strtok((char*)args," ");
|
||||
if(!character_name_str)
|
||||
return false;
|
||||
return false;
|
||||
|
||||
std::string character_name = character_name_str;
|
||||
if(!normalizePlayerName(character_name))
|
||||
return false;
|
||||
return false;
|
||||
|
||||
uint64 character_guid;
|
||||
uint32 account_id;
|
||||
|
||||
Player *player = objmgr.GetPlayer(character_name.c_str());
|
||||
Player *player = objmgr.GetPlayer(character_name.c_str());
|
||||
if(player)
|
||||
{
|
||||
character_guid = player->GetGUID();
|
||||
@@ -157,10 +157,10 @@ bool ChatHandler::HandleCharacterDeleteCommand(const char* args)
|
||||
account_id = objmgr.GetPlayerAccountIdByGUID(character_guid);
|
||||
}
|
||||
|
||||
std::string account_name;
|
||||
std::string account_name;
|
||||
accmgr.GetName (account_id,account_name);
|
||||
|
||||
Player::DeleteFromDB(character_guid, account_id, true);
|
||||
Player::DeleteFromDB(character_guid, account_id, true);
|
||||
PSendSysMessage(LANG_CHARACTER_DELETED,character_name.c_str(),GUID_LOPART(character_guid),account_name.c_str(), account_id);
|
||||
return true;
|
||||
}
|
||||
@@ -170,7 +170,7 @@ bool ChatHandler::HandleServerExitCommand(const char* args)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_EXIT);
|
||||
World::m_stopEvent = true;
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Display info on users currently in the realm
|
||||
@@ -227,7 +227,7 @@ bool ChatHandler::HandleAccountCreateCommand(const char* args)
|
||||
char *szAcc = strtok((char*)args, " ");
|
||||
char *szPassword = strtok(NULL, " ");
|
||||
if(!szAcc || !szPassword)
|
||||
return false;
|
||||
return false;
|
||||
|
||||
// normilized in accmgr.CreateAccount
|
||||
std::string account_name = szAcc;
|
||||
@@ -256,8 +256,8 @@ bool ChatHandler::HandleAccountCreateCommand(const char* args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Set the level of logging
|
||||
@@ -268,10 +268,10 @@ bool ChatHandler::HandleServerSetLogLevelCommand(const char *args)
|
||||
|
||||
char *NewLevel = strtok((char*)args, " ");
|
||||
if (!NewLevel)
|
||||
return false;
|
||||
return false;
|
||||
|
||||
sLog.SetLogLevel(NewLevel);
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// @}
|
||||
@@ -325,12 +325,13 @@ void CliRunnable::run()
|
||||
{
|
||||
for(int x=0;command_str[x];x++)
|
||||
if(command_str[x]=='\r'||command_str[x]=='\n')
|
||||
{
|
||||
command_str[x]=0;
|
||||
break;
|
||||
}
|
||||
{
|
||||
command_str[x]=0;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!*command_str)
|
||||
|
||||
if(!*command_str)
|
||||
{
|
||||
printf("TC>");
|
||||
continue;
|
||||
@@ -346,7 +347,9 @@ void CliRunnable::run()
|
||||
sWorld.QueueCliCommand(&utf8print,command.c_str());
|
||||
}
|
||||
else if (feof(stdin))
|
||||
{
|
||||
World::m_stopEvent = true;
|
||||
}
|
||||
}
|
||||
|
||||
///- End the database thread
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/// \addtogroup Trinityd Trinity Daemon
|
||||
@@ -137,7 +137,6 @@ extern int main(int argc, char **argv)
|
||||
sLog.outError("Could not find configuration file %s.", cfg_file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
sLog.outString("Using configuration file %s.", cfg_file);
|
||||
|
||||
uint32 confVersion = sConfig.GetIntDefault("ConfVersion", 0);
|
||||
|
||||
+11
-11
@@ -10,12 +10,12 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/** \file
|
||||
@@ -83,15 +83,15 @@ public:
|
||||
uint32 curtime = getMSTime();
|
||||
//DEBUG_LOG("anti-freeze: time=%u, counters=[%u; %u]",curtime,Master::m_masterLoopCounter,World::m_worldLoopCounter);
|
||||
|
||||
// There is no Master anymore
|
||||
// TODO: clear the rest of the code
|
||||
// There is no Master anymore
|
||||
// TODO: clear the rest of the code
|
||||
// // normal work
|
||||
// if(m_loops != Master::m_masterLoopCounter)
|
||||
// {
|
||||
// m_lastchange = curtime;
|
||||
// m_loops = Master::m_masterLoopCounter;
|
||||
// }
|
||||
// // possible freeze
|
||||
// // possible freeze
|
||||
// else if(getMSTimeDiff(m_lastchange,curtime) > _delaytime)
|
||||
// {
|
||||
// sLog.outError("Main/Sockets Thread hangs, kicking out server!");
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
w_lastchange = curtime;
|
||||
w_loops = World::m_worldLoopCounter;
|
||||
}
|
||||
// possible freeze
|
||||
// possible freeze
|
||||
else if(getMSTimeDiff(w_lastchange,curtime) > _delaytime)
|
||||
{
|
||||
sLog.outError("World Thread hangs, kicking out server!");
|
||||
@@ -250,7 +250,7 @@ int Master::Run()
|
||||
///- Launch CliRunnable thread
|
||||
ZThread::Thread td1(new CliRunnable);
|
||||
}
|
||||
|
||||
|
||||
ZThread::Thread td2(new RARunnable);
|
||||
|
||||
///- Handle affinity for multiple processors and process priority on Windows
|
||||
@@ -328,7 +328,7 @@ int Master::Run()
|
||||
}
|
||||
|
||||
sWorldSocketMgr->Wait ();
|
||||
|
||||
|
||||
// set server offline
|
||||
loginDatabase.PExecute("UPDATE realmlist SET color = 2 WHERE id = '%d'",realmID);
|
||||
|
||||
@@ -339,7 +339,7 @@ int Master::Run()
|
||||
// since worldrunnable uses them, it will crash if unloaded after master
|
||||
t.wait();
|
||||
td2.wait ();
|
||||
|
||||
|
||||
///- Clean database before leaving
|
||||
clearOnlineAccounts();
|
||||
|
||||
@@ -459,7 +459,7 @@ bool Master::_StartDB()
|
||||
|
||||
sWorld.LoadDBVersion();
|
||||
|
||||
sLog.outString("Using %s", sWorld.GetDBVersion());
|
||||
sLog.outString("Using %s", sWorld.GetDBVersion());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ void Master::clearOnlineAccounts()
|
||||
loginDatabase.PExecute(
|
||||
"UPDATE account SET online = 0 WHERE online > 0 "
|
||||
"AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')",realmID);
|
||||
|
||||
|
||||
|
||||
CharacterDatabase.Execute("UPDATE characters SET online = 0");
|
||||
}
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/** \file
|
||||
@@ -197,8 +197,8 @@ void RASocket::OnRead()
|
||||
loginDatabase.escape_string(pw);
|
||||
|
||||
QueryResult *check = loginDatabase.PQuery(
|
||||
"SELECT 1 FROM account WHERE username = '%s' AND sha_pass_hash=SHA1(CONCAT(username,':','%s'))",
|
||||
login.c_str(), pw.c_str());
|
||||
"SELECT 1 FROM account WHERE username = '%s' AND sha_pass_hash=SHA1(CONCAT(username,':','%s'))",
|
||||
login.c_str(), pw.c_str());
|
||||
|
||||
if(check)
|
||||
{
|
||||
@@ -244,13 +244,13 @@ void RASocket::zprint( const char * szText )
|
||||
|
||||
#ifdef RA_CRYPT
|
||||
|
||||
char *megabuffer=strdup(szText);
|
||||
char *megabuffer=strdup(szText);
|
||||
unsigned int sz=strlen(megabuffer);
|
||||
Encrypt(megabuffer,sz);
|
||||
send(r,megabuffer,sz,0);
|
||||
send(r,megabuffer,sz,0);
|
||||
delete [] megabuffer;
|
||||
|
||||
#else
|
||||
|
||||
#else
|
||||
|
||||
unsigned int sz=strlen(szText);
|
||||
send(r,szText,sz,0);
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/** \file
|
||||
@@ -77,7 +77,7 @@ void WorldRunnable::run()
|
||||
sWorld.KickAllQueued(); // kick all queued players (and prevent its login at kick in game players)
|
||||
sWorld.KickAll(); // save and kick all players
|
||||
sWorld.UpdateSessions( 1 ); // real players unload required UpdateSessions call
|
||||
|
||||
|
||||
sWorldSocketMgr->StopNetwork();
|
||||
|
||||
MapManager::Instance().UnloadAll(); // unload all grids (including locked in memory)
|
||||
|
||||
Reference in New Issue
Block a user