say Albocal not albocal
THANKS, but...
I have done. but when loggin with my numers and passowrd and creat a acoount look this:
00:50 Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.
I say: account
00:51 Account Manager: Do you want to change your 'password', request a 'recovery key', add a 'character', or 'delete' a character?
i say: character
00:51 Account Manager: What would you like as your character name?
I say albocal
00:51 Account Manager: That name seems to contain invalid symbols tell me another name.
:S
I don't belive that tala didn't patched that memory leak with spells so this script is most likely unnecessary.
What memory leak with spells patch are you referring to? I can't remember patching a memory leak related to spells in the last months.
Index: C:/Users/Pietia/Desktop/svn dirs/open tibia/otserv/trunk/connection.cpp
===================================================================
--- C:/Users/Pietia/Desktop/svn dirs/open tibia/otserv/trunk/connection.cpp (revision 4349)
+++ C:/Users/Pietia/Desktop/svn dirs/open tibia/otserv/trunk/connection.cpp (revision 4350)
@@ -388,28 +388,35 @@
return false;
}
- msg->getProtocol()->onSendMessage(msg);
-
if(m_pendingWrite == 0){
+ msg->getProtocol()->onSendMessage(msg);
+
+ TRACK_MESSAGE(msg);
+
#ifdef __DEBUG_NET_DETAIL__
std::cout << "Connection::send " << msg->getMessageLength() << std::endl;
#endif
+
internalSend(msg);
}
else{
#ifdef __DEBUG_NET__
std::cout << "Connection::send Adding to queue " << msg->getMessageLength() << std::endl;
#endif
- m_outputQueue.push_back(msg);
+
+ TRACK_MESSAGE(msg);
+ OutputMessagePool* outputPool = OutputMessagePool::getInstance();
+ outputPool->addToAutoSend(msg);
}
+
m_connectionLock.unlock();
return true;
}
void Connection::internalSend(OutputMessage_ptr msg)
{
+ TRACK_MESSAGE(msg);
m_pendingWrite++;
-
try{
boost::asio::async_write(getHandle(),
boost::asio::buffer(msg->getOutputBuffer(), msg->getMessageLength()),
@@ -444,28 +451,12 @@
#endif
m_connectionLock.lock();
+ m_pendingWrite--;
+
+ TRACK_MESSAGE(msg);
msg.reset();
- if(!error){
- if(m_pendingWrite > 0){
- if(!m_outputQueue.empty()){
- msg = m_outputQueue.front();
- m_outputQueue.pop_front();
- internalSend(msg);
- #ifdef __DEBUG_NET_DETAIL__
- std::cout << "Connection::onWriteOperation send " << msg->getMessageLength() << std::endl;
- #endif
- }
- m_pendingWrite--;
- }
- else{
- std::cout << "Error: [Connection::onWriteOperation] Getting unexpected notification!" << std::endl;
- // Error. Pending operations counter is 0, but we are getting a
- // notification!!
- }
- }
- else{
- m_pendingWrite--;
+ if(error){
handleWriteError(error);
}
Index: C:/Users/Pietia/Desktop/svn dirs/open tibia/otserv/trunk/outputmessage.cpp
===================================================================
--- C:/Users/Pietia/Desktop/svn dirs/open tibia/otserv/trunk/outputmessage.cpp (revision 4349)
+++ C:/Users/Pietia/Desktop/svn dirs/open tibia/otserv/trunk/outputmessage.cpp (revision 4350)
@@ -96,6 +96,22 @@
{
boost::recursive_mutex::scoped_lock lockClass(m_outputPoolLock);
OutputMessageMessageList::iterator it;
+
+ for(it = m_toAddQueue.begin(); it != m_toAddQueue.end();){
+ //drop messages that are older than 10 seconds
+ if(OTSYS_TIME() - (*it)->getFrame() > 10000){
+ (*it)->getProtocol()->onSendMessage(*it);
+ it = m_toAddQueue.erase(it);
+ continue;
+ }
+
+ (*it)->setState(OutputMessage::STATE_ALLOCATED);
+ m_autoSendOutputMessages.push_back(*it);
+ ++it;
+ }
+
+ m_toAddQueue.clear();
+
for(it = m_autoSendOutputMessages.begin(); it != m_autoSendOutputMessages.end(); ){
OutputMessage_ptr omsg = *it;
#ifdef __NO_PLAYER_SENDBUFFER__
@@ -160,6 +176,10 @@
}
msg->freeMessage();
+
+#ifdef __TRACK_NETWORK__
+ msg->clearTrack();
+#endif
m_outputPoolLock.lock();
m_outputMessages.push_back(msg);
@@ -182,41 +202,28 @@
return OutputMessage_ptr();
}
- OutputMessage_ptr outputmessage;
- if(m_outputMessages.empty()) {
-#ifdef __TRACK_NETWORK__
- if(m_allOutputMessages.size() >= 5000){
- std::cout << "High usage of outputmessages: " << std::endl;
- m_allOutputMessages.back()->PrintTrace();
- }
-#endif
- outputmessage.reset(new OutputMessage,
- boost::bind(&OutputMessagePool::releaseMessage, this, _1));
+ if(m_outputMessages.empty()){
+ OutputMessage* msg = new OutputMessage();
+ m_outputMessages.push_back(msg);
#ifdef __TRACK_NETWORK__
- m_allOutputMessages.push_back(outputmessage.get());
+ m_allOutputMessages.push_back(msg);
#endif
- } else {
- outputmessage.reset(m_outputMessages.back(),
- boost::bind(&OutputMessagePool::releaseMessage, this, _1));
-#ifdef __TRACK_NETWORK__
- // Print message trace
- if(outputmessage->getState() != OutputMessage::STATE_FREE) {
- std::cout << "Using allocated message, message trace:" << std::endl;
- outputmessage->PrintTrace();
- }
-#else
- assert(outputmessage->getState() == OutputMessage::STATE_FREE);
-#endif
- m_outputMessages.pop_back();
}
+ OutputMessage_ptr outputmessage;
+ outputmessage.reset(m_outputMessages.back(),
+ boost::bind(&OutputMessagePool::releaseMessage, this, _1));
+
+ m_outputMessages.pop_back();
+
configureOutputMessage(outputmessage, protocol, autosend);
return outputmessage;
}
void OutputMessagePool::configureOutputMessage(OutputMessage_ptr msg, Protocol* protocol, bool autosend)
{
+ TRACK_MESSAGE(msg);
msg->Reset();
if(autosend){
msg->setState(OutputMessage::STATE_ALLOCATED);
@@ -241,3 +248,8 @@
#endif
msg->setFrame(m_frameTime);
}
+
+void OutputMessagePool::addToAutoSend(OutputMessage_ptr msg)
+{
+ m_toAddQueue.push_back(msg);
+}
Index: C:/Users/Pietia/Desktop/svn dirs/open tibia/otserv/trunk/networkmessage.h
===================================================================
--- C:/Users/Pietia/Desktop/svn dirs/open tibia/otserv/trunk/networkmessage.h (revision 4349)
+++ C:/Users/Pietia/Desktop/svn dirs/open tibia/otserv/trunk/networkmessage.h (revision 4350)
@@ -125,6 +125,7 @@
#ifdef __TRACK_NETWORK__
virtual void Track(std::string file, long line, std::string func) {};
+ virtual void clearTrack() {};
#endif
Index: C:/Users/Pietia/Desktop/svn dirs/open tibia/otserv/trunk/outputmessage.h
===================================================================
--- C:/Users/Pietia/Desktop/svn dirs/open tibia/otserv/trunk/outputmessage.h (revision 4349)
+++ C:/Users/Pietia/Desktop/svn dirs/open tibia/otserv/trunk/outputmessage.h (revision 4350)
@@ -67,6 +67,7 @@
Protocol* getProtocol() { return m_protocol;}
Connection* getConnection() { return m_connection;}
+ uint64_t getFrame() const { return m_frame;}
//void setOutputBufferStart(uint32_t pos) {m_outputBufferStart = pos;}
//uint32_t getOutputBufferStart() const {return m_outputBufferStart;}
@@ -81,6 +82,12 @@
os << /*file << ":"*/ "line " << line << " " << func;
last_uses.push_back(os.str());
}
+
+ virtual void clearTrack()
+ {
+ last_uses.clear();
+ }
+
void PrintTrace()
{
int n = 1;
@@ -89,7 +96,9 @@
}
}
#endif
+
protected:
+
#ifdef __TRACK_NETWORK__
std::list<std::string> last_uses;
#endif
@@ -132,7 +141,6 @@
OutputMessageState getState() const { return m_state;}
void setFrame(uint64_t frame) { m_frame = frame;}
- uint64_t getFrame() const { return m_frame;}
Protocol* m_protocol;
Connection* m_connection;
@@ -168,6 +176,7 @@
size_t getTotalMessageCount() const {return m_allOutputMessages.size();}
size_t getAvailableMessageCount() const {return m_outputMessages.size();}
size_t getAutoMessageCount() const {return m_autoSendOutputMessages.size();}
+ void addToAutoSend(OutputMessage_ptr msg);
protected:
@@ -181,6 +190,7 @@
InternalOutputMessageList m_outputMessages;
InternalOutputMessageList m_allOutputMessages;
OutputMessageMessageList m_autoSendOutputMessages;
+ OutputMessageMessageList m_toAddQueue;
boost::recursive_mutex m_outputPoolLock;
uint64_t m_frameTime;
bool m_isOpen;