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

Thank you!
Keep up the good work!
Reply

I just updated the server in Linux using java command because the .sh didn't work but now I get the following error: libjawt.so: cannot open shared object file: No such file or directory
Reply

Are you sure that you start the server via the startup.sh file?
Reply

I also had this error. I added its location to LD_LIBRARY_PATH environment variable. On my setup, that library was located in ./usr/lib/jvm/java-8-oracle/lib/i386/libjawt.so, for you it may be different.
Reply

Yeah, I started it via startup.sh and it seems the new plugin has this problem.
I have already setup the LD_LIBRARY_PATH

And in the server log:
Код:
[15:27:19] filterscripts = ""  (string)
[15:27:19] 
[15:27:19] Server Plugins
[15:27:19] --------------
[15:27:19]  Loading plugin: Shoebill
[15:27:19]   Failed (libjawt.so: cannot open shared object file: No such file or directory)
[15:27:19]  Loaded 0 plugins.

[15:27:19] 
[15:27:19] Filterscripts
[15:27:19] ---------------
[15:27:19]   Loaded 0 filterscripts.

[15:27:19] Number of vehicle models: 0
Reply

Hmm this usually means that the gamemode exited on its own OR it crashed. Either way check the server_log.txt(if still using pawn) and shoebill/logs/ for clues.
Reply

I'm sorry, I mean I get this always, the last post I made was a fail
[15:27:19] filterscripts = "" (string)
[15:27:19]
[15:27:19] Server Plugins
[15:27:19] --------------
[15:27:19] Loading plugin: Shoebill
[15:27:19] Failed (libjawt.so: cannot open shared object file: No such file or directory)
[15:27:19] Loaded 0 plugins.

[15:27:19]
[15:27:19] Filterscripts
[15:27:19] ---------------
[15:27:19] Loaded 0 filterscripts.

[15:27:19] Number of vehicle models: 0

There aren't anything in the logs folders
Reply

As dusk said, I think you need to add your java installation to the LD_LIBRARY_PATH environment variable.
Maybe this can help you: http://stackoverflow.com/questions/1...-path-in-linux.

You will have to locate your java installation path and add the libjawt.so to the variable. Dusk said his installation was located at /usr/lib/jvm/java-8-oracle/lib/i386/libjawt.so. Make sure you select 32 Bit.
Reply

Exactly I had two paths, so I added them both. Easy way to find out where these files exist would be with:

Код:
root@vps1129117:/# find -name "libjawt.so"
./usr/lib/jvm/java-8-oracle/lib/i386/libjawt.so
./usr/lib/jvm/java-8-oracle/jre/lib/i386/libjawt.so
The char used to separate paths is ":".
So in my case:
Код:
export LD_LIBRARY_PATH=/usr/lib/jvm/java-8-oracle/lib/i386/libjawt.so:/usr/lib/jvm/java-8-oracle/jre/lib/i386/libjawt.so
You can then use printenv command to see a list of environment variables to see if its amongst them.
Reply

I did it but it didn't work, also I can't locate this: ~/.bashrc
What were the changes made on the version 1.2?
The Shoebill 1.1 plugin is working fine
Reply

Nothing about the JRE is changed in Shoebill 1.2.
Show me your startup.sh file please.
Reply

Код:
#export JAVA_HOME=Path to JDK8 (32-bit)
export LD_LIBRARY_PATH=.:/opt/jdk1.8.0_65/jre/lib/i386/client:/opt/jdk1.8.0_65/jre/lib/i386/server:/usr/local/lib
./samp03svr
Reply

Try changing the LD_LIBRARY_PATH in the startup.sh file to the libjawt.so file.

Try this:
export LD_LIBRARY_PATH=.:/opt/jdk1.8.0_65/jre/lib/i386/libjawt.so:/usr/local/lib
Reply

I get the same result, I also tried:
Код:
#export JAVA_HOME=Path to JDK8 (32-bit)
export LD_LIBRARY_PATH=.:/opt/jdk1.8.0_65/jre/lib/i386/:/usr/local/lib
./samp03svr
EDIT: Snifff..... finally it worked... thanks, I did the following:
Код:
#export JAVA_HOME=Path to JDK8 (32-bit)
export LD_LIBRARY_PATH=.:/opt/jdk1.8.0_65/jre/lib/i386:/opt/jdk1.8.0_65/jre/lib/i386/client:/opt/jdk1.8.0_65/jre/lib/i386/server:/usr/local/lib
./samp03svr
And installed the next libraries:
Код:
yum install libXext.i686
yum install libXrender.i686
yum install libXtst.i686
I hope this will be very useful for everyone
Reply

Hey again
I think that this is a bug:
If you call player.spawn on a dialog (that is showed after an e.disallow() function on PlayerRequestSpawnEvent) the PlayerSpawnEvent is called twice.
I have only one player.spawn function, only one event manager, only a
Код:
event.registerHandler(PlayerSpawnEvent.class, (e) ->
        {
and I don't have any TogglePlayerSpectating() code, and also I do not have any filterscript.

By the way I got this:
Код:
[2016-01-04 14:18:48][INFO][out] net.gtaun.shoebill.object.impl.VehicleImpl@74f035[id=379,isStatic=false,modelId=0]
Код:
if(newState == PlayerState.DRIVER){
            Vehicle vid = player.getVehicle();
            System.out.println(vid);
As you can see the modelId is equal to zero!
Reply

@Su37Erich: I fixed the problem with the ModelId, but I don't understand what you exactly mean with "the PlayerSpawnEvent is called twice". Can you give me some full example code?
Reply

Код:
package dev.acesamp;
public class Test extends Gamemode {
    protected static final DialogId dialogSpawn = DialogId.create();
    protected void onEnable() throws Throwable {
        EventManager event = getEventManager();
        event.registerHandler(PlayerSpawnEvent.class, (e) ->
        {
            System.out.println("Message");//This message appears two times at the same second
            Callbacks.onPlayerSpawn(e.getPlayer());
        });
        event.registerHandler(PlayerRequestSpawnEvent.class, (e) ->
        {
            Callbacks.onPlayerRequestSpawn(e.getPlayer());
            e.disallow();
        });}
       evento.registerHandler(DialogResponseEvent.class, (e) ->
       {
              Callbacks.onDialogResponse(e.getDialog(), e.getPlayer(), e.getDialogResponse(), e.getListitem(), e.getInputText());
       });
    }
    @Override
    protected void onDisable() throws Throwable {

    }
}
Код:
package dev.acesamp;
public class Callbacks extends Test{
    public static void onPlayerSpawn(Player player){
    }
    public static void onPlayerRequestSpawn(Player player){
        Server.showSpawnMenu(player);
        }
    }
    public static int onDialogResponse(DialogId dialog, Player player, int response, int listitem, String inputtext){
        if(dialog == dialogSpawn){
            player.spawn();
        }
    }
}
Код:
package dev.acesamp;
public class Server extends  Test{
    public static void showSpawnMenu(Player player){
        dialogSpawn.show(player, DialogStyle.LIST, "Title", "Option1", "Choose", "");    
    }
}
Reply

@Su37Erich: I will try to reproduce it. Another question: Why do you subclass your classes from "Test"? And you should not use DialogId, instead you should use the dialogs from shoebill-common, such as MsgboxDialog or ListDialog.
Reply

Because I need to use the variables of Test in the subclasses like the dialog variable, ArrayList of custom vehicles, array list of teams, etc., like global variables that I created on the "main class". It's pretty hard for me to deal with the plugin because there aren't enough examples and explanations of the plugin itself, so I found the DialogId, tested it and it worked, that's the reason I used it.
Reply

@Su37Erich: You should not do this, because your subclasses are not in relation to your base class. You can create an instance variable that will allow you to access an instance of your Test class. Here is an example:

PHP код:
public class Test extends Plugin {
    private static 
Test instance;
    public static 
Test getInstance() {
        return 
instance;
    }
    @
Override
    
public void onEnable() {
        
instance this;
    }

You can then somewhere else access it like this:
PHP код:
Test.getInstance().getEventManager().register(...); 
Dialogs can be used like this:
PHP код:
MsgboxDialog.create(playereventManager)
    .
caption("This is my dialog caption")
    .
message("Do you like this server?")
    .
buttonOk("Yes")
    .
buttonCancel("No")
    .
onClickOk((dialog) -> {
        
player.sendMessage("That's nice to hear!");
    }) 
    .
onClickCancel((dialog) -> {
        
player.sendMessage("That's a shame :(");
    })
    .
build()
    .
show(); 
Reply


Forum Jump:


Users browsing this thread: 16 Guest(s)