Guild Leaders Channel (9.X and 8.6)

Ninja

Global Moderator
Staff member
Global Moderator
Joined
Apr 6, 2010
Messages
5,934
Best answers
30
Reaction score
1,415
Location
Sweden
Guild Leaders Channel


This channel is especially for Guild Leaders, where they could chat with each other about upcoming battles et cetera. It has been tested on latest revision, (protocol 9.70 r5893).

Good to know
- Only Guild Leaders will be able to enter the channel.
- It will show their Guild Name next to their own so others can see which guild they're representing.

I'll use channel ID 10, so if that ID is taken already then change to another one!

channels.xml
XML:
<channel id="10" name="Guild Leaders"/>
chat.cpp

Find bool ChatChannel::talk and replace it or compare it with this one.

9.X
[cpp]bool ChatChannel::talk(Player* player, MessageClasses type, const std::string& text, uint32_t statementId)
{
UsersMap::iterator it = m_users.find(player->getID());
if(it == m_users.end())
return false;


if(m_condition && !player->hasFlag(PlayerFlag_CannotBeMuted))
{
if(Condition* condition = m_condition->clone())
player->addCondition(condition);
}


for(it = m_users.begin(); it != m_users.end(); ++it) {
if(m_id == 10) {
std::stringstream ss;
ss << player->getName() << " [" << player->getGuildName() << "]";
it->second->sendChannelMessage(ss.str(), std::string(text), type, (uint8_t)m_id);
} else {
it->second->sendCreatureChannelSay(player, type, text, m_id, statementId);
}
}


if(hasFlag(CHANNELFLAG_LOGGED) && m_file->is_open())
*m_file << "[" << formatDate() << "] " << player->getName() << ": " << text << std::endl;


return true;
}[/cpp]

8.6
[CPP]bool ChatChannel::talk(Player* player, SpeakClasses type, const std::string& text, uint32_t _time/* = 0*/)
{
UsersMap::iterator it = m_users.find(player->getID());
if(it == m_users.end())
return false;


if(m_condition && !player->hasFlag(PlayerFlag_CannotBeMuted))
{
if(Condition* condition = m_condition->clone())
player->addCondition(condition);
}


for(it = m_users.begin(); it != m_users.end(); ++it) {
if(m_id == 10) {
std::stringstream ss;
ss << player->getName() << " [" << player->getGuildName() << "]";
it->second->sendChannelMessage(ss.str(), std::string(text), type, (uint8_t)m_id);
} else {
it->second->sendToChannel(player, type, text, m_id, _time);
}
}


if(hasFlag(CHANNELFLAG_LOGGED) && m_file->is_open())
*m_file << "[" << formatDate() << "] " << player->getName() << ": " << text << std::endl;


return true;
}[/CPP]
Replace this
[cpp]player->getVocationId())))[/cpp]
with this
[cpp]player->getVocationId())) || (channelId == 10 && !(player->getGuildLevel() == GUILDLEVEL_LEADER)))[/cpp]

Enjoy!
 
Last edited:

Printer

if Printer then print("LUA") end
Premium User
Joined
Dec 27, 2009
Messages
5,733
Best answers
21
Reaction score
2,015
Location
Sweden?

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,168
Best answers
9
Reaction score
1,010
Location
Germany :O
I love it, great idea.
I also had a awesome idea, but I forgot it ffs-.-
 
OP
Ninja

Ninja

Global Moderator
Staff member
Global Moderator
Joined
Apr 6, 2010
Messages
5,934
Best answers
30
Reaction score
1,415
Location
Sweden
I would say 9.X in current state, but for which protocol do you want it for?
 
OP
Ninja

Ninja

Global Moderator
Staff member
Global Moderator
Joined
Apr 6, 2010
Messages
5,934
Best answers
30
Reaction score
1,415
Location
Sweden
8.6 version.

