Nottinghster
Tibia World RPG Developer
- Joined
- Oct 24, 2007
- Messages
- 1,570
- Solutions
- 6
- Reaction score
- 437
- Location
- Brazil - Rio de Janeiro
- GitHub
- Nottinghster
Hello OTLanders!
I've added Guild War system to my source code (otserv_svn 0.6.3 - version 7.72) and I have fixed some things and now works 99,9% (skulls system, frags and other things), the 0,1% is a weird problem: THE MESSAGE SENT TO GUILD CHANNEL !!!
(Opponent XXX of the YYY was killed by ZZZ - The new score is 123:321 frags (limit 500)) --> THAT KIND OF MESSAGE
Everytime that I kill an enemy and the guild channel is opened, the server crash, the reason: I REALLY DON'T KNOW !!!
Here's the code about sending the messages
Here's the broadcastMessage function:
Someone can help me with that ?
Thank you guys !!!
--------------------- EDIT -------------------------
After checking the code for some time, I finally fixed, please some MOD, can close the thread
I've added Guild War system to my source code (otserv_svn 0.6.3 - version 7.72) and I have fixed some things and now works 99,9% (skulls system, frags and other things), the 0,1% is a weird problem: THE MESSAGE SENT TO GUILD CHANNEL !!!
(Opponent XXX of the YYY was killed by ZZZ - The new score is 123:321 frags (limit 500)) --> THAT KIND OF MESSAGE
Everytime that I kill an enemy and the guild channel is opened, the server crash, the reason: I REALLY DON'T KNOW !!!
Here's the code about sending the messages
Code:
//Send message to channels
std::stringstream msg;
msg << "Opponent " << player->getName() << " of the " << enemy->getName() << " was killed by " << kmsg <<
". The new score is " << frags << ":" << enemyFrags << " frags (limit " << it->second.fragLimit << ").";
guild->broadcastMessage(SPEAK_CHANNEL_R1, msg.str());
msg.str("");
msg << "Guild member " << player->getName() << " was killed by " << kmsg << " of the " << guild->getName() <<
". The new score is " << enemyFrags << ":" << frags << " frags (limit " << it->second.fragLimit << ").";
enemy->broadcastMessage(SPEAK_CHANNEL_R1, msg.str());
if(it->second.finished){
//Send final war messages
msg.str("");
msg << "Congratulations! You have won the war against " << enemy->getName() <<
" with " << frags << " frags.";
guild->broadcastMessage(SPEAK_CHANNEL_R1, msg.str());
msg.str("");
msg << "You have lost the war against " << guild->getName() <<
". They have reached the limit of " << frags << " frags.";
enemy->broadcastMessage(SPEAK_CHANNEL_R1, msg.str());
Here's the broadcastMessage function:
Code:
void Guild::broadcastMessage(SpeakClasses type, const std::string& msg) const
{
ChatChannel* channel = g_chat.getGuildChannel(getId());
if(channel) //Channel doesn't necessarily exists
channel->sendInfo(type, msg);
}
Someone can help me with that ?
Thank you guys !!!
--------------------- EDIT -------------------------
After checking the code for some time, I finally fixed, please some MOD, can close the thread
Last edited: