ScarfaceMS
Please login or register to enjoy the full features and benefits of the forum. Also when you are logged in you will have reduced AD's and much more. So what are you waiting for! Not a member? Register now! Already a member? Just simply log in! Thank You Smile ~
-Tony And 2nd Owner Legend<3!
ScarfaceMS
Please login or register to enjoy the full features and benefits of the forum. Also when you are logged in you will have reduced AD's and much more. So what are you waiting for! Not a member? Register now! Already a member? Just simply log in! Thank You Smile ~
-Tony And 2nd Owner Legend<3!
ScarfaceMS
Would you like to react to this message? Create an account in a few clicks or log in to continue.

ScarfaceMS

Maplestory v75 Private Server
 
HomePortalGalleryLatest imagesSearchRegisterLog in
Please vote for our server on all links inorder to have a better and bigger community!

 

 @callgm command

Go down 
AuthorMessage
KryptoDev
Newbie
Newbie
KryptoDev


Posts : 28
Join date : 2010-07-04

@callgm command Empty
PostSubject: @callgm command   @callgm command EmptySun Jul 04, 2010 11:46 pm

In WorldChannelInterfaceImpl.java
Add this,


public void broadcastGMMessage(String sender, byte[] message) throws RemoteException {
for (int i : WorldRegistryImpl.getInstance().getChannelServer() ) {
ChannelWorldInterface cwi = WorldRegistryImpl.getInstance().getChannel(i);
try {
cwi.broadcastGMMessage(sender, message);
} catch (RemoteException e) {
WorldRegistryImpl.getInstance().deregisterChannelS erver(i);
}
} }

Add this to WorldChannelCommonOperations.java,

public void broadcastGMMessage(String sender, byte[] message) throws RemoteException;

Add this to your PlayerCommands.java

else if (splitted[0].equals("@callgm")) {
StringBuilder sb = new StringBuilder();
sb.append(c.getPlayer().getName());
sb.append(" needs your help.");
WorldChannelInterface wci = c.getChannelServer().getWorldInterface();
try{wci.broadcastGMMessage(null, MaplePacketCreator.serverNotice(5 , sb.toString()).getBytes());} catch(Exception ex){}
}

Add this to the definitions

new CommandDefinition("callgm", "", "Calls a gm for help", 0),

Add this to WorldChannelInterfaceImpl.java,

public void broadcastGMMessage(String sender, byte[] message) throws RemoteException {
MaplePacket packet = new ByteArrayMaplePacket(message);
server.broadcastGMPacket(packet);
}

And this to your ChannelServer.java,

public void broadcastGMPacket(MaplePacket data) {
for (MapleCharacter chr : players.getAllCharacters()) {
if(chr.isGM())
chr.getClient().getSession().write(data);
}
}
Back to top Go down
 
@callgm command
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
ScarfaceMS :: Extras :: Releases-
Jump to: