Посмотрите видео ниже, чтобы узнать, как установить наш сайт в виде веб-приложения на главном экране.
Примечание: Эта функция может быть недоступна в некоторых браузерах.
угу я вкурсе. только вот какой пакет должен отправить сервер чтобы открылся данный таймер. вот что я хотел.
Клиент HF. Какой серверный пакет откроет AITimerWnd на клиенте? Кто знает ? AITimerWnd - таймер
Посмотреть вложение 19683
public void SendUiEventToClient(string msg, int time, bool increase, bool hide)
{
time -= 1; //Поправка на время
var answ = new GameWriter(GameDataToClient);
answ.writeB(PacketList.Server.ExSendUIEvent);
answ.writeD(0);
answ.writeD(hide ? 1 : 0);
answ.writeD(0);
answ.writeD(0);
answ.writeS(increase ? "1" : "0");
answ.writeS(Convert.ToString(time / 60));
answ.writeS(Convert.ToString(time % 60));
answ.writeS("0");
answ.writeS("0");
answ.writeD(-1); //1911120
answ.writeS(msg);
SendToClient(answ.Getpacket());
}
package l2p.gameserver.network.serverpackets;
import l2p.gameserver.model.Player;
import l2p.gameserver.network.serverpackets.components.NpcString;
import l2p.gameserver.network.serverpackets.components.Opcode;
public class ExSendUIEvent extends NpcStringContainer
{
public static final int STYLE_TIMER_SHOW = 0;
public static final int STYLE_TIMER_HIDE = 1;
public static final int STYLE_BALLISTA_CHARGE = 2;
public static final int STYLE_COUNTER = 3;
public static final int STYLE_UNK_4 = 4;
public static final int STYLE_PROGRESS_BAR = 5;
public static final int STYLE_TEMPERATURE_1 = 6;
public static final int STYLE_TEMPERATURE_2 = 7;
public static final int STYLE_UNK_8 = 8;
public static final int MODE_NONE = -1;
public static final int MODE_REMAINING = 0;
public static final int MODE_ELAPSED = 1;
private int _objectId;
private int _style;
private int _mode;
private int _value1;
private int _value2;
private int _sysStringId1;
private int _sysStringId2;
public ExSendUIEvent(Player player, int style, int mode, int value1, int value2, String... params)
{
this(player, style, mode, value1, value2, 0, 0, NpcString.NONE, params);
}
public ExSendUIEvent(Player player, int style, int mode, int value1, int value2, NpcString npcString, String... params)
{
this(player, style, mode, value1, value2, 0, 0, npcString, params);
}
public ExSendUIEvent(Player player, int style, int mode, int value1, int value2, int sysStringId1, int sysStringId2, NpcString npcString, String... params)
{
super(npcString, params);
_objectId = player != null ? player.getObjectId() : 0;
_style = style;
_mode = mode;
_value1 = value1;
_value2 = value2;
_sysStringId1 = sysStringId1;
_sysStringId2 = sysStringId2;
}
@Override
protected void writeImpl()
{
writeEx(Opcode.ExSendUIEvent);
writeD(_objectId);
writeD(_style); // ID timer (any style)
writeD(0x00); // unknown
writeD(0x00); // unknown
writeS(String.valueOf(_mode)); // Name indicator
if (_mode >= 0 && _style < 6)
{
writeS(String.valueOf(_value1 / 60)); // timer starting minute(s)
writeS(String.valueOf(_value1 % 60)); // timer starting second(s)
writeS(String.valueOf(_value2 / 60)); // timer length minute(s) (timer will disappear 10 seconds before it ends)
writeS(String.valueOf(_value2 % 60)); // timer length second(s) (timer will disappear 10 seconds before it ends)
}
else
{
writeS(String.valueOf(_value1));
writeS(String.valueOf(_value2));
writeS(String.valueOf(_sysStringId1));
writeS(String.valueOf(_sysStringId2));
}
writeElements();
}
}
protected void writeElements()
{
writeD(_npcString.getId());
for (String st : _parameters)
writeS(st);
}
шлём пакет ExSendUIEvent с сервера на клиентНу если решили отпишите для других, что за привычка
Зачем мне? И выше было сказано и не раз о том же.шлём пакет ExSendUIEvent с сервера на клиенти получаем таймер. вот и всё.
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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 <Вы не можете просматривать ссылку пожалуйста воспользуйтесь следующими ссылками Вход или Регистрация>.
*/
package com.l2jserver.gameserver.network.serverpackets;
import java.util.Arrays;
import java.util.List;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.NpcStringId;
public class ExSendUIEvent extends L2GameServerPacket
{
private final int _objectId;
private final boolean _type;
private final boolean _countUp;
private final int _startTime;
private final int _endTime;
private final int _npcstringId;
private List<String> _params = null;
/**
* @param player
* @param hide
* @param countUp
* @param startTime
* @param endTime
* @param text
*/
public ExSendUIEvent(L2PcInstance player, boolean hide, boolean countUp, int startTime, int endTime, String text)
{
this(player, hide, countUp, startTime, endTime, -1, text);
}
/**
* @param player
* @param hide
* @param countUp
* @param startTime
* @param endTime
* @param npcString
* @param params
*/
public ExSendUIEvent(L2PcInstance player, boolean hide, boolean countUp, int startTime, int endTime, NpcStringId npcString, String... params)
{
this(player, hide, countUp, startTime, endTime, npcString.getId(), params);
}
/**
* @param player
* @param hide 0 = show, 1 = hide (there is 2 = pause and 3 = resume also but they don't work well you can only pause count down and you cannot resume it because resume hides the counter).
* @param countUp 0 = count down, 1 = count up
* @param startTime
* @param endTime
* @param npcstringId
* @param params
*/
public ExSendUIEvent(L2PcInstance player, boolean hide, boolean countUp, int startTime, int endTime, int npcstringId, String... params)
{
_objectId = player.getObjectId();
_type = hide;
_countUp = countUp;
_startTime = startTime;
_endTime = endTime;
_npcstringId = npcstringId;
_params = Arrays.asList(params);
}
@Override
protected void writeImpl()
{
writeC(0xFE);
writeH(0x8E);
writeD(_objectId);
writeD(_type ? 1 : 0); // 0 = show, 1 = hide (there is 2 = pause and 3 = resume also but they don't work well you can only pause count down and you cannot resume it because resume hides the counter).
writeD(0);// unknown
writeD(0);// unknown
writeS(_countUp ? "1" : "0"); // 0 = count down, 1 = count up
// timer always disappears 10 seconds before end // Таймер всегда исчезает за 10 секунд до конца
writeS(String.valueOf(_startTime / 60));
writeS(String.valueOf(_startTime % 60));
writeS(String.valueOf(_endTime / 60));
writeS(String.valueOf(_endTime % 60));
writeD(_npcstringId);
if (_params != null)
{
for (String param : _params)
{
writeS(param);
}
}
}
}