首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >向SmartFoxserver发送位图数组

向SmartFoxserver发送位图数组
EN

Stack Overflow用户
提问于 2013-09-18 14:08:51
回答 1查看 355关注 0票数 0

有谁能帮我向SmartFoxServer2X发送一组位图呢?我知道有一个文档,但我对编程很陌生,我不知道如何解决这个问题。在客户端,我使用JavaScript,并希望将这个数组发送到服务器:

代码语言:javascript
复制
 var params = {n1:this.cubes1to20_arr};
    this.sfs.addEventListener(SFS2X.SFSEvent.EXTENSION_RESPONSE, this.onExtensionResponse,this);
    this.sfs.send(new SFS2X.Requests.System.ExtensionRequest("upload_cubes",params));

就像我说的,this.cubes1to20_arr是一个包含20个位图的数组。当我试图将请求发送到服务器时,我会得到错误信息。

代码语言:javascript
复制
> `[INFO] OUTGOING DATA
p: [Object]
    p: [Object]
        n1: [Array]
            19: [Bitmap (name=null)] (Unsupported)
            18: [Bitmap (name=null)] (Unsupported)
            17: [Bitmap (name=null)] (Unsupported)
            16: [Bitmap (name=null)] (Unsupported)
            15: [Bitmap (name=null)] (Unsupported)
            14: [Bitmap (name=null)] (Unsupported)
            13: [Bitmap (name=null)] (Unsupported)
            12: [Bitmap (name=null)] (Unsupported)
            11: [Bitmap (name=null)] (Unsupported)
            10: [Bitmap (name=null)] (Unsupported)
            9: [Bitmap (name=null)] (Unsupported)
            8: [Bitmap (name=null)] (Unsupported)
            7: [Bitmap (name=null)] (Unsupported)
            6: [Bitmap (name=null)] (Unsupported)
            5: [Bitmap (name=null)] (Unsupported)
            4: [Bitmap (name=null)] (Unsupported)
            3: [Bitmap (name=null)] (Unsupported)
            2: [Bitmap (name=null)] (Unsupported)
            1: [Bitmap (name=null)] (Unsupported)
            0: [Bitmap (name=null)] (Unsupported)
    r: -1 (Num)
    c: upload_cubes (Str)
c: 1 (Num)
a: 13 (Num)`

因此,我认为我必须创建一个byteArray,而不是将它发送到服务器。你知道我怎么才能意识到这一点吗?

提前谢谢你帮我!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-11-28 15:49:55

你可能不想这样做:)

SFS是用于多人游戏的功能,而不是上传图像。我建议通过一个与SFS相适应的web服务器启动一个上传脚本。通常,您希望保持SFS服务器的同样多的处理能力,而上传大数据包将需要更多的处理。

是否有办法做到这一点,是的,但是使用JavaScript API会使它变得更难(而且更慢)。在C#、Java甚至AS3方面,您会有更多的运气。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18874495

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档