0

I have created an online multiplayer card game using Adobe flash Professional. In this game multiple clients/account is not allowed, hence I need to detect whether the users are joining game from different devices or not. I can't simply do a server sided check for the IP-address because I still want e.g. people in the same office to be able to play together.

I have found some solution like reading the MAC address (Here) but the problem is that NetworkInfo.networkInfo.findInterfaces() works only on Adobe air, which is not my case.

Another solution could be using browser cookies, but the problem of this solution is that, the users can use e.g. Chrome and Firefox on the same computer.

As this a web game, using js could be also a solution, so I tag this question as js as well.

UPDATE

Using SharedObject does not work in this case, since google chrome uses its own storage.

Any suggestion will be appreciated.

Community
  • 1
  • 1
csuo
  • 820
  • 3
  • 16
  • 31
  • Here is an example of using SharedObject (flash player cookie equivalent): http://stackoverflow.com/questions/15667848/as3-for-ios-how-to-serialize-an-array-and-then-save-it/15668079#15668079 – BadFeelingAboutThis Aug 05 '14 at 16:24
  • Using SharedObject does not work in this case, since google chrome uses its own storage. – csuo Aug 05 '14 at 22:43
  • Use openId/OAUTH then (eg login with google/facebook/twitter button) then store that providers id in a database as a means for keeping tabs on your users. – BadFeelingAboutThis Aug 05 '14 at 22:47
  • Actually this a Facebook app, but the problem is that the clients can create more than one Facebook accounts, that is why we want to prevent cheating. – csuo Aug 05 '14 at 22:53
  • Well there is no reliable way to track a device using web technologies. Mostly by design (eg MAC address). Flash shared object is still probably your best bet even with Chrome (and likely metro IE as well) limitations. – BadFeelingAboutThis Aug 05 '14 at 23:01
  • Or force your users to disable the build in version of flash on chrome (pepperflash I think it is) - but that probably wouldn't be wise – BadFeelingAboutThis Aug 05 '14 at 23:03

1 Answers1

0

Instead browser cookies you can use "flash cookies" - SharedObject. It is really simple and have mechanic similar to browser cookies, but stored in flash local storage.

UPDATE

Example:

var mySo:SharedObject = SharedObject.getLocal("host"); // get saved SO with name "host" if exists or create new if doesn't exist
mySo.data = {someProperty: "someData"}; // writing some data
var flushResult:Object = mySo.flush(); // saving data in local storage
...
var savedSO:SharedObject = SharedObject.getLocal("host");
trace(savedSO.data.someProperty); // output: someData
Crabar
  • 1,829
  • 1
  • 14
  • 26
  • thank for your answer, but I am afraid that flash local storage are different for Google Chrome. You can see the example on this link: republicofcode.com/tutorials/flash/as3sharedobject try to move an object in chrome, and reload the page using another browser. – csuo Aug 05 '14 at 22:35