Unik2psc
-
Posts
29 -
Joined
-
Last visited
Never -
Donations
0.00 GBP
Content Type
Profiles
Bug Tracker
Wiki
Release Notes
Forums
Downloads
Blogs
Events
Posts posted by Unik2psc
-
-
1. Player *pPlayer = m_session->GetPlayer(); change to if(Player *pPlayer = m_session->GetPlayer(). Security.
2. Where your code is ?. (function name, file).
-
forbiddenn, mtmaps or kero patch ?
-
New patch (by Kero):
https://gist.github.com/725939
You've lost these lines:
ACE_Based::Thread::Sleep(loopSleepms);- SqlOperation* s = NULL;
- while (m_sqlQueue.next(s))
+ ACE_Based::Thread::Sleep(loopSleepms);
+ SqlAsyncTask * s = dynamic_cast<SqlAsyncTask*> (m_sqlQueue.dequeue(/*&_time*/));
+ if(s)
Regards
-
Kerto, this patch is full patch or patch for mod ace mtmaps ?
-
git clone -b mangos-0.12 git://github.com/mangos/mangos.git folder(/example:mangosTbc)
-
compilation error:
eps/TaxiHandler.Tpo -c -o TaxiHandler.o ../../../src/game/TaxiHandler.cpp../../../src/game/TargetedMovementGenerator.cpp: In member function 'void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T&, bool)':
../../../src/game/TargetedMovementGenerator.cpp:114: error: no matching function for call to 'min(uint32&, long unsigned int&)'
../../../src/game/TargetedMovementGenerator.cpp: In member function 'void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T&, bool) [with T = Player, D = ChaseMovementGenerator<Player>]':
../../../src/game/TargetedMovementGenerator.cpp:269: instantiated from here
../../../src/game/TargetedMovementGenerator.cpp:114: error: no matching function for call to 'min(uint32, long unsigned int)'
../../../src/game/TargetedMovementGenerator.cpp: In member function 'void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T&, bool) [with T = Creature, D = ChaseMovementGenerator<Creature>]':
../../../src/game/TargetedMovementGenerator.cpp:281: instantiated from here
../../../src/game/TargetedMovementGenerator.cpp:114: error: no matching function for call to 'min(uint32, long unsigned int)'
../../../src/game/TargetedMovementGenerator.cpp: In member function 'void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T&, bool) [with T = Player, D = FollowMovementGenerator<Player>]':
../../../src/game/TargetedMovementGenerator.cpp:339: instantiated from here
../../../src/game/TargetedMovementGenerator.cpp:114: error: no matching function for call to 'min(uint32, long unsigned int)'
../../../src/game/TargetedMovementGenerator.cpp: In member function 'void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T&, bool) [with T = Creature, D = FollowMovementGenerator<Creature>]':
../../../src/game/TargetedMovementGenerator.cpp:352: instantiated from here
../../../src/game/TargetedMovementGenerator.cpp:114: error: no matching function for call to 'min(uint32, long unsigned int)'
make[3]: *** [TargetedMovementGenerator.o] Błąd 1
make[3]: *** Oczekiwanie na niezakończone zadania....
cat /proc/versionLinux version 2.6.32.2-xxxx-grs-ipv4-64 (---) (gcc version 4.3.2 (Debian 4.3.2-1.1) ) #1 SMP Tue Dec 29 14:41:12 UTC 2009
ACE libary external. ( --with-debug-info --disable-builtin-ace).
--- Edit:
diff --git a/src/game/TargetedMovementGenerator.cpp b/src/game/TargetedMovementGenerator.cppindex 85eb3be..e060152 100644
--- a/src/game/TargetedMovementGenerator.cpp
+++ b/src/game/TargetedMovementGenerator.cpp
@@ -22,6 +22,7 @@
#include "Creature.h"
#include "DestinationHolderImp.h"
#include "World.h"
//+#include <algorithm>
//#include "ace/High_Res_Timer.h"
#define SMALL_ALPHA 0.05f
@@ -111,7 +112,12 @@ void TargetedMovementGeneratorMedium<T,D>::_setTargetLocation(T &owner, bool upd
if (m_pathPointsSent < 2 || startIndex == 1 || i_recalculateTravel || owner.IsStopped())
{
// send 10 nodes, or send all nodes if there are less than 10 left
- m_pathPointsSent = std::min(uint32(10), pointPath.size() - startIndex);
+ #ifdef WIN32
+ m_pathPointsSent = std::min(uint32(10), pointPath.size() - startIndex);
+ #else
+ m_pathPointsSent = ((uint32(10) < (pointPath.size() - startIndex)) ? uint32(10) : (pointPath.size() - startIndex));
+ #endif
+
uint32 endIndex = m_pathPointsSent + startIndex;
// dist to next node + world-unit length of the path
Maybe ?
-
Mangos revision: 10206
Link to patch: http://gist.github.com/489162
Description:
Add options "send mail". There are some quest of this type.
Example - quest DK - http://www.wowhead.com/quest=12711
UPDATE quest_template SET WHERE StartScript = '', CompleteScript = '12711' entry = 12711; DELETE FROM `quest_end_scripts` WHERE id = `12711`; INSERT INTO `quest_end_scripts` VALUES(12711, 0, 20, 1, 3, 27760, 0, 0, 0, 0, 0, 0, 0); INSERT INTO `mail_template` (`id`, `title`, `text`, `item1`, `item1_count`, `item2`, `item2_count`, `item3`, `item3_count`, `item4`, `item4_count`, `item5`, `item5_count`) VALUES (1, 'News From The North', 'attachment below', 39317, 1, 0, 0, 0, 0, 0, 0, 0, 0);
*_scripts type 20:
* @datalong - mail_id
* @datalong2 (3 - CREATURE, 4 - OBJECT)
* @datalogn3 datalong2_guid or entry
Github account: Emtec
It work
-
Insider44(3.3.5)[mangos rev: 10176] + vehicle patch
and
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 32a60fd..6717860 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1694,7 +1694,7 @@ Vehicle* WorldObject::SummonVehicle(uint32 id, float x, float y, float z, float } if (x == 0.0f && y == 0.0f && z == 0.0f) - GetClosePoint(x, y, z, v->GetObjectSize()); + GetClosePoint(x, y, z, v->GetObjectBoundingRadius()); v->Relocate(x, y, z, ang); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index ec13a6f..42f89bf 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10325,9 +10325,9 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seat_id, bool force) return; m_movementInfo.SetTransportData(v->GetGUID(), - (veSeat->m_attachmentOffsetX + v->GetObjectSize()) * GetFloatValue(OBJECT_FIELD_SCALE_X), - (veSeat->m_attachmentOffsetY + v->GetObjectSize()) * GetFloatValue(OBJECT_FIELD_SCALE_X), - (veSeat->m_attachmentOffsetZ + v->GetObjectSize()) * GetFloatValue(OBJECT_FIELD_SCALE_X), + (veSeat->m_attachmentOffsetX + v->GetObjectBoundingRadius()) * GetFloatValue(OBJECT_FIELD_SCALE_X), + (veSeat->m_attachmentOffsetY + v->GetObjectBoundingRadius()) * GetFloatValue(OBJECT_FIELD_SCALE_X), + (veSeat->m_attachmentOffsetZ + v->GetObjectBoundingRadius()) * GetFloatValue(OBJECT_FIELD_SCALE_X), veSeat->m_passengerYaw, v->GetCreationTime(), seat_id, veSeat->m_ID, sObjectMgr.GetSeatFlags(veSeat->m_ID), v->GetVehicleFlags()); @@ -10380,7 +10380,7 @@ void Unit::ExitVehicle() vehicle->SetSpawnDuration(1); } } - v_size = vehicle->GetObjectSize(); + v_size = vehicle->GetObjectBoundingRadius(); vehicle->RemovePassenger(this); } SetVehicleGUID(0);
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index eae5df1..925710e 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3594,8 +3594,8 @@ void Aura::HandleAuraModStun(bool apply, bool Real) ((Player*)target)->m_movementInfo.SetMovementFlags(MOVEFLAG_NONE); target->SetStandState(UNIT_STAND_STATE_STAND);// in 1.5 client } - - if(!m_target->hasUnitState(UNIT_STAT_ON_VEHICLE)) + + if(!target->hasUnitState(UNIT_STAT_ON_VEHICLE)) { WorldPacket data(SMSG_FORCE_MOVE_ROOT, 8); data << target->GetPackGUID();
-
Confirm on rev. 10154
Just one player began to bg and
Here is an example, as you can see there say that BG is going to close in 1 day and 5 hours. -
This is good news I try write this code for 2 days - but, I used FindMap. It was my mistake.Very very thank man !!!
-
Tuxity - this is patch for TBC core ?
-
LordJZ - We do not understand. I do not mean - if someone can come or not. Because it works well. I mean the active column. I mean the active column. Mangos has to change status to active to 0 ( when all in-active ban).
I do not have any errors. Maybe I wrote wrong in the beginning. But in this code there is nothing wrong. I changed what was already in the code.
// cleanup query //set expired bans to inactive loginDatabase.Execute("UPDATE account_banned SET active = 0 WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate"); loginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate");
this is default code (startup realmd).
If you apply patch it is run from time to time. (chang column active to 0 - not we can connect to server).
So do not say that something is wrong. Because query has not changed. Only be carried out from time to time.
Query for web should be written based on the active column.Mangos decided that bans are not important.
Sorry if you don't understand me. Mayby, I should write "not remove bans, and changing the column active".
You know. I know - that i can build the web query with dates. But - when something is this column is "active".
A simple query on the side and behind. I realizes - that can be otherwise. But why.
-
LordJZ. Yes you are right. Player login > check ban > deactive ban per player.For me I noticed that it was not really working well.
My code doesn't delete ban per player (when he logs on). This code does delete all in-active ban (it needn't player logs on) - form time to time (AccountBanUpdateDelay).
This is my solution. This allows me to maintain order in the list ban.
/// Remove a ban from an account or IP address bool World::RemoveBanAccount(BanMode mode, std::string nameOrIP) { if (mode == BAN_IP) { loginDatabase.escape_string(nameOrIP); loginDatabase.PExecute("DELETE FROM ip_banned WHERE ip = '%s'",nameOrIP.c_str()); } else { uint32 account = 0; if (mode == BAN_ACCOUNT) account = sAccountMgr.GetId (nameOrIP); else if (mode == BAN_CHARACTER) account = sObjectMgr.GetPlayerAccountIdByPlayerName (nameOrIP); if (!account) return false; //NO SQL injection as account is uint32 loginDatabase.PExecute("UPDATE account_banned SET active = '0' WHERE id = '%u'",account); }
it need player logs on. (mangosd) - it doesn't delete ban when player not logs on
Realmd - only that I changed (when Server startup )
// cleanup query //set expired bans to inactive loginDatabase.Execute("UPDATE account_banned SET active = 0 WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate"); loginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate");
It work when startup server.
AuthSocket.cpp
///- If the account is banned, reject the logon attempt QueryResult *banresult = loginDatabase.PQuery("SELECT bandate,unbandate FROM account_banned WHERE " "id = %u AND active = 1 AND (unbandate > UNIX_TIMESTAMP() OR unbandate = bandate)", (*result)[1].GetUInt32()); if(banresult)
This only used select query. Not update & delete query.
Patch is not bad. Because I changed what it was.
Server does delete all ban when we turn on server, now - for time to time.
-
The server is deleting bans only when he is launching, he isn't doing it when he is already running in the meantime. I've changed that ( I have seen it as a must ). A player recently wrote to me that 2 days ago his ban was still present and was not removed
-
Currently bans are removed when we turn on server. During action server bans are not removed.
I tried to correct it. Now - ban are removed when running server
diff --git a/src/realmd/Main.cpp b/src/realmd/Main.cpp index f019e6d..0d4686e 100644 --- a/src/realmd/Main.cpp +++ b/src/realmd/Main.cpp @@ -57,6 +57,9 @@ void HookSignals(); bool stopEvent = false; ///< Setting it to true stops the server +uint32 m_AccountBanDelay = 0; +time_t m_AccountBanNext = time(NULL); + DatabaseType loginDatabase; ///< Accessor to the realm server database /// Print out the usage string for this program on the console. @@ -210,10 +213,8 @@ extern int main(int argc, char **argv) return 1; } - // cleanup query - //set expired bans to inactive - loginDatabase.Execute("UPDATE account_banned SET active = 0 WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate"); - loginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate"); + m_AccountBanDelay = sConfig.GetIntDefault( "AccountBanUpdateDelay", 20); + m_AccountBanNext = time(NULL) + m_AccountBanDelay; h.Add(&authListenSocket); @@ -270,6 +271,14 @@ extern int main(int argc, char **argv) ///- Wait for termination signal while (!stopEvent) { + + if(m_AccountBanDelay > 0 && m_AccountBanNext < time(NULL)){ + sLog.outDetail("Delete old account ban..."); + loginDatabase.Execute("UPDATE account_banned SET active = 0 WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate"); + loginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate"); + + m_AccountBanNext = time(NULL) + m_AccountBanDelay; + } h.Select(0, 100000); diff --git a/src/realmd/realmd.conf.dist.in b/src/realmd/realmd.conf.dist.in index 66335b7..04c88b9 100644 --- a/src/realmd/realmd.conf.dist.in +++ b/src/realmd/realmd.conf.dist.in @@ -81,6 +81,12 @@ ConfVersion=2007062001 # Default: 20 # 0 (Disabled) # +# AccountBanUpdateDelay +# Updating ban (exclusion is not active ban) +# Default: 20 +# 0 (Disabled) +# +# # WrongPass.MaxCount # Number of login attemps with wrong password before the account or IP is banned # Default: 0 (Never ban) @@ -111,6 +117,7 @@ LogColors = "" UseProcessors = 0 ProcessPriority = 1 RealmsStateUpdateDelay = 20 +AccountBanUpdateDelay = 20 WrongPass.MaxCount = 0 WrongPass.BanTime = 600 WrongPass.BanType = 0
I tested it. Code is working good.
(Github username: Emtec)
-
commit 9ae413e4a5568c8ccfbf0cdf26510675fa352126
Author: izidor.millenium <[email protected]>
Date: Thu Feb 25 18:26:32 2010 +0100
- ACE multithread map lock for spell update
Signed-off-by: izidor.millenium <[email protected]>
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index cbe69fd..1e1a2e9 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -310,8 +310,10 @@ void Unit::Update( uint32 p_time )
// WARNING! Order of execution here is important, do not change.
// Spells must be processed with event system BEFORE they go to _UpdateSpells.
// Or else we may have some SPELL_STATE_FINISHED spells stalled in pointers, that is bad.
+ sWorld.m_spellUpdateLock.acquire();
m_Events.Update( p_time );
_UpdateSpells( p_time );
+ sWorld.m_spellUpdateLock.release();
CleanupDeletedAuras();
diff --git a/src/game/World.h b/src/game/World.h
index 8a4b370..961c5bd 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -545,6 +545,7 @@ class World
//used Script version
void SetScriptsVersion(char const* version) { m_ScriptsVersion = version ? version : "unknown scripting library"; }
char const* GetScriptsVersion() { return m_ScriptsVersion.c_str(); }
+ ACE_Thread_Mutex m_spellUpdateLock;
protected:
void _UpdateGameTime();
It is wrong solution.
+ ACE_Thread_Mutex m_spellUpdateLock;
How much is a instance class World ? = 1.
Then we take the mutex. How many units? - Each player, vehicle, npc.
Each update get mutex, in that time others threads is waiting for the queue. This creates a "bottleneck."
How many maps is the npc? - 1.
Why update was to be made from more than one thread?
Solutions must be sought - mutexs are not needed.
If two threads at once the update (), the problem lies elsewhere. Mutexs do not fix it.
(Sorry for my english)
-
Sorry for telling my problems, but I'm not friends with linux libs .- TBB
cd /root
wget http://www.threadingbuildingblocks.o...809oss_src.tgz
tar xvfz tbb22_20090809oss_src.tgz
mv tbb22_20090809oss tbb
cd tbb/src
make
cd /root/tbb/build/linux*release
chmod 777 tbbvars.sh
./tbbvars.sh
cd /root/tbb/build/linux*release
cp *.2 /usr/lib
cd /usr/lib
ln -s libtbb.so.2 libtbb.so
ln -s libtbbmalloc.so.2 libtbbmalloc.so
ln -s libtbbmalloc_proxy.so.2 libtbbmalloc_proxy.so
// --------------------------------------
- ACE
wget http://download.dre.vanderbilt.edu/previous_versions/ACE-5.7.6.tar.gz
tar xvzf ACE-5.7.6.tar.gz
mv ACE_wrappers ACE
cd ~/ACE/
mkdir build
cd build
../configure
make
make install
ls -s /path/to_ACCE/libACE-5.7.6.so /usr/lib/libACE-5.7.6.so
you have used command make install ?
-
I made it too ! ... what a mess !
what error message pops up?
-
tbb works but when I configure mangos sources, configure tells me that I've not installed ACE (because I desactivated the included ACE files) but there is some ACE files in /usr/local/ (I've linked this with /usr/ too)
Debian need /usr/lib/
ls -s /path/to_ace/libACE-5.7.6.so /usr/lib/libACE-5.7.6.so expamle.
-
lo, i'm stupid how could I forget: (
one big thanks KERO
how to (for debian):
cd /rootwget http://www.threadingbuildingblocks.org/uploads/77/142/2.2/tbb22_20090809oss_src.tgz
tar xvfz tbb22_20090809oss_src.tgz
mv tbb22_20090809oss tbb
cd tbb/src
make
cd /root/tbb/build/linux*release
chmod 777 tbbvars.sh
./tbbvars.sh
and
cd /root/tbb/build/linux*releasecp *.2 /usr/lib
cd /usr/lib
ln -s libtbb.so.2 libtbb.so
ln -s libtbbmalloc.so.2 libtbbmalloc.so
ln -s libtbbmalloc_proxy.so.2 libtbbmalloc_proxy.so
and
-
/usr/bin/ld: cannot find -ltbb collect2: ld returned 1 exit status make[3]: *** [mangos-realmd] Error 1 make[3]: Leaving directory `/home/test/objdir/src/realmd' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/test/objdir/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/test/objdir' make: *** [all] Error 2
-
*NOTE: Remove objdir and do again:
autoreconf --install --force
Yeap, I know, always do the changes in makefile
automake src/bindings/ScriptDev2/MakefileNot need, my makefile = mangos + sd2
generally have fun. On one thread I have compilation errors . Live not to die: D
-
Kero - you have compilation errors when compiled tbb in threads?
-
During compilation, I have the same errors
Ubuntu = debian + packet
I have 2x disks hardware 500GB + raid 0 + hardware controller raid
system file: ext3
[10870][patch] Removing character and friend list
in ... acceptedOld
Posted
What bug does the patch fix? What features does the patch add?
Delete characters from friend list when friend are online.
For which repository revision was the patch created?
MaNGOS/master
Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.
If We deleted character and our friends are online. Our friends will have "non existing" in friends list.
Who has been writing this patch? Please include either forum user names or email addresses.
Emtec on github.
Link to patch
https://gist.github.com/738573
Need test. I'll update my server tommorow (sorry)