Namespace OmiyaGames.Web.Security
Classes
DebugWebDomainInfo
Helper debug methods for OmiyaGames.Web.Security namespace. WebDomainVerifier
StateChangeEventArgs
Event arguments used to indicate how a state has changed. See OnBeforeStateChange and OnAfterStateChange.
VerifyEventArgs
Event arguments used to provide information on verify events. See OnBeforeVerifyWebDomain and OnAfterVerifyWebDomain.
WebDomainVerifier
Original code by andyman from Github:
https://gist.github.com/andyman/e58dea85cce23cccecff
Extra modifications by jcx from Github:
https://gist.github.com/jcx/93a3fc93531911add8a8
For WebGL builds, this script grabs the domain of the website this game is running on, and verifies it against two lists:
- The list of strings in DefaultDomainList.
-
Optionally, if RemoteDomainListUrl isn't an empty string
(or null), this script will attempt to download from the specified url,
and read it as a
. If successful, the globs listed in the will be used to match the domain as well. Remember that if the is encrypted, the OmiyaGames.Web.Security.WebDomainVerifier.domainDecrypter needs to be set in the Unity inspector to help decrypt the content of the list.
[SerializeField]
private WebDomainVerifier domainVerifier;
IEnumerator Start()
{
yield return StartCoroutine(domainVerifier.VerifyWebDomain());
Debug.Log(domainVerifier.CurrentState);
}
WebLocationChecker
Original code by andyman from Github:
https://gist.github.com/andyman/e58dea85cce23cccecff
Extra modifications by jcx from Github:
https://gist.github.com/jcx/93a3fc93531911add8a8
Add this script to an object in the first scene of your game. For WebGL builds, this script grabs the domain the game is running on, and verifies it against two lists:
- The list of strings in DefaultDomainList.
-
Optionally, if RemoteDomainListUrl isn't an empty string
(or null), this script will attempt to download from the specified url,
and read it as a
. If successful, the globs listed in the will be used to match the domain as well. Remember that if the is encrypted, the OmiyaGames.Web.Security.WebLocationChecker.domainDecrypter needs to be set in the Unity inspector to help decrypt the content of the list.
IEnumerator Start()
{
WebLocationChecker checker = GetComponent<WebLocationChecker>();
yield return StartCoroutine(checker.CheckDomainList());
Debug.Log(checker.CurrentState);
}
If the script is attached to a Enums
WebDomainVerifier.State
Indicates progression and result of this script.
WebLocationChecker.State
Indicates progression and result of this script.