Exemplo n.º 1
0
void WiiNetConfig::ReadConfig()
{
	if (File::Exists(m_path))
	{
		if (!File::IOFile(m_path, "rb").ReadBytes(&m_data, sizeof(m_data)))
			ResetConfig();
	}
	else
	{
		ResetConfig();
	}
}
Exemplo n.º 2
0
void MainExitServer()
{
	lprintf("ExitServer terminating server\n");
	
	ExitAsyncConnections();
	
	CloseAllSessions(); /* gotta do this before anything, cause it uses kod, accounts */
	
	CloseDefaultChannels();
	
	ResetLoadMotd();
	ResetLoadBof();
	
	ResetTable();
	ResetBufferPool();
	ResetSysTimer();
	ResetDLlist();
	ResetNameID();
	ResetAccount();
	ResetUser();
	ResetString();
	ResetRoomData();
	ResetResource();
	ResetTimer();
	ResetList();
	ResetObject();
	ResetMessage();
	ResetClass();
	
	ResetConfig();
	
	DeleteAllBlocks();
}
Exemplo n.º 3
0
	bool Main::Run()
	{
		ResetConfig();
		GetConfig();

#if		_DEBUG
		mRoot = new Ogre::Root("","","ogre.graphics.log");
#else
		mRoot = new Ogre::Root("","","ogre.graphics.log");
#endif

		setupRenderSystem();

		Log::Instance().LogMessage("Main Run");

		mWindow = mRoot->initialise(true, "Blackstar Engine");

		size_t window_hwnd;
		mWindow->getCustomAttribute("WINDOW", &window_hwnd);
		createInputSystem(window_hwnd);

		initScene();

		CreateMainLoopThreads();

		return true;
	}
Exemplo n.º 4
0
void cGmSystem::Load()
{
    ResetConfig();
    Config.IsGMSystem	= Configs.GetInt(0, 1, 0, "GMSystem", "IsGMSystem",	IAJuliaGM);
    if(!Config.IsGMSystem)return;
    Config.IsGMInDB		= Configs.GetInt(0, 1, 0, "GMSystem", "IsGMInDB",	IAJuliaGM);

    FILE *file;

    file = fopen(IAJuliaGM,"r");

    if (file == NULL)
    {
        Config.IsGMSystem = 0;
        Log.ConsoleOutPut(1,c_Red,t_Error,"[X] [GMSystem]\tCan`t Find %s",IAJuliaGM);
        return;
    }

    char Buff[256];
    int Flag = 0;

    while (!feof(file))
    {
        fgets(Buff,256,file);

        if(Utilits.IsBadFileLine(Buff, Flag))
            continue;

        if (Flag == 1)
        {
            int n[15];
            char GetGMName[11];
            int isAdmin;

            sscanf(Buff, "%d %10s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d",&isAdmin, &GetGMName, &n[0], &n[1], &n[2], &n[3], &n[4], &n[5],  &n[6], &n[7], &n[8], &n[9], &n[10], &n[11], &n[12], &n[13], &n[14]);
            GM[GMCount].IsAdmin		= isAdmin;
            sprintf(GM[GMCount].Name,"%s",GetGMName);
            GM[GMCount].Drop		= n[0];
            GM[GMCount].Gg			= n[1];
            GM[GMCount].SetZen		= n[2];
            GM[GMCount].Status		= n[3];
            GM[GMCount].Gmove		= n[4];
            GM[GMCount].SetPK		= n[5];
            GM[GMCount].PkClear		= n[6];
            GM[GMCount].BanPlayer	= n[7];
            GM[GMCount].Reload		= n[8];
            GM[GMCount].Skin		= n[9];
            GM[GMCount].BanPost		= n[10];
            GM[GMCount].Voskl		= n[11];
            GM[GMCount].Disconnect	= n[12];
            GM[GMCount].Trace		= n[13];
            GM[GMCount].DisableChat = n[14];
            GMCount++;
        }
    }

    fclose(file);
    Log.ConsoleOutPut(1, c_Magenta, t_GM, "[û] [GMSystem]\tLoad successfully. Total GMs: %d", GMCount);
}
Exemplo n.º 5
0
// =============================================================================
LogBuffer::LogBuffer()
	: mGenICamEnabled( true )
	, mBufferAllEnabled( false )
	, mBufferErrorEnabled( true )
	, mWriteToFileEnabled( false )
{
	ResetConfig();
}
Exemplo n.º 6
0
	void Main::ExternInit()
	{
		mRoot = new Ogre::Root("","","ogre.graphics.log");

		ResetConfig();
		GetConfig();

		setupRenderSystem();
		mRoot->initialise(false);
	}
