/// <summary> /// Connects to target. /// If platform doesn't require connection, just return true. /// </summary> public bool Connect() { if (_ps3mapi == null) { _ps3mapi = new PS3MAPI(); } bool ret = false; if (_ps3mapi.IPAddr == "127.0.0.1") { ret = _ps3mapi.ConnectTarget(); } else { ret = _ps3mapi.ConnectTarget(_ps3mapi.IPAddr); } return(ret); }
static void ConnectAPI() { try { //Takes IP Address in input, and connects through the ConnectTarget function Console.WriteLine("Insert IP Address please"); string IPAddr = Console.ReadLine(); API.ConnectTarget(IPAddr); isConnected = true; ConsoleTitle += "Connected!"; Console.ForegroundColor = ConsoleColor.Green; API.PS3.Notify("Please don't cheat, this will ruin your fun!"); Console.WriteLine("Succesfully connected, and please don't go in GTA Online cos i'm probably playing it rn."); Console.ResetColor(); } catch (Exception e) { //If something fails, throws this error Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Something bad happened during connection"); Console.ResetColor(); } }