Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by GizmoBradwell · Sep 19, 2011 at 03:09 PM · copyprevention

unity web player security

Is a game that's running in unity web player able to be prevented from being linked into another website and secured against being explicitly downloaded/copied?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by jahroy · Sep 19, 2011 at 09:29 PM

Unity provides at least two methods that can help with this.

The Application.absoluteUrl property will tell you the full URL where your unity3d data file is being hosted. You can use this property to check whether or not your game is being loaded from the correct place. This will help prevent people from downloading your unity3d file and hosting it somewhere else.

There is also the Applicatoin.srcValue property, which will tell you the path used in your html page to identify the unity3d file. You can use this, for example, to ensure that the html page is in the same directory as the unity3d file. This will help prevent people from creating html pages and pointing them at your data.

You can also implement your own security on top of this. We have our data file hosted behind Drupal. Every now and then the Unity game pings the server to make sure the user is valid, the user is logged in, and the user has access to the game in question.

Here is some extremely simple code (almost taken directly from the documentation) that shows how to use these properties:

/* return true if piracy has been detected */

function detectPiracy () : boolean { / only calling this for webplayer right now /

 if ( ! Application.isWebPlayer ) {
     return false;
 }

 var urlPath   =  Application.absoluteURL.ToLower();
 var dataPath  =  Application.srcValue.ToLower();

 /* unity3d file must be found in same directory as html file */

 if ( dataPath != "mygame.unity3d" ) {
     return true;
 }

 /* html file must be located at myhost.com */

 if ( urlPath == "http://myhost.com/some/path/mygame.unity3d" ) {
     return false;
 }

 if ( urlPath == "http://www.myhost.com/some/path/mygame.unity3d" ) {
     return false;
 }

 return true;

}

All of these techniques help prevent people from playing your game if they access it the wrong way. They do not prevent people from downloading it from your site.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Chambers · Sep 19, 2011 at 03:19 PM

I don't believe so, I think Unity games can be downloaded and re-uploaded to other websites with fairly simple means. I also believe there are methods that assets and code from within Unity projects can be extracted (I think this is an illegal practise however and is frowned upon). I'm afraid the reality is your project is always going to be at risk of being uploaded elsewhere if its on the internet.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Copying Unity project/scenes to another Mac 2 Answers

Standalone Copying Failure 0 Answers

Unity 4.0 mesh duplication possible? 2 Answers

How do I keep a texture different on copied objects? 1 Answer

Copy From Array to List without reference [C#] 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges