SocketIO客户端扩展
SocketIO客户端可以用来开发实时网络聊天,实时网络游戏等…
SocketIO extension can be used for real time chat, real time game, ...
方法与事件
设置服务器网址 URL
服务器需要自己搭建,方法见下面
You need to setup your own server, pleae check below to find how to.
There is a default URL you can use.
设置存储空间 Namespace
用于区分同一服务器上的不同应用。给你的应用取一个独特的空间名。
There can be more than 1 app runing on the same server, there should use different namespace.
Always give your app a unique namespace.
连接服务器 Connect
用户名必须是独一的
Try to connect with the server. the username should be unique underwater the same namespace.
After connected, you will get a connected event.
断开连接 Disconnect
因网络原因断开连接,也会引发 已断开连接 事件 (和离开房间事件,如果在房间内)
Disconnect with the server manually.
Fired when the internet lost connection, or you leave the room manually (if you are in a room).
自动匹配房间/取消匹配房间 AutoMatch/CancelMatch Event
AutoMatch会进入排队队列,排队人数达到要求,会自动加入一个房间(房间名随机)
AutoMatch will let you be in line waiting. When the amount reach the compacity, they will join a random room automaticly.
And get a Matched event, and the userlist in the room
主动加入房间 JoinRoom
房间内所有人(包括自己)都会收到此消息
Try to Join a room with room name. If succeed, you will get a JoinedRoon Event.
When other user joined the room (if you are in this room), you will also get this JoinedRoom event.
主动离开房间 LeaveRoom
用户会收到Leftroom事件,其他人收到OtherLeftRoom事件
Try to leave the room
If succeed, you will get a LeftRoom Event. And other user (still in the room) will get OtherLeftRoom event.
发送消息 Send Message
房间内所有人会收到消息
Send a message to the users in the room
If succeed, all users in the room (including the sender) will get a GotMessage event.
设置房间容量 SetRoomCapacity
同时也是排队人数。默认房间最大人数2人
Set up how many users can be in the room (also the match up line up).
This should be called after connected to server.
Default capacity is 2.
发生错误事件 Got Error
如何自己部署服务器 How to setup server.
服务器源码已经上传到gitee。 点这里 获取源码,你可以将它部署到支持nodejs的服务器上。
the code is on Gitee : HERE , you can download and then deploy to your own server.
下载链接
发送邮件到wangsk789@qq.com
Send a message to email: wangsk789@qq.com for the aix
Hi
Can I get the the extension.aix