PUN for Windows 8 Phone and Windows Store

Options
Tobias
Tobias admin
As Unity 4.2 supports Windows 8 Phone and Windows Store apps, we are working on an update for Photon Unity Networking (PUN) to support those platforms as well.

It's a bit tricky to get done seamlessly for various reasons: Per platform, specific assemblies must be used as some of the classes are missing on the new platforms, methods changed, etc..

By now, we got it running with only one change required on your side: When you use the class Hashtable, you now have to use ours.
Add this to the top of your (c#) script: using Hashtable = ExitGames.Client.Photon.Hashtable;

Before we update PUN in the Asset Store, we would like to make sure this runs well on the new target platforms, so your feedback would be appreciated. Post
It should run on Windows 8 Phone, Windows Store Apps but also in Editor, Web, iOS and Android. The Blackberry export still has a crash issue.

Download the PUN 1.22 preview here:
http://db.tt/kBSdGCpD

Important:
Backup your project before importing this version.
Before you import to an existing project: Delete the "library" folder (and content). Make sure the .cs files just get replaced with the new ones.
In the player settings are checkboxes for all kinds of rights: Check "Internet Client".
Build D3D C# solution, not XAML.


Please report any issues here but also when you successfully tested on some plaform!
Name the Unity version you used, the platform you exported to and the issues.

Comments

  • fuzzball
    Options
    My current structure for Photon files in Unity is

    Plugins
    PhotonNetwork
    library

    After importing the new unitypackage, almost all the files in the PhotonNetwork folder where marked as already defined else ware. After removing all these double files, i still couldn’t get the game running again.

    I finally resorted to going back to the previous build. I would still like to try the windows store feature tough.

    Unity free 4.2
    Windows Store Apps


    EDIT

    Tried it again, ended up with all the photon classfiles having ambiguity between default Hashtabel and the Exit games Hashtable


    Greetings,
    fuzzball
  • Igavva
    Options
    Thank you so much for efficiency!
    Special thanks for Hashtable!!! :)

    Got this error:
    PhotonView ID duplicate found: 1. New: View (0)1 on Core (scene) old: View (0)1 on Core (scene). Maybe one wasn't destroyed on scene load?! Check for 'DontDestroyOnLoad'. Destroying old entry, adding new.
    UnityEngine.Debug:LogError(Object)

    http://clip2net.com/clip/m126245/137494 ... p-73kb.png
  • Tobias
    Options
    fuzzball:
    The package linked here includes all PUN source files and the dlls in updated form. You need to make sure that the import replaces yours.
    If the package import doesn't do this automatically, you should import the new package into an empty project first, then copy the files (via explorer or finder) to your full project. Make sure to map each file and to get rid of the dll and pdb in the "old" project that you want to update.


    Igavva:
    Thanks for testing!
    The error you report most likely doesn't have to do with this package but the setup of your game objects, etc. The viewId 1 should be a scene object. Maybe the editor (for some reason) assigned that id twice? Find the scene object with photonview on it and try to assign ID 0. The editor should re-assign all IDs. Do that for the scene(s) affected.
  • Tobias
    Options
    It seems that building a XAML project might cause issues.
    http://forum.unity3d.com/threads/193215

    I always use D3D C# projects and "mscore" lib.
  • fuzzball
    Options
    Third time lucky :-), I removed the Photon folders from my project, imported the new Photon package and updated the photon views again. Now the to windows store app does work. Updated Package.appxmanifest to allow internet connections, and got my game running.

    Building a C# XAML solution does indeed cause a issue

    Thanks for the support,

    Greetings,
    FuZZbaLL
  • Tobias
    Options
    fuzzball: Great you got it working!
    I updated the original post here with the info we now have. Settings, etc.

    Thanks for the feedback so far!
  • Huh, should have read about XAML before coding, would have used Photon SDK instead :)

    I guess nothing new for you - we get type initializing error when accessing anything from PhotonNetwork class.

    We build a Windows Store game and part of the UI is XAML based, part is Unity based, so non-XAML project is not an option.

    Any plans on XAML/C# project support?

    Tomas
  • Tobias
    Options
    Actually, I don't know what keeps this from running with XAML projects, so at the moment, I have no clue what to fix.
    I will take a look into it certainly but most likely I need to find the time to ask Unity about it.
  • It was my mistake, I forgot to add resources file to VS project and type loader failed because it was unable to get connection settings on static field initializer.

    Everything seems to work, simple things for now - I get prefabs instantiated and synchronized properly.

    Now we'll try building something real.
  • When I pass the certification, I get an error:

    [*]◦ API System.Threading.ThreadStart in MSCORLIB, PUBLICKEYTOKEN = B77A5C561934E089 not supported for this type of application. Assembly-CSharp.dll calls this API.
    ◦ API System.Security.Cryptography.MD5 in MSCORLIB, PUBLICKEYTOKEN = B77A5C561934E089 not supported for this type of application. Assembly-CSharp.dll calls this API.
    ◦ API System.Security.Cryptography.MD5CryptoServiceProvider in MSCORLIB, PUBLICKEYTOKEN = B77A5C561934E089 not supported for this type of application. Assembly-CSharp.dll calls this API.
    ◦ API System.Security.Cryptography.HashAlgorithm in MSCORLIB, PUBLICKEYTOKEN = B77A5C561934E089 not supported for this type of application. Assembly-CSharp.dll calls this API.
    ◦ API System.Collections.ArrayList in MSCORLIB, PUBLICKEYTOKEN = B77A5C561934E089 not supported for this type of application. Assembly-CSharp.dll calls this API.
    ◦ API System.Reflection.MethodInfo.op_Equality (System.Reflection.MethodInfo, System.Reflection.MethodInfo) in MSCORLIB, PUBLICKEYTOKEN = B77A5C561934E089 not supported for this type of application. Assembly-CSharp.dll calls this API.
  • Tobias
    Options
    I will take a look what's wrong. The library should not need this, so it seems to be in the code (scripts in the project).
  • Tobias
    Options
    The new package (linked in first post) will pass certification just fine. Make sure to keep the folder plugins and it's subfolders metro and wp8 plus all the dlls in there.
    On export to w8phone and w8rt, these subfolder dlls are used and they pass certification...