How to make Personal Chat within a room?

Options
Hi,
I am using photon plugin for enterprise server, and Javascript in client side. My players are able to join a room and chat with all others in that room. Now I want to make a option for personal chat also within the room. This means after joining a room, player can send personal message to any member of that room. Is this possible in Photon? If possible How can I Achieve this?

Best Answers

  • JohnTube
    JohnTube ✭✭✭✭✭
    Answer ✓
    Options
    Hi @soumen_rjs,

    If you want to send a message to a single actor then it should be possible to select target actor when raising an event.

    Otherwise I could not get what you want to achieve.
  • vadim
    vadim mod
    Answer ✓
    Options
    According to js sdk documentation, array of numbers should be passed as 'targretActors' in 'options' parameter: { targetActors: [actorNr] }

Answers

  • JohnTube
    JohnTube ✭✭✭✭✭
    Answer ✓
    Options
    Hi @soumen_rjs,

    If you want to send a message to a single actor then it should be possible to select target actor when raising an event.

    Otherwise I could not get what you want to achieve.
  • soumen_rjs
    edited January 2017
    Options
    Thank you @JohnTube
    This is exactly what I want. Can you please share a piece of code for selecting the target actor while raising the event
    Now I am using this: raiseEvent(1, { message: "Hello", senderName: this.myActor().name });
    This sends message to all actors. But I want to send this message to only one actor
  • soumen_rjs
    edited January 2017
    Options
    I have used: raiseEvent(1, { message: "Hello", senderName: this.myActor().name },{targetActors:actrNr});

    where actrNr is the actor number. Now no message is delivered to anyone when I am using the targetActors Parameter. Am I doing something wrong?
  • soumen_rjs
    edited January 2017
    Options
    Thank you @JohnTube
    You have gave me the concept. But still Stuck in the code :(
  • vadim
    vadim mod
    Answer ✓
    Options
    According to js sdk documentation, array of numbers should be passed as 'targretActors' in 'options' parameter: { targetActors: [actorNr] }
  • soumen_rjs
    edited January 2017
    Options
    Thanks a lot @vadim