private void ListenServerMessage(NetworkMessage message)
 {
     ReceiveMsg       = new StringMessage();
     ReceiveMsg.value = message.ReadMessage <StringMessage>().value;
     try
     {
         AnimationMsgArr = ReceiveMsg.value.Split('|');
     }
     finally
     {
         if (AnimationMsgArr[0] == "AppStart")
         {
             networkOperations.SendMessage(ServerDev, "appisstarting");
             VideoCnv.enabled = true;
             MenuCnv.enabled  = false;
         }
         else if (AnimationMsgArr[0] == "AppQuit")
         {
             Application.Quit();
         }
         else
         {
             VideoPlayer.VideoURL = AnimationMsgArr[0];
         }
         txtReceiveMsg.text = AnimationMsgArr[0];
     }
 }
Beispiel #2
0
    private void ListenServerMessage(NetworkMessage message)
    {
        StringMessage ReceiveMsg = new StringMessage();

        ReceiveMsg.value = message.ReadMessage <StringMessage>().value;
        try
        {
            ReceiveMsgArr = ReceiveMsg.value.Split('|');
        }
        finally
        {
            if (ReceiveMsgArr[0] == "appisstarting")
            {
                networkOperations.SendMessage(Display, "http://" + NetworkOperations.ServerIP + "/" + NetworkOperations.ProjectFolderName + "/introAnimation.mp4");
                networkOperations.SendMessage(Control, "subjectSelect");
            }
            else if (ReceiveMsgArr[1] == "False" && ReceiveMsgArr[2] == "-1")
            {
                user.animation.Subject = ReceiveMsgArr[0];
                UpdateFactorAnimation();
                user.Answer       = Convert.ToBoolean(ReceiveMsgArr[1]);
                user.animation.ID = Convert.ToInt32(ReceiveMsgArr[2]);

                GetDataFromJSON(FactorAnimation + 1, "SELF");
                networkOperations.SendMessage(Display, "http://" + NetworkOperations.ServerIP + "/" + NetworkOperations.ProjectFolderName + "/Video/" + ReceiveMsgArr[0] + "Sokagi/" + ReceiveMsgArr[0] + "Sokagi_1.mp4");
                networkOperations.SendMessage(Control, QuestionMessage);
            }
            else if (ReceiveMsgArr[1] == "True")
            {
                GetDataFromJSON(Convert.ToInt32(ReceiveMsgArr[2]), "TAID"); // TrueAnswer ID
                networkOperations.SendMessage(Display, AnimationMessage);
                networkOperations.SendMessage(Control, QuestionMessage);
            }
            else if (ReceiveMsgArr[1] == "False")
            {
                GetDataFromJSON(Convert.ToInt32(ReceiveMsgArr[2]), "WAID"); // WrongAnswer ID
                networkOperations.SendMessage(Display, AnimationMessage);
                networkOperations.SendMessage(Control, QuestionMessage);
            }
            Debug.Log(ReceiveMsgArr[0]);
        }
    }
Beispiel #3
0
 void Update()
 {
     Timer -= Time.deltaTime;
     if (Convert.ToInt32(Timer) > 0)
     {
         TimeLeft.text = "Kalan Süre : " + Convert.ToInt32(Timer).ToString();
         Debug.Log(Convert.ToInt32(Timer).ToString());
     }
     else if (Convert.ToInt32(Timer) == 0)
     {
         user.Answer = false;
         networkOperations.SendMessage(ServerDev, user.animation.Subject + "|" + user.Answer + "|" + user.animation.ID); // BilgiPaketi();
     }
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         Menu.enabled = true;
     }
 }
Beispiel #4
0
    //public void BilgiPaketi()
    //{
    //    StringMessage MbltoSrvrMsg = new StringMessage();
    //    MbltoSrvrMsg.value = user.animation.Subject + "|" + user.Answer + "|" + user.animation.ID;
    //    ServerDev.Send(888, MbltoSrvrMsg);
    //}

    public void ButtonchoiceOne()
    {
        if (AnswerCheck(choiceOne) && user.animation.ID > ((totalAnimation + FactorAnimation) - 2))
        {
            choiceOne.image.sprite = TrueImg;
            networkOperations.SendMessage(ServerDev, "appisstarting");
            user.animation.ID = -1; user.animation.Subject = "tanimsiz"; user.Answer = false;  // Eğer son 2 soruda doğru yaparsa başa intro'ya döner
        }
        else if (AnswerCheck(choiceOne))
        {
            choiceOne.image.sprite = TrueImg;
            networkOperations.SendMessage(ServerDev, user.animation.Subject + "|" + user.Answer + "|" + user.animation.ID); // Son 2 soru haricinde doğru yapılan blok
        }
        else
        {
            choiceOne.image.sprite = WrongImg;
            networkOperations.SendMessage(ServerDev, user.animation.Subject + "|" + user.Answer + "|" + user.animation.ID); //BilgiPaketi(); // Sourya Yanlış cevap verilen blok
        }
        choiceOne.image.sprite = null;
    }