refactored client code. it now uses IClient and IServer and

has a CServerProxy, making it's design similar to the server
code.
This commit is contained in:
crs
2002-07-10 20:18:32 +00:00
parent df6748f669
commit 710e1bdd47
15 changed files with 1207 additions and 669 deletions

View File

@@ -81,6 +81,7 @@ realMain(CMutex* mutex)
// create client
s_client = new CClient(s_name);
s_client->camp(s_camp);
s_client->setAddress(s_serverAddress);
if (!s_client->open()) {
delete s_client;
s_client = NULL;
@@ -92,13 +93,17 @@ realMain(CMutex* mutex)
mutex->unlock();
}
locked = false;
bool success = s_client->run(s_serverAddress);
s_client->run();
locked = true;
if (mutex != NULL) {
mutex->lock();
}
// get client status
bool success = !s_client->wasRejected();
// clean up
s_client->close();
delete s_client;
s_client = NULL;
CLog::setLock(NULL);
@@ -111,6 +116,7 @@ realMain(CMutex* mutex)
if (!locked && mutex != NULL) {
mutex->lock();
}
s_client->close();
delete s_client;
s_client = NULL;
CLog::setLock(NULL);