mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	Some more work on the world server.
This commit is contained in:
		| @@ -1,6 +1,7 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Net; | ||||
| using System.Net.Sockets; | ||||
| using System.Text; | ||||
| using System.Threading.Tasks; | ||||
| @@ -9,8 +10,31 @@ namespace FFXIVClassic_World_Server.DataObjects | ||||
| { | ||||
|     class ZoneServer | ||||
|     { | ||||
|         public string zoneServerIp; | ||||
|         public int zoneServerPort; | ||||
|         public readonly string zoneServerIp; | ||||
|         public readonly int zoneServerPort; | ||||
|         public bool isConnected = false; | ||||
|         public Socket zoneServerConnection; | ||||
|  | ||||
|         public ZoneServer(string ip, int port) | ||||
|         { | ||||
|             zoneServerIp = ip; | ||||
|             zoneServerPort = port; | ||||
|         } | ||||
|  | ||||
|         public void Connect() | ||||
|         { | ||||
|             Program.Log.Info("Connecting to zone server @ {0}:{1}", zoneServerIp, zoneServerPort); | ||||
|             IPEndPoint remoteEP = new IPEndPoint(IPAddress.Parse(zoneServerIp), zoneServerPort); | ||||
|             zoneServerConnection = new Socket(AddressFamily.InterNetwork, | ||||
|                 SocketType.Stream, ProtocolType.Tcp); | ||||
|  | ||||
|             try | ||||
|             { | ||||
|                 zoneServerConnection.Connect(remoteEP); | ||||
|                 isConnected = true; | ||||
|             } | ||||
|             catch (Exception e) | ||||
|             { Program.Log.Error("Failed to connect"); return; }             | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user