Problem with private messages in SFSIslandDemo

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

Moderators: Lapo, Bax

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

Problem with private messages in SFSIslandDemo

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

Post by ThomasLund »

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

Post by COB »

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

Post by COB »

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?

Post by skyhaiwei »

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

Post by ThomasLund »

Post Reply