Page 1 of 1

Problem with private messages in SFSIslandDemo

Posted: 28 Dec 2010, 09:22
by COB
I am trying to implement private messages to the SFSIslandDemo, but unfortunately something is not working properly. I added this code:

Code: Select all

   private void SendPrivateChatMessage(String message, int userId) {
      Debug.Log("pm to: " + userId + " my id: " +SmartFox.Connection.myUserId);
      SmartFoxClient client = NetworkController.GetClient();
      client.SendPrivateMessage(message, userId);   
   }

to the ChatController.cs, and for sure appropriate debug log is showed when private message is sent. I double checked all player IDs.
I have also this code:

Code: Select all

SFSEvent.onPrivateMessage += OnPrivateMessage;

in network controller, and of course also this function:

Code: Select all

   public void OnPrivateMessage(string message, User fromUser, int roomId, int receiverId)
   {
      Debug.Log("pm from: " + fromUser.GetId() + " receiverid: " +receiverId);
   }

However, this debug log is not displayed so I assume that private message is sent but it is not received.

Posted: 28 Dec 2010, 12:40
by ThomasLund
Are you sending to yourself? Or another player?

Because I'm pretty sure that you dont receive messages send to yourself.

/T

Posted: 28 Dec 2010, 12:51
by COB
I am sending PM to other player. Public messages are passed without any problems.

Posted: 29 Dec 2010, 18:50
by COB
Problem solved by the SmartFoxClient-1.2.7-rc1.dll patch...

SmartFoxClient-1.2.7-rc1.dll Where can I get?

Posted: 22 Jan 2011, 09:14
by skyhaiwei
COB wrote:SmartFoxClient-1.2.7-rc1.dll Where can I get? patch...

Posted: 22 Jan 2011, 11:41
by ThomasLund
Its a sticky right above this post :-)

viewtopic.php?t=8572