git.stg.codes
/
stg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d53db9f
)
Initialize and fill proto with users in main
author
Maxim Mamontov
<faust@gts.dp.ua>
Tue, 10 May 2011 12:52:54 +0000
(15:52 +0300)
committer
Maxim Mamontov
<faust@gts.dp.ua>
Tue, 10 May 2011 12:52:54 +0000
(15:52 +0300)
projects/sgauthstress/main.cpp
patch
|
blob
|
history
diff --git
a/projects/sgauthstress/main.cpp
b/projects/sgauthstress/main.cpp
index 3d0adb49b96aac8464786aa4735a53251a73db8c..f4e94b4f61921d6d076e85f7c9cf1702a59bc240 100644
(file)
--- a/
projects/sgauthstress/main.cpp
+++ b/
projects/sgauthstress/main.cpp
@@
-35,6
+35,7
@@
#include "settings.h"
#include "store_loader.h"
#include "settings.h"
#include "store_loader.h"
+#include "proto.h"
#include "user.h"
time_t stgTime;
#include "user.h"
time_t stgTime;
@@
-94,6
+95,11
@@
if (settings.ReadSettings())
SetSignalHandlers();
SetSignalHandlers();
+PROTO proto(settings.GetServerName(),
+ settings.GetServerPort(),
+ settings.GetLocalPort(),
+ 1);
+
STORE_LOADER storeLoader(settings.GetModulesPath(), settings.GetStoreModuleSettings());
if (storeLoader.Load())
{
STORE_LOADER storeLoader(settings.GetModulesPath(), settings.GetStoreModuleSettings());
if (storeLoader.Load())
{
@@
-110,7
+116,6
@@
if (dataStore->GetUsersList(&userList))
return -1;
}
return -1;
}
-std::vector<USER> users;
std::vector<std::string>::const_iterator it;
for (it = userList.begin(); it != userList.end(); ++it)
{
std::vector<std::string>::const_iterator it;
for (it = userList.begin(); it != userList.end(); ++it)
{
@@
-120,18
+125,16
@@
for (it = userList.begin(); it != userList.end(); ++it)
std::cerr << "Failed to read user conf: '" << dataStore->GetStrError() << "'" << std::endl;
return -1;
}
std::cerr << "Failed to read user conf: '" << dataStore->GetStrError() << "'" << std::endl;
return -1;
}
-
users.push_back
(
+
proto.AddUser
(
USER(
USER(
- settings.GetServerName(),
- settings.GetServerPort(),
- settings.GetLocalPort(),
*it,
*it,
- userConf.password
+ userConf.password,
+ userConf.ips[0].ip
)
);
}
)
);
}
-std::cout << "Successfully loaded " <<
users.size
() << " users" << std::endl;
+std::cout << "Successfully loaded " <<
proto.UserCount
() << " users" << std::endl;
running = true;
while (running)
running = true;
while (running)