Author Topic: Interlude Announcements Empty load  (Read 88 times)

Online Dagger

  • Heir
  • **
  • Posts: 21
Announcements Empty load
« on: September 12, 2020, 03:19:20 AM »
game\data\announcements.txt



If the file is empty, it weighs 1kb, the UTF-8 encoding must be changed to UTF-8 (sans Bom)



http://www.mediafire.com/file/1gow4pyx3i4i0ud/announcements.rar/file

Online Mobius

  • Administrator
  • Distinguished King
  • *****
  • Posts: 7700
Re: Announcements Empty load
« Reply #1 on: September 13, 2020, 11:55:32 AM »
I wanted to move announcements to SQL because of this.
Too busy with Homunculus Ch. 2 and Essence atm.

Online Dagger

  • Heir
  • **
  • Posts: 21
Re: Announcements Empty load
« Reply #2 on: September 13, 2020, 03:54:48 PM »
I think it is better that it is by txt and not by database the less queries to the database the better Here a small modification to correct the problem  ;)

=========================================
index org.l2jmobius.gameserver.model.entity.Announcements.java
=========================================

Code: [Select]
private void readFromDisk(final File file)
{
LineNumberReader lnr = null;
FileReader reader = null;
try
{
int i = 0;

String line = null;
reader = new FileReader(file);
lnr = new LineNumberReader(reader);
+ if(lnr.read()==-1)
+ return;
while ((line = lnr.readLine()) != null)

[13/09 10:49:26] Announcements: Loaded 0 Announcements.


Online Mobius

  • Administrator
  • Distinguished King
  • *****
  • Posts: 7700