Unicode Problem on SFS2X Server with C++ Client Api
Posted: 08 Mar 2016, 15:55
Hi,
I used C++ SFS2X Client Api.
When I sent params value of UNICODE STRING, the server show this Error:
Error deserializing request: java.nio.BufferUnderflowException
My client Code For Sending Data To server:
------MY SERVER CODE-------
When I sent Unicode data from server to client, the client receive correct ascii value part, but incorrect unicode value
Client Code to receive data from server
The client will correctly received "Welcome ..." but the unicode part is wrong (/303/302)
Any suggestion?
Thanks;
I used C++ SFS2X Client Api.
When I sent params value of UNICODE STRING, the server show this Error:
Error deserializing request: java.nio.BufferUnderflowException
My client Code For Sending Data To server:
Code: Select all
boost::shared_ptr<ISFSObject> params (new SFSObject());
params->PutUtfString("test", ("helloសាកល្បង");
boost::shared_ptr<IRequest> request (new ExtensionRequest("cmi", params));
GameServer::getSingleton().getSmartFox()->Send(request);
------MY SERVER CODE-------
When I sent Unicode data from server to client, the client receive correct ascii value part, but incorrect unicode value
Code: Select all
ISFSObject notiparams = SFSObject.newInstance();
notiparams.putUtfString("notiMSG", "Welcome ... សាកល្បង");
this.send("notiRMFF", notiparams, user);
Client Code to receive data from server
Code: Select all
boost::shared_ptr<string> cmdx = ((boost::static_pointer_cast<string>)(param->GetUtfString("notiMSG")));
CCLog("Server Mess:%s",cmdx->c_str());
The client will correctly received "Welcome ..." but the unicode part is wrong (/303/302)
Any suggestion?
Thanks;