예제 #1
0
    void DP_Room(string msg)
    {
        string[] m    = msg.Split('/');
        int      sid  = int.Parse(m[0]);
        string   code = m[1];

        if (matchInfos.matchCode != code)
        {
            return;
        }

        if (sn != null)
        {
            sn.Leave(CB_LeaveScene, sid);
            Debug.Log("Sn is not null");
        }
        else
        {
            sn               = new ArcaletScene(ag, sguid_game, sid);
            sn.onMessageIn  += GameMessageIn;
            sn.onCompletion += CB_EnterRoom;
            sn.Launch();
            UnityEngine.SceneManagement.SceneManager.LoadScene("level_village");
        }
    }
 internal void SceneGameOver(ArcaletScene sn)
 {
     if (sn != null)
     {
         Console.WriteLine("SceneGameOver");
         sn.Leave(CB_SceneGameOver, null);
     }
 }
예제 #3
0
 void CB_RematchLeave(int code, object token)
 {
     if (code == 0)
     {
         sn = null;
         matchInfos.GenerateMatchCode();
         //	string msg = ag.gameUserid + "/" + ag.poid + "/" + OXGame.playerInfo.nickname + "/" + matchInfos.matchCode;
         //	ag.PrivacySend("match:" + msg , serverSettings.dpPoid);
     }
 }
 void CB_EnterRoom6(int code, ArcaletScene scene)
 {
     if (code == 0)
     {
         Console.WriteLine("CB_EnterRoom6 Successed");
         m_user[5].sn.Send("bb_ready:" + m_user[5].account + "/" + m_user[5].ag.poid);
     }
     else
     {
         Console.WriteLine("CB_EnterRoom6 Failed: " + code);
     }
 }
예제 #5
0
 void CB_EnterRoom(int code, ArcaletScene scene)
 {
     if (code == 0)
     {
         Debug.Log("CB_EnterRoom Successed");
         scene.Send("bb_ready:" + ag.gameUserid + "/" + ag.poid);
     }
     else
     {
         Debug.Log("CB_EnterRoom Failed: " + code);
     }
 }
예제 #6
0
 void CB_SceneGameOver(int code, object token)
 {
     if (code == 0)
     {
         sn = null;
         Debug.Log("CB_SceneGameOver Successed");
     }
     if (code != 0)
     {
         Debug.Log("CB_SceneGameOver Failed");
     }
 }
 void GameMessageIn2(string msg, int delay, ArcaletScene scene)
 {
     try
     {
         Console.WriteLine("@ GameMsg2 >> " + msg);
         string[] cmds = msg.Split(':');
         switch (cmds[0])
         {
         case "bb_over": SceneGameOver(scene); break;
         }
     }
     catch (Exception e) { Console.WriteLine("GameMessageIn Exception:\r\n" + e.ToString()); }
 }
예제 #8
0
    void GameMessageIn(string msg, int delay, ArcaletScene scene)
    {
        try {
            Debug.Log("@ GameMsg>> " + msg);
            string[]     cmds = msg.Split(':');
            CGameManager game = FindObjectOfType(typeof(CGameManager)) as CGameManager;
            if (game == null)
            {
                return;
            }

            switch (cmds[0])
            {
            case "bb_move":
                game.player_move(cmds[1]);
                break;

            case "bb_stop":
                game.player_stop(cmds[1]);
                break;

            case "bb_player":
                game.add_player(cmds[1]);
                break;

            case "bb_wball":
                game.bb_wball(cmds[1]);
                break;

            case "bb_death":
                game.handle_death_message(cmds[1]);
                break;

            case "bb_over":
                //game.
                break;

            default:
                break;
                //	case "dp_start": game.GameStart(cmds[1]); break;
                //	case "dp_player": game.SetRevalInfos(cmds[1]); break;
                //	case "dp_slot": game.FillSlot(cmds[1]); break;
                //	case "dp_gameover": game.DP_GameOver(cmds[1]); break;
                //	case "dp_draw": game.DP_Draw(cmds[1]); break;
                //	case "dp_timeup": game.DP_TiemUP(cmds[1]); break;
                //	case "dp_sync" : game.TimerSynchronization(cmds[1], delay); break;
            }
        }
        catch (Exception e) { Debug.LogWarning("GameMessageIn Exception:\r\n" + e.ToString()); }
    }
예제 #9
0
 void CB_LeaveScene(int code, object token)
 {
     if (code == 0)
     {
         Debug.Log("CB_LeaveScene Successed");
         int sid = (int)token;
         sn               = new ArcaletScene(ag, sguid_game, sid);
         sn.onMessageIn  += GameMessageIn;
         sn.onCompletion += CB_EnterRoom;
         sn.Launch();
     }
     else
     {
         Debug.Log("CB_LeaveScene Failed: " + code);
         matchInfos.matchCode = "";
         ag.PrivacySend("cancel:" + ag.poid, serverSettings.dpPoid);
         //	Application.LoadLevel("MainMenu");
     }
 }
        void GameMessageIn6(string msg, int delay, ArcaletScene scene)
        {
            try
            {
                Console.WriteLine("@ GameMsg6 >> " + msg);

                /*	string[] cmds = msg.Split(':');
                 * switch (cmds[0])
                 * {
                 *              case "dp_start": game.GameStart(cmds[1]); break;
                 *              case "dp_player": game.SetRevalInfos(cmds[1]); break;
                 *              case "dp_slot": game.FillSlot(cmds[1]); break;
                 *              case "dp_gameover": game.DP_GameOver(cmds[1]); break;
                 *              case "dp_draw": game.DP_Draw(cmds[1]); break;
                 *              case "dp_timeup": game.DP_TiemUP(cmds[1]); break;
                 *              case "dp_sync" : game.TimerSynchronization(cmds[1], delay); break;
                 * }
                 */
            }
            catch (Exception e) { Console.WriteLine("GameMessageIn Exception:\r\n" + e.ToString()); }
        }