Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • Bugs /
avatar image
Question by simonl · Nov 05, 2020 at 06:31 AM · multiplayer

FormatException on Network reconnect,FormatException spam after a reconnect

Hi,

We're using Playfab on Windows 10 for multiplayer and using an xbox live token to sign in.

We are able to successfully get two players into a network for the first time. One player calls CreateAndJoinNetwork() and the other uses JoinNetwork(string networkId). Once we've disconnected them both call LeaveNetwork successfully. The problem then arrises when we attempt to re-connect them. The host is able to create a Network without any issues but when the client calls JoinNetwork we receive hundereds of errors inside the Playfab SDK on both host and client. The exception is:

FormatException: Input string was not in a correct format.
  at System.Number.StringToNumber (System.String str, System.Globalization.NumberStyles options, System.Number+NumberBuffer& number, System.Globalization.NumberFormatInfo info, System.Boolean parseDecimal) [0x00057] in <fb001e01371b4adca20013e0ac763896>:0 
  at System.Number.ParseUInt64 (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) [0x00014] in <fb001e01371b4adca20013e0ac763896>:0 
  at System.UInt64.Parse (System.String s, System.IFormatProvider provider) [0x00008] in <fb001e01371b4adca20013e0ac763896>:0 
  at System.Convert.ToUInt64 (System.String value) [0x0000c] in <fb001e01371b4adca20013e0ac763896>:0 
  at PlayFab.Party._Internal.PlayFabChatXboxLivePolicyProvider.GetPlayerByXuid (System.UInt64 xuid) [0x0001f] in C:\Repositories\PhogsProjects\Phogs\Assets\Plugins\Playfab\PlayFabPartySDK\Source\Scripts\PartyUnitySDK\PlayFabChatXboxLivePolicyProvider.cs:556 
  at PlayFab.Party._Internal.PlayFabChatXboxLivePolicyProvider.IsReadyToSetChatPermissions (PartyXBLCSharpSDK.PARTY_XBL_CHAT_USER_HANDLE localXblChatUser, PartyXBLCSharpSDK.PARTY_XBL_CHAT_USER_HANDLE targetXblChatUser) [0x0003b] in C:\Repositories\PhogsProjects\Phogs\Assets\Plugins\Playfab\PlayFabPartySDK\Source\Scripts\PartyUnitySDK\PlayFabChatXboxLivePolicyProvider.cs:409 
  at PlayFab.Party._Internal.PlayFabChatXboxLivePolicyProvider.ProcessQueuedOperations () [0x00001] in C:\Repositories\PhogsProjects\Phogs\Assets\Plugins\Playfab\PlayFabPartySDK\Source\Scripts\PartyUnitySDK\PlayFabChatXboxLivePolicyProvider.cs:268 
  at PlayFab.Party.PlayFabMultiplayerManager.ProcessQueuedOperations () [0x000c2] in C:\Repositories\PhogsProjects\Phogs\Assets\Plugins\Playfab\PlayFabPartySDK\Source\Scripts\PartyUnitySDK\PlayFabMultiplayerManager.cs:767 
  at PlayFab.Party.PlayFabMultiplayerManager.Update () [0x00012] in C:\Repositories\PhogsProjects\Phogs\Assets\Plugins\Playfab\PlayFabPartySDK\Source\Scripts\PartyUnitySDK\PlayFabMultiplayerManager.cs:144 


So far all I've figured out is that the _platformSpecificUserId inside PlayfabPlayer is mapped to the Xbox Live XUID of our players during the first play session but when they reconnect it's set to the same value as EntityKey.ID but I can't figure out why.

Any help would be greatly appreciated.

Thanks,

Si

Comment

People who like this

0 Show 10
10 |1200 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 Citrus Yan ♦ · Nov 05, 2020 at 07:07 AM 0
Share

May I know the SDK you're using along with its version?

avatar image simonl · Nov 05, 2020 at 08:01 AM 0
Share

Hi @Citrus Yan,

We're using Playfab Party version: https://github.com/PlayFab/PlayFabPartyUnity/releases/tag/1.5.0.1-main.0

And Playfab SDK Version: 2.97.201014.

Thanks

avatar image Citrus Yan ♦ simonl · Nov 05, 2020 at 08:11 AM 0
Share

Cool, we will try to reproduce this issue from our side and keep you updated.