[CPP]bool ChatChannel::talk(Player* player, SpeakClasses type, const std::string& text, uint32_t _time/* = 0*/)
{
UsersMap::iterator it = m_users.find(player->getID());
if(it == m_users.end())
return false;


if(m_condition && !player->hasFlag(PlayerFlag_CannotBeMuted))
{
if(Condition* condition = m_condition->clone())
player->addCondition(condition);
}


for(it = m_users.begin(); it != m_users.end(); ++it) {
if(m_id == 10) {
std::stringstream ss;
ss << player->getName() << " [" << player->getGuildName() << "]";
it->second->sendChannelMessage(ss.str(), std::string(text), type, (uint8_t)m_id);
} else {
it->second->sendToChannel(player, type, text, m_id, _time);
}
}


if(hasFlag(CHANNELFLAG_LOGGED) && m_file->is_open())
*m_file << "[" << formatDate() << "] " << player->getName() << ": " << text << std::endl;


return true;
}[/CPP]
 
Last edited:

Wolfenrir

how you remind me?
Joined
Sep 29, 2008
Messages
105
Best answers
0
Reaction score
1
Location
/home?
i use tfs 0.3.6pl1 protocol 8.6, really work?
 
OP
Ninja

Ninja

Global Moderator
Staff member
Global Moderator
Joined
Apr 6, 2010
Messages
5,934
Best answers
30
Reaction score
1,415
Location
Sweden
It should be working for 0.3.6pl1 aswell.
 
OP
Ninja

Ninja

Global Moderator
Staff member
Global Moderator
Joined
Apr 6, 2010
Messages
5,934
Best answers
30
Reaction score
1,415
Location
Sweden
Available for non-premium users now :p
 

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,856
Best answers
0
Reaction score
88
Location
Brazil
I tested and non-leaders can write in the channel, same to non-guild-members
 
OP
Ninja

Ninja

Global Moderator
Staff member
Global Moderator
Joined
Apr 6, 2010
Messages
5,934
Best answers
30
Reaction score
1,415
Location
Sweden
Seems like you didn't followed the whole "tutorial". The channel is only visible for Leaders.

Just tested it 30 seconds ago. :p
 
OP
Ninja

Ninja

Global Moderator
Staff member
Global Moderator
Joined
Apr 6, 2010
Messages
5,934
Best answers
30
Reaction score
1,415
Location
Sweden
That's what I did a few minutes myself and it worked as it should. This makes channel 10 only available for Leaders.
Code:
player->getVocationId())) [COLOR=#ff0000]|| (channelId == 10 && !(player->getGuildLevel() == GUILDLEVEL_LEADER)))[/COLOR]
 

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,715
Best answers
7
Reaction score
281
This channel is especially for Guild Leaders, where they could chat with each other about upcoming battles et cetera.
Wait, what? These "trade team" do not have any TeamSpeak or Ventrilo or Skype? o_O

Btw, if this trade team, do not have.. seems legit.
 
Last edited:
OP
Ninja

Ninja

Global Moderator
Staff member
Global Moderator
Joined
Apr 6, 2010
Messages
5,934
Best answers
30
Reaction score
1,415
Location
Sweden
Wait, what? These "trade team" do not have any TeamSpeak or Ventrilo or Skype? o_O
Why would you even bring that up? Sure they have these applications available on their computers.

It's a simple channel where you could find other Guild Leaders and arrange battles. Only Guild leaders are able to open this channel anyway.
 

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,715
Best answers
7
Reaction score
281
Why would you even bring that up? Sure they have these applications available on their computers.

It's a simple channel where you could find other Guild Leaders and arrange battles. Only Guild leaders are able to open this channel anyway.
So, this is great, but and how about the Vice-leaders? They can't arrange battles with this simple channel? That is unfair
 
OP
Ninja

Ninja

Global Moderator
Staff member
Global Moderator
Joined
Apr 6, 2010
Messages
5,934
Best answers
30
Reaction score
1,415
Location
Sweden
It can always be added :p

&& !(player->getGuildLevel() == GUILDLEVEL_VICE)
 
Top