[Мануал] Как сделать .info - Форум администраторов игровых серверов
Форум администраторов игровых серверов StormWall - Защита от DDos атак
Регистрация Мнения Справка Сообщество Календарь
Вернуться   Форум администраторов игровых серверов > MMO > Lineage II > Тех-документация

Тех-документация Статьи по редактированию, компиляции и настройки ява серверов Lineage 2

Ответ
Опции темы
Непрочитано 24.01.2009, 11:10   #1
™Diablo

Автор темы (Топик Стартер) [Мануал] Как сделать .info

Здравствуйте ! Сегодня я вам расскажу как сделать на сервере .info
Зачем это?Это очень удобно для Новостей или что-то типа того
Новость(другое) нужно будет писать в HTML
И так приступим

1.Идём в L2_GameServer_IL \ SRC \ Main \ Java \ Net \ SF \ l2j \ GameServer \ Handler \ voicedcommandhandlers
и создаём новый файл VoiceInfo.java.

Код:
[high=java]/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see http://www.gnu.org/licenses/
 */
package net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.GameServer;
import net.sf.l2j.gameserver.cache.HtmCache;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;

/**
 * @author Michiru
 *
 */
public class VoiceInfo implements IVoicedCommandHandler
{
	private static String[]	VOICED_COMMANDS	=
											{ "info" };

	/* (non-Javadoc)
	* @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
	*/
	public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
	{
		String htmFile = "data/html/custom/xx.htm";
		String htmContent = HtmCache.getInstance().getHtm(htmFile);
		if (htmContent != null)
		{
			NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
			infoHtml.setHtml(htmContent);
			activeChar.sendPacket(infoHtml);
		}
		else
		{
			activeChar.sendMessage("omg lame error! where is " + htmFile + " ! blame the Server Admin");
		}
		return true;
	}

	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
}[/high]
что бы ввести пусть к вашему файлу поменяйте строку htmFile = "data/html/custom/xx.htm"; Теперь идём в L2_GameServer_IL \ SRC \ Main \ Java \ Net \ SF \ l2j \ GameServer \ Handler \
октрываем
Код:
voicecommandhandlers.java
и вставляем:

Код:
[high=java]import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoiceInfo;[/high]
После

Код:
[high=java]import net.sf.l2j.gameserver.handler.voicedcommandhandlers.CastleDoors;[/high]
Теперь идём на 54-ую строчку и вставляем вот это:

Код:
[high=java]registerVoicedCommandHandler(new VoiceInfo());[/high]
Всё,готовО!
Статью немного изменил
Автор: BrainFucker

Последний раз редактировалось Zone-Game; 04.03.2009 в 04:15.
Zone-Game вне форума Отправить сообщение для Zone-Game с помощью ICQ Ответить с цитированием
Сказали спасибо:
Ответ


Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Быстрый переход


© 2007–2024 «Форум администраторов игровых серверов»
Защита сайта от DDoS атак — StormWall
Работает на Булке неизвестной версии с переводом от zCarot
Текущее время: 00:16. Часовой пояс GMT +3.

Вверх