DecodeSFSObject Exception!

Post here your questions about the C++ API for SFS2X

Moderators: Lapo, Bax, MBagnati

Post Reply
scofy
Posts: 79
Joined: 08 Apr 2012, 09:04

DecodeSFSObject Exception!

Post by scofy »

Code: Select all

ISFSObject* DefaultSFSDataSerializer::DecodeSFSObject(ByteArray* buffer)
{
	SFSObject* sfsObject = SFSObject::NewInstance();
						
	// Get tpyeId
	unsigned char headerByte;
	buffer->ReadByte(headerByte);
						
	// Validate typeId
	if (headerByte != (unsigned char)SFSDATATYPE_SFS_OBJECT) 
	{
		string* err = new string();

		string* format = new string("Invalid SFSDataType. Expected: %d, found: %d");
		StringFormatter<long int, unsigned char> (err, format, SFSDATATYPE_SFS_OBJECT, headerByte);

		delete format;
		format = NULL;

		boost::shared_ptr<SFSCodecError> exception(new SFSCodecError(err));
		throw exception;
	}
While client receive a big packet and decode,it will throw a exception.In this scenario,the buffer size is 1984 bytes,and client crash.
+ px 0x03763338 {message=0x03782880 "Invalid SFSDataType. Expected: 18, found: 120" } Sfs2X::Exceptions::SFSCodecError *
bqlf1907
Posts: 25
Joined: 13 May 2013, 10:28

Re: DecodeSFSObject Exception!

Post by bqlf1907 »

No one answers???
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: DecodeSFSObject Exception!

Post by Bax »

The issue is being investigated.
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: DecodeSFSObject Exception!

Post by Bax »

Paolo Bax
The SmartFoxServer Team
Post Reply