avatar image Citrus Yan ♦ simonl · Nov 05, 2020 at 08:12 AM 0
Share

Actually, it would be helpful if you can provide the code snippet you were using, along with the brief steps to reproduce the issue. Do you mind sharing that?

avatar image simonl Citrus Yan ♦ · Nov 05, 2020 at 08:39 PM 0
Share

Hi Citrus,

Sorry for the delay. I will put together a small sample project for you tomorrow and send that across (I'm based in the UK).

I will make sure I include a readme with some reproduction steps as well.

Show more comments
Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image

Answer by Bob Cowburn · Nov 06, 2020 at 03:39 PM

I have exactly the same problem. Using the same SDKs as yourself. My fix was to put protection on the line that causes the exception.

private PlayFabPlayer GetPlayerByXuid(ulong xuid)
        {
            PlayFabPlayer player = null;
            foreach (PlayFabPlayer currentPlayer in _multiplayerManager.RemotePlayers)
            {
                ulong currentPlayerXuid = 0;    

                if (!string.IsNullOrEmpty(currentPlayer._platformSpecificUserId))  <--- ***Fixed here***
                    currentPlayerXuid = Convert.ToUInt64(currentPlayer._platformSpecificUserId);
 
                if (currentPlayerXuid != 0 &&
                    xuid != 0 &&
                    currentPlayerXuid == xuid)
                {
                    player = currentPlayer;
                    break;
                }
            }

            return player;

        }<br>

After doing this, I have found other errors that occur. Can provide you with details, you may experience the same yourself.

The fix is not ideal, but it prevents the constant error logging and allows you to progress a little.

Comment

People who like this

0 Show 4 · Share
10 |1200 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 Bob Cowburn · Nov 06, 2020 at 04:03 PM 0
Share

It's possible you may be experiencing this problem also. It could be related to the issue (of course I'm only guessing about this). The exception only fires once, with apparently benign effects, its easy to miss in the log.


https://community.playfab.com/questions/46355/exception-thrown-in-party-create-new-network-compl.html

avatar image Citrus Yan ♦ Bob Cowburn · Nov 09, 2020 at 07:45 AM 0
Share

Thanks for sharing your insights with us!

avatar image simonl · Nov 09, 2020 at 10:47 AM 0
Share

Hi Bob,

Thank you for your reply!

When I put the above fix in I start receiving the following repeated errors (Truncated for character limit):

[GamepassLobby] Playfab Network Error. Type Error. Code: 20481. Message a user with this Xbox Live user id already exists.
Lobby:OnError(Object, PlayFabMultiplayerManagerErrorArgs) (at C:\Repositories\Playfab\Playfab\Assets\Scripts\Lobby.cs:86)
PlayFab.Party.PlayFabMultiplayerManager:_LogError(UInt32, PlayFabMultiplayerManagerErrorType) (at C:\Repositories\Playfab\Playfab\Assets\PlayFabPartySDK\Source\Scripts\PartyUnitySDK\PlayFabMultiplayerManager.cs:475)

a user with this Xbox Live user id already exists
PlayFab.Party.PlayFabMultiplayerManager:_LogError(String) (at C:\Repositories\Playfab\Playfab\Assets\PlayFabPartySDK\Source\Scripts\PartyUnitySDK\PlayFabMultiplayerManager.cs:450)
PlayFab.Party.PlayFabMultiplayerManager:_LogError(UInt32, PlayFabMultiplayerManagerErrorType) (at C:\Repositories\Playfab\Playfab\Assets\PlayFabPartySDK\Source\Scripts\PartyUnitySDK\PlayFabMultiplayerManager.cs:478)

Are these the same errors you see?

avatar image Bob Cowburn simonl · Nov 09, 2020 at 11:15 AM 0
Share

Yes, same problem. I had a brief look at why, it's related to the same issue, i.e. the empty string '_platformSpecificUserId ', and the fix to prevent the exception.

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.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    Problems with legacy multiplayer 1 Answer

    Why are all my attempts at using the Dedicated Server Setup ending in TooManyServerRestarts? (Unreal Engine 4.25.3) 2 Answers

    Multiplayer server stability? 1 Answer

    Asset with Id xxxxx.zip is not found 2 Answers

    "Waiting for heartbeats from the game server" stuck issue 2 Answers

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges