QQ多人聊天室

一、实现功能
1.登录
2.私聊
3.抖动窗口
4.视频
二、流程图

[img]http://dl.iteye.com/upload/attachment/431839/5ec5b0bf-b674-3d89-bfbe-71763ee7b94d.jpg[/img]
三、自定义通信协议xmpp
1------>客户端与服务器连接
a.没有连接上则返回超时,
b.连接上 密码错误则进行提示
正确则返回个人信息、用户列表并进入用户窗口

1-1 . 登录请求
<msg>
<type>login</type>
<account>账号</account>
<pwd>密码</pwd>
</msg>

1-2 . 登录应答
<msg>
<type>login_response</type>
<state>1表示成功,0表示失败</state>
</msg>

1-3 . 发送个人信息
<msg><type>user</type><name>用户名</name><account>用户账号</account><picture>用户头像</picture></msg>

1-4 . 发送好友队列信息---默认2个组
<msg>
<type>好友类型</type>
<name>好友名</name>
<account>好友账号</account>
<picture>好友头像</picture>
</msg>


2 . 聊天
彼此在线,好友发送消息过来时,弹出对应的聊天框
2-1. <msg>
<type>chat</type>
<myaccount>本人账号</myaccount>
<friendaccount>朋友账号</friendaccount>
<content>内容</content>
</msg>
对方不在线时,给发送者提示
2-2. <msg>
<type>line</type>
<state>-1</state>
<friendaccount>不在线好友账号</friendaccount>
</msg>

3 . 抖动
点击抖动按钮则可以让对方的聊天框出现一段时间的抖动,条件是该好友要在线
3-1. <msg>
<type>shake</type>
<myaccount>发送方账号</myaccount>
<friendaccount>接收方账号</friendaccount>
</msg>

4. 视频
4-1 视频请求(点击开始视频按钮)
<msg>
<type>vidio</type>
<myaccount>发送方账号</myaccount>
<friendaccount>接收方账号</friendaccount>
<session>发送者的ip,port<session>
</msg>
4-2 视频应答(点击接受按钮)
<msg>
<type>r_vidio</type>
<myaccount>发送方账号</myaccount>
<friendaccount>接收方账号</friendaccount>
<session>发送者的ip,port<session>
</msg>
四、界面图
1,登录


[img]http://dl.iteye.com/upload/attachment/431883/2812b358-5efd-3893-86e9-081c3d485c3d.jpg[/img]

2,用户界面
[img]http://dl.iteye.com/upload/attachment/431862/c0897112-3ff8-366e-a056-1b2b48b48c78.jpg[/img]

3,聊天界面

[img]http://dl.iteye.com/upload/attachment/431892/bff47e94-132c-3239-8b63-45f1e18011b4.jpg[/img]


4,服务器界面

[img]http://dl.iteye.com/upload/attachment/431885/f3b78200-a378-344a-9d3a-5b3b15a314de.jpg[/img]
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值