0

有没有人可以帮助我将一组位图发送到 SmartFoxServer2X?我知道有一个文档,但我是编程新手,我不知道如何解决这个问题。在客户端,我使用 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 个位图的数组。当我尝试将请求发送到服务器时,我收到错误

> `[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 并将其发送到服务器。你知道我怎么能意识到这一点吗?

预先感谢您帮助我!

4

1 回答 1

0

你可能不想这样做:)

SFS 用于多人游戏功能,而不是上传图像。我建议通过与 SFS 相对的 Web 服务器启动上传脚本。通常,您希望尽可能多地关闭 SFS 服务器的处理能力,上传大数据包将需要更繁重的处理。

有没有办法做到这一点,是的,但是使用 JavaScript API 会变得更难(而且更慢)。使用 C#、Java 甚至 AS3 会更幸运。

于 2013-11-28T15:49:55.220 回答