Skip to content

Commit

Permalink
Core/Misc: Remove the use of logging system from WPFatal (Fixes tools…
Browse files Browse the repository at this point in the history
… compile)

Closes #9501
  • Loading branch information
xurxogr committed Mar 26, 2013
1 parent d03da13 commit 3c6c8c1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/server/collision/CMakeLists.txt
Expand Up @@ -83,6 +83,10 @@ add_library(collision STATIC
${collision_STAT_PCH_SRC}
)

target_link_libraries(collision
shared
)

# Generate precompiled header
if (USE_COREPCH)
add_cxx_pch(collision ${collision_STAT_PCH_HDR} ${collision_STAT_PCH_SRC})
Expand Down
25 changes: 21 additions & 4 deletions src/server/shared/Debugging/Errors.cpp
@@ -1,5 +1,22 @@
/*
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* 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 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, see <http://www.gnu.org/licenses/>.
*/

#include "Errors.h"
#include "Log.h"

#include <ace/Stack_Trace.h>
#include <ace/OS_NS_unistd.h>
Expand All @@ -16,22 +33,22 @@ void Assert(char const *file, int line, char const *function, char const *messag

void Fatal(char const *file, int line, char const *function, char const *message)
{
sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s FATAL ERROR:\n %s\n",
fprintf(stderr, "\n%s:%i in %s FATAL ERROR:\n %s\n",
file, line, function, message);
ACE_OS::sleep(10);
*((volatile int*)NULL) = 0;
}

void Error(char const *file, int line, char const *function, char const *message)
{
sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s ERROR:\n %s\n",
fprintf(stderr, "\n%s:%i in %s ERROR:\n %s\n",
file, line, function, message);
*((volatile int*)NULL) = 0;
}

void Warning(char const *file, int line, char const *function, char const *message)
{
sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s WARNING:\n %s\n",
fprintf(stderr, "\n%s:%i in %s WARNING:\n %s\n",
file, line, function, message);
}

Expand Down
18 changes: 18 additions & 0 deletions src/server/shared/Packets/ByteBuffer.cpp
@@ -1,3 +1,21 @@
/*
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* 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 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, see <http://www.gnu.org/licenses/>.
*/

#include "ByteBuffer.h"
#include "Log.h"

Expand Down

11 comments on commit 3c6c8c1

@xurxogr
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WPAssert wasn't using logging system
WPError and WPWarnings are unused
WPFatal was only used when connecting to DB

So makes sense to me to remove Logging system from this file... also probably now makes sense to move function back to .h to remove the need to link shared to collision

@Krogonos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, and +1 on adding the licenses and copyright holders.

@JasperAppec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why mangos copyright? :)

@Dokman
Copy link

@Dokman Dokman commented on 3c6c8c1 Mar 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple TrinityCore is derived from Massive Network Game Object Server

@JasperAppec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple TrinityCore is derived from Massive Network Game Object Server

... You don't say? That doesn't mean files created newly solely for and by TrinityCore need copyright to mangos. >_>

@Dokman
Copy link

@Dokman Dokman commented on 3c6c8c1 Mar 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but is derived from MaNGOS, he have his credits you have tyu understand it, and althought have a base of MaNGOS, for this reason put the copyright of MaNGOS you understand this?

@Dokman
Copy link

@Dokman Dokman commented on 3c6c8c1 Mar 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rsa @boxa @mns have contributed alot in this time to TrinityCore

@Aokromes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only add Mangos credits on files that comes from Mangos, on own Trinitycore files or full rewriten files there is no need of add Mangos (C) or can be removed.

@JasperAppec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dokman please...

@killradio
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hahaha nice catch @Discover! I bet there are bunch of files in tc with wrong copyrights...

@xurxogr
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was a copy and paste :) in fact no need to be there.

Please sign in to comment.