public Boolean canSendMessage(WorldClient Client, ChatChannelEnum ChannelType) { ; switch (ChannelType) { case ChatChannelEnum.CHANNEL_ALIGNMENT: if (Client.Character.Deshonor >= 1) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.ERREUR, 83, getTimeEplased(Client, ChannelType).ToString())); return(false); } if (Client.Character.Alignement == 0) { Client.Send(new BasicNoOperationMessage()); return(false); } else if (getTimeLeft(Client, ChannelType) < ChatTiming.getTime(ChannelType)) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.INFO, 115, getTimeEplased(Client, ChannelType).ToString())); return(false); } break; case ChatChannelEnum.CHANNEL_GENERAL: if (getTimeLeft(Client, ChannelType) < ChatTiming.getTime(ChannelType)) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.UNK, 184)); return(false); } break; case ChatChannelEnum.CHANNEL_GUILD: if (getTimeLeft(Client, ChannelType) < ChatTiming.getTime(ChannelType)) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.UNK, 184)); return(false); } break; case ChatChannelEnum.CHANNEL_GROUP: if (getTimeLeft(Client, ChannelType) < ChatTiming.getTime(ChannelType)) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.UNK, 184)); return(false); } break; case ChatChannelEnum.CHANNEL_RECRUITMENT: if (getTimeLeft(Client, ChannelType) < ChatTiming.getTime(ChannelType)) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.INFO, 115, getTimeEplased(Client, ChannelType).ToString())); return(false); } break; case ChatChannelEnum.CHANNEL_DEALING: if (getTimeLeft(Client, ChannelType) < ChatTiming.getTime(ChannelType)) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.INFO, 115, getTimeEplased(Client, ChannelType).ToString())); return(false); } break; case ChatChannelEnum.CHANNEL_PRIVATE_SEND: if (getTimeLeft(Client, ChannelType) < ChatTiming.getTime(ChannelType)) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.UNK, 184)); return(false); } break; } return(true); }
public long getTimeEplased(WorldClient Client, ChatChannelEnum ChannelType) { return(Convert.ToInt32(Math.Ceiling((ChatTiming.getTime(ChannelType) - (Program.currentTimeMillis() - Client.myChatRestrictions[ChannelType])) / 1000d) + 1)); }