Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
7
Question by Matt- · May 02, 2012 at 12:02 AM · networkingrpcguid

NetworkMessageInfo sender.guid set to empty string "" or "0"?

I'm seeing weird behavior in an RPC.

My function looks something like this (simplified):

 [RPC]
 void AddPlayer( Vector3 position, Quaternion rotation, NetworkMessageInfo info )
 {
     print(info.sender.guid);
 }

This RPC is getting called from OnConnectedToServer.

Sometimes info.sender.guid is set to a correct looking guid.

Sometimes info.sender.guid is "0" which I think corresponds to the sender being the same as the receiver, which doesn't seem to be a problem if that's the case (but I can't find that documented anywhere).

However at other times info.sender.guid is "". This happens on the joining client but not the server. I'm not sure why this is happening or how to work around it (I need the guid for uniquely naming and identifying some objects).

I think the problem might be that the guid hasn't been assigned at the time I call the RPC (I'm calling it from OnConnectedToServer), but can't find any documentation about when the guid gets set.

  1. Does the sender.guid of "0" correspond to the receiver being the sender or is something else going wrong?

  2. Why is the guid blank for connecting clients (set to the empty string "")?

  3. At what point does the NetworkPlayer guid get assigned in the connection process?

Comment
Add comment · Show 2
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 drizzlybear · Apr 15, 2013 at 03:42 PM 0
Share

Would love to see the answer to this question-- particularly #3 on the list.

avatar image nventimiglia · Feb 25, 2014 at 01:07 AM 0
Share

Just ran into this. Passing old networkPlayers to clients when a new client connects. The index value is correct but the guild is string.empty.

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Matt- · May 02, 2012 at 10:28 PM

I'm working around it now by passing Network.player.guid as a parameter to my RPC (so it's void AddPlayer( Vector3 position, Quaternion rotation, string netPlayerGuid, NetworkMessageInfo info ) ).

But I'm still curious why it doesn't always come through correctly in NetworkMessageInfo.

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

RPC calls to a function with a same name in different scripts 1 Answer

RPC function order 0 Answers

Is server the sender of RPC? 0 Answers

How can I send RPC from one client to another client directly in multiplayer game? 0 Answers

RPC setName() not working correctly 0 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