bool FUniqueNetIdRepl::ImportTextItem(const TCHAR*& Buffer, int32 PortFlags, UObject* Parent, FOutputDevice* ErrorText)
{
	SetUniqueNetId(nullptr);

	bool bShouldWarn = true;
	if (Buffer)
	{
		static FString InvalidString(TEXT("INVALID"));
		if (Buffer[0] == TEXT('\0') || Buffer == InvalidString)
		{
			// An empty string or the word invalid are just considered expected invalid FUniqueNetIdRepls. No need to warn about those.
			bShouldWarn = false;
		}
		else
		{
			checkf(UOnlineEngineInterface::Get() && UOnlineEngineInterface::Get()->IsLoaded(), TEXT("Attempted to ImportText to FUniqueNetIdRepl while OSS is not loaded. Parent:%s"), *GetPathNameSafe(Parent));
			FString Contents(Buffer);
			UniqueIdFromString(Contents);
		}
	}

	if (bShouldWarn && !IsValid())
	{
#if !NO_LOGGING
		ErrorText->CategorizedLogf(LogNet.GetCategoryName(), ELogVerbosity::Warning, TEXT("Failed to import text to FUniqueNetIdRepl Parent:%s"), *GetPathNameSafe(Parent));
#endif
	}

	return true;
}
Example #2
0
void FLiveEditorManager::Initialize()
{
	PmError Error = Pm_Initialize();
	if ( Error != pmNoError )
		return;

	FindDevices();
	MIDIBuffer = new PmEvent[DEFAULT_BUFFER_SIZE];

	GConfig->GetArray(TEXT("LiveEditor"), TEXT("ActiveBlueprintTemplates"), ActiveBlueprintTemplates, GEditorUserSettingsIni);
	for ( int32 i = ActiveBlueprintTemplates.Num()-1; i >= 0; --i )
	{
		FString &Name = ActiveBlueprintTemplates[i];
		if ( !FPackageName::DoesPackageExist(*Name) )
		{
			ActiveBlueprintTemplates.RemoveAt(i);
			GConfig->SetArray(TEXT("LiveEditor"), TEXT("ActiveBlueprintTemplates"), ActiveBlueprintTemplates, GEditorUserSettingsIni);
			GConfig->Flush(false, GEditorUserSettingsIni);
		}
	}

	LiveEditorUserData = new FLiveEditorUserData();

	bInitialized = true;
}
Example #3
0
void FLiveEditorManager::RegisterEventListener( UObject *Target, FName EventName )
{
	if ( !Target )
		return;

	UFunction *Function = Target->FindFunction( EventName );
	if ( Function == NULL )
		return;

	ULiveEditorBlueprint *Blueprint = Cast<ULiveEditorBlueprint>(Target);
	check( Blueprint != NULL );
	
	FString BlueprintName = Blueprint->GetName();
	int32 chopIndex = BlueprintName.Find( TEXT("_C"), ESearchCase::CaseSensitive, ESearchDir::FromEnd );
	if ( chopIndex != INDEX_NONE )
	{
		BlueprintName = BlueprintName.LeftChop( BlueprintName.Len() - chopIndex );
	}

	const FLiveEditBinding* Binding = LiveEditorUserData->GetBinding( BlueprintName, EventName.ToString() );
	if ( Binding != NULL )
	{
		ILiveEditListener *Listener = new ILiveEditListener(EventName, *Binding, Target);
		int ID = LISTENER_ID(Listener->Binding.Channel,Listener->Binding.ControlID); //needs to remain int (instead of int32) since numbers are derived from TPL that uses int
		EventListeners.Add(ID,Listener);
	}
	else
	{
		FString Message = FString::Printf( TEXT("A LiveEditor Event (%s) is not bound and will not work. Please Re-bind this LiveEditorBlueprint in the LiveEditor Control Panel"), *EventName.ToString() );
		FPlatformMisc::MessageBoxExt( EAppMsgType::Ok, *Message, *NSLOCTEXT("MessageDialog", "DefaultDebugMessageTitle", "ShowDebugMessagef").ToString() );
	}
}
Example #4
0
BOOL DimensionDialog::OnInitDialog()
{
   HWND listHwnd = GetDlgItem(IDC_TABLE_DIM_LIST).GetHwnd();
   LVCOLUMN lvc;
   LVITEM lv;
   ListView_SetExtendedListViewStyle(listHwnd, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
   memset(&lvc, 0, sizeof(LVCOLUMN));
   lvc.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_FMT;
   lvc.cx = 150;
   lvc.pszText = TEXT("Manufacturer");
   ListView_InsertColumn(listHwnd, 0, &lvc);
   lvc.cx = 60;
   lvc.pszText = TEXT("Width");
   ListView_InsertColumn(listHwnd, 1, &lvc);
   lvc.cx = 60;
   lvc.pszText = TEXT("Height");
   ListView_InsertColumn(listHwnd, 2, &lvc);

   if (listHwnd != NULL)
      ListView_DeleteAllItems(listHwnd);
   lv.mask = LVIF_TEXT;
   char textBuf[32];
   for (int i = 0; i < DIM_TABLE_SIZE; i++)
   {
      lv.iItem = i;
      lv.iSubItem = 0;
      lv.pszText = dimTable[i].name;
      ListView_InsertItem(listHwnd, &lv);
      sprintf_s(textBuf, "%.03f", dimTable[i].width);
      ListView_SetItemText(listHwnd, i, 1, textBuf);
      sprintf_s(textBuf, "%.03f", dimTable[i].height);
      ListView_SetItemText(listHwnd, i, 2, textBuf);
   }
   return TRUE;
}
Example #5
0
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Execute command
HRESULT Execute(PTSTR ptzCmd, CXT& XT)
{
	while ((*ptzCmd == ' ') || (*ptzCmd == '\t')) ptzCmd++;
	if (*ptzCmd == '[')
	{
		XT.hXVar = Import((PTSTR) XT.ptzCur, &XT.ptzNext);
	}
	else if (*ptzCmd && (*ptzCmd != ';'))
	{
		if (g_hWnd)
		{
			Log(ptzCmd);
			Log(TEXT("\r\n"));
			XT.hXVar = Dispatch(ptzCmd, XT);

			TCHAR tzStr[MAX_PATH];;
			UINT i = UStrPrint(tzStr, TEXT("     %08X "), XT.hXVar);
			i += FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, XT.hXVar, 0, tzStr + i, _NumOf(tzStr), NULL);
			UStrCopy(tzStr + i, (tzStr[i - 1] == '\n') ? TEXT("\r\n") : TEXT("\r\n\r\n"));

			Log(tzStr);
		}
		else
		{
			XT.hXVar = Dispatch(ptzCmd, XT);
		}
	}
	return XT.hXVar;
}
	virtual IOnlineSubsystemPtr CreateSubsystem(FName InstanceName)
	{
		if (!GooglePlaySingleton.IsValid())
		{
			GooglePlaySingleton = MakeShareable(new FOnlineSubsystemGooglePlay());
			if (GooglePlaySingleton->IsEnabled())
			{
				if(!GooglePlaySingleton->Init())
				{
					UE_LOG(LogOnline, Warning, TEXT("FOnlineSubsystemGooglePlayModule failed to initialize!"));
					DestroySubsystem();
				}
			}
			else
			{
				UE_LOG(LogOnline, Warning, TEXT("FOnlineSubsystemGooglePlayModule was disabled"));
				DestroySubsystem();
			}

			return GooglePlaySingleton;
		}

		UE_LOG_ONLINE(Warning, TEXT("Can't create more than one instance of a Google Play online subsystem!"));
		return NULL;
	}
