public static void InitNetwork() { Console.WriteLine("INIT Packets..."); ServerHandleData.InitializePackets(); serverSocket.Start(); serverSocket.BeginAcceptTcpClient(new AsyncCallback(OnClientConnect), null); }
public static void InitializeNetwork() { Yazi.Log_yaz("Paketleriniz Başlatılıyor"); ServerHandleData.InitializePackets(); serverSocket.Start(); serverSocket.BeginAcceptTcpClient(new AsyncCallback(OnClientConnet), null); }
private static void SetupServer() { for (int i = 0; i < Constants.MAX_PLAYERS; i++) { Types.TempPlayer[i] = new Types.TempPlayerRec(); } ServerHandleData.InitMessages(); NetworkSocket.Instance.ServerStart(); MySql.MySqlInit(); Database.InitializeCardDatabase(); }
private void OnReceiveData(IAsyncResult result) { try { int length = stream.EndRead(result); if (length <= 0) { CloseConnection(); return; } byte[] newBytes = new byte[length]; Array.Copy(recBuffer, newBytes, length); ServerHandleData.HandleData(connectionID, newBytes); stream.BeginRead(recBuffer, 0, socket.ReceiveBufferSize, OnReceiveData, null); } catch (Exception) { CloseConnection(); return; } }