Im using C# & NGUI in project. I hope you will understand.
source code:
- Code: Select all
public GameObject Name;
public GameObject Password;
public GameObject EMail;
public void OnClick()
{
PlayerIO.UnityInit(this);
/*
PlayerIO.QuickConnect.SimpleRegister(
Const.GameID,
Name.GetComponent<UIInput>().text,
Password.GetComponent<UIInput>().text,
"ddd@dd.ru",//EMail.GetComponent<UIInput>().text,
null, null, null, null,
onRegisterSuccess, oneRegisterError);
*/
PlayerIO.QuickConnect.SimpleRegister(
"gameid",
"ddd",
"wdwd",
"2ed@rr.ru",
null,null,null,null,
onRegisterSuccess, onRegisterError);
}
public void onRegisterSuccess(Client client)
{
Debug.Log("User connected to server");
//client.BigDB.Load(Const.UsersTable, null, onCreateUserInDB);
client.Multiplayer.CreateJoinRoom("test room","public",true,null,null, onRoomCreatingSuccess,null);
}
public void onRegisterError(PlayerIORegistrationError error)
{
Debug.Log("UserName error: " + error.UsernameError);
Debug.Log("Password error: " + error.PasswordError);
Debug.Log("EMail error: " + error.EmailError);
Debug.Log("Error: " + error.Message);
}
private void onCreateUserInDB(DatabaseObject DBObject)
{
DBObject.Set("Name", Name.GetComponent<UIInput>().text);
DBObject.Set("Password", Password.GetComponent<UIInput>().text);
DBObject.Set("EMail", EMail.GetComponent<UIInput>().text);
Debug.Log("User are added to db:" +
Name.GetComponent<UIInput>().text +
Password.GetComponent<UIInput>().text +
EMail.GetComponent<UIInput>().text);
}
private void onMessageHandler(Message message)
{
Debug.Log(message.Type.ToString());
}
public void onRoomCreatingSuccess(Connection connection)
{
connection.Send("Hello World");
}
here's the error: