Hi everyone,
I'm using sfs client like: https://github.com/chapatiz/smartfox-haxe-client, but cannot connect. My project is html5 project. Can you help me, thank all
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
here the connectWithConfig doesn't exist with html5 |
try{ |
#if html5 |
sfs.connect(); |
#else |
sfs.connectWithConfig(config); |
> You received this message because you are subscribed to a topic in the Google Groups "Haxe" group.
I'm thinking must to add js library but i don't know how to do. I will try with this way. Thank you so much :D
CheersIt's not really hard to handle. I will try to add some doc about it tomorrow.some code must be changed in your project using compilation flags because the api function are not exactly the sames :I spend some time today to try to publish to html5 a current project. I succeded. I still haven't push the html5 branch of the haxe api to github but I will do it tomorrow morning. It's basicly some externs for the html5 api.To use it you need to add the .js api to your project.xml like this:
<dependency path="path/to/SFS2X_API_JS.js" if="html5" />
Here html5 api has one more parameter:
sfs.addEventListener(SFSEvent.ROOM_JOIN_ERROR, onSocketError #if html5 ,this #end);
here the connectWithConfig doesn't exist with html5
try{
#if html5
sfs.connect();
#else #end
sfs.connectWithConfig(config);
You received this message because you are subscribed to a topic in the Google Groups "Haxe" group.
I'm thinking must to add js library but i don't know how to do. I will try with this way. Thank you so much :D
hi,i tried follow your tut#if !html5var config:com.smartfoxserver.v2.util.ConfigData = new com.smartfoxserver.v2.util.ConfigData();config.httpPort = 6788;config.useBlueBox = false;#elsevar config:com.smartfoxserver.v2.SmartFox.ConfigObj = {host:"sb.azgame.us",port:6788,useSSL:false,zone:"chatall",debug:true};#end#if html5Browser.alert('create smartfox html5 - ');smartFox = new com.smartfoxserver.v2.SmartFox(config);Browser.alert('create success smartfox ');#elsesmartFox = new com.smartfoxserver.v2.SmartFox(true);#endbut when create new, my browser run to 'create smartfox html5 - ' not show ('create success smartfox ')
i using firefox browser, if i do follow smartfox-haxe-client, i can call connect to server but server decline connect. if i follow your way or follow https://libraries.io/github/giabao/sfs2x-api, i can't create new smartfox
i can't find function join room, if you don't join room, you can't send extension request???
i downloaded haxe client lastest, but haven't folder com.smartfoxserver.v2.extensions, how do i have file BaseClientRequestHandler
sfs.send(
new
JoinRoomRequest(
"The Lobby"
) );
:| i coding for client, that mean i need use file SFSHandler.hx, that right? But in this file, i see after login, you call ExtensionRequest in your room but you don't join room. So how do i join exist room?
if i import class JoinRoomRequest, i have errorsrc/com/smartfoxserver/v2/requests/BaseRequest.hx:162: characters 10-31 : Class<com.smartfoxserver.v2.entities.data.SFSObject> has no field newInstancesrc/com/smartfoxserver/v2/requests/BaseRequest.hx:193: characters 19-53 : com.smartfoxserver.v2.requests.ExtensionRequest has no field useUDPall of error at class BaseRequest.hx
oh yeah, it run success, thank you so much !!!
my object: var sfo:Dynamic = {cmd:getPlayingInfo, un:'116'};after i call function SFSObjectTool.instanceToSFSObject(sfo)my object is change: obj: oy3:cmdy14:getPlayingInfoy2:uny3:116g (Str)why do my object change to that?
Oh, server smartfox is code by java. So have you way get sfsobject from server
Oh, server smartfox is code by java. So have you way get sfsobject from server
this is my code, i having 2 error now1. when i call function getPlayingInfo() in clientToServer.hx --> SFSObjectTool.instanceToSFSObject(sfo) --> my object is change: obj: oy3:cmdy14:getPlayingInfoy2:uny3:116g (Str)2. when have respone from server, if i call SFSObjectTool.sfsObjectToInstance(extParams); --> object always nullcan you help me?
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Haxe" group.