当前位置: 首页>>代码示例>>C#>>正文


C# RoomEvent.getData方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: onJoinRoomDone

        public void onJoinRoomDone(RoomEvent eventObj)
        {
            if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
            {
                // reset the local global properties as we are starting a new game play session
                GlobalContext.tableProperties["Player1Score"] = 0;
                GlobalContext.tableProperties["Player1Score"]=0;
                GlobalContext.tableProperties["Player2Score"]=0;
                GlobalContext.tableProperties["WindX"]=0;
                GlobalContext.tableProperties["WindY"]=0;
                GlobalContext.tableProperties["fireNumber"]=1;
                GlobalContext.GameRoomId = eventObj.getData().getId();
                WarpClient.GetInstance().SubscribeRoom(GlobalContext.GameRoomId);
                // get live information to fetch the name of the opponent if already inside
                WarpClient.GetInstance().GetLiveRoomInfo(GlobalContext.GameRoomId);
            }
            else
            {
                try
                {
                    if (GlobalContext.tableProperties["IsPrivateRoom"].ToString().Equals("true",StringComparison.InvariantCultureIgnoreCase))
                    {
                        // failed to join a private room
                        Deployment.Current.Dispatcher.BeginInvoke(new ShowResultCallback(mShowResultCallback), "Sorry,Remote has already got the partner!!");
                    }
                    else
                    {
                        // failed to join a random room, create a new one
                        WarpClient.GetInstance().CreateTurnRoom("TurnBasedRoom", GlobalContext.localUsername, 2, GlobalContext.tableProperties,GlobalContext.turnTime);
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message);

                }
            }
        }
开发者ID:rahulpshephertz,项目名称:CatapultWar_TurnBased,代码行数:38,代码来源:RoomReqListener.cs

示例7: OnCreateRoomDone

    public void OnCreateRoomDone(RoomEvent eventObj)
    {
        if (isUserConnected)
        {
            Debug.Log("OnCreateRoomDone " + eventObj.getResult() + eventObj.getData().getId() + " " + eventObj.getData().getRoomOwner());
            if (eventObj.getResult() == 0)
            {
                unityUIObjects["LoadingText"].GetComponent<Text>().text = "Waiting for opponent...";
                roomId = eventObj.getData().getId();
                SC_AppWarpKit.JoinToRoom(eventObj.getData().getId());
                SC_AppWarpKit.RegisterToRoom(eventObj.getData().getId());
            }

        }
    }
开发者ID:moshe31sh,项目名称:TankWarZone---Unity_Project,代码行数:15,代码来源:CS_MultiPlayerAppWrap.cs

示例8: onJoinRoomDone

 public void onJoinRoomDone(RoomEvent eventObj)
 {
     status = "onJoinRoomDone " + eventObj.getResult ();
     if (eventObj.getResult () == WarpResponseResultCode.SUCCESS) {
         Context.gameRoomId = eventObj.getData ().getId ();
         WarpClient.GetInstance ().SubscribeRoom (Context.gameRoomId);
     } else {
         WarpClient.GetInstance ().CreateRoom ("bananas", "monkey", 2, null);
     }
 }
开发者ID:nightsnaker,项目名称:XamarinMultiplayerBananas,代码行数:10,代码来源:GameStartLayer.cs

示例9: OnJoinToRoom

 //join roome
 public void OnJoinToRoom(RoomEvent eventObj)
 {
     if (isUserConnected)
     {
         Debug.Log("OnJoinToRoom " + eventObj.getResult());
         if (eventObj.getResult() == 0)
         {
             unityUIObjects["LoadingText"].GetComponent<Text>().text = "Waiting for Game...";
             Debug.Log("Joined Room! " + eventObj.getData().getId());
         }
         else
         {
             SC_AppWarpKit.JoinToRoom(roomId);
             SC_AppWarpKit.RegisterToRoom(roomId);
         }
     }
 }
开发者ID:moshe31sh,项目名称:TankWarZone---Unity_Project,代码行数:18,代码来源:CS_MultiPlayerAppWrap.cs

示例10: onCreateRoomDone

 public void onCreateRoomDone(RoomEvent eventObj)
 {
     ClientSample.roomId = eventObj.getData ().getId ();
             WarpClient.GetInstance ().JoinRoom (ClientSample.roomId);
 }
开发者ID:rahulpshephertz,项目名称:RestoretheSessionafterCrash,代码行数:5,代码来源:ClientSample.cs

示例11: OnJoinToRoom

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

示例12: onSubscribeToRoom

 public void onSubscribeToRoom(RoomEvent eventObj)
 {
     Debug.Log("onSubscribeToRoom " + eventObj.getResult());
     guiText.text += "SubscribeToRoom ! " +  eventObj.getData ().getId () + System.Environment.NewLine;
     //if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
     //	Debug.Log("onSubscribeRoomDone : " + eventObj.getResult());
 }
开发者ID:ohadsas,项目名称:Unity_Ice_Flakes_Project,代码行数:7,代码来源:SC_Logic.cs

示例13: OnJoinToRoom

 public void OnJoinToRoom(RoomEvent eventObj)
 {
     if(isUserConnected)
     {
         Debug.Log("OnJoinToRoom " + eventObj.getResult());
         if (eventObj.getResult() == 0)
         {
             Debug.Log("Joined Room! " +  eventObj.getData ().getId ());
         }
         else
         {
             SC_AppWarpKit.JoinToRoom(roomId);
             SC_AppWarpKit.RegisterToRoom(roomId);
         }
     }
 }
开发者ID:ohadsas,项目名称:Unity_Ice_Flakes_Project,代码行数:16,代码来源:Multi_Player.cs

示例14: OnCreateRoomDone

 public void OnCreateRoomDone(RoomEvent eventObj)
 {
     if (isUserConnected)
     {
         Debug.Log ("OnCreateRoomDone " + eventObj.getResult () + eventObj.getData ().getId () + " " + eventObj.getData ().getRoomOwner ());
         if (eventObj.getResult () == 0) {
             roomId = eventObj.getData ().getId ();
             SC_AppWarpKit.JoinToRoom (eventObj.getData ().getId ());
             SC_AppWarpKit.RegisterToRoom (eventObj.getData ().getId ());
         }
     }
 }
开发者ID:ohadsas,项目名称:Unity_Ice_Flakes_Project,代码行数:12,代码来源:Multi_Player.cs

示例15: onSubscribeRoomDone

        //RoomRequestListener
        public void onSubscribeRoomDone(RoomEvent eventObj)
        {
            if(eventObj.getResult() == 0)
            {
                WarpClient.GetInstance ().GetLiveRoomInfo(eventObj.getData().getId());
                /*string json = "{\"start\":\""+id+"\"}";
                WarpClient.GetInstance().SendChat(json);
                state = 1;*/
                //WarpClient.GetInstance().JoinRoom(m_apppwarp.roomid);
            }

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


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