Jump to content

lp-vamp

Members
  • Posts

    24
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by lp-vamp

  1. I do not think that the project will become bloated. There are some additions and changes in the past. Some parts are gone because of the reason that no one had used it over time. I've seen structure changes in parts of the code, some features changed from hard coded to db-content, better look and feel all about. So what about new content, nice patches and additions. I've seen that mangos will support many patches, but it is bound to some conditions how the patch will be find its way to the core. The patch has to match the mangos structure of coding and should be nearly free of so called "hacks" (this definition is described here in forums in long terms). The more the patch is tested the better. These are all the things the patch writer or community can do. The rest depends on the devs. The patch can be the best in your life, but without the review of a dev it will be stuck in paches and it will not find it's way to the core. The importend part here is. The dev have to look in your code and test it for all the flavour. Maybe he'll modify it a bit, understand the meaning of every funktion bevor he get a fully understanding of the whole patch. Only if the devs are able to support and understand this patch code they might do decide it to implement in core. In my basic understanding, a patch find its way into the core when: - it has mangos coding style - only needed Hacks (witch is hard to determine) - tested and reviewed by community and dev - the devs are able to manage the code, take support and more - dev team descisions (is the funktion nessesary, other ways of implementation, un/wanted feature because of reasons) It is up to us. Personaly i would prefer every patch to be reviewed, but time is expensive. I'am looking forward. maybe the is some patch in review of the dev that i am not aware of yet. cheers
  2. No update here for more than a year. It seems that the thread owner is not updating any more. Please release the sticky or create a new thread with the same intention. Interesting GIT Branches is needed updated. cheers
  3. What about solutions about time hops? Some of them might happen, but rare. - User Time change while server running ( no seriously) - Summe/Winter time change (two a year) The funktion GetTickCount() returns the time ticks since system-boot-up, why not try to count your own timer in one variable to solve some issues? Timer Thread( uint64 globaltimevalue init( globaltimevalue==0 old_time=GetTickCount() ) run( new_time=GetTickCount() if (old_time<=new_time) globatimevalue=globaltimevalue+(new_time-old_time) if (old_time>new_time) // do noting because some time hopp has happend and we don't know the time between old_time==GetTickCount() ) uint64 getglobaltimevalue( return globaltimevalue) ) The Thead should be called by the world class and returns the positive value of time ticks since world start. The common funktion should be able to calculate new_globalvalue-old_globalvalue for time_diff Maybe i'am totaly wrong, but this thought flashed through my mind cheers
  4. every variable is limited in size. The question is quite right. How much time diff would we like to count? The 49 Days is quite huge but i can remember i've my server projekt online for one month with ~10ppl. In my oppinion i would spend a larger range of time diff, larger than 49 days. In my programming skills i would try to catch the overflow and count tha to another variable. So at the end it would end in two uint32 = one uint64 varible. uint64 sounds good to me cheers
  5. hello, in git commit [10879] you have removed the description in mangosd.conf.dist.in: -# SocketSelectTime -# Socket select time (in milliseconds) -# Default: 10000 (10 secs) -# but you have missed the real option: MaxOverspeedPings = 2 GridUnload = 1 -SocketSelectTime = 10000 GridCleanUpDelay = 300000 MapUpdateInterval = 100 cheers
  6. Thanks for the finding Schmoozerd, even if you coded a solution that not fit in the current way of processing Go's per Type. Its a learning project. I don't thing anyone is willing to code a hack here.
  7. You should think of an "Press any key to continue" feature.. some new users my fail, because they could not read the text.. (Command Window close immediately situation)
  8. Documentation of structue, class and code could be in text and graphic forms. To generate a UML class diagram of the code you can reverse engeneering the code-base. Every class could be introduce with some lines of clear text. Doxygen is a good point for a dictionary where to search names/variables/references within. Entety Relation diagram for the DB-structure, i am sure i've seen some pictures here in the past.
  9. Your log will be created in MovementHandler.cpp void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data) { sLog.outDebug("WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); recv_data.hexlike(); uint64 old_mover_guid; if(!recv_data.readPackGUID(old_mover_guid)) return; if(_player->m_mover->GetGUID() == old_mover_guid) { sLog.outError("HandleMoveNotActiveMover: incorrect mover guid: mover is " I64FMT " and should be " I64FMT " instead of " UI64FMTD, _player->m_mover->GetGUID(), _player->GetGUID(), old_mover_guid); recv_data.rpos(recv_data.wpos()); // prevent warnings spam return; } MovementInfo mi; mi.guid = old_mover_guid; ReadMovementInfo(recv_data, &mi); _player->m_movementInfo = mi; } and for me it seems that there is some not working Mind Control cheers
  10. My starting point in mangos was http://amki.kicks-ass.org/doxygens/mangos/main.html I hope that someone will reactivate a online doxygen documentation or something similar. It is nice as reverence to class and structures when no developement tool is avaiable. cheers
  11. What bug does the patch fix? What features does the patch add? This patch limit the line size of the log file. The information will be stored in two files. One file is filled with logging data. If the file reaches max line size the other fille will be filled. The logging data that exeeds 2*size_of_lines (two log files) is not stored, an will be lost. For which repository revision was the patch created? Rev. 8987 Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread. this thread for testing Who has been writing this patch? Please include either forum user names or email addresses. lp-vamp diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index 479a6ce..a62a646 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -1,4 +1,4 @@ -##################################### +##################################### # MaNGOS Configuration file # ##################################### ConfVersion=2008080101 @@ -223,6 +223,11 @@ AddonChannel = 1 # 0 = Minimum; 1 = Error; 2 = Detail; 3 = Full/Debug # Default: 0 # +# LogFileSize +# Server logging file size +# 0 = disabled +# Default: 0 +# # LogFilter_AchievementUpdates # LogFilter_CreatureMoves # LogFilter_TransportMoves @@ -298,6 +303,7 @@ LogTime = 0 LogFile = "Server.log" LogTimestamp = 0 LogFileLevel = 0 +LogFileSize = 0 LogFilter_AchievementUpdates = 1 LogFilter_CreatureMoves = 1 LogFilter_TransportMoves = 1 diff --git a/src/shared/Log.cpp b/src/shared/Log.cpp index 429b089..c5d69b4 100644 --- a/src/shared/Log.cpp +++ b/src/shared/Log.cpp @@ -249,6 +249,10 @@ void Log::Initialize() // Char log settings m_charLog_Dump = sConfig.GetBoolDefault("CharLogDump", false); + + // Log File size + m_count_lines = 0; + m_file_size_limit = sConfig.GetIntDefault("LogFileSize", 0); } FILE* Log::openLogFile(char const* configFileName,char const* configTimeStampFlag, char const* mode) @@ -266,6 +270,8 @@ FILE* Log::openLogFile(char const* configFileName,char const* configTimeStampFla logfn += m_logsTimestamp; } + if(strcmp(configFileName,"LogFile")==0 && log_filename.empty()) { log_filename=log_filename.append(m_logsDir+logfn); } + return fopen((m_logsDir+logfn).c_str(), mode); } @@ -340,6 +346,7 @@ void Log::outTitle( const char * str) fprintf(logfile, str); fprintf(logfile, "\\n" ); fflush(logfile); + swapLogFile(); } fflush(stdout); @@ -355,6 +362,7 @@ void Log::outString() outTimestamp(logfile); fprintf(logfile, "\\n" ); fflush(logfile); + swapLogFile(); } fflush(stdout); } @@ -390,6 +398,7 @@ void Log::outString( const char * str, ... ) va_end(ap); fflush(logfile); + swapLogFile(); } fflush(stdout); } @@ -426,6 +435,7 @@ void Log::outError( const char * err, ... ) fprintf(logfile, "\\n" ); fflush(logfile); + swapLogFile(); } fflush(stderr); } @@ -463,6 +473,7 @@ void Log::outErrorDb( const char * err, ... ) fprintf(logfile, "\\n" ); fflush(logfile); + swapLogFile(); } if(dberLogfile) @@ -513,6 +524,7 @@ void Log::outBasic( const char * str, ... ) fprintf(logfile, "\\n" ); va_end(ap); fflush(logfile); + swapLogFile(); } fflush(stdout); } @@ -552,6 +564,7 @@ void Log::outDetail( const char * str, ... ) fprintf(logfile, "\\n" ); fflush(logfile); + swapLogFile(); } fflush(stdout); @@ -616,6 +629,7 @@ void Log::outDebug( const char * str, ... ) fprintf(logfile, "\\n" ); fflush(logfile); + swapLogFile(); } fflush(stdout); } @@ -652,6 +666,7 @@ void Log::outCommand( uint32 account, const char * str, ... ) fprintf(logfile, "\\n" ); va_end(ap); fflush(logfile); + swapLogFile(); } if (m_gmlog_per_account) @@ -760,6 +775,7 @@ void Log::outMenu( const char * str, ... ) fprintf(logfile, "\\n" ); fflush(logfile); + swapLogFile(); } fflush(stdout); } @@ -781,6 +797,29 @@ void Log::outRALog( const char * str, ... ) fflush(stdout); } +void Log::swapLogFile() +{ + if (logfile && m_file_size_limit>0) // there is a logfile and a size limit + { + if(m_count_lines >= m_file_size_limit) + { + m_count_lines=0; + if(log_size_limit_filename.empty()) // generate backup file name if empty + { + size_t dot_pos = log_filename.find_last_of("."); + log_size_limit_filename.append(log_filename); + log_size_limit_filename.insert(dot_pos,"_part"); + } + // close the logfile, remove, rename, open new logfile .. TODO Error Handling + fclose(logfile); + remove(log_size_limit_filename.c_str()); + rename(log_filename.c_str(),log_size_limit_filename.c_str()); + logfile=fopen(log_filename.c_str(), "w"); + } + else {m_count_lines++;} + } +} + void outstring_log(const char * str, ...) { if( !str ) @@ -849,4 +888,4 @@ void error_db_log(const char * str, ...) va_end(ap); sLog.outErrorDb(buf); -} +} \\ No newline at end of file diff --git a/src/shared/Log.h b/src/shared/Log.h index 2500c67..ce35f43 100644 --- a/src/shared/Log.h +++ b/src/shared/Log.h @@ -155,6 +155,13 @@ class Log : public MaNGOS::Singleton<Log, MaNGOS::ClassLevelLockable<Log, ACE_Th // gm log control bool m_gmlog_per_account; std::string m_gmlog_filename_format; + + // log file size limit + uint32 m_file_size_limit; // limit size <= 0 deaktivate + uint32 m_count_lines; // count the lines in the log file + std::string log_filename; + std::string log_size_limit_filename; + void swapLogFile(); }; #define sLog MaNGOS::Singleton<Log>::Instance()
  12. I've made some progress in coding. For me it's long time ago since i have to code in c++ but still.. seems to go smooth. I've witten some lines (hardcoded values) witch are able to split the logfile in two files of limited size (eg.100 lines). This is revision 0. Step by step I'll go further. My destination is a seperated logfile / debuglevel 3 / limited lines / rotation cheers
  13. If you need a tool that copy the last ammount of given lines to a extra file you can do so by coding it into the mangos core, or code a simple application. The application could generate a log file with the last (100) lines out of the log. If the detail level is up to 3, you get full info.This application has the charm that it could be run only once your server crashed. Another approach would be to place this code into the core with hardcoded loglevel 3. So the user can choose a normal log file with log debug 0-3, and (if enabled) he would get the detailes log also. In this case, the extra generation of another log file have to be triggered in core. Need extra time. I don't know what i would prefer. Disk operations are realy cost intensive in speed performance.
  14. yes, win 1.0 ... nice one http://en.wikipedia.org/wiki/File:Windows_1_0_crash.png
  15. is this the right place where we can scan the \\124 messages? void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) Maybe it is possible to log and trace the messages at this point. I know there is source git for a chat logger with lyrics check. Are all \\124 handled by this opcocde, or are there some others to mention? I am not be able to find any further information about \\124 commands. thx
  16. lazy.. hmm.. why not try to use search content "sendmail"..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use