abnr / fluorescence

Automatically exported from code.google.com/p/fluorescence
GNU General Public License v3.0
0 stars 0 forks source link

Client crash #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
At entering at world client crashed (log and screenshot at attachments). Some 
times client crashed befor world rendered. At left corner of screen you can see 
some trash, it's not russian characters. It's seems to it is some problem with 
encodings and font's any ideas? )

Original issue reported on code.google.com by staticz@uoquint.ru on 17 Aug 2012 at 12:15

Attachments:

GoogleCodeExporter commented 9 years ago
Hm.. Some times it dosn't crashed, but more often crashes... very strange 
bug... It's seems it can enter world while server is offline... )))

next step 0xA9 Packet it's again wrong for HS.

It must be smt like this:

    if (fluo::net::Manager::getSingleton()->getProtocolVersion() >= ProtocolVersion::HS) // this code is not only for HS but for SA clients above 7.0.13.0
        for (unsigned int i = 0; i < cityCount_; ++i) {
            ret &= PacketReader::read(buf, len, index, idx);
            cityIndices_.push_back(idx);

            ret &= PacketReader::readUtf8Fixed(buf, len, index, tmp, 32);
            cityNames_.push_back(tmp);

            ret &= PacketReader::readUtf8Fixed(buf, len, index, tmp, 32);
            tavernNames_.push_back(tmp);

            uint32_t temp; // just read and skip values
            PacketReader::read(buf, len, index, temp);  // X
            PacketReader::read(buf, len, index, temp);  // Y
            PacketReader::read(buf, len, index, temp);  // Z 
            PacketReader::read(buf, len, index, temp);  // Map
            PacketReader::read(buf, len, index, temp);  // Description (cliloc ID)
            PacketReader::read(buf, len, index, temp);  // 0
        }
    else 
        for (unsigned int i = 0; i < cityCount_; ++i) {
            ret &= PacketReader::read(buf, len, index, idx);
            cityIndices_.push_back(idx);

            ret &= PacketReader::readUtf8Fixed(buf, len, index, tmp, 31);
            cityNames_.push_back(tmp);

            ret &= PacketReader::readUtf8Fixed(buf, len, index, tmp, 31);
            tavernNames_.push_back(tmp);
        }

    unsigned int readSize = (fluo::net::Manager::getSingleton()->getProtocolVersion() >= ProtocolVersion::HS) // this code is not only for HS but for SA clients above 7.0.13.0
                          ? 5 + charCount_*60 + cityCount_*89 : 5 + charCount_*60 + cityCount_*63;

Original comment by staticz@uoquint.ru on 17 Aug 2012 at 4:08

GoogleCodeExporter commented 9 years ago
PS Please Ither delete default config ither don't forget to update it's 
content. I spend a lot of time trying understand why anything doesn't work 
looking for it....

Original comment by staticz@uoquint.ru on 17 Aug 2012 at 4:13

GoogleCodeExporter commented 9 years ago
I made misstake in last line, the correct one:

if (fluo::net::Manager::getSingleton()->getProtocolVersion() >= 
ProtocolVersion::HS) // this code is not only for HS but for SA clients above 
7.0.13.0
        for (unsigned int i = 0; i < cityCount_; ++i) {
            ret &= PacketReader::read(buf, len, index, idx);
            cityIndices_.push_back(idx);

            ret &= PacketReader::readUtf8Fixed(buf, len, index, tmp, 32);
            cityNames_.push_back(tmp);

            ret &= PacketReader::readUtf8Fixed(buf, len, index, tmp, 32);
            tavernNames_.push_back(tmp);

            uint32_t temp; // just read and skip values
            PacketReader::read(buf, len, index, temp);  // X
            PacketReader::read(buf, len, index, temp);  // Y
            PacketReader::read(buf, len, index, temp);  // Z 
            PacketReader::read(buf, len, index, temp);  // Map
            PacketReader::read(buf, len, index, temp);  // Description (cliloc ID)
            PacketReader::read(buf, len, index, temp);  // 0

            unsigned int readSize = 5 + charCount_*60 + cityCount_*89;
            if (size_ - readSize == 4 || size_ - readSize == 6) {
                PacketReader::read(buf, len, index, flags_);
            }
            if (size_ - readSize == 6) {
                uint16_t temp2; // just read and skip values
                PacketReader::read(buf, len, index, temp2);  // Last Character Slot
            }
        }
    else 
        for (unsigned int i = 0; i < cityCount_; ++i) {
            ret &= PacketReader::read(buf, len, index, idx);
            cityIndices_.push_back(idx);

            ret &= PacketReader::readUtf8Fixed(buf, len, index, tmp, 31);
            cityNames_.push_back(tmp);

            ret &= PacketReader::readUtf8Fixed(buf, len, index, tmp, 31);
            tavernNames_.push_back(tmp);

            unsigned int readSize = 5 + charCount_*60 + cityCount_*63;
            if (size_ - readSize == 4) {
                PacketReader::read(buf, len, index, flags_);
            }
        }

Original comment by staticz@uoquint.ru on 17 Aug 2012 at 5:18

GoogleCodeExporter commented 9 years ago
maybe it's better to name protocol as client version like runuo: 
"post6.0.14.3", "post7.0.13.0", etc?  

Original comment by staticz@uoquint.ru on 17 Aug 2012 at 5:35

GoogleCodeExporter commented 9 years ago
i found line in manager.cpp

void Manager::systemMessage(const UnicodeString& msg, unsigned int hue, 
unsigned int font) {
    LOG_INFO << "SysMsg: " << msg << std::endl;

    sysLog_->add(msg, hue, font);

    // TODO: add to journal
}

and delted "sysLog_->add(msg, hue, font);" now client doesn't crashing at 
lohing, but ofcourse there are no any text... So the problem is related with 
fontengine. 

Original comment by staticz@uoquint.ru on 17 Aug 2012 at 7:43

GoogleCodeExporter commented 9 years ago
It's difficult without debuger.. ))

Original comment by staticz@uoquint.ru on 17 Aug 2012 at 7:44

GoogleCodeExporter commented 9 years ago
With the most recent version, the debugger was working (at least on my 
computer).
Maybe this is related to one of the changes I had to make to get the debugger 
running: 

misc/string.cpp, try changing line 34 back to
UnicodeString ret = UnicodeString::fromUTF8(string);

It did not work for me in the debugger, maybe I should use some preprocessor 
instructions around it. 

I'll integrate the packet fix in one of the next updates.

Original comment by spin@fluorescence-client.org on 18 Aug 2012 at 5:55

GoogleCodeExporter commented 9 years ago
should be fixed in the next release

Original comment by spin@fluorescence-client.org on 9 Nov 2012 at 7:14