Exemplo n.º 7
0
void DllModule::Attach()
{
	ParseCommandLine([&](std::wstring const& key, std::wstring const& val){
		if (key == L"ydwe")
		{
			ydwe_path = val;
		}
		else if (key == L"window")
		{
			IsWindowMode = true;
		}
	});

	try {
		slk::IniTable table;
		ResetConfig(table);

		try {
			slk::buffer buf = base::file::read_stream(ydwe_path / L"bin" / L"EverConfig.cfg").read<slk::buffer>();
			slk::buffer_reader reader(buf);
			slk::IniReader::Read(reader, table);
		} 
		catch (...) {
		}

		IsFullWindowedMode      = "0" != table["MapTest"]["LaunchFullWindowed"];
		IsLockingMouse          = "0" != table["MapTest"]["LaunchLockingMouse"];
		IsFixedRatioWindowed    = "0" != table["MapTest"]["LaunchFixedRatioWindowed"];
		IsDisableSecurityAccess = "0" != table["MapTest"]["LaunchDisableSecurityAccess"];

		try {
			if (table["War3Patch"]["Option"] == "1")
			{
				if (table["MapSave"]["Option"] == "1")
				{
					SearchPatch(patch_path, L"1.20.4.6074");
				}
				else if (table["MapSave"]["Option"] == "2")
				{
					SearchPatch(patch_path, L"1.24.4.6387");
				}
			}
			else if (table["War3Patch"]["Option"] == "2")
			{
				patch_path = ydwe_path / L"share" / L"patch"/ table["War3Patch"]["DirName"];
			}
		}
		catch (...) {
		}
	} 
	catch (...) {
	}

	RealLoadLibraryA  = base::hook::iat(L"War3.exe", "kernel32.dll", "LoadLibraryA", (uintptr_t)FakeLoadLibraryA);
}
Exemplo n.º 8
0
void NWC24Config::ReadConfig()
{
  if (File::Exists(m_path))
  {
    if (!File::IOFile(m_path, "rb").ReadBytes(&m_data, sizeof(m_data)))
    {
      ResetConfig();
    }
    else
    {
      const s32 config_error = CheckNwc24Config();
      if (config_error)
        ERROR_LOG(WII_IPC_WC24, "There is an error in the config for for WC24: %d", config_error);
    }
  }
  else
  {
    ResetConfig();
  }
}
Exemplo n.º 9
0
/* static */ void Game::Rescan()
{
	TarScanner::DoScan(TarScanner::GAME);

	Game::scanner_info->RescanDir();
	Game::scanner_library->RescanDir();
	ResetConfig();

	InvalidateWindowData(WC_AI_LIST, 0, 1);
	SetWindowClassesDirty(WC_AI_DEBUG);
	InvalidateWindowClassesData(WC_AI_SETTINGS);
}
Exemplo n.º 10
0
/* ======================================================================
Function: handleFactoryReset 
Purpose : reset the module to factory settingd
Input   : -
Output  : - 
Comments: -
====================================================================== */
void handleFactoryReset(void)
{
  // Just to debug where we are
  Debug(F("Serving /factory_reset page..."));
  ResetConfig();
  ESP.eraseConfig();
  Debug(F("sending..."));
  server.send ( 200, "text/plain", FPSTR(FP_RESTART) );
  Debugln(F("Ok!"));
  delay(1000);
  ESP.restart();
  while (true)
    delay(1);
}
Exemplo n.º 11
0
void CocosFrame::OnFileMenuCreateSolution(wxCommandEvent& event) {
	CreateSolutionDialog path(NULL, wxID_ANY, _T("create solution"));
	path.CentreOnScreen();

	if (wxID_OK == path.ShowModal()) {
		if (wxFile::Exists(wxT(path.GetPath().c_str()))) {
			wxLogMessage("solution %s existed!", path.GetPath().c_str());
			return;
		}

		AppendSolutionItem(path.GetPath());

		ResetConfig();
		SaveConfig();
	}
}
Exemplo n.º 12
0
// =============================================================================
void LogBuffer::Load( PvConfigurationReader &aReader )
{
    PvResult lResult;
    PvString lPvStr;

	// Always load from a blank setup!
	ResetConfig();

	// bool mGenICamEnabled;
    lResult = aReader.Restore( TAG_GENICAMENABLED, lPvStr );
    if ( lResult.IsOK() )
    {
        mGenICamEnabled = ( lPvStr == VAL_TRUE );
    }

	// bool mBufferAllEnabled;
    lResult = aReader.Restore( TAG_BUFFERALLENABLED, lPvStr );
    if ( lResult.IsOK() )
    {
        mBufferAllEnabled = ( lPvStr == VAL_TRUE );
    }

	// bool mBufferErrorEnabled;
    lResult = aReader.Restore( TAG_BUFFERERRORENABLED, lPvStr );
    if ( lResult.IsOK() )
    {
        mBufferErrorEnabled = ( lPvStr == VAL_TRUE );
    }

	// QString mFilename;
    lResult = aReader.Restore( TAG_LOGFILENAME, lPvStr );
    if ( lResult.IsOK() )
	{
		SetFilename( lPvStr.GetAscii() );
	}

	// bool mWriteToFileEnabled;
    lResult = aReader.Restore( TAG_WRITETOFILEENABLED, lPvStr );
    if ( lResult.IsOK() )
    {
        SetWriteToFileEnabled( lPvStr == VAL_TRUE );
    }
}
Exemplo n.º 13
0
void cDropSystem::Load()
{
    ResetConfig();

    FILE *file;
    file = fopen(IAJuliaDropSystem,"r");

    if (file == NULL)
    {
        Log.ConsoleOutPut(1, c_Red, t_Error, "[X] [Drop System]\tImpossivel abrir %s", IAJuliaDropSystem);
        return;
    }

    char Buff[256];
    int Flag = 0;

    while (!feof(file))
    {
        fgets(Buff,256,file);

        if(Utilits.IsBadFileLine(Buff, Flag))
        {
            continue;
        }

        if(Flag == 1)
        {
            int n[22];
            sscanf(Buff, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", &n[0], &n[1], &n[2], &n[3], &n[4], &n[5], &n[6], &n[7], &n[8], &n[9], &n[10], &n[11], &n[12], &n[13], &n[14], &n[15], &n[16], &n[17], &n[18], &n[19], &n[20], &n[21]);

            if(n[0] == -1)
            {
                int j = AllMobArrayMaxItem;

                if(j >= 1000)
                {
                    continue;
                }

                AllMobItemsDrop[j].MMap			= n[1];
                AllMobItemsDrop[j].MMinLvl		= n[2];
                AllMobItemsDrop[j].MMaxLvl		= n[3];
                AllMobItemsDrop[j].IDropRate	= n[4];
                AllMobItemsDrop[j].IGroup		= n[5];
                AllMobItemsDrop[j].IIndex		= n[6];
                AllMobItemsDrop[j].IMinLvl		= n[7];
                AllMobItemsDrop[j].IMaxLvl		= n[8];
                AllMobItemsDrop[j].ILvlRate		= n[9];
                AllMobItemsDrop[j].IMinOpt		= n[10];
                AllMobItemsDrop[j].IMaxOpt		= n[11];
                AllMobItemsDrop[j].IOptRate		= n[12];
                AllMobItemsDrop[j].ISkill		= n[13];
                AllMobItemsDrop[j].ISkillRate	= n[14];
                AllMobItemsDrop[j].ILuck		= n[15];
                AllMobItemsDrop[j].ILuckRate	= n[16];
                AllMobItemsDrop[j].IMinExc		= n[17];
                AllMobItemsDrop[j].IMaxExc		= n[18];
                AllMobItemsDrop[j].IExcRate		= n[19];
                AllMobItemsDrop[j].IAnc			= n[20];
                AllMobItemsDrop[j].IAncRate		= n[21];

                AllMobArrayMaxItem = ++j;
            }
            else
            {
                int MobId = n[0];
                int j = ArrayMaxItem[MobId];

                if(j >= MAX_ITEM_FOR_MONSTER)
                {
                    continue;
                }

                ItemsDrop[MobId][j].MMap		= n[1];
                ItemsDrop[MobId][j].MMinLvl		= n[2];
                ItemsDrop[MobId][j].MMaxLvl		= n[3];
                ItemsDrop[MobId][j].IDropRate	= n[4];
                ItemsDrop[MobId][j].IGroup		= n[5];
                ItemsDrop[MobId][j].IIndex		= n[6];
                ItemsDrop[MobId][j].IMinLvl		= n[7];
                ItemsDrop[MobId][j].IMaxLvl		= n[8];
                ItemsDrop[MobId][j].ILvlRate	= n[9];
                ItemsDrop[MobId][j].IMinOpt		= n[10];
                ItemsDrop[MobId][j].IMaxOpt		= n[11];
                ItemsDrop[MobId][j].IOptRate	= n[12];
                ItemsDrop[MobId][j].ISkill		= n[13];
                ItemsDrop[MobId][j].ISkillRate	= n[14];
                ItemsDrop[MobId][j].ILuck		= n[15];
                ItemsDrop[MobId][j].ILuckRate	= n[16];
                ItemsDrop[MobId][j].IMinExc		= n[17];
                ItemsDrop[MobId][j].IMaxExc		= n[18];
                ItemsDrop[MobId][j].IExcRate	= n[19];
                ItemsDrop[MobId][j].IAnc		= n[20];
                ItemsDrop[MobId][j].IAncRate	= n[21];

                ArrayMaxItem[MobId] = ++j;
            }
        }
    }

    fclose(file);
    Log.ConsoleOutPut(1, c_Yellow, t_DROP, "[û] [Drop System]\tItens carregados");
}
Exemplo n.º 14
0
static void Initialize(HWND hWnd)
{
  _hWnd = hWnd;

  ResetConfig();
 
  SE_InitEngine("");

  // Get device content
  HDC hDC = GetDC(hWnd);
  if(hDC==NULL) {
    ASSERT(FALSE);
    return;
  }

  EnumFonts(hDC,NULL,(FONTENUMPROC)ProcEnumFonts,0);
  SendDlgItemMessage(_hWnd,ICB_FONT_NAMES,CB_SETCURSEL,(WPARAM) 0,0);

  char strText[32] = {0,};

  INDEX ctFontSizes = sizeof(_aiFontSizes) / sizeof(INDEX);
  for(INDEX ifs=0;ifs<ctFontSizes;ifs++) {
    itoa(_aiFontSizes[ifs],strText,10);
    SendDlgItemMessage(_hWnd,ICB_FONT_SIZES,CB_ADDSTRING,0,(LPARAM) (LPCTSTR) strText);
  }
  SendDlgItemMessage(_hWnd,ICB_FONT_SIZES,CB_SETCURSEL,(WPARAM)4, 0);

  // Align
  SendDlgItemMessage(_hWnd,IDC_ALIGN_H,CB_ADDSTRING,0,(LPARAM) (LPCTSTR) "H");
  SendDlgItemMessage(_hWnd,IDC_ALIGN_H,CB_ADDSTRING,0,(LPARAM) (LPCTSTR) "C");
  SendDlgItemMessage(_hWnd,IDC_ALIGN_H,CB_ADDSTRING,0,(LPARAM) (LPCTSTR) "V");
  SendDlgItemMessage(_hWnd,IDC_ALIGN_V,CB_ADDSTRING,0,(LPARAM) (LPCTSTR) "H");
  SendDlgItemMessage(_hWnd,IDC_ALIGN_V,CB_ADDSTRING,0,(LPARAM) (LPCTSTR) "C");
  SendDlgItemMessage(_hWnd,IDC_ALIGN_V,CB_ADDSTRING,0,(LPARAM) (LPCTSTR) "V");
  SetComboIndex(IDC_ALIGN_H,1);
  SetComboIndex(IDC_ALIGN_V,1);

  INDEX ctTexSizes = sizeof(_aiTexSizes) / sizeof(INDEX);
  for(INDEX its=0;its<ctTexSizes;its++) {
    itoa(_aiTexSizes[its],strText,10);
    SendDlgItemMessage(_hWnd,ICB_TEX_WIDTH,CB_ADDSTRING,0,(LPARAM) (LPCTSTR) strText);
    SendDlgItemMessage(_hWnd,ICB_TEX_HEIGHT,CB_ADDSTRING,0,(LPARAM) (LPCTSTR) strText);
  }
  SendDlgItemMessage(_hWnd,ICB_TEX_WIDTH,CB_SETCURSEL,(WPARAM)2, 0);
  SendDlgItemMessage(_hWnd,ICB_TEX_HEIGHT,CB_SETCURSEL,(WPARAM)2, 0);

  ReleaseDC(hWnd, hDC);

  HWND hWndCanvas = GetDlgItem(hWnd,IDC_CANVAS);
  ASSERT(hWndCanvas!=NULL);

  ClearCharTable();
  SetWindowLong(hWndCanvas,GWL_WNDPROC,(LONG)CanvasProc);
  _pGfx->ResetDisplayMode(GAT_OGL);
 	_pGfx->CreateWindowCanvas(hWndCanvas, &_pvpViewPort, &_pdpDrawPort);
  UpdateWindow(hWndCanvas);
  _bInitialized = TRUE;
  GenerateFont();

  LoadSettings((CTString)"Temp\\GenFont.cfg");
}
Exemplo n.º 15
0
/* static */ void AI::Rescan()
{
	AI::ai_scanner->RescanAIDir();
	ResetConfig();
}