• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# RoomEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中RoomEvent的典型用法代码示例。如果您正苦于以下问题:C# RoomEvent类的具体用法?C# RoomEvent怎么用?C# RoomEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RoomEvent类属于命名空间,在下文中一共展示了RoomEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: onUnSubscribeRoomDone

 public void onUnSubscribeRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
       //  _page.showresult("Yay! UnSubscribe room :)");
     }
 }
开发者ID:susheels,项目名称:Know-your-movie,代码行数:7,代码来源:RoomReqListener.cs


示例2: onSubscribeRoomDone

 public void onSubscribeRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         //WarpClient.GetInstance().SendChat("hello");
     }
 }
开发者ID:Katry4,项目名称:WinRepo,代码行数:7,代码来源:RoomsListener(не+треба).cs


示例3: onSubscribeRoomDone

 public void onSubscribeRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult () == WarpResponseResultCode.SUCCESS) {
         StartActivity(typeof(ChatActivity));
         this.Finish();
     }
 }
开发者ID:shephertz,项目名称:AppWarpMono,代码行数:7,代码来源:JoinActivity.cs


示例4: onLeaveRoomDone

 public void onLeaveRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         _page.showResult("Yay! Leave room :)");
     }
 }
开发者ID:AtulSBiet,项目名称:Tutorials_WP_7_8,代码行数:7,代码来源:RoomReqListener.cs


示例5: JoinRoom

        async public Task<JoinRoomResponse> JoinRoom(JoinRoomS2S request)
        {
            if (_roomMembers.Count >= MaxRoomSize)
                return new JoinRoomResponse { RetCode = JoinRoomRetCode.RoomIsFull };
            else
            {
                if (_roomMembers.Any(x => x.UserName == request.UserName))
                    return new JoinRoomResponse { RetCode = JoinRoomRetCode.NameIsTaken };

                try
                {

                    var joinNotification = new RoomEvent { Text = "User joined", UserName = request.UserName };
                    _callbackChannel.OnRoomEvent(joinNotification);

                    _roomMembers.Add(new RoomMember { UserName = request.UserName });

                    return new JoinRoomResponse { RetCode = JoinRoomRetCode.Ok };
                }
                catch (Exception)
                {
                    return new JoinRoomResponse() { RetCode = JoinRoomRetCode.Retry };
                }
            }
        }
开发者ID:Rurouni,项目名称:MassiveOnlineUniversalServerEngine,代码行数:25,代码来源:SFRoomActor.cs


示例6: onCreateRoomDone

        public void onCreateRoomDone(RoomEvent eventObj)
        {
            Log ("onCreateRoomDone : " + eventObj.getResult());
            if (eventObj.getResult () == 0) {
                WarpClient.GetInstance().JoinRoom(eventObj.getData().getId());

            }
        }
开发者ID:shephertz,项目名称:AppWarpUnitySamples,代码行数:8,代码来源:Listener.cs


示例7: onSubscribeRoomDone

        public void onSubscribeRoomDone(RoomEvent eventObj)
        {
            if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
            {
                WarpClient.GetInstance().GetLiveRoomInfo(GlobalContext.GameRoomId);

            }
        }
开发者ID:AtulSBiet,项目名称:Tutorials_WP_7_8,代码行数:8,代码来源:RoomReqListener.cs


示例8: onJoinRoomDone

 public void onJoinRoomDone(RoomEvent eventObj)
 {
     Console.WriteLine("onJoinRoomDone as "+eventObj.getResult());
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         Console.WriteLine("Subscribing Room "+Constants.CHAT_ROOM_ID);
         WarpClient.GetInstance().SubscribeRoom(Constants.CHAT_ROOM_ID);
     }
 }
开发者ID:shephertz,项目名称:AppWarpMono,代码行数:9,代码来源:JoinController.cs


示例9: OnCreateRoomDone

 public void OnCreateRoomDone(RoomEvent eventObj)
 {
     Debug.Log("OnCreateRoomDone " + eventObj.getResult() + " room Owner " + eventObj.getData().getRoomOwner() + " " + eventObj.getData().getRoomOwner());
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         roomId = eventObj.getData().getId();
         SC_AppWarpKit.JoinToRoom(eventObj.getData().getId());
     }
 }
开发者ID:DFaiz,项目名称:BattleShipGame,代码行数:9,代码来源:SC_Logic.cs


示例10: onSubscribeRoomDone

 public void onSubscribeRoomDone(RoomEvent eventObj)
 {
     System.Diagnostics.Debug.WriteLine("subscribe room");
     
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         Global.warpClient.GetLiveRoomInfo(Global.DynRoomId);
     }
 }
开发者ID:susheels,项目名称:Know-your-movie,代码行数:9,代码来源:RoomReqListener.cs


