[Plugin] Shoebill 1.1 - SA-MP Java Development Kit

Yes, because there is an old version of shoebill-api included.
I think if you disable offlineMode in resources.yml it should download the newest api.
Reply

OfflineMode is disabled by default. But I found out that there is no .jar file in ..\shoebill\repository\net\gtaun\shoebill-api\1.1-SNAPSHOT.
Reply

I updated both server packages, you can redownload them at the start-post. I tried everything and it should launch without any configuration now (except JAVA_HOME variable).
Reply

[Image: 15LWaBE]

We just patched an important bug. You should update immediately if you don't want to put your server at risk.
You can use the provided update-shoebill.bat/sh file to update all the old files, or you can redownload the package from the first post, and replace files.
Reply

Are all the native function provided by 0.3z fully supported? Or are there any native functions missing? I still see a lot of interfaces in the source code like the Textdraw interface. I just want to make sure that all the 0.3z functionality can be accessed.

//EDiT: Nevermind, found that there are lots of implementations in a different project.
Reply

Yes, every SAMP Function is implemented, also every callback. You can take a look at shoebill-common for extra functions, like paged dialogs
Reply

If I see that correctly, callbacks are implemented as event handlers, right? No general functions like Gamemode.onPlayerConnect etc.?
Reply

You should add an event so that we can use plugin callbacks.
Reply

@The King's Bastard: Yes, you can register as many events as you want. You can create EventManagerNodes and destroy them etc.

You register a event like this: eventManager.registerHandler(PlayerConnectEvent.cl ass, (e) -> { ... });

@stokdam: Yes, we are currently working on it. You can already call natives.
Reply

Another question. Can I call shoebill functions from a child thread?
Reply

Yes, you can call SAMP Functions from a child thread, but you need to use
Код:
Shoebill.get().runOnSampThread(() -> {
            
});
in your running thread.
Reply

Mk124, one question.
Can one plug a Java MongoDB driver into this, and use it as a replacement for MySQL? Or does it require a custom-made DB connector?
Reply

@Anarkien: You just need to add a mysql / mongodb connector to your maven dependencies, and shoebill will download the needed connector automatically if you use maven. You can use every already existing java librarie with shoebill.

For example, you can see my project, it used Mongo DB: https://github.com/GTAUN/wl-vehicle-manager
Reply

I have a problem with my login dialog;

PHP код:
DscGamemode.get().getShoebill().runOnSampThread(()->
            {
                
                
InputDialog.create(playerDscGamemode.get().getEventManager())
                .
caption("Login for Player " player.getName())
                .
message("Please enter the password for account " player.getName())
                .
buttonCancel("Disconnect")
                .
buttonOk("Login")
                .
onClickOk(new DialogLogin())
                .
onClickCancel(abstractDialog -> player.kick())
                .
build()
                .
show();
                
            });
public class 
DialogLogin implements ClickOkHandler{
    public 
DialogLogin()
    {
        
    }
    
    @
Override
    
public void onClickOk(InputDialog dialogString testo) {
        
Player player dialog.getPlayer();
        
Utente utente Utente.getUtente(player);
        
String hashPassCmp Metodi.criptaPass(testoutente.getSalt()); //Get the hash from inputtext and salt
        
if (hashPassCmp.equals(utente.getHashPass()))
        {
            
utente.setLoggato(true); //set the user logged in
            
player.sendMessage(Color.LIGHTGREEN"You succesful logged in");    
        }
        else
        {
            
utente.aggiungiTentativo(); //user login attempts count
            
dialog.setCaption("Login failed");
            
dialog.setMessage("You entered the wrong password.\nTry again.");
            
dialog.show();
        }
    }

I have managed to show the dialog again if the player insterted the wrong password. The dialog appears but the caption and the message are not changed.
Reply

@stokdam: I tried to reproduce this, but it didn't work. Everything is working correctly, I tried it with this code:

Код:
        InputDialog.create(player, Gamemode.get().getEventManager())
                .caption("This is the old cap.")
                .message("This is old text")
                .onClickOk((dialog, text) -> {
                    dialog.setCaption("This is the new cap");
                    dialog.setMessage("This is the new text");
                    dialog.show();
                })
                .build()
                .show();
Reply

Quote:
Originally Posted by mk124
Посмотреть сообщение
@stokdam: I tried to reproduce this, but it didn't work. Everything is working correctly, I tried it with this code:

Код:
        InputDialog.create(player, Gamemode.get().getEventManager())
                .caption("This is the old cap.")
                .message("This is old text")
                .onClickOk((dialog, text) -> {
                    dialog.setCaption("This is the new cap");
                    dialog.setMessage("This is the new text");
                    dialog.show();
                })
                .build()
                .show();
The difference is that I called dialog.setCaption(" ") after the method build(), using the InputDialog object.
Reply

I am doing the exact same as you do, just in a lambda expression. The dialog variable is the input dialog, and then onClickOk Event will be called after the .build() of course, so both do the exact same thing.
Reply

Recompiled the project from my Linux pc and now it's working. I don't know what was happening. Thank you anyway for your help
Reply

I like it, is there a list of all available functions and such and how to utilize them such as handling events?
Reply

You can take a look at the example gamemode: https://github.com/Shoebill/example-lvdm
Eventhandeling is pretty easy:
Код:
eventManager.registerHandler(EventName.class, (e) -> {
    //Handle event, get player or vehicle etc. like: e.getPlayer()
});
The event names are like in pawn, for example: PlayerConnectEvent.class, PlayerUpdateEvent.class, PlayerTextEvent.class.

Also, you can take a look at shoebill-common. In this package are many functions to make developing a gamemode much easier.
Reply


Forum Jump:


Users browsing this thread: 22 Guest(s)