public void warnUsersAboutPlayerEventInChat(ChatChannel channel, string info, byte eventId) { MessageOut msg=new MessageOut(Protocol.CPMSG_CHANNEL_EVENT); msg.writeInt16(channel.getId()); msg.writeInt8(eventId); msg.writeString(info); sendInChannel(channel, msg); }
void guildChannelTopicChange(ChatChannel channel, int playerId, string topic) { Guild guild=Program.guildManager.findByName(channel.getName()); if(guild!=null) { if((guild.getUserPermissions(playerId)&(int)GuildAccessLevel.GAL_TOPIC_CHANGE)!=0) //TODO Überprüfen ob Vergleich so richtig rum { Program.chatChannelManager.setChannelTopic(channel.getId(), topic); } } }
void sendInChannel(ChatChannel channel, MessageOut msg) { List<ChatClient> users=channel.getUserList(); foreach(ChatClient user in users) { user.send(msg); } }