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
2
Question by siddharth3322 · Feb 09, 2015 at 03:52 PM · multiplayerphotonfacebook

Play Game with FaceBook Friend

Basically I am developing two player Tic Tac Toe game. I am using Photon as my game server and normal working of this game is perfect.

For this game, I want to add FaceBook support through which player can send request to other friend so that they can play together.

At present I have working code with other player receiving notification about playing request. But now I want to implement both player can able to play game in same room. Means I want to create private room for both of these players so that they can play together.

But I can't able to detect they are FaceBook friend and want to play together. Please give some suggestion in implementing this. Only some though become enough for me.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by tobiass · Feb 13, 2015 at 01:49 PM

If you are able to invite your friend, you usually can include a custom message / info in that invitation. Then it's easy, as Photon uses a "room name" as ID for each room. When you make up a room name and send it, then both players can join this room.

Best of all, we have PhotonNetwork.JoinOrCreateRoom(). Both players can call this method to get into the room by name - no matter who happens to call this first.

If you can't send a room name, you can derive one from the invitation itself, too! Let's say "playerA" invites "playerB", then the room name can be "playerA"+"playerB"+date.ToString(), e.g.

Check out the PhotonNetwork-Documentation.chm in the PUN package for the API reference. See "Custom Authentication with Facebook" for help with custom auth and using FB userIDs in PUN.

Comment
Add comment · Show 3 · 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 siddharth3322 · Feb 13, 2015 at 01:59 PM 0
Share

@tobiass, Thanks for your reply. First of all, I can't able to understand Custom Authentication with Facebook available in Photon. What is the purpose of that? Please give some advice for that.

avatar image tobiass · Feb 13, 2015 at 02:28 PM 1
Share

Custom Authentication in Photon means that our server asks another server if the user's "login" is O$$anonymous$$ and if you allow the connection to Photon. You basically build a web service which checks user authentication before clients can connect to Photon.

It's optional. If you want that, check the linked page.

avatar image siddharth3322 · Feb 13, 2015 at 02:40 PM 0
Share

$$anonymous$$eans using Custom Authentication with Facebook, I don't need to check if player has connected with Facebook or not. Am I right in this?

If the player was not connected then we have to move to that page.

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

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Cannot Instantiate Player on PhotonNetwork 0 Answers

Player Instantiate won't work 2 Answers

photon rematching game doesn't work 0 Answers

Photon / Multiplayer - Bootcamp Demo 3 Answers

PUN 2 : Impossible to applied damage to all player in overlapSphere created by a bomb ? 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