• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[8.7] The Forgotten Server v0.2.10 (Mystic Spirit)

Status
Not open for further replies.
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

bogart is right, every name, even in real Tibia must start with a capital letter.
Then you can change it in your db to lower-case afterwards.
 
@Talaturen

Please add in new relase new blessing system or option to choose between old and new one. New system I mean, when you have all 5 blessings, you don't lose your eq and backpack.
 
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.
 
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.

Output message memory leak actually it was called but it was related to spells spamming.
r.4350
Code:
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;
 
I have looked into the code and seems like that you have that patched already.
 
Could some1 please help me create a "LOWlevelLOCK" so you wont go lower than lvl 50 and so.
Id be really happy if you can help me out. :)
Ofc Rep++
 
first of all before you reply to me i am just STARTING to learn about ots anyway lets get on with my question
basically i configured everything and when i log in on the account manager account i press 'OK' it just stays there and then a notice comes up saying cannot connect to the game server login port : 7171 game port : 7172 any ideas ? last time i tried some old engine i could log in with the account manager but i cant with this someone help ? pretty please :)
 
sorry for double post but i fixed the problem didnt realise my ports werent open for some reason ..
 
srry, I don't read all posts, but I found one error in this distrubution.
Item Atributes don't save when player logout. Ex: I set my armor to actionID 5000, if I relog my armor has lose this actionID.

Just a report. THX
 
as Talaturen told, this bug happens only with SQLite
 
ruda, ty for help, I will try fix this bug or run in mysql database.
 
You're probably off making your own server from scratch than using this one... It fails much... !bless = broken..... fields = broken.....Monsters = missing.... Functions = Outdated, and it just continues on from there... You will find a new problem every day and very few people who will help you im promise..
 
Status
Not open for further replies.
Back
Top