示例11: OnCreateRoomDone

 public void OnCreateRoomDone(RoomEvent eventObj)
 {
     Debug.Log("OnCreateRoomDone " + eventObj.getResult() + " room Owner " + eventObj.getData().getRoomOwner() + " " + eventObj.getData().getRoomOwner());
     if(eventObj.getResult() == 	WarpResponseResultCode.SUCCESS)
     {
         roomId = eventObj.getData ().getId ();
         guiText.text += "Room created! " +  eventObj.getData ().getId () + System.Environment.NewLine;
         SC_AppWarpKit.JoinToRoom(eventObj.getData().getId());
     }
 }
开发者ID:ohadsas,项目名称:Unity_Ice_Flakes_Project,代码行数:10,代码来源:SC_Logic.cs


示例12: onJoinRoomDone

 public void onJoinRoomDone(RoomEvent eventObj)
 {
     if(eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         WarpClient.GetInstance().SubscribeRoom(AppWarp.roomid);
     }
     else {
         Debug.Log("There are alredy 2 user wait for some time");
     }
     Log ("onJoinRoomDone : " + eventObj.getResult());
 }
开发者ID:4ONSports,项目名称:Prototype_2,代码行数:11,代码来源:RoomListener.cs


示例13: onJoinRoomDone

 public void onJoinRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         _page.showResult("joined room!");
         //WarpClient.GetInstance().SubscribeRoom(eventObj.getData().getId());
     }
     else
     {
         _page.showResult("failed to join room!");
     }
 }
开发者ID:Katry4,项目名称:WinRepo,代码行数:12,代码来源:RoomsListener(не+треба).cs


示例14: onJoinRoomDone

        public void onJoinRoomDone(RoomEvent eventObj)
        {

            if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
            {
                Global.roomJoined = true;

                System.Diagnostics.Debug.WriteLine("joined room");
            
                Global.DynRoomId = eventObj.getData().getId();
                Global.warpClient.SubscribeRoom(Global.DynRoomId);
                
                if(!Global.PlayerIsFirst)
                    Global.opponentUsername = eventObj.getData().getRoomOwner();
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    _page.ready.Text = Global.localUsername + " \nvs\n" + Global.opponentUsername;
                });

            }
            else if (eventObj.getResult() == WarpResponseResultCode.RESOURCE_NOT_FOUND)
            {
                System.Diagnostics.Debug.WriteLine("room not found .. hence creating");
                Global.PlayerIsFirst = true;
                Global.dictionary = new Dictionary<string,object>();
                Global.dictionary.Add("category", Global.itemName[(int)settings["trigger"]]);
                Global.dictionary.Add("availUsers", 0);
                Global.dictionary.Add("score0", 0);
                Global.dictionary.Add("score1", 0);
                Global.dictionary.Add("status", "notyetstarted");
                
                Global.dictionary.Add("ready0", false);
                Global.dictionary.Add("ready1", false);
                
                // first for buffering - later per question

                Global.dictionary.Add("endgame0", false);
                Global.dictionary.Add("endgame1", false);

                int[] temp = randomize(Global.maxClips[(int)settings["trigger"]]);

                for (int i = 0; i < 5; i++ )
                {
                    Global.dictionary.Add("q" + (i+1), temp[i]);
                }


                Global.warpClient.CreateRoom(Global.localUsername, Global.localUsername, 2, Global.dictionary);
                System.Diagnostics.Debug.WriteLine("request to create room");
            
            }
            // Global.warpClient.LeaveRoom(eventObj.getData().getId());
        }
开发者ID:susheels,项目名称:Know-your-movie,代码行数:53,代码来源:RoomReqListener.cs


示例15: onSubscribeRoomDone

 public void onSubscribeRoomDone(RoomEvent eventObj)
 {
     Console.WriteLine("onSubscribeRoomDone as "+eventObj.getResult());
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         InvokeOnMainThread (delegate {
             nameTextField.ResignFirstResponder();
             ChatController cc = new ChatController();
             this.NavigationController.PushViewController(cc, true);
         });
     }
 }
开发者ID:shephertz,项目名称:AppWarpMono,代码行数:12,代码来源:JoinController.cs


示例16: onJoinRoomDone

 public void onJoinRoomDone(RoomEvent eventObj)
 {
     if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     {
         WarpClient.GetInstance().SubscribeRoom(GlobalContext.GameRoomId);
     }
     else
     {
         Deployment.Current.Dispatcher.BeginInvoke(() =>
         {
             MessageBox.Show("There are alredy 2 user wait for some time");
         });
     }
 }
开发者ID:AtulSBiet,项目名称:Tutorials_WP_7_8,代码行数:14,代码来源:RoomReqListener.cs


