Closed flashultra closed 7 years ago
About IBuddyManager , I agree with you.
What exactly is the issue with ByteArray ? I tested on flash and js at the moment and not find any problem. The main problem for me was with Smartfox Javascript API i.e. I found Bytes is just Array
Can you pull the latest version and modify your pull request or make a new one? Here is a summary.
Modifications I want to keep : com/smartfoxserver/v2/core/SFSBuddyEvent.hx com/smartfoxserver/v2/core/SFSIOHandler.hx com/smartfoxserver/v2/entities/SFSBuddy.hx com/smartfoxserver/v2/entities/SFSUser.hx com/smartfoxserver/v2/entities/data/SFSObject.hx com/smartfoxserver/v2/entities/managers/SFSBuddyManager.hx com/smartfoxserver/v2/requests/BaseRequest.hx com/smartfoxserver/v2/requests/SubscribeRoomGroupRequest.hx com/smartfoxserver/v2/requests/buddylist/BuddyMessageRequest.hx
Modifications I don't want to keep : com/smartfoxserver/v2/SmartFox.hx com/smartfoxserver/v2/entities/managers/SFSBuddyManager.hx ( isInited is a property in both flash and js) com/smartfoxserver/v2/entities/match/IMatcher.hx
Thank you for merge my request. About bytearray , here is my code for using getByteArray(..) from SFSObject
#if html5
var arrInt:Array<Int> = sfso.getByteArray("d");
var bt:Bytes = Bytes.alloc(arrInt.length);
for (i in 0...arrInt.length)
bt.set(i, arrInt[i]);
var ba:BytesData = bt.getData();
#else
var ba: ByteArray = sfso.getByteArray("d");
#end
Also there is bug for flash target when use Bytes.ofData(ba); https://github.com/HaxeFoundation/haxe/issues/6556 i.e you should use
#if flash
b.endian = flash.utils.Endian.LITTLE_ENDIAN;
#end
after each call of Bytes.ofData(....) Thank you again.
You are welcome. Thank you for getByteArray code. I will try to integrate it to my test project : https://github.com/boorik/smartfox-haxe-mmo This is an adaptation of the SimpleMMOWorld2 example from smarfoxserver site. It's quite messy but I will make it cleaner when everything will work. I will also make a test project to validate app ( maybe some functional tests ) from this mmo project. We need to test on all targets to prevent regression.
This pull request contains many small changes. About SFSObject.hx , in js Bytes is represent as Array , so to work correctly I change it.