private void OnGetMatch(GetMatchResult result)
    {
        //storing the players IDs on the PlayersIDSaver two join them
        string p1 = result.Members[0].Attributes.DataObject.ToString();
        string p2 = result.Members[1].Attributes.DataObject.ToString();

        Debug.Log("..." + p1);
        Debug.Log("..." + p2);
        string p1ID = "";
        string p2ID = "";

        //reading the id of the two players
        for (int i = 7; i < p1.Length - 2; i++)
        {
            p1ID += p1[i];
        }
        for (int i = 7; i < p2.Length - 2; i++)
        {
            p2ID += p2[i];
        }
        Debug.Log(p1ID);
        Debug.Log(p2ID);
        idSaver.ManageIDs(p1ID, p2ID);
        //sending my selected level data to the other player
        EftClient.Send(Application.persistentDataPath + "/Multiplayer Levels/" + PlayerPrefs.GetString("selectedLevelName") + ".level",
                       ID_Generator.ID_to_IP(PlayerPrefs.GetString("otherPlayerID")), 9999);
        matchmakingObjects.SetActive(false);
        gameplayObjects.SetActive(true);
    }
예제 #2
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            string fn = (string)e.Argument;

            EasyFileTransfer.Model.Response rsp = EftClient.Send(fn, textBox2.Text, Convert.ToInt32(textBox1.Text));
            timer1.Stop();
            progressBar1.BeginInvoke((MethodInvoker)(() => progressBar1.Value = 100));
            MessageBox.Show(rsp.description, "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            progressBar1.BeginInvoke((MethodInvoker)(() => progressBar1.Value = 0));
        }
예제 #3
0
 private void SnedButton_Click(object sender, EventArgs e)
 {
     if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         EasyFileTransfer.Model.Response rsp = EftClient.Send(openFileDialog1.FileName, textBox2.Text, Convert.ToInt32(textBox1.Text));
         if (rsp.status == 1)
         {
             MessageBox.Show("send successfully.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }