main.cpp 952 B

12345678910111213141516171819202122232425262728293031323334
  1. // EgoServer.cpp : This file contains the 'main' function. Program execution begins and ends there.
  2. //
  3. #define WIN32_LEAN_AND_MEAN
  4. #include <windows.h>
  5. #include <WinSock2.h>
  6. #include "DBConnect.h"
  7. #include "UserManager.h"
  8. #include "NetService.h"
  9. #include "WorkAreaManager.h"
  10. #include "TimeSync.h"
  11. #define DBHOST "tcp://localhost:3306/egodb"
  12. int main()
  13. {
  14. //CWorkAreaManager::GetInstance().LoadCSV("data.csv");
  15. char path[MAX_PATH];
  16. GetCurrentDirectoryA(MAX_PATH, path);
  17. char file[MAX_PATH];
  18. sprintf_s(file, "%s\\config.ini", path);
  19. char user[64];
  20. char pass[64];
  21. GetPrivateProfileStringA("mysql", "user", "", user, sizeof(user), file);
  22. GetPrivateProfileStringA("mysql", "password", "", pass, sizeof(pass), file);
  23. CDBConnectPool::GetInstance().initPool(DBHOST, "egodb", user, pass, 12);
  24. CNetService::GetInstance().Start();
  25. CUserManager::GetInstance().Start();
  26. CTimeSync sync;
  27. sync.Start();
  28. CNetService::GetInstance().Run();
  29. return 0;
  30. }