示例#1
0
文件: App.cpp 项目: angel0sl/FServer
void App::OnSMsgVerifyAccountReq(SMsgVerifyAccountReq* msg)
{
	SMsgVerifyAccountRes res;
	res.mutable_base()->set_type(Msg_VerifyAccountRes);
	res.mutable_base()->set_result(EVAR_Success);
	//帐号验证,包括内存和数据库
	//分配base服务器地址,并通知base
// 	auto it = theBCPlayerMgr->GetObject(res.)

	auto verifyKey = theGuid->Generate32Guid(ESAT_BaseCenter);
	auto baseapp = theBaseAppMgr->DispatchBaseApp();
	if (baseapp)
	{
		auto bCfg = theConfigMgr->GetServerCfg(baseapp->GetAppID());
		if (bCfg)
		{
			res.set_base_ip(bCfg->serverIP);
			res.set_base_port(bCfg->serverPort);
			//res.set_base_ip(bCfg->serverIP);
		}
		else
			res.mutable_base()->set_result(EVAR_Fail);
	}
	else
		res.mutable_base()->set_result(EVAR_Fail);
}
示例#2
0
void CProfile::ClearData(LPCTSTR appName)
{
	int n = GetAppID(appName);
	if (n == MAX_APP)
		return;
	AppConfig& appConfig = m_Config.AppConfig[n];
	ZeroMemory(appConfig.CmdID, sizeof(appConfig.CmdID));
	ZeroMemory(appConfig.AppName, sizeof(appConfig.AppName));
}
示例#3
0
static void ReadHeader(const char*  fileID, const char*  typeID)
{
    int majVer, minVer;
    ReadFileHeader(fileID, majVer, minVer, typeID);

    if ((majVer != 0) || (minVer != 0))
        InputError("Bad version #");

    isCurrentApp = (ReadInt() == GetAppID());
}
示例#4
0
void CIpo::OnCbnSelchangeComboAppid()
{
	// TODO: 在此添加控件通知处理程序代码
	int sel =m_listapp.GetCurSel();
	if (sel != -1)
	{
		CString curText =_T("");
		m_listapp.GetLBText(sel,curText);
		string appname =strprintf("%s",curText);
		m_appid = GetAppID(appname);
	}
}
示例#5
0
void GCNetLogic::OnUnRegisterApp(const NetMessage* nmsg)
{
	MsgUnRegisterApp msg;
	if (!MsgFromBytes(nmsg, msg))
		return;
	auto app = theAppMgr->GetObject(msg.app_id());
	if (!app)
		return;
	OnDisconnect(app->GetIndex());
	theAppMgr->RemoveObject(app->GetAppID());

	LOG(INFO) << "UnRegisterApp" << LogValue("apptype", msg.app_type()) << LogValue("appid", msg.app_id());
}
示例#6
0
int CProfile::AssignAppID(LPCTSTR appName)
{
	int id = GetAppID(appName);
	if (id != MAX_APP)
		return id;
	for (id = 0; id < MAX_APP; ++id) {
		AppConfig& appConfig = m_Config.AppConfig[id];
		if (!appConfig.AppName[0]) {
			_tcsncpy_s(appConfig.AppName, appName, _TRUNCATE);
			CopyDefault(id);
			return id;
		}
	}
	return id;
}
示例#7
0
文件: App.cpp 项目: angel0sl/FServer
void App::OnMsg(const NetMessage* nmsg, int msgType /* = 0 */)
{
	switch (GetAppType())
	{
	case ESAT_GameCenter:
		OnGCMsg(nmsg, msgType);
		break;
	case ESAT_Base:
		OnBaseMsg(nmsg, msgType);
		break;
	case ESAT_Login:
		OnLoginMsg(nmsg, msgType);
		break;
	default:
		LOG(ERROR) << "Unknown App msg!" << LogValue("apptype", GetAppType()) << LogValue("appid", GetAppID()) << LogValue("msgtype", msgType);
		break;
	}
}
示例#8
0
文件: App.cpp 项目: angel0sl/FServer
void App::Disconnected()
{
	LOG(INFO) << "App disconnected!" << LogValue("apptype", GetAppType()) << LogValue("appid", GetAppID());
}
示例#9
0
		int 			IsPublic() { return GetAppID() != kAPP_VIZR; }
