Beispiel #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");
        }
    }
Beispiel #2
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");
     }
 }