同时进入房间的问题
如果两个用户同时进入房间,在OnAnyChatOnlineUser方法中,userNumber 为,调用getOnlineUser,获取到的count为0,这个时候怎样解决呢 而且不会调用OnAnyChatUserEnterRoom方法 userNumber 为1 本帖最后由 佰锐技术-卓剑锐 于 2014-7-14 11:07 编辑Crystal 发表于 2014-7-14 10:56
而且不会调用OnAnyChatUserEnterRoom方法
您好,getOnlineUser方法是获取当前在线用户列表的API。
您是基于什么平台上的项目呢?是否有用我们的标准demo测试过您所说的情况? 佰锐技术-卓剑锐 发表于 2014-7-14 11:04
您好,getOnlineUser方法是获取当前在线用户列表的API。
您是基于什么平台上的项目呢?是否有用我们的 ...
ios,我是在OnAnyChatOnlineUser里面去调用 getonlineuser的
我也是拿不到数据的 佰锐技术-卓剑锐 发表于 2014-7-14 11:04
您好,getOnlineUser方法是获取当前在线用户列表的API。
您是基于什么平台上的项目呢?是否有用我们的 ...
我用demo运行也是一样的,同时登陆也是拿不到的,如果是先后登陆房间就可以获取到用户
Crystal 发表于 2014-7-14 11:08
我用demo运行也是一样的,同时登陆也是拿不到的,如果是先后登陆房间就可以获取到用户
您好,已安排IOS工程师在验证。有消息我们会第一时间通知您。 - (void)viewDidLoad
{
;
[ addObserver:self selector:@selector(AnyChatNotifyHandler:) name:@"ANYCHATNOTIFY" object:nil];
anychat = [ init];
anychat.notifyMsgDelegate = self;
;
;
}
- (void)didReceiveMemoryWarning
{
;
// Dispose of any resources that can be recreated.
}
-(void) viewWillAppear:(BOOL)animated
{
;
_videoChatViewController.view.frame = self.view.frame;
}
- (void)AnyChatNotifyHandler:(NSNotification*)notify
{
NSDictionary*dict =notify.userInfo;
;
}
-(void) loginAnyChatWithUserName:(NSString*)userName password:(NSString*)password
{
;
;
;
}
// 连接服务器消息
- (void) OnAnyChatConnect:(BOOL) bSuccess
{
}
// 用户登陆消息
- (void) OnAnyChatLogin:(int) dwUserId : (int) dwErrorCode
{
if(dwErrorCode == GV_ERR_SUCCESS) {
;
} else {
}
}
// 用户进入房间消息
- (void) OnAnyChatEnterRoom:(int) dwRoomId : (int) dwErrorCode
{
NSMutableArray *onlineUserList = [ initWithArray:];
NSLog(@"0000000000 %d onlineUser count %d",dwRoomId,onlineUserList.count);
}
// 房间在线用户消息
- (void) OnAnyChatOnlineUser:(int) dwUserNum : (int) dwRoomId
{
NSMutableArray *onlineUserList = [ initWithArray:];
NSLog(@"1111111111 %d , onLineUser count %d",dwUserNum,onlineUserList.count);
}
// 用户进入房间消息
- (void) OnAnyChatUserEnterRoom:(int) dwUserId
{
NSMutableArray *onlineUserList = [ initWithArray:];
NSLog(@"22222222 %d onlineUser count %d",onlineUserList.count);
}
// 用户退出房间消息
- (void) OnAnyChatUserLeaveRoom:(int) dwUserId
{
NSLog(@"2222222222");
}
获取的onlineuser count 都是0 您好,两个用户同时进入房间,还是会有一个先后顺序,您需要处理两个事件:自己进入房间事件、其它用户进入、离开房间事件,参考:http://www.anychat.cn/faq/index.php?action=artikel&cat=2&id=193&artlang=zh 第三部分。
页:
[1]
2