示例#10
0
bool FBuildPatchAppManifest::IsSameAs(FBuildPatchAppManifestRef Other) const
{
	return this == &Other.Get() || (GetAppID() == Other->GetAppID() && GetAppName() == Other->GetAppName() && GetVersionString() == Other->GetVersionString());
}
示例#11
0
void Package::Initialize() {
    if (FInitialized == true) {
        return;
    }

    Platform& platform = Platform::GetInstance();

    FBootFields = new PackageBootFields();
    FDebugging = dsNone;

    FBootFields->FPackageRootDirectory = platform.GetPackageRootDirectory();
    FBootFields->FPackageAppDirectory = platform.GetPackageAppDirectory();
    FBootFields->FPackageLauncherDirectory = platform.GetPackageLauncherDirectory();
    FBootFields->FAppDataDirectory = platform.GetAppDataDirectory();

    std::map<TString, TString> keys = platform.GetKeys();

    // Read from configure.cfg/Info.plist
    AutoFreePtr<ISectionalPropertyContainer> config = platform.GetConfigFile(platform.GetConfigFileName());

    config->GetValue(keys[CONFIG_SECTION_APPLICATION], keys[CONFIG_APP_ID_KEY], FBootFields->FAppID);
    config->GetValue(keys[CONFIG_SECTION_APPLICATION], keys[PACKAGER_APP_DATA_DIR], FBootFields->FPackageAppDataDirectory);
    FBootFields->FPackageAppDataDirectory = FilePath::FixPathForPlatform(FBootFields->FPackageAppDataDirectory);

    // Main JAR.
    config->GetValue(keys[CONFIG_SECTION_APPLICATION], keys[CONFIG_MAINJAR_KEY], FBootFields->FMainJar);
    FBootFields->FMainJar = FilePath::IncludeTrailingSeparater(GetPackageAppDirectory()) +
                            FilePath::FixPathForPlatform(FBootFields->FMainJar);

    // Classpath.
    // 1. If the provided class path contains main jar then only use provided class path.
    // 2. If class path provided by config file is empty then add main jar.
    // 3. If main jar is not in provided class path then add it.
    config->GetValue(keys[CONFIG_SECTION_APPLICATION], keys[CONFIG_CLASSPATH_KEY], FBootFields->FClassPath);
    FBootFields->FClassPath = FilePath::FixPathSeparatorForPlatform(FBootFields->FClassPath);

    if (FBootFields->FClassPath.empty() == true) {
        FBootFields->FClassPath = GetMainJar();
    }
    else if (FBootFields->FClassPath.find(GetMainJar()) == TString::npos) {
        FBootFields->FClassPath = GetMainJar() + FilePath::PathSeparator() + FBootFields->FClassPath;
    }

    // Main Class.
    config->GetValue(keys[CONFIG_SECTION_APPLICATION], keys[CONFIG_MAINCLASSNAME_KEY], FBootFields->FMainClassName);

    // Splash Screen.
    if (config->GetValue(keys[CONFIG_SECTION_APPLICATION], keys[CONFIG_SPLASH_KEY], FBootFields->FSplashScreenFileName) == true) {
        FBootFields->FSplashScreenFileName = FilePath::IncludeTrailingSeparater(GetPackageAppDirectory()) +
                                             FilePath::FixPathForPlatform(FBootFields->FSplashScreenFileName);

        if (FilePath::FileExists(FBootFields->FSplashScreenFileName) == false) {
            FBootFields->FSplashScreenFileName = _T("");
        }
    }

    // Runtime.
    FBootFields->FIsRuntimeBundled = true;
    config->GetValue(keys[CONFIG_SECTION_APPLICATION], keys[JVM_RUNTIME_KEY], FBootFields->FJVMRuntimeDirectory);

    if (FBootFields->FJVMRuntimeDirectory.empty()) {
        FBootFields->FIsRuntimeBundled = false;
        FBootFields->FJVMRuntimeDirectory = platform.GetSystemJRE();
    }

    // Read jvmargs.
    PromoteAppCDSState(config);
    ReadJVMArgs(config);

    // Read args if none were passed in.
    if (FBootFields->FArgs.size() == 0) {
        OrderedMap<TString, TString> args;

        if (config->GetSection(keys[CONFIG_SECTION_ARGOPTIONS], args) == true) {
            FBootFields->FArgs = Helpers::MapToNameValueList(args);
        }
    }

    // Read jvmuserarg defaults.
    config->GetSection(keys[CONFIG_SECTION_JVMUSEROPTIONS], FDefaultJVMUserArgs);

    // Load JVM user overrides.
    TString jvmUserArgsConfigFileName = GetJVMUserArgsConfigFileName();

    if (FilePath::FileExists(jvmUserArgsConfigFileName) == true) {
        // Load new location for user VM overrides.
        IniFile userConfig;

        if (userConfig.LoadFromFile(jvmUserArgsConfigFileName) == false) {
            // New property file format was not found, attempt to load old property file format.
            userConfig.GetSection(keys[CONFIG_SECTION_JVMUSEROVERRIDESOPTIONS], FJVMUserArgsOverrides);
        }

        userConfig.GetSection(keys[CONFIG_SECTION_JVMUSEROVERRIDESOPTIONS], FJVMUserArgsOverrides);
    }
    else {
        // Attemp to load java.util.prefs for legacy JVM user overrides.
        AutoFreePtr<JavaUserPreferences> javaPreferences(JavaUserPreferences::CreateInstance());

        if (javaPreferences->Load(GetAppID()) == true) {
            FJVMUserArgsOverrides = javaPreferences->GetData();
        }
    }

    // Auto Memory.
    TString autoMemory;

    if (config->GetValue(keys[CONFIG_SECTION_APPLICATION], keys[CONFIG_APP_MEMORY], autoMemory) == true) {
        if (autoMemory == _T("auto") || autoMemory == _T("100%")) {
            FBootFields->FMemoryState = PackageBootFields::msAuto;
            FBootFields->FMemorySize = platform.GetMemorySize();
        }
        else if (autoMemory.length() == 2 && isdigit(autoMemory[0]) && autoMemory[1] == '%') {
            FBootFields->FMemoryState = PackageBootFields::msAuto;
            FBootFields->FMemorySize = StringToPercentageOfNumber(autoMemory.substr(0, 1), platform.GetMemorySize());
        }
        else if (autoMemory.length() == 3 && isdigit(autoMemory[0]) && isdigit(autoMemory[1]) && autoMemory[2] == '%') {
            FBootFields->FMemoryState = PackageBootFields::msAuto;
            FBootFields->FMemorySize = StringToPercentageOfNumber(autoMemory.substr(0, 2), platform.GetMemorySize());
        }
        else {
            FBootFields->FMemoryState = PackageBootFields::msManual;
            FBootFields->FMemorySize = 0;
        }
    }

    MergeJVMDefaultsWithOverrides();
}
示例#12
0
void CProfile::CopyDefault(LPCTSTR appName)
{
	CopyDefault(GetAppID(appName));
}
示例#13
0
BOOL CIpo::Create(CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID)
{
	// TODO: 在此添加专用代码和/或调用基类

	BOOL bRes = CDialogBar::Create(pParentWnd, nIDTemplate, nStyle, nID);
	if ( bRes ) {
		UpdateData(FALSE);
		struct LISTCol {
			CString		name ;
			UINT		size ;
		} listcol[3]  = {
			{"序号" ,      145},
			{"金额" ,      368}, 
			{"解冻高度" ,  348}
		};
		m_listCtrl.SetBkColor(RGB(255,255,255));       
		m_listCtrl.SetRowHeigt(35);               
		m_listCtrl.SetHeaderHeight(1.9);         
		m_listCtrl.SetHeaderFontHW(15,0);
		m_listCtrl.SetHeaderBKColor(/*224,65,18,*/ 35, 109, 206, 0); 
		m_listCtrl.SetHeaderTextColor(RGB(255,255,255)); 
		m_listCtrl.SetTextColor(RGB(0,0,0));  
		for( int i = 0 ; i <3 ; i++  ) {
			m_listCtrl.InsertColumn(i,listcol[i].name,LVCFMT_CENTER,listcol[i].size);
		}
		m_listCtrl.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP );// |LVS_SINGLESEL  );

		m_rBtnSelect.SetBitmaps( IDB_BITMAP_BUT1 , RGB(255, 255, 0) , IDB_BITMAP_BUT1 , RGB(255, 255, 255) );
		m_rBtnSelect.SetAlign(CButtonST::ST_ALIGN_OVERLAP);
		m_rBtnSelect.SetWindowText("账号查询") ;
		m_rBtnSelect.SetFontEx(-12 , _T("微软雅黑"));
		m_rBtnSelect.SetColor(CButtonST::BTNST_COLOR_FG_OUT , RGB(255,255,255));
		m_rBtnSelect.SetColor(CButtonST::BTNST_COLOR_FG_IN , RGB(200, 75, 60));
		m_rBtnSelect.SetColor(CButtonST::BTNST_COLOR_FG_FOCUS, RGB(255, 255,255));
		m_rBtnSelect.SetColor(CButtonST::BTNST_COLOR_BK_IN, RGB(255,255,255));
		m_rBtnSelect.SizeToContent();

		m_rBtnDraw.SetBitmaps( IDB_BITMAP_ORANGE_BUT1 , RGB(255, 255, 0) , IDB_BITMAP_ORANGE_BUT1 , RGB(255, 255, 255) );
		m_rBtnDraw.SetAlign(CButtonST::ST_ALIGN_OVERLAP);
		m_rBtnDraw.SetWindowText("提现") ;
		m_rBtnDraw.SetFontEx(-12 , _T("微软雅黑"));
		m_rBtnDraw.SetColor(CButtonST::BTNST_COLOR_FG_OUT , RGB(255,255,255));
		m_rBtnDraw.SetColor(CButtonST::BTNST_COLOR_FG_IN , RGB(200, 75, 60));
		m_rBtnDraw.SetColor(CButtonST::BTNST_COLOR_FG_FOCUS, RGB(255, 255,255));
		m_rBtnDraw.SetColor(CButtonST::BTNST_COLOR_BK_IN, RGB(255,255,255));
		m_rBtnDraw.SizeToContent();

		m_editAddr.SetBkColor(RGB(241, 246, 252));
		m_editAddr.SetFMColor(RGB(222, 222, 222));

		InitCombox();
		m_listapp.SetCurSel(0);
		int sel =m_listapp.GetCurSel();
		if (sel != -1)
		{
			CString curText =_T("");
			m_listapp.GetLBText(sel,curText);
			string appname =strprintf("%s",curText);
			m_appid = GetAppID(appname);
		}

	}
	return bRes ;
}
示例#14
0
static void WriteHeader(const char*  fileID)
{
    WriteFileHeader(fileID, 0, 0);
    WriteInt(GetAppID());
    WriteLine();
}
示例#15
0
BOOL CProcessLauncher::Init()
{
	bool bStartWait, bHeartbeat;
	bStartWait = bHeartbeat = false;

	CScanner s;
	if( s.Load( "launcher.ini" ) == FALSE)
		return FALSE;

	s.GetToken();
	while( s.tok != FINISHED )
	{
		if( s.Token == "lpAddr" )
		{
			s.GetToken();	// =
			s.GetToken();
			strcpy( m_lpAddr, s.Token );
		}
		else if( s.Token == "lpApplicationName" )
		{
			s.GetToken();	// =
			s.GetToken();
			strcpy( m_lpApplicationName, s.Token );
			SetConsoleTitle( m_lpApplicationName );
		}
		else if( s.Token == "lpCurrentDirectory" )
		{
			s.GetToken();	// =
			s.GetToken();
			strcpy( m_lpCurrentDirectory, s.Token );
		}
		else if( s.Token == "dwId" )
		{
			s.GetToken();	// =
			m_dwId	= (DWORD)s.GetNumber();
		}
		else if( s.Token == "DeadlockCheck" )
		{
			s.GetToken();	// =
			m_dwMilliseconds	= (DWORD)s.GetNumber();
			bHeartbeat = true;
		}
		else if( s.Token == "bWait" )
		{
			s.GetToken();	// =
			bStartWait = (bool)(s.GetNumber() != 0);
		}
		else if( s.Token == "lpDownDirectory" )
		{
			s.GetToken();	// =
			s.GetToken();
			//m_uploader.SetDownDirectory( s.Token );
			strcpy( m_lpDownDirectory, s.Token );			
		}
		s.GetToken();
	}

	if( bStartWait && bHeartbeat )
	{
		AfxMessageBox( "INVALID CONDITION - bWait AND bHeartbeat must be exclusive" );
		return FALSE;
	}
	m_bStartWait = bStartWait;
	
	if( bStartWait || bHeartbeat )
	{
		char lpName[32];
		sprintf( lpName, "%d", GetAppID() );

		m_hEvent = CreateEvent( NULL, FALSE, FALSE, lpName ) ;
		if( m_hEvent == FALSE )
		{
			char szBuffer[128];
			sprintf( szBuffer, "CreateEvent ERROR:%d", GetLastError() );
			AfxMessageBox( szBuffer );
			return FALSE;
		}
	}

	return TRUE;
}