TSharedRef< FSlateStyleSet > FCrashReportClientStyle::Create()
{
	TSharedRef<FSlateStyleSet> StyleRef = MakeShareable(new FSlateStyleSet("CrashReportClientStyle"));
	FSlateStyleSet& Style = StyleRef.Get();

	const FTextBlockStyle DefaultText = FTextBlockStyle()
		.SetFont(TTF_FONT("Fonts/Roboto-Black", 10))
		.SetColorAndOpacity(FSlateColor::UseForeground())
		.SetShadowOffset(FVector2D::ZeroVector)
		.SetShadowColorAndOpacity(FLinearColor::Black);

	// Set the client app styles
	Style.Set(TEXT("Code"), FTextBlockStyle(DefaultText)
		.SetFont(TTF_FONT("Fonts/DroidSansMono", 8))
		.SetColorAndOpacity(FSlateColor(FLinearColor::White * 0.8f))
	);

	Style.Set(TEXT("Title"), FTextBlockStyle(DefaultText)
		.SetFont(TTF_FONT("Fonts/Roboto-Bold", 12))
	);

	Style.Set(TEXT("Status"), FTextBlockStyle(DefaultText)
		.SetColorAndOpacity(FSlateColor::UseSubduedForeground())
	);

	return StyleRef;
}
bool CPLPSolver::pointSatisfiesConstraints(float tx, float ty, int n, float d, bool onlyCircles)
{
	if (debug)
	{
		UE_LOG(LogRVOTest, Warning, TEXT("pointsatisfies: tx ty n d %f %f %d %f"), tx, ty, n, d);
	}
	for (int j = 0; j <= n; j++)
	{
		if (onlyCircles && constraintTypes[order[j]] == CT_LINEAR)
		{
			continue;
		}
		if (!pointSatisfiesConstraint(tx, ty, order[j], d))
		{
			if (debug)
			{
				UE_LOG(LogRVOTest, Warning, TEXT("pointsatisfies: false"));
			}
			return false;
		}
	}
	if (debug)
	{
		UE_LOG(LogRVOTest, Warning, TEXT("pointsatisfies: true"));
	}
	return true;
}
void CPLPSolver::updatePointIfBetter(float x, float y, int n, float& resX, float& resY, float& d)
{
	if (debug)
	{
		UE_LOG(LogRVOTest, Warning, TEXT("updatepointif:  x y n %f %f %d"), x, y, n);
	}
	if (pointSatisfiesConstraints(x, y, n, 0.f, true))
	{
		
		float td = getPointsMaxDistance(x, y);
		if (td < d)
		{
			if (debug)
			{
				UE_LOG(LogRVOTest, Warning, TEXT("updatepointif updating, old d, new d %f %f"), d, td);
			}
			resX = x;
			resY = y;
			d = td;
			if (BMU::isnanf(resX) || BMU::isnanf(resY))
			{
				UE_LOG(LogRVOTest, Warning, TEXT("BAM in: updatepointifbetter"));
			}
			
		}

		
	}

	else if (debug)
	{
		UE_LOG(LogRVOTest, Warning, TEXT("updatepointif:  not updating"));
	}
}
Example #10
0
void CGraphicsView::OnFileOpen()
{
	// TODO:  在此添加命令处理程序代码
	CFileDialog dlg(TRUE, TEXT(".BMP"), TEXT("*.BMP"));

	if (dlg.DoModal() == IDOK)
	{
		CGraphicsDoc* pDoc = GetDocument();

		pDoc->LoadBitmap(dlg.GetPathName());
		Bitmap* pBitmap = pDoc->GetSrcBitmap();

// 		Bitmap* pPPM = pBitmap->Clone();
// 		pPPM->SwapChannel(0, 2);
// 		Save2PPM(pPPM, "f:\\1.ppm");
// 		delete pPPM;
#if 0
		m_pBitmap = new CBitmap;
		m_pBitmap->CreateCompatibleBitmap(GetDC(), pBitmap->biWidth, pBitmap->biHeight);
		m_pBitmap->ExtendAlpha(255);
		m_pBitmap->SetBitmapBits(pBitmap->size, pBitmap->bits);
#else
		m_pSrcBitmap = CreateBitmap(pBitmap);
#endif
// 		Bitmap* pResult = m_pProcesser->SmoothBitmap(pBitmap, sigma);
// 		m_pDstBitmap = CreateBitmap(pResult);
// 		pDoc->SetDstBitmap(pResult);
// 
// 		m_strText.Format(TEXT("smooth sigma = %f"), sigma);
//		SendMessage(WM_PAINT, 0, 0);
		UpdateBitmap(sigma);
	}
}
Example #11
0
static void OnFlarmLockClicked(WindowControl * Sender)
{
  (void)Sender;

  dlgTextEntryShowModal(XCSoarInterface::SetSettingsComputer().TeamFlarmCNTarget, 4);

  XCSoarInterface::SetSettingsComputer().TeammateCodeValid = false;

  int flarmId = LookupFLARMDetails(XCSoarInterface::SettingsComputer().TeamFlarmCNTarget);

  if (flarmId == 0)
    {
      MessageBoxX(gettext(TEXT("Unknown Competition Number")),
		  gettext(TEXT("Not Found")),
		  MB_OK|MB_ICONINFORMATION);

      XCSoarInterface::SetSettingsComputer().TeamFlarmTracking = false;
      XCSoarInterface::SetSettingsComputer().TeamFlarmIdTarget = 0;
      XCSoarInterface::SetSettingsComputer().TeamFlarmCNTarget[0] = 0;
    }
  else
    {
      XCSoarInterface::SetSettingsComputer().TeamFlarmIdTarget = flarmId;
      XCSoarInterface::SetSettingsComputer().TeamFlarmTracking = true;
    }
}
bool FGenericPlatformInstallation::NormalizeEngineRootDir(FString &RootDir)
{
    // Canonicalize the engine path and remove the last backslash.
    FString NormalizedRootDir = RootDir;
    FPaths::NormalizeDirectoryName(NormalizedRootDir);

    // Check if it's valid
    if (FDesktopPlatformModule::Get()->IsValidRootDirectory(NormalizedRootDir))
    {
        RootDir = NormalizedRootDir;
        return true;
    }

    // Otherwise try to accept directories underneath the root
    if (!NormalizedRootDir.RemoveFromEnd(TEXT("/Engine")))
    {
        if (!NormalizedRootDir.RemoveFromEnd(TEXT("/Engine/Binaries")))
        {
            NormalizedRootDir.RemoveFromEnd(FString(TEXT("/Engine/Binaries/")) / FPlatformProcess::GetBinariesSubdirectory());
        }
    }

    // Check if the engine binaries directory exists
    if (FDesktopPlatformModule::Get()->IsValidRootDirectory(NormalizedRootDir))
    {
        RootDir = NormalizedRootDir;
        return true;
    }

    return false;
}
	void EmitProperties(FEmitterLocalContext& Context)
	{
		ensure(!NativeVariablePropertyName.IsEmpty());
		if (bSetNativeCreationMethod)
		{
			Context.AddLine(FString::Printf(TEXT("%s->CreationMethod = EComponentCreationMethod::Native;"), *NativeVariablePropertyName));
		}

		if (!ParentVariableName.IsEmpty())
		{
			const FString SocketName = (AttachToName == NAME_None) ? FString() : FString::Printf(TEXT(", TEXT(\"%s\")"), *AttachToName.ToString());
			Context.AddLine(FString::Printf(TEXT("%s->AttachTo(%s %s);"), *NativeVariablePropertyName, *ParentVariableName, *SocketName));
			// AttachTo is called first in case some properties will be overridden.
		}

		UClass* ComponentClass = ComponentTemplate->GetClass();
		for (auto Property : TFieldRange<const UProperty>(ComponentClass))
		{
			FEmitDefaultValueHelper::OuterGenerate(Context, Property, NativeVariablePropertyName
				, reinterpret_cast<const uint8*>(ComponentTemplate)
				, reinterpret_cast<const uint8*>(ObjectToCompare)
				, FEmitDefaultValueHelper::EPropertyAccessOperator::Pointer);
		}

	}
bool FMatineePerformanceCaptureCommand::Update()
{
	//for every matinee actor in the level
	for (TObjectIterator<AMatineeActor> It; It; ++It)
	{
		AMatineeActor* MatineeActor = *It;
		FString MatineeFOOName = MatineeActor->GetName();
		if (MatineeActor->GetName().Equals(MatineeName,ESearchCase::IgnoreCase))
		{	


			//add latent action to execute this matinee
			ADD_LATENT_AUTOMATION_COMMAND(FPlayMatineeLatentCommand(MatineeActor));

			//Run the Stat FPS Chart command
			ADD_LATENT_AUTOMATION_COMMAND(FExecWorldStringLatentCommand(TEXT("StartFPSChart")));

			//add action to wait until matinee is complete
			ADD_LATENT_AUTOMATION_COMMAND(FWaitForMatineeToCompleteLatentCommand(MatineeActor));

			//Stop the Stat FPS Chart command
			ADD_LATENT_AUTOMATION_COMMAND(FExecWorldStringLatentCommand(TEXT("StopFPSChart")));
		}
		else
		{
			UE_LOG(LogEngineAutomationLatentCommand, Log, TEXT("'%s' is not the matinee name that is being searched for."), *MatineeActor->GetName())
		}
	}

	return true;

}
Example #15
0
bool ZFileExtDlg::SetExtWithProgram(const tstring & strProgramName, const tstring & strExt, tstring strFullProgramPath, const tstring & strIcon, int iIconIndex)
{
	ZFileExtReg fileExtReg;


	if ( strFullProgramPath.empty() )
	{
		// get full file path to program executable file
		TCHAR szProgPath[MAX_PATH] = { 0 };
		::GetModuleFileName(NULL, szProgPath, sizeof(szProgPath) / sizeof(TCHAR));

		strFullProgramPath = szProgPath;
	}

	tstring strTempText;

	fileExtReg.m_strExtension = strExt.c_str();

	// 프로그램에게 인자를 넘겨줄 때의 full path 를 만든다.
	strTempText  = strFullProgramPath;
	strTempText += TEXT(" \"%1\"");
	fileExtReg.m_strShellOpenCommand = strTempText.c_str();
	fileExtReg.m_strDocumentShellOpenCommand = strTempText.c_str();

	// 레지스트리에 등록할 때의 프로그램의 이름과 확장자를 정한다.
	tstring strClassName = strProgramName;
	strClassName += TEXT(".");
	strClassName += strExt;
	fileExtReg.m_strDocumentClassName = strClassName.c_str();

	// 확장자에 맞는 기본 아이콘을 지정한다.
	if ( strIcon.size() <= 0 )
	{
		// 아이콘 프로그램을 지정하지 않으면 원래 프로그램의 첫번째 아이콘을 쓴다.
		strTempText  = strFullProgramPath;
		strTempText += TEXT(",0");
	}
	else
	{
		// 아이콘 프로그램을 지정했으면 icon 번호를 쓴다.
		if ( iIconIndex < 0 )
		{
			assert(iIconIndex >= 0 );
			iIconIndex = 0;
		}

		strTempText = strIcon;
		strTempText += TEXT(",");

		TCHAR szTemp[COMMON_BUFFER_SIZE] = { 0 };
		SPrintf(szTemp, COMMON_BUFFER_SIZE, TEXT("%d"), iIconIndex);
		strTempText += szTemp;
	}
	fileExtReg.m_strDocumentDefaultIcon = strTempText.c_str();

	// 설정된 값으로 레지스트리를 등록한다.
	fileExtReg.SetRegistries();

	return true;
}
	FConstructorStatics()
		: NavigationTextureObject(TEXT("/Engine/EditorResources/S_NavP"))
		, ID_Navigation(TEXT("Navigation"))
		, NAME_Navigation(NSLOCTEXT("SpriteCategory", "Navigation", "Navigation"))
		, BadNavigationTextureObject(TEXT("/Engine/EditorResources/Bad"))
	{
	}
