示例#1
0
 void ChallengeAccepted(GSMessage msg)
 {
     print(msg.JSONString);
     print("Challenge accepted !");
     accepted.Fire();
     EventManager.instance.OnAcceptedChallenge(msg);
 }
示例#2
0
 void ChallengeWithdrawn(GSMessage msg)
 {
     challenge.Reset();
     withdrawn.Fire();
     challenge.Reset();
     EventManager.instance.OnWithdrawChallenge();
 }
示例#3
0
 //This will be our message listener, this will be triggered when we successfully upload a file
 public void GetUploadMessage(GSMessage message)
 {
     //Every time we get a message
     Debug.Log(message.BaseData.GetString("uploadId"));
     //Save the last uploadId
     lastUploadId = message.BaseData.GetString("uploadId");
 }
示例#4
0
 public void OnDeclinedChallenge(GSMessage msg)
 {
     if (declinedChallenge != null)
     {
         declinedChallenge(msg);
         print("Decline challenge event fired!");
     }
 }
示例#5
0
 public void OnAcceptedChallenge(GSMessage msg)
 {
     if (acceptedChallenge != null)
     {
         acceptedChallenge(msg);
         print("Accepted challenge event fired!");
     }
 }
示例#6
0
 public void OnRecievedChallenge(GSMessage msg)
 {
     if (recievedChallenge != null)
     {
         recievedChallenge(msg);
         print("On recieved challenge event fired!");
     }
 }
示例#7
0
 void ChallengeStarted(GSMessage msg)
 {
     //		if (!occupied.value) {
     started.Fire();
     EventManager.instance.OnChallengeStarted(msg);
     print("Challenge started!");
     //		}
 }
示例#8
0
    public void OnChallengeStarted(GSMessage msg)
    {
        if (challengeStarted != null)
        {
            challengeStarted(msg);
//			ChallegeWaitGUI.instance.isBusy = false;
            print("Accepted challenge event fired!");
        }
    }
    //This will be our message listener, this will be triggered when we successfully upload a file
    public void GetUploadMessage(GSMessage message)
    {
        lastUploadId = message.BaseData.GetString("uploadId");
        Database.SetDsiplayImageUploadId(Register.userId, lastUploadId);

        MyNotification notification = new MyNotification();

        notification.MakeNotification("Picture Uploaded Successfully!");
    }
示例#10
0
 void ChallengeDeclined(GSMessage msg)
 {
     ObliusGameManager.isFriendlyBattle = false;
     challenge.Reset();
     declined.Fire();
     challenge.Reset();
     EventManager.instance.OnDeclinedChallenge(msg);
     print(msg.JSONString);
 }
示例#11
0
        static internal void HandleMessage(GSInstance gsInstance, GSObject messageData)
        {
            var message = GSMessage.CreateMessageFromObject(gsInstance, messageData);

            if (_AllMessages != null)
            {
                _AllMessages(message);
            }

            message.NotifyListeners();
        }
    void GetUploadMessage(GSMessage message)
    {
        var uploadId = message.BaseData.GetString("uploadId");

        new GetUploadedRequest()
        .SetUploadId(uploadId)
        .Send((response) => {
            GSData scriptData = response.ScriptData;
            var size          = response.Size;
            string url        = response.Url;

            PreferencesFactory.SetString(Constants.ProfileAvatarUploadId, uploadId);
        });
    }
示例#13
0
 void GotChallenge(GSMessage message)
 {
     if (!occupied.value)
     {
         challenge.data = JsonUtility.FromJson <ChallengeData>(message.JSONString);
         recieved.Fire();
         EventManager.instance.OnRecievedChallenge(message);
         print("recived challenged firedddddddddddddddddddddd");
     }
     else
     {
         challengeOther.data = JsonUtility.FromJson <ChallengeData>(message.JSONString);
         recieved.Fire();
     }
 }
示例#14
0
 /// <summary>
 /// Our upload message listener. Triggers when an upload was successful, setting m_UploadId to be used in junction
 /// with m_PostDownloadFunctionInfo. Race condition can occur between this function and UploadTexture2D. Measures have
 /// been put into place to help prevent this
 /// </summary>
 /// <param name="message">The upload message that triggered this listener</param>
 private void GetUploadMessage(GSMessage message)
 {
     //Since GetUploadMessage is a listener, it gets triggered on all (locally) ASL objects, even those that did not send a texture
     //Therefore, we check if this ASL object was the sender (or at the very least, a sender, if the file size happens to be the same),
     //and if so, add the upload id.
     foreach (var texture2DFileSize in m_Texture2DUploadSizeList)
     {
         message.BaseData.GetGSData("uploadData").BaseData.TryGetValue("fileSize", out var value);
         if (int.Parse(value.ToString()) == texture2DFileSize)
         {
             m_UploadIds.Add(message.BaseData.GetString("uploadId"));
             if (m_PostDownloadFunctionInfo.Count > 0)      //If UploadTexture2D has completed (if upload completed before GetUpload message came back)
             {
                 InformAllUsersTexture2DReadyForDownload(); //Send out packet informing users to download Texture2D
             }
             return;
         }
     }
 }
示例#15
0
    //This will be our message listener, this will be triggered when we successfully upload a file
    public void GetUploadMessage(GSMessage message)
    {
        new LogEventRequest_DeleteUploaded()
        .Set_Upload(GameSparksManager.getInstance().getGameDataURL())
        .Send((response) => {
            if (response.HasErrors)
            {
                Debug.Log(response.Errors.JSON);
            }
            else
            {
                Debug.Log("Deleted " + GameSparksManager.getInstance().getGameDataURL());
            }
        });
        new DismissMessageRequest()
        .SetMessageId(message.MessageId)
        .Send((response) => {
            if (response.HasErrors)
            {
                Debug.Log(response.Errors.JSON);
            }
            else
            {
                Debug.Log("Deleted message" + message.MessageId);
            }
        });

        //Every time we get a message
        Debug.Log(message.BaseData.GetString("uploadId"));
        //Save the last uploadId
        lastUploadId = message.BaseData.GetString("uploadId");

        new FileInfo(Application.persistentDataPath + "/Online/" + game.getGame().getName() + ".zip").Delete();
        new DirectoryInfo(Application.persistentDataPath + "/Online/" + game.getGame().getName()).Delete(true);

        takeTurn();
    }
示例#16
0
 void HandleGameSparksMessageReceived(GSMessage message)
 {
     HandleLog("MSG:" + message.JSONString);
 }
示例#17
0
	void HandleGameSparksMessageReceived(GSMessage message)
	{
		//This will pass the Full JSON String to the Handle Log function, handy for seeing if the the values you're looking for are actually there.
		HandleLog("MSG:" + message.JSONString);
	}
 void HandleGameSparksMessageReceived(GSMessage message)
 {
     HandleLog("MSG:" + message.JSONString);
 }
 void HandleGameSparksMessageReceived(GSMessage e)
 {
     MyDebug.Log("MSG" + e.JSONString);
 }