public void ConnectToServer(string ipToUse) { if (ipToUse != "") { ip = ipToUse; } InitializeClientData(); isConnected = true; tcp.Connect(); }
void Awake() { instance = this; DontDestroyOnLoad(this); lh = new Framework.Log.LogHandler(); var config = new ServerConfig(); var coder = new Coder(); TCPInstance = new TCP(config, coder); UpdateActions += TCPInstance.DoActions; TCPInstance.Connect(); UIInstance = new UIManager(); var userDataInst = UserData.Instance; var roomInst = Lobby.Instance; var battleInst = BattleData.Instance; var dialogInst = Dialog.Instance; Screen.sleepTimeout = SleepTimeout.NeverSleep; SceneManager.sceneLoaded += SceneManager_sceneLoaded; SceneManager.sceneUnloaded += SceneManager_sceneUnloaded; AssetBundleManager.Instance.LoadManifestAsyn(m => { /*SceneManager.LoadScene(1);*/ }, () => { }); UIInstance.PushWindowFromResource(WindowType.Loading, WinMsg.None); }
public void ConnectToServer() { InitializeClientData(); UIManager.instance.InitializeErrorCodes(); tcp.Connect(); }
public void ConnectToServer() { Debug.Log("connectto server"); InitializeClientData(); tcp.Connect(); }
private void ConsoleInput_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == 13) { ConsoleOutputList.Add(ConsoleInput.Text); ConsoleOutputList.Add(TCP.Connect(Mission.IP, ConsoleInput.Text, Mission.port)); ConsoleInput.Text = ""; GenerateText(); ConsoleWindow.Text = ConsoleOutput; remebered = ConsoleOutputList.Count; } if (e.KeyValue == 38) { if (remebered - 2 > 0) { remebered -= 2; ConsoleInput.Text = ConsoleOutputList[remebered]; } } if (e.KeyValue == 40) { if (remebered + 2 < ConsoleOutputList.Count) { remebered += 2; ConsoleInput.Text = ConsoleOutputList[remebered]; } else { ConsoleInput.Text = ""; } } }
public void ConnectToServer() { InitializeClientData(); isConnected = true; tcp.Connect(); }
public static void Connect(string _username, string _ip, int _port) { myUsername = _username; ip = _ip; port = _port; try { TcpClient tcpClient = new TcpClient(); Console.WriteLine("Connecting..."); tcpClient.Connect(_ip, _port); tcp = new TCP(); InitializeClientData(); isConnected = true; tcp.Connect(); Console.WriteLine("Connected."); } catch (Exception _ex) { Console.WriteLine($"An error occured: {_ex}"); } }
public void Connect() { tcp = new TCP(HandlePacket, Disconnect, OnConnectInvoked, OnConnectionFailedInvoked, (int _id) => { id = _id; }); isConnected = true; tcp.Connect(ip, port); }
public void ConnectToServer(String ipaddress, int port) { InitializeClientData(); isConnected = true; tcp.Connect(ipaddress, port); }
public void ConnectToServer(string addr = IP_ADDRESS) { Debug.Log($"Calling tcp.Connect() | Socket: {addr}:{PORT}"); InitializeClientData(); tcp = new TCP(); tcp.Connect(addr, PORT); }
public void ConnectToServer(bool _createNewPersonalData) { InitializeClientData(); isConnected = true; createNewPersonalData = _createNewPersonalData; tcp.Connect(); }
public void ConnectToServer(bool _console) { InitializeClientData(); isConnected = true; console = _console; tcp.Connect(); }
static void Main(string[] args) { Console.WriteLine("IP:"); string IP = Console.ReadLine(); Console.WriteLine("PORT:"); int port = int.Parse(Console.ReadLine()); Console.WriteLine("Mission Name:"); string missionName = Console.ReadLine(); double time = 0; while (true) { List <Image> images = new List <Image>(); images.Add(Image.FromFile(@"andrzej1.jpg")); images.Add(Image.FromFile(@"andrzej2.jpg")); images.Add(Image.FromFile(@"andrzej3.jpg")); images.Add(Image.FromFile(@"andrzej4.jpg")); images.Add(Image.FromFile(@"andrzej5.jpg")); foreach (var image in images) { TCP.Connect(IP, "SendUpdate " + missionName + " Images " + time + " " + Base64.ImageToBase64(image, ImageFormat.Jpeg), port); time += 0.2; Thread.Sleep(5000); } } }
//hack: e //private void Start() //{ // tcp = new TCP(); // udp = new UDP(); //} public void ConnectToServer(string _ipField) //public void ConnectToServer() => tcp.Connect(); { tcp = new TCP(); udp = new UDP(); var _ipFieldArray = Dns.GetHostAddresses(_ipField); foreach (var i in _ipFieldArray) { if (_ipField.Length > 0) { string[] subIP = i.ToString().Split('.'); if (subIP.Length == 4) { ip = i.ToString(); //InitializeClientData(); //tcp.Connect(); //TODO: fix this double connect bug - not to do with udp, i removed //break; //HACK: Remove this since bit would happen anyway at the end! } else { //TODO: IPV6 } } } Debug.Log(_ipField); //UDP doesn't connect. InitializeClientData(); tcp.Connect(); }
/// <summary>Attempts to connect to the server.</summary> public void ConnectToServer() { InitializeClientData(); isConnected = true; tcp.Connect(); // Connect tcp, udp gets connected once tcp is done }
public void ConnectToServerManager() { UnityEngine.Debug.Log("Connecting to ServerManager"); TcpClient tcpClient = new TcpClient(_serverManagerIP, _serverManagerPort); ServerManagerTCP = new TCP(); ServerManagerTCP.Connect(tcpClient, PacketHandlers.ServerManagerClient, false); }
public void ConnectToServer() { //Initializes the Data of the Client InitializeClientData(); //Calls the Connect() method tcp.Connect(); }
public void ConnectToServer() { tcp = new TCP(); udp = new UDP(); InitializeClientData(); tcp.Connect(); }
//클라이언트에서 사용할 때. public NetworkController(string serverAddress) { hostType = HostType.Client; GameObject nObj = GameObject.Find("Network"); network = nObj.GetComponent<TCP>(); network.Connect(serverAddress, PORT); }
public void ConnectToServer(string _userName) { Username = _userName; tcp = new TCP(); udp = new UDP(PacketHandlers.Client); tcp.Connect(ip, port, PacketHandlers.Client); GameManager.instance.SpawnPlayerUI(this); }
public static void ConnectToServer(string ip, int port = 23000) { isConnecting = true; desiredIp = (string.IsNullOrEmpty(ip))?"127.0.0.1":ip; tcp = new TCP(); udp = new UDP(); InitData(); tcp.Connect(desiredIp, port); }
public void ConnectToServer() { tcp = new TCP(); isConnected = true; tcp.Connect(); Debug.Log("Connected to server: " + tcp.socket.Client.RemoteEndPoint); GameSettings.activeConnection = GameSettings.Connection.Client; }
public void ConnectToServer() { tcp = new TCP(); udp = new UDP(); //sets up our network protocols InitializeClientData(); //self explanatory isConnected = true; tcp.Connect(); }
public static void initTCP() { var config = new ServerConfig(); var coder = new Coder(); TCPInstance = new TCP(config, coder); instance.UpdateActions += TCPInstance.DoActions; TCPInstance.Connect(); }
public void ConnectToServer() { tcp = tcp ?? new TCP(); udp = udp ?? new UDP(); InitializeClientData(); isConnected = true; tcp.Connect(Instance.serverIp, Instance.port); }
static string CommandExecute() { string respond; try { respond = TCP.Connect(Mission.IP, command, Mission.port); } catch (Exception e) { throw new UnableToConnectToServerException(); } clear(); return(respond); }
private IEnumerator LoginAttempt() { while (!isConnected) { if (connectionAttempt++ <= maxConnectionAttempts) { tcp.Connect(); Debug.Log($"Attempting Connection: {connectionAttempt} at: {Time.time}"); yield return(new WaitForSeconds(attemptOffset)); } else { Debug.Log("Sever is not responding."); isConnected = true; } } Debug.Log($"Connection successful on attempt: {connectionAttempt}"); }
public void ConnectToServer() // Connect to server btn { tcp = new TCP(); udp = new UDP(); InitializeClientData(); IsConnected = true; tcp.Connect(); }
public void ConnectToServer(GameserverInstance gameserverInstance) { tcp = new TCP(); udp = new UDP(PacketHandlers.Client); ip = gameserverInstance.IP; port = gameserverInstance.Port; tcp.Connect(ip, port, PacketHandlers.Client); GameManager.instance.SpawnPlayerUI(this); }
private void Start() { tcp = new TCP(); udp = new UDP(); InitializeClientData(); coroutine = LoginAttempt(); StartCoroutine(coroutine); tcp.Connect(); }
/// <summary>Attempts to connect to the server.</summary> public void ConnectToServer() { tcp = new TCP(); udp = new UDP(); InitializeClientData(); tcp.Connect(); // Connect tcp, udp gets connected once tcp is done }