Example #17
0
void ZFileExtDlg::SaveExtEnv()
{
	std::vector < ExtSetting >::iterator it, endit = ExtInfoManager::GetInstance().m_extConnect.end();

	tstring strProgramFolder(GetProgramFolder());

	tstring strIconDll = strProgramFolder;
	strIconDll += TEXT("ZViewerIcons.dll");

	for ( it = ExtInfoManager::GetInstance().m_extConnect.begin(); it != endit; ++it)
	{
		const ExtSetting & extset = *it;

		if ( false == SetExtWithProgram(TEXT("ZViewer"), extset.m_strExt, 
			TEXT(""),	/// 프로그램 Full Path. 비워두면 현재 프로그램이다.
			strIconDll.c_str(),	/// 아이콘 프로그램
			extset.m_numIconIndex	/// 아이콘 index
		) )
		{
			assert(false);
		}
	}

	/// explorer 의 아이콘을 update 시킨다.
	SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
}
Example #18
0
char* OpenDialog::getfilename()
{
	char *modelFileName;
	char bufFileName[MAX_PATH * 2] = "";
	OPENFILENAME ofn;

	ZeroMemory(&ofn, sizeof(OPENFILENAME));

	ofn.lStructSize = sizeof(OPENFILENAME);
	ofn.hwndOwner = NULL;
	ofn.lpstrFilter = (LPCWSTR)TEXT("3D model (*.model)\0*.model\0 All files (*.*)\0*.*\0");
	ofn.lpstrFile = (LPWSTR)bufFileName;
	ofn.nMaxFile = MAX_PATH;
	ofn.lpstrTitle = (LPCWSTR)TEXT("Choose 3D model file");
	ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
	ofn.lpstrDefExt = (LPCWSTR)TEXT("*.model");

	if (GetOpenFileName(&ofn))
	{
		delete_zero_symbols(bufFileName);
		modelFileName = (char*)calloc(strlen(bufFileName) + 1, sizeof(char));
		strcpy(modelFileName, bufFileName);
		return modelFileName;
	}
	else
	{
		return NULL;
	}
}
Example #19
0
File: tkWinSend.c Project: dgsb/tk
static Tcl_Obj*
Win32ErrorObj(
    HRESULT hrError)
{
    LPTSTR lpBuffer = NULL, p = NULL;
    TCHAR  sBuffer[30];
    Tcl_Obj* errPtr = NULL;

    FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM
	    | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, (DWORD)hrError,
	    LANG_NEUTRAL, (LPTSTR)&lpBuffer, 0, NULL);

    if (lpBuffer == NULL) {
	lpBuffer = sBuffer;
	wsprintf(sBuffer, TEXT("Error Code: %08lX"), hrError);
    }

    if ((p = _tcsrchr(lpBuffer, TEXT('\r'))) != NULL) {
	*p = TEXT('\0');
    }

#ifdef _UNICODE
    errPtr = Tcl_NewUnicodeObj(lpBuffer, (int)wcslen(lpBuffer));
#else
    errPtr = Tcl_NewStringObj(lpBuffer, (int)strlen(lpBuffer));
#endif /* _UNICODE */

    if (lpBuffer != sBuffer) {
	LocalFree((HLOCAL)lpBuffer);
    }

    return errPtr;
}
Example #20
0
void FLevelModel::UpdateDisplayName()
{
	if (IsPersistent())
	{
		DisplayName = LOCTEXT("PersistentTag", "Persistent Level").ToString();
	}
	else
	{
		DisplayName = GetLongPackageName().ToString();
		if (!LevelCollectionModel.GetDisplayPathsState())
		{
			DisplayName = FPackageName::GetShortName(DisplayName);
		}
	}

	if (HasValidPackage())
	{
		// Append actors count
		if (LevelCollectionModel.GetDisplayActorsCountState() && IsLoaded())
		{
			DisplayName += TEXT(" (");
			DisplayName.AppendInt(LevelActorsCount);
			DisplayName += TEXT(")");
		}
	}
	else
	{
		DisplayName+= LOCTEXT("MissingLevelErrorText", " [Missing Level] ").ToString();
	}
}
Example #21
0
void ExpandLocalPath(TCHAR* filein) {
  // Convert %LOCALPATH% to Local Path

  if (_tcslen(filein)==0) {
    return;
  }

  TCHAR lpath[MAX_PATH];
  TCHAR code[] = TEXT("%LOCAL_PATH%\\");
  TCHAR output[MAX_PATH];
  LocalPath(lpath);

  TCHAR* ptr = _tcsstr(filein, code);
  if (!ptr) return;

  ptr += _tcslen(code);
  TCHAR* ptr2 = lpath + _tcslen(lpath) -1;
  if(*ptr != _T('\\') && *ptr2 != _T('\\')) {
      _tcscat(lpath, _T("\\"));
  }
  if(*ptr == _T('\\') && *ptr2 == _T('\\')) {
      ++ptr;
  }

  if (_tcslen(ptr)>0) {
    _stprintf(output,TEXT("%s%s"),lpath, ptr);
    _tcscpy(filein, output);
  }
}
Example #22
0
DWORD CThread::FilesInFolder(CString scFolder)
{
	HANDLE hFind = NULL;
	WIN32_FIND_DATA dFind;

	DWORD res = 0;

	// Ищем все файлы\папки в переданной папке
	CString sFolder = scFolder + TEXT("\\*");
	if ((hFind = FindFirstFile(sFolder.C(), &dFind)) != INVALID_HANDLE_VALUE)
	{
		do
		{
			// Если прервали выполнение - выход из цикла
			if (IsTerminated()) break;

			// Пропускаем специальные папки '.' и '..'
			if (lstrcmp(dFind.cFileName, TEXT(".")) == 0 ||
				lstrcmp(dFind.cFileName, TEXT("..")) == 0)
				continue;

			if ((dFind.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
				res++;

		} while (FindNextFile(hFind, &dFind) != 0);

		FindClose(hFind);
	}

	return res;
}
Example #23
0
HRESULT ASOC(PCTSTR ptzCmd)
{
	if (*ptzCmd == '!')
	{
		return  SHDeleteKey(HKEY_CLASSES_ROOT, (ptzCmd[1] ? &ptzCmd[1] : STR_AppName));
	}

	if (*ptzCmd)
	{
		CReg reg1(ptzCmd, HKEY_CLASSES_ROOT);
		reg1.SetStr(NULL, STR_AppName);
	}

	CReg reg2(STR_AppName, HKEY_CLASSES_ROOT);
	reg2.SetStr(NULL, STR_AppName);

	TCHAR tzPath[MAX_PATH];
	PTSTR p = tzPath;
	*p++ = '"';
	p += GetModuleFileName(NULL, p, MAX_PATH);
	CReg reg3(STR_AppName TEXT("\\DefaultIcon"), HKEY_CLASSES_ROOT);
	UStrCopy(p, TEXT(",1"));
	reg3.SetStr(NULL, tzPath + 1);

	UStrCopy(p, TEXT("\" %1"));
	CReg reg4(STR_AppName TEXT("\\Shell\\Open\\Command"), HKEY_CLASSES_ROOT);
	reg4.SetStr(NULL, tzPath);
	return S_OK;
}
Example #24
0
void CThread::DelFiles(CString sFolder)
{
	if ((GetFileAttributes(sFolder.C()) & FILE_ATTRIBUTE_DIRECTORY) == 0)
	{
		DeleteFile(sFolder.C());
		return;
	}

	HANDLE hFind = NULL;
	WIN32_FIND_DATA dFind;

	CString sFindFolder = sFolder + TEXT("\\*");
	if ((hFind = FindFirstFile(sFindFolder.C(), &dFind)) != INVALID_HANDLE_VALUE)
	{
		do
		{
			if (lstrcmp(dFind.cFileName, TEXT(".")) == 0 ||
				lstrcmp(dFind.cFileName, TEXT("..")) == 0)
				continue;

			DelFiles(sFolder + TEXT("\\") + dFind.cFileName);
		} while (FindNextFile(hFind, &dFind) != 0);

		FindClose(hFind);
	}

	RemoveDirectory(sFolder.C());
	return;
}
Example #25
0
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copy directory
BOOL CopyDir(PCTSTR ptzSrc, PCTSTR ptzDst)
{
	WIN32_FIND_DATA fd;
	TCHAR tzDst[MAX_PATH];
	TCHAR tzSrc[MAX_PATH];
	TCHAR tzFind[MAX_PATH];
	UStrPrint(tzFind, TEXT("%s\\*"), ptzSrc);
	HANDLE hFind = FindFirstFile(tzFind, &fd);
	if (hFind != INVALID_HANDLE_VALUE)
	{
		do
		{
			if (fd.cFileName[0] != '.')
			{
				UStrPrint(tzDst, TEXT("%s\\%s"), ptzDst, fd.cFileName);
				UStrPrint(tzSrc, TEXT("%s\\%s"), ptzSrc, fd.cFileName);
				if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
				{
					CopyDir(tzSrc, tzDst);
				}
				else
				{
					UDirCreate(tzDst);
					CopyFile(tzSrc, tzDst, FALSE);
				}
			}
		}
		while (FindNextFile(hFind, &fd));
		FindClose(hFind);
	}
	UStrPrint(tzDst, TEXT("%s\\"), ptzDst);
	UDirCreate(tzDst);
	return TRUE;
}
FText UAnimGraphNode_ModifyBone::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
	if ((TitleType == ENodeTitleType::ListView || TitleType == ENodeTitleType::MenuTitle) && (Node.BoneToModify.BoneName == NAME_None))
	{
		return GetControllerDescription();
	}
	// @TODO: the bone can be altered in the property editor, so we have to 
	//        choose to mark this dirty when that happens for this to properly work
	else //if (!CachedNodeTitles.IsTitleCached(TitleType, this))
	{
		FFormatNamedArguments Args;
		Args.Add(TEXT("ControllerDescription"), GetControllerDescription());
		Args.Add(TEXT("BoneName"), FText::FromName(Node.BoneToModify.BoneName));

		// FText::Format() is slow, so we cache this to save on performance
		if (TitleType == ENodeTitleType::ListView || TitleType == ENodeTitleType::MenuTitle)
		{
			CachedNodeTitles.SetCachedTitle(TitleType, FText::Format(LOCTEXT("AnimGraphNode_ModifyBone_ListTitle", "{ControllerDescription} - Bone: {BoneName}"), Args), this);
		}
		else
		{
			CachedNodeTitles.SetCachedTitle(TitleType, FText::Format(LOCTEXT("AnimGraphNode_ModifyBone_Title", "{ControllerDescription}\nBone: {BoneName}"), Args), this);
		}
	}
	return CachedNodeTitles[TitleType];
}
Example #27
0
bool FLiveEditorManager::ConnectToRemoteHost( FString IPAddress )
{
	IPAddress.Replace( TEXT(" "), TEXT("") );

	TArray<FString> Parts;
	IPAddress.ParseIntoArray( Parts, TEXT("."), true );
	if ( Parts.Num() != 4 )
		return false;

	uint8 NumericParts[4];
	for ( int32 i = 0; i < 4; ++i )
	{
		NumericParts[i] = FCString::Atoi( *Parts[i] );
	}

	FSocket* Socket = FTcpSocketBuilder(TEXT("FLiveEditorManager.RemoteConnection"));
	FIPv4Endpoint Endpoint(FIPv4Address(NumericParts[0], NumericParts[1], NumericParts[2], NumericParts[3]), LIVEEDITORLISTENSERVER_DEFAULT_PORT);
	if ( Socket->Connect(*Endpoint.ToInternetAddr()) )
	{
		RemoteConnections.Add(IPAddress, Socket);
		return true;
	}
	else
	{
		return false;
	}
}
Example #28
0
const TCHAR* UStrProperty::ImportText_Internal( const TCHAR* Buffer, void* Data, int32 PortFlags, UObject* Parent, FOutputDevice* ErrorText ) const
{
	if( !(PortFlags & PPF_Delimited) )
	{
		*(FString*)Data = Buffer;

		// in order to indicate that the value was successfully imported, advance the buffer past the last character that was imported
		Buffer += FCString::Strlen(Buffer);
	}
	else
	{
		// require quoted string here
		if (*Buffer != TCHAR('"'))
		{
			ErrorText->Logf(TEXT("Missing opening '\"' in string property value: %s"), Buffer);
			return NULL;
		}
		const TCHAR* Start = Buffer;
		FString Temp;
		Buffer = UPropertyHelpers::ReadToken(Buffer, Temp);
		if (Buffer == NULL)
		{
			return NULL;
		}
		if (Buffer > Start && Buffer[-1] != TCHAR('"'))
		{
			ErrorText->Logf(TEXT("Missing terminating '\"' in string property value: %s"), Start);
			return NULL;
		}
		*(FString*)Data = Temp;
	}
	return Buffer;
}
AFrisbeeNulCharacter::AFrisbeeNulCharacter()
{
	// Set size for player capsule
	GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);

	// Don't rotate character to camera direction
	bUseControllerRotationPitch = false;
	bUseControllerRotationYaw = false;
	bUseControllerRotationRoll = false;

	// Configure character movement
	GetCharacterMovement()->bOrientRotationToMovement = true; // Rotate character to moving direction
	GetCharacterMovement()->RotationRate = FRotator(0.f, 640.f, 0.f);
	GetCharacterMovement()->bConstrainToPlane = true;
	GetCharacterMovement()->bSnapToPlaneAtStart = true;
	GetCharacterMovement()->MaxWalkSpeed = 1000;

	// Create a camera boom...
	CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));
	CameraBoom->AttachTo(RootComponent);
	CameraBoom->bAbsoluteRotation = true; // Don't want arm to rotate when character does
	CameraBoom->TargetArmLength = 800.f;
	CameraBoom->RelativeRotation = FRotator(-60.f, 0.f, 0.f);
	CameraBoom->bDoCollisionTest = false; // Don't want to pull camera in when it collides with level

	// Create a camera...
	TopDownCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("TopDownCamera"));
	TopDownCameraComponent->AttachTo(CameraBoom, USpringArmComponent::SocketName);
	TopDownCameraComponent->bUsePawnControlRotation = false; // Camera does not rotate relative to arm

}
Example #30
0
void AGameNetworkManager::EnableStandbyCheatDetection(bool bIsEnabled)
{
	UNetDriver* Driver = GetWorld()->GetNetDriver();
	if (Driver)
	{
		// If it's being enabled set all of the vars
		if (bIsEnabled)
		{
			Driver->bHasStandbyCheatTriggered = false;
			Driver->StandbyRxCheatTime = StandbyRxCheatTime;
			Driver->StandbyTxCheatTime = StandbyTxCheatTime;
			Driver->BadPingThreshold = BadPingThreshold;
			Driver->PercentMissingForRxStandby = PercentMissingForRxStandby;
			Driver->PercentMissingForTxStandby = PercentMissingForTxStandby;
			Driver->PercentForBadPing = PercentForBadPing;
			Driver->JoinInProgressStandbyWaitTime = JoinInProgressStandbyWaitTime;
		}
		// Enable/disable based upon the passed in value and make sure the cheat time vars are valid
		Driver->bIsStandbyCheckingEnabled = bIsEnabled && StandbyRxCheatTime > 0.f;
		UE_LOG(LogGameNetworkManager, Log, TEXT("Standby check is %s with RxTime (%f), TxTime (%f), PingThreshold (%d), JoinInProgressStandbyWaitTime (%f)"),
			Driver->bIsStandbyCheckingEnabled ? TEXT("enabled") : TEXT("disabled"),
			StandbyRxCheatTime,
			StandbyTxCheatTime,
			BadPingThreshold,
			JoinInProgressStandbyWaitTime);
	}
}