Subject: How can I use MucManager?
Hi everyone. I'm trying to make a simple demo app using xmpp.
My environment is Unity3D, and MatriX for Mono.
I could make a connection to my xmpp server(openfire), and succeeded to make a chat with other clients(spark, adium...).
Now I'm trying to make a multi user chat with MucManager, but I can't make.
When I call MucManager.EnterRoom, connection is disappeared.. here is my code.
What's my mistake?
XmppClient _xmppClient = null;
MucManager _mucManager = null;
-------------------------------------------------------
No error logs but no connection appeared in server admin page. can you help me?
My environment is Unity3D, and MatriX for Mono.
I could make a connection to my xmpp server(openfire), and succeeded to make a chat with other clients(spark, adium...).
Now I'm trying to make a multi user chat with MucManager, but I can't make.
When I call MucManager.EnterRoom, connection is disappeared.. here is my code.
What's my mistake?
XmppClient _xmppClient = null;
MucManager _mucManager = null;
- void Start () {
- input.onSubmit = onsubmit;
- _xmppClient = XmppManager.instance.xmpp; //my singleton instance
- _mucManager = XmppManager.instance.muc; //my singleton instance
- Connect ();
- }
- public bool Connect() {
- try {
- _xmppClient.SetUsername("myID");
- _xmppClient.Password = "password";
- _xmppClient.SetXmppDomain("my-pc");
- _xmppClient.ResolveSrvRecords = false;
- _xmppClient.Hostname = "192.168.3.125";
- _xmppClient.Port = 5222;
- _xmppClient.Status = "I can chat";
- _xmppClient.Show = Matrix.Xmpp.Show.chat;
- _xmppClient.AutoRoster = true;
- _xmppClient.AutoPresence = true;
- _xmppClient.OnMessage += xmppClient_OnMessage;
- _xmppClient.OnLogin += xmppClient_OnLogin;
- _xmppClient.OnPresence += xmppClient_OnPresence;
- _xmppClient.Open();
- return true;
- } catch (Exception ex) {
- Debug.Log(ex.ToString());
- return false;
- }
- }
- private void xmppClient_OnLogin(object sender, Matrix.EventArgs e) {
- Join(); //if xmppClient is OK, try to join chat room
- }
- public bool Join() {
- try {
- Debug.Log ("join");
- //I've already made the group chat room name 'aaaa' with openfire server admin page.
- _mucManager.EnterRoom(jid, "nick");
- return true;
- } catch (Exception ex) {
- return false;
- }
- }
-------------------------------------------------------
No error logs but no connection appeared in server admin page. can you help me?