Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[TUTORIAL] Send Notice to Server (Command)

Newbie Spellweaver
Joined
Dec 27, 2015
Messages
11
Reaction score
8
Hello members!
I'm new in this section (PB/Blackout DEV) and I decided to work on sources published here. Sorry any shenanigans.. :blink:


First, I'm working on this source: https://forum.ragezone.com/f904/release-updated-database-project-blackout-1072030/


I took a look in this package: (ru.pb.game.network.client.packets.server).
I was looking for any thing like "Show PopUp" or something like that.. and I found SM_SEND_NOTICE . We don't need nothing more haha :eek:tt:


Just add this class in ru.pb.game.chat.commands:

SendNoticeAdminCommand.java

Code:
package ru.pb.game.chat.commands;


import ru.pb.game.network.client.ClientConnection;
import ru.pb.game.network.client.packets.server.SM_SEND_NOTICE;


/**
 * @author Iazzetta
 *
 */
public class SendNoticeAdminCommand implements BaseCommand {
    
    @Override
    public String getPrefix() {
        return "notice";
    }
    
    @Override
    public String call(ClientConnection conn, String msg) {
        try {
            String noticeMessage = conn.getPlayer().getName() + ": " + msg; // PLAYER: ...message...
            conn.sendPacket(new SM_SEND_NOTICE(noticeMessage));
            return "Message sent.";
        } catch(Exception e){
            return "Correct Command: /adm notice [MESSAGE]";
        }
    }


}


and add to AdminCommandHandler (ru.pb.game.handler):

Code:
...
commands.add(new SendNoticeAdminCommand());
...

lobby screen:
ingame:

I don't know if all on server can receive this message.. I was testing alone :/ but who can..
Credits to author of this source, i just construct a simple method :drool: cya
 
Last edited:
Newbie Spellweaver
Joined
Jan 22, 2015
Messages
18
Reaction score
6
Re: [RELEASE] Send Notice to Server (Command)

It's not working to compile! GAME the BUILD FAILED...
 
Newbie Spellweaver
Joined
Nov 18, 2015
Messages
58
Reaction score
9
Re: [RELEASE] Send Notice to Server (Command)

mateusbp3

Download Jdk
 
Newbie Spellweaver
Joined
Jan 22, 2015
Messages
18
Reaction score
6
Re: [RELEASE] Send Notice to Server (Command)

It is giving BUILD FAILED
>> game-build.xml <<
H4tzmN0 - [TUTORIAL] Send Notice to Server (Command) - RaGEZONE Forums




Send the Source already compiled into SendNotice already in it?



I have JDK! But I know not ta WHAT happening: /
bT8yENr - [TUTORIAL] Send Notice to Server (Command) - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
Dec 27, 2015
Messages
11
Reaction score
8
Re: [RELEASE] Send Notice to Server (Command)

Send the Source already compiled into SendNotice already in it?
I have JDK! But I know not ta WHAT happening: /

put here the class SendNoticeAdminCommand.java...
You added "commands.add(new SendNoticeAdminCommand()); in AdminCommandHandler?
Imported the SendNoticeAdminCommand in AdminCommandHandler? check this first. I wont post the compiled source here, sorry.

It's not just download the JDK.You need to set it in the Eclipse properties.
(put this in GOOGLE: setting jdk in eclipse).
 
Newbie Spellweaver
Joined
Jan 22, 2015
Messages
18
Reaction score
6
G1JzQDx - [TUTORIAL] Send Notice to Server (Command) - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Back
Top