Problem with private messages in SFSIslandDemo

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

COB
Posts: 68
Joined: 28 Dec 2010, 08:54

Problem with private messages in SFSIslandDemo

Postby COB » 28 Dec 2010, 09:22

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.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 28 Dec 2010, 12:40

Are you sending to yourself? Or another player?

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

/T
COB
Posts: 68
Joined: 28 Dec 2010, 08:54

Postby COB » 28 Dec 2010, 12:51

I am sending PM to other player. Public messages are passed without any problems.
COB
Posts: 68
Joined: 28 Dec 2010, 08:54

Postby COB » 29 Dec 2010, 18:50

Problem solved by the SmartFoxClient-1.2.7-rc1.dll patch...
skyhaiwei
Posts: 1
Joined: 22 Jan 2011, 09:07

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

Postby skyhaiwei » 22 Jan 2011, 09:14

COB wrote:SmartFoxClient-1.2.7-rc1.dll Where can I get? patch...
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 22 Jan 2011, 11:41

Its a sticky right above this post :-)

viewtopic.php?t=8572

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 19 guests