From 01761191e15f2093c6348cb28b5a925db5bd2e45 Mon Sep 17 00:00:00 2001 From: "False.Genesis" Date: Fri, 12 Jan 2007 20:07:18 +0000 Subject: [PATCH] misc stuff --- src/Client/PseuWoW.cpp | 9 +++++++++ src/Client/PseuWoW.h | 1 + src/Client/Realm/RealmSocket.cpp | 3 ++- src/Client/World/WorldSocket.cpp | 5 +++++ src/Client/World/WorldSocket.h | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Client/PseuWoW.cpp b/src/Client/PseuWoW.cpp index 026d9fb..43319d4 100644 --- a/src/Client/PseuWoW.cpp +++ b/src/Client/PseuWoW.cpp @@ -50,6 +50,7 @@ PseuInstance::PseuInstance(PseuInstanceRunnable *run) _fastquit=false; _startrealm=true; createWorldSession=false; + _error=false; } @@ -180,6 +181,14 @@ void PseuInstance::Run(void) SaveAllCache(); + if(GetConf()->exitonerror == false && _error) + { + log("Exiting on error is disabled, PseuWoW is now IDLE"); + log("-- Press enter to exit --"); + char crap[100]; + fgets(crap,sizeof(crap),stdin); + } + } void PseuInstance::Update() diff --git a/src/Client/PseuWoW.h b/src/Client/PseuWoW.h index 490ba83..d5f999c 100644 --- a/src/Client/PseuWoW.h +++ b/src/Client/PseuWoW.h @@ -91,6 +91,7 @@ class PseuInstance bool _initialized; bool _stop,_fastquit; bool _startrealm; + bool _error; BigNumber _sessionkey; char *_ver,*_ver_short; SocketHandler _sh; diff --git a/src/Client/Realm/RealmSocket.cpp b/src/Client/Realm/RealmSocket.cpp index ebd3ff2..5884cb2 100644 --- a/src/Client/Realm/RealmSocket.cpp +++ b/src/Client/Realm/RealmSocket.cpp @@ -107,8 +107,9 @@ void RealmSocket::Start(void) { if(_rhost.empty() || _rport==0 || _instance==NULL) return; + log("Connecting to Realm Server on '%s:%u'",_rhost.c_str(),_rport); + Open(_rhost,_rport); - bool result=Open(_rhost,_rport); //... _valid=true; } diff --git a/src/Client/World/WorldSocket.cpp b/src/Client/World/WorldSocket.cpp index 4a87f0d..8a2e86a 100644 --- a/src/Client/World/WorldSocket.cpp +++ b/src/Client/World/WorldSocket.cpp @@ -27,6 +27,11 @@ void WorldSocket::OnDelete() _session->SetSocket(NULL); } +void WorldSocket::OnException() +{ + this->SetCloseAndDelete(); +} + void WorldSocket::OnRead() { TcpSocket::OnRead(); diff --git a/src/Client/World/WorldSocket.h b/src/Client/World/WorldSocket.h index 68f0a87..a341615 100644 --- a/src/Client/World/WorldSocket.h +++ b/src/Client/World/WorldSocket.h @@ -29,6 +29,7 @@ public: void OnConnect(); void OnConnectFailed(); void OnDelete(); + void OnException(); void SendWorldPacket(WorldPacket &pkt); void InitCrypt(uint8*,uint32);