Destined-MS

    @callgm command suggestion :)

    Share
    avatar
    Fate

    Posts : 85
    Join date : 2009-12-26
    Age : 25
    Location : Malaysia

    @callgm command suggestion :)

    Post  Fate on Sat Dec 26, 2009 5:05 am

    Make a @callgm.... its easy for a newbie or a player when they are having their probs... But for those who missuse it will be jail or ban~

    Haseo

    Posts : 44
    Join date : 2009-12-20
    Location : In your girlfriend XD

    Re: @callgm command suggestion :)

    Post  Haseo on Sat Dec 26, 2009 2:41 pm

    NOOOOO jail is scary
    avatar
    genocious

    Posts : 69
    Join date : 2009-12-19

    Re: @callgm command suggestion :)

    Post  genocious on Sun Dec 27, 2009 9:14 pm

    lolz this suggestion not bad~~

    cicktowin

    Posts : 2
    Join date : 2009-12-28

    Re: @callgm command suggestion :)

    Post  cicktowin on Mon Dec 28, 2009 7:23 am

    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().deregisterChannelServer(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);
    }
    }
    avatar
    Fate

    Posts : 85
    Join date : 2009-12-26
    Age : 25
    Location : Malaysia

    Re: @callgm command suggestion :)

    Post  Fate on Mon Dec 28, 2009 8:13 am

    o.O i see u are a coder~
    avatar
    genocious

    Posts : 69
    Join date : 2009-12-19

    Re: @callgm command suggestion :)

    Post  genocious on Mon Dec 28, 2009 8:18 am

    Codes are confusing confused
    avatar
    Fate

    Posts : 85
    Join date : 2009-12-26
    Age : 25
    Location : Malaysia

    Re: @callgm command suggestion :)

    Post  Fate on Mon Dec 28, 2009 8:19 am

    Yea~ it take me years to learn~~

    Sponsored content

    Re: @callgm command suggestion :)

    Post  Sponsored content


      Current date/time is Tue Dec 11, 2018 9:07 pm