示例17: onSubscribeRoomDone

        public void onSubscribeRoomDone(RoomEvent eventObj)
        {
            if(eventObj.getResult() == WarpResponseResultCode.SUCCESS)
            {
                /*string json = "{\"start\":\""+id+"\"}";
                WarpClient.GetInstance().SendChat(json);
                state = 1;*/
            //				WarpClient.GetInstance().JoinRoom(AppWarp.roomid);
                AppWarp.isConnected = true;
                WarpClient.GetInstance().GetLiveRoomInfo(AppWarp.roomid);
            }

            Log ("onSubscribeRoomDone : " + eventObj.getResult());
        }
开发者ID:4ONSports,项目名称:Prototype_2,代码行数:14,代码来源:RoomListener.cs


示例18: onDeleteRoomDone

        /// Invoked when a response for DeleteRoom request is receieved.
        /// <param name="eventObj"></param>
        public void onDeleteRoomDone(RoomEvent eventObj)
        {
            Global.deleteSuccess = true;

            if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
            {

                System.Diagnostics.Debug.WriteLine("zone listener - room deleted");
            
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    MessageBox.Show("Yay! Deleted room :)");
                });
            }
        }
开发者ID:susheels,项目名称:Know-your-movie,代码行数:17,代码来源:ZoneRequestListener.cs


示例19: Process

        async public Task<JoinRoomResponse> Process(JoinRoomS2S request, IOperationContext context)
        {
            if (_roomMembers.Count >= MaxRoomSize)
                return new JoinRoomResponse { RetCode = JoinRoomRetCode.RoomIsFull };
            else
            {
                if (_roomMembers.Any(x => x.UserName == request.UserName))
                    return new JoinRoomResponse { RetCode = JoinRoomRetCode.NameIsTaken };

                _state = await _stateManager.GetOrAddAsync<IReliableDictionary<string, DateTime>>(ActorRef.Key.Id);

                try
                {
                    var callbackChannel = await _node.ConnectToCallbackChannel(request.CallbackChannelRef);

                    callbackChannel.DisconnectedEvent
                        .Subscribe(_ =>
                            Fiber.Process(() =>
                            {
                                _roomMembers.RemoveAll(x => x.UserName == request.UserName);

                                var leaveNotification = new RoomEvent { Text = "User left", UserName = request.UserName };
                                foreach (var roomMember in _roomMembers)
                                {
                                    roomMember.CallbackChannel.Send(leaveNotification);
                                }

                                if (_roomMembers.Count == 0)
                                    Dispose();

                            }));

                    var joinNotification = new RoomEvent { Text = "User joined", UserName = request.UserName };
                    foreach (var roomMember in _roomMembers)
                    {
                        roomMember.CallbackChannel.Send(joinNotification);
                    }

                    _roomMembers.Add(new RoomMember { UserName = request.UserName, CallbackChannel = callbackChannel });

                    return new JoinRoomResponse { RetCode = JoinRoomRetCode.Ok };
                }
                catch (Exception)
                {
                    return new JoinRoomResponse() { RetCode = JoinRoomRetCode.Retry };
                }
            }
        }
开发者ID:Rurouni,项目名称:MassiveOnlineUniversalServerEngine,代码行数:48,代码来源:RoomActor.cs


示例20: onJoinRoomDone

        public void onJoinRoomDone(RoomEvent roomEventObj)
        {
            if (roomEventObj.getResult() == WarpResponseResultCode.SUCCESS)
            {
                // reset the local global properties as we are starting a new game play session
                GlobalContext.GameRoomId = roomEventObj.getData().getId();
                Debug.WriteLine("Room Joined !!");
                WarpClient.GetInstance().SubscribeRoom(GlobalContext.GameRoomId);
                // get live information to fetch the name of the opponent if already inside
                WarpClient.GetInstance().GetLiveRoomInfo(GlobalContext.GameRoomId);
                Deployment.Current.Dispatcher.BeginInvoke(delegate()
                {
                    Debug.WriteLine("On Joined Room");
                    if (GlobalContext.tableProperties["IsPrivateRoom"].Equals("true")&&GlobalContext.AmIOwner)
                    {
                        GlobalContext.AmIOwner = false;
                        Debug.WriteLine("Send Invitation");
                        MoveMessage.SendInvitation();
                    }
                    else
                    {
                       App.g_HomePageListener.StartQuiz();
                    }
                });
            }
            else
            {

                try
                {
                    Deployment.Current.Dispatcher.BeginInvoke(delegate() {
                        Debug.WriteLine("Room Joined Failed " + roomEventObj);
                        WarpClient.GetInstance().CreateRoom("QuizRoom","QuizRoom", GlobalContext.MaxUsersInRoom, GlobalContext.tableProperties);
                    });
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message);
                }
            }
        }
开发者ID:rahulpshephertz,项目名称:QuizUp-AppWarpS2,代码行数:41,代码来源:RoomReqListener.cs



注:本文中的RoomEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RoomItem类代码示例发布时间:2022-05-24
下一篇:
C# RoomData类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap