From 03628b0d3ceb15a0644ceffb2cf7e9e46a5aa6be Mon Sep 17 00:00:00 2001 From: NOT-FOUND-404-UI <57438209+NOT-FOUND-404-UI@users.noreply.github.com> Date: Sat, 30 Apr 2022 11:43:02 +0900 Subject: [PATCH] Update PhiClient.cs In the previous method, it was not possible to specify the port number when connecting. Performs the process of splitting the server address and server port in recognition of the colon. --- Source/PhiClient/PhiClient.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Source/PhiClient/PhiClient.cs b/Source/PhiClient/PhiClient.cs index 14ff769..6970d94 100644 --- a/Source/PhiClient/PhiClient.cs +++ b/Source/PhiClient/PhiClient.cs @@ -69,7 +69,20 @@ public void TryConnect() Disconnect(); } - client = new Client(serverAddress, 16180); + // Edited by [NOT-FOUND-404-UI] + // --------------------------------------------------------------- + int serverPort = new int(); + if (0 <= serverAddress.IndexOf(":")) { + string[] temp = new string[2]; + temp = serverAddress.Split(':'); + serverAddress = temp[0]; + serverPort = int.Parse(temp[1]); + } else { + serverPort = PORT; + } + client = new Client(serverAddress, serverPort); + // --------------------------------------------------------------- + //client = new Client(serverAddress,16180); client.Connection += ConnectionCallback; client.Message += MessageCallback; client.Disconnection += DisconnectCallback; @@ -382,4 +395,4 @@ public void ChangeNickname(string newNickname) }); } } -} \ No newline at end of file +}