Merged with released L2J-Unity files.

This commit is contained in:
mobiusdev
2016-06-12 01:34:09 +00:00
parent e003e87887
commit 635557f5da
18352 changed files with 3245113 additions and 2892959 deletions

View File

@@ -0,0 +1,66 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 handlers.telnethandlers.chat;
import com.l2jmobius.gameserver.network.telnet.ITelnetCommand;
import com.l2jmobius.gameserver.network.telnet.TelnetServer;
import com.l2jmobius.gameserver.util.Broadcast;
import io.netty.channel.ChannelHandlerContext;
/**
* @author UnAfraid
*/
public class Announce implements ITelnetCommand
{
private Announce()
{
}
@Override
public String getCommand()
{
return "announce";
}
@Override
public String getUsage()
{
return "Announce <text>";
}
@Override
public String handle(ChannelHandlerContext ctx, String[] args)
{
if ((args.length == 0) || args[0].isEmpty())
{
return null;
}
final StringBuilder sb = new StringBuilder();
for (String str : args)
{
sb.append(str + " ");
}
Broadcast.toAllOnlinePlayers(sb.toString());
return "Announcement sent!";
}
public static void main(String[] args)
{
TelnetServer.getInstance().addHandler(new Announce());
}
}

View File

@@ -0,0 +1,68 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 handlers.telnethandlers.chat;
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import com.l2jmobius.gameserver.network.telnet.ITelnetCommand;
import com.l2jmobius.gameserver.network.telnet.TelnetServer;
import io.netty.channel.ChannelHandlerContext;
/**
* @author UnAfraid
*/
public class GMChat implements ITelnetCommand
{
private GMChat()
{
}
@Override
public String getCommand()
{
return "gmchat";
}
@Override
public String getUsage()
{
return "Gmchat <text>";
}
@Override
public String handle(ChannelHandlerContext ctx, String[] args)
{
if ((args.length == 0) || args[0].isEmpty())
{
return null;
}
final StringBuilder sb = new StringBuilder();
for (String str : args)
{
sb.append(str + " ");
}
AdminData.getInstance().broadcastToGMs(new CreatureSay(0, ChatType.ALLIANCE, "Telnet GM Broadcast", sb.toString()));
return "GMChat sent!";
}
public static void main(String[] args)
{
TelnetServer.getInstance().addHandler(new GMChat());
}
}

View File

@@ -0,0 +1,74 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 handlers.telnethandlers.chat;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import com.l2jmobius.gameserver.network.telnet.ITelnetCommand;
import com.l2jmobius.gameserver.network.telnet.TelnetServer;
import io.netty.channel.ChannelHandlerContext;
/**
* @author UnAfraid
*/
public class Msg implements ITelnetCommand
{
private Msg()
{
}
@Override
public String getCommand()
{
return "msg";
}
@Override
public String getUsage()
{
return "Msg <player> <text>";
}
@Override
public String handle(ChannelHandlerContext ctx, String[] args)
{
if ((args.length < 2) || args[0].isEmpty())
{
return null;
}
final L2PcInstance player = L2World.getInstance().getPlayer(args[0]);
if (player != null)
{
final StringBuilder sb = new StringBuilder();
for (int i = 1; i < args.length; i++)
{
sb.append(args[i] + " ");
}
player.sendPacket(new CreatureSay(0, ChatType.WHISPER, "Telnet Priv", sb.toString()));
return "Announcement sent!";
}
return "Couldn't find player with such name.";
}
public static void main(String[] args)
{
TelnetServer.getInstance().addHandler(new Msg());
}
}