Hi I am trying to connect to Photon Chat but I am not able to connect to it. Rather I am getting disconnected. If I don't put the
if(chatclient!=null)
chatclient.Service();
in the Update loop, it is not getting disconnected, but rather not getting connected as well. Well this is my code
public class PhotonChatController : MonoBehaviour, IChatClientListener
{
void Start()
{
if (string.IsNullOrEmpty(PhotonNetwork.PhotonServerSettings.AppSettings.AppIdChat))
Debug.Log("no CHat app ID provided");
ConnectToPhotonChat();
}
private void ConnectToPhotonChat()
{
chatclient = new ChatClient(this);
chatclient.ChatRegion="in";
chatclient.Connect(PhotonNetwork.PhotonServerSettings.AppSettings.AppIdChat,PhotonNetwork.AppVersion,
new Photon.Chat.AuthenticationValues(nickname));
Debug.Log("Connect to Photon Chat");
}
void Update()
{
if(chatclient!=null)
chatclient.Service();//in the update so that I constantly is connected and receiving messages
}
public void OnDisconnected()
{
Debug.Log("You have disconnected from the Photon Chat........");
}
public void OnConnected()
{
Debug.Log("You have successfully connected to the Photon Chat.......");
chatclient.SendPrivateMessage("chethan7", "INVITE......");
}
Actually speaking in the console "You have successfully connected to the Photon Chat.......",which is the one which gets executed when you successfully connect to Photon Chat should be executed.But that statement is not getting executed at all.