public void MostrarRanking() { if (ChannelServices.RegisteredChannels.Length == 0) { Debug.Log("canal null"); canal = new TcpClientChannel(); ChannelServices.RegisterChannel(canal, false); } I_damas obj = (I_damas)Activator.GetObject( typeof(I_damas), "tcp://localhost:5555/serverDamas"); if (obj.Equals(null)) { Debug.Log("Error"); } else { List <String> usuarios = obj.Ranking(); for (int i = 0; i < usuarios.Count; i = i + 3) { nick.text = nick.text + "\n" + usuarios[i]; puntaje.text = puntaje.text + "\n" + usuarios[i + 1]; ganadas.text = ganadas.text + "\n" + usuarios[i + 2]; } } }
public static I_damas conectarCliente() { TcpChannel canal = new TcpChannel(); ChannelServices.RegisterChannel(canal, false); I_damas obj = (I_damas)Activator.GetObject( typeof(I_damas), "tcp://localhost:5555/serverDamas"); if (obj.Equals(null)) { Debug.Log("Error"); return(null); } else { return(obj); } }
public Boolean EditarUsuario() { if (ChannelServices.RegisteredChannels.Length == 0) { Debug.Log("canal null"); canal = new TcpClientChannel(); ChannelServices.RegisterChannel(canal, false); } I_damas obj = (I_damas)Activator.GetObject( typeof(I_damas), "tcp://localhost:5555/serverDamas"); if (obj.Equals(null)) { Debug.Log("Error"); return(false); } else { return(obj.Actualizar(IdUsuario, Nick, Nombre, Correo)); } }
public Usuario IniciarSesion() { if (ChannelServices.RegisteredChannels.Length == 0) { Debug.Log("canal null"); canal = new TcpClientChannel(); ChannelServices.RegisterChannel(canal, false); } I_damas obj = (I_damas)Activator.GetObject( typeof(I_damas), "tcp://localhost:5555/serverDamas"); if (obj.Equals(null)) { Debug.Log("Error"); return(null); } else { string pass = HashPassword(); List <String> usuario = obj.Ingresar(Nick, pass); IdUsuario = Convert.ToInt32(usuario[0]); Nick = usuario[1]; Nombre = usuario[2]; Password = usuario[3]; Correo = usuario[4]; List <int> registros = obj.Registros(IdUsuario); if (registros == null) { RegistrosU = new Registro(0, 0, 0, 0); } else { RegistrosU = new Registro(registros[1], registros[2], registros[3], registros[0]); } return(this); } }
public Boolean RegistrarUsuario() { if (ChannelServices.RegisteredChannels.Length == 0) { Debug.Log("canal null"); canal = new TcpClientChannel(); ChannelServices.RegisterChannel(canal, false); } I_damas obj = (I_damas)Activator.GetObject( typeof(I_damas), "tcp://localhost:5555/serverDamas"); if (obj.Equals(null)) { Debug.Log("Error"); return(false); } else { string pass = HashPassword(); Boolean flag = obj.RegistrarUsuario(Nick, Nombre, pass, Correo); return(flag); } }