fix news loading

This commit is contained in:
HarpyWar 2014-07-08 23:00:29 +04:00
parent 5d7049ca18
commit 039ad8adf3
3 changed files with 11 additions and 7 deletions
conf/i18n
src/bnetd

View file

@ -1,9 +1,8 @@
{03/28/2014}
(edit this text in conf/news.txt)
Note that Warcraft 3 client caches news in bncache.dat
(remove the file on the client side before login to see the changes immediately)
{03/29/2014}
Note that text of news is cached in Warcraft 3 client. Be careful when deleting existing news -
it remain on a client side until bncache.dat won't be removed or outdated!
A file news.txt is loaded once when the server starts. Use command "/rehash news" to reload the file.
New support channel at:

View file

@ -34,6 +34,7 @@ namespace pvpgn
#define JUST_NEED_TYPES
# include <string>
# include "connection.h"
# include "common/format.h"
#undef JUST_NEED_TYPES

View file

@ -27,6 +27,9 @@
#include "common/eventlog.h"
#include "common/xalloc.h"
#include "common/tag.h"
#include "i18n.h"
#include "common/setup_after.h"
namespace pvpgn
@ -142,7 +145,8 @@ namespace pvpgn
return -1;
}
if ((fp = std::fopen(filename, "rt")) == NULL) {
// FIXME: (HarpyWar) change news loading when user log on to send a localized version
if ((fp = std::fopen(i18n_filename(filename, GAMELANG_ENGLISH_UINT), "rt")) == NULL) {
eventlog(eventlog_level_warn, __FUNCTION__, "can't open news file");
_news_insert_default();
return 0;