Page 1 of 1

[solved] Broadcast / privlevel > 1 cant read

PostPosted: Sun Jul 13, 2014 12:00 am
by Carnifexe
i checked the normal serverrules that we used

normalserverrules.cs
Code: Select all
public override bool IsAllowedToUnderstand(GameLiving source, GamePlayer target) { if(source == null || target == null) return false; // clients with priv level > 1 are allowed to talk and hear anyone if(source is GamePlayer && ((GamePlayer)source).Client.Account.PrivLevel > 1) return true; if(target.Client.Account.PrivLevel > 1) return true; //Peace flag NPCs can be understood by everyone if (source is GameNPC) if ((((GameNPC)source).Flags & GameNPC.eFlags.PEACE) != 0) return true; if(source.Realm > 0 && source.Realm != target.Realm) return false; return true; }
we got the realm chat also Realm = 5,

broadcast.cs
Code: Select all
private void Broadcast(GamePlayer player, string message) { foreach (GamePlayer p in GetTargets(player)) { if (GameServer.ServerRules.IsAllowedToUnderstand(p, player) || ((eBroadcastType)ServerProperties.Properties.BROADCAST_TYPE == eBroadcastType.Server)) { p.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "Scripts.Players.Broadcast.Message", player.Name, message), eChatType.CT_Broadcast, eChatLoc.CL_ChatWindow); } } }
player realm 1 cant read 2 and 3 its perfect but privlevel > 1 cant read all 3 realms anything didnt work well... cant figure it out since couple of hours i beg you for a small help / hint

just wanted gm / admin can read everything and noone else...

Greetings Carnifexe

Re: Broadcast / privlevel > 1 cant read

PostPosted: Sun Jul 13, 2014 1:51 am
by elcotek
you mean GM's cant read alle realms in the broat ?

Re: Broadcast / privlevel > 1 cant read

PostPosted: Sun Jul 13, 2014 10:02 am
by Carnifexe
Yes schnitte this is what i mean i tryd this in all ways but i think in the wrong direction hehe

Re: Broadcast / privlevel > 1 cant read

PostPosted: Sun Jul 13, 2014 12:38 pm
by geshi
just change
Code: Select all
if (GameServer.ServerRules.IsAllowedToUnderstand(p, player) || ((eBroadcastType)ServerProperties.Properties.BROADCAST_TYPE == eBroadcastType.Server))
to
Code: Select all
if (GameServer.ServerRules.IsAllowedToUnderstand(p, player) || ((eBroadcastType)ServerProperties.Properties.BROADCAST_TYPE == eBroadcastType.Server) || player.Client.Account.PrivLevel >= (uint)ePrivLevel.GM || p.Client.Account.PrivLevel >= (uint)ePrivLevel.GM)
then all GMs will be able to read what everyone's is saying and everyone will be able to read what the GMs are saying in broadcast.

You shouldn't really be modifying stuff in GameServer but I guess it's too late now

Re: Broadcast / privlevel > 1 cant read

PostPosted: Sun Jul 13, 2014 1:10 pm
by Carnifexe
just change
Code: Select all
if (GameServer.ServerRules.IsAllowedToUnderstand(p, player) || ((eBroadcastType)ServerProperties.Properties.BROADCAST_TYPE == eBroadcastType.Server))
to
Code: Select all
if (GameServer.ServerRules.IsAllowedToUnderstand(p, player) || ((eBroadcastType)ServerProperties.Properties.BROADCAST_TYPE == eBroadcastType.Server) || player.Client.Account.PrivLevel >= (uint)ePrivLevel.GM || p.Client.Account.PrivLevel >= (uint)ePrivLevel.GM)
then all GMs will be able to read what everyone's is saying and everyone will be able to read what the GMs are saying in broadcast.

You shouldn't really be modifying stuff in GameServer but I guess it's too late now

This is what i tryd before but
Code: Select all
case eBroadcastType.Realm: { foreach (GameClient thisClient in WorldMgr.GetClientsOfRealm(player.Realm)) { list.Add(thisClient.Player); } break; }
we use eBroadcastType.Realm also Realm = 5,
and it wont work :(
Class Reference is icommandhandler and abstractcommandhandler but i think i comes from the serverrules

any idea left ?

Re: Broadcast / privlevel > 1 cant read

PostPosted: Sun Jul 13, 2014 2:28 pm
by elcotek
ok my time is short, i have post the better broatcast here on the Forum:
http://www.dolserver.net/viewtopic.php?f=47&t=22067

have fun with the fix :wink:

Re: Broadcast / privlevel > 1 cant read

PostPosted: Tue Jul 15, 2014 10:57 pm
by elcotek
if you use the script on your server, you have to say the problem is soved, so the staff can set it as "solved"

is it now solved or not ?

Re: [solved] Broadcast / privlevel > 1 cant read

PostPosted: Wed Jul 16, 2014 10:52 am
by Graveen
done