static void Main(string[] args) { items.Load("items.otb"); Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); server.Bind(new IPEndPoint(IPAddress.Any, 41567)); server.Listen(10); Console.WriteLine("[Info] Waiting for connections"); while (true) { var socket = server.Accept(); Console.WriteLine("[Info] Connection from " + socket.RemoteEndPoint.ToString()); if (socket != null) { lock (connections) { connections.Add(new Connection(socket, items)); } } } }
private void LoadItems() { try { otItems = new OtItems(); otItems.Load("items.otb"); Trace.WriteLine("Open Tibia items successfully loaded."); } catch (Exception e) { MessageBox.Show(this, "Unable to load items. Details: " + e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } }