SA-MP Forums Archive
[Plugin] Shoebill 1.1 - SA-MP Java Development Kit - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: [Plugin] Shoebill 1.1 - SA-MP Java Development Kit (/showthread.php?tid=397735)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - SetupDLL - 23.01.2015

How should interrupt() and disallow() methods work in PlayerTextEvent? Because when I use interrupt() in the middle of event handler, the code in this event handler doesn't interrupt in the place, where I used interrupt(), but another event handler (with lower priority) doesn't work.
And when I use disallow(), my message sends in chat.


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - mk124 - 23.01.2015

@SetupDLL: Ok, I'm sorry for the problems. Please update shoebill-runtime (switch to onlineMode -> Start Server -> Switch back to offlineMode) and then it should work.

//Edit: Ok, now it's working. Please update the plugin with update-shoebill.bat. (and shoebill-runtime as mentioned above)


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - SetupDLL - 23.01.2015

thank you for quick fixes!


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - mk124 - 23.01.2015

No problem If you have any questions, you can post them here, so other people can see them too


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - stokdam - 24.01.2015

Can anyone explain me how to call a native of a plugin such as streamer?


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - mk124 - 24.01.2015

@stokdam: In the current build you can only call functions from a pawn file. But I made a update today, and I will push it tomorrow, and then you can call native functions. But there is a streamer for shoebill. You can get it with this dependency:

<dependency>
<groupId>net.gtaun</groupId>
<artifactId>shoebill-streamer</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

And use it like this:

DynamicSampObject.create(...)

I will write you a private message tomorrow.


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - stokdam - 24.01.2015

Quote:
Originally Posted by mk124
Посмотреть сообщение
@stokdam: In the current build you can only call functions from a pawn file. But I made a update today, and I will push it tomorrow, and then you can call native functions. But there is a streamer for shoebill. You can get it with this dependency:

<dependency>
<groupId>net.gtaun</groupId>
<artifactId>shoebill-streamer</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

And use it like this:

DynamicSampObject.create(...)

I will write you a private message tomorrow.
Thankyou, i didn't know there was a streamer for shoebill, it was the only plugin i need because all other things such as mysql are availble in java directly, i'm goinig to test it.

EDIT: It says "Missing artifact net.gtaunhoebill-streamer:jar:1.0-SNAPSHOT" in pom.xml


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - mk124 - 24.01.2015

What do you mean? Are you in offlineMode?


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - stokdam - 25.01.2015

It seems that it cant find the dependency


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - mk124 - 25.01.2015

Which repositories do you use right now?


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - stokdam - 25.01.2015

Код:
<repositories>
		<repository>
			<id>gtaun-public-repo</id>
			<name>GTAUN Public Repository</name>
			<url>http://repo.gtaun.net/content/groups/public</url>
		</repository>
		
		<repository>
     		<id>sonatype-nexus-snapshots</id>
     		<name>Sonatype Nexus Snapshots</name>
     		<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
     		<snapshots>
         		<enabled>true</enabled>
          		<updatePolicy>daily</updatePolicy>
      		</snapshots>
		</repository>
	</repositories>



Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - mk124 - 25.01.2015

Ok, looks fine. Are you sure that you use the correct dependency?
Can you access DynamicSampObject? Do you get in error in the console?


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - stokdam - 25.01.2015

No, I cant access DynamicSampObject. I just copied and pasted the dependency from your previus post:
Код:
<dependency>
<groupId>net.gtaun</groupId>
<artifactId>shoebill-streamer</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>



Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - mk124 - 25.01.2015

These are my settings, and I can access DynamicSampObject and it's members:


<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>

<repository>
<id>gtaun-public-repo</id>
<name>GTAUN Public Repository</name>
<url>http://repo.gtaun.net/content/groups/public</url>
</repository>
</repositories>

and the dependency:

<dependency>
<groupId>net.gtaun</groupId>
<artifactId>shoebill-streamer</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

The dynamic object is located in this package: net.gtaun.shoebill.object.*
Other people can access it too, which IDE are you using? Maybe you need to reimport the maven project.


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - mk124 - 25.01.2015

[Image: 1yYJNMw]

- All callbacks that handle return values are now correctly usable. (Cancel PlayerUpdateEvent, PlayerTextEvent, etc.)
- You can now call native functions from other plugins (make sure the shoebill plugin is the first entry in the plugins line in your server.cfg)
- Fixed the player.spawn() bug, they will now spawn normally

[Image: 1yH03Tv]

Cancel callbacks:
Код:
eventManager.registerHandler(PlayerTextEvent.class, event -> {
            if(event.getPlayer().isSpectating())
                event.disallow(); //There will be no message in the chat if the player is currently spectating somebody
});
Call native functions:
Код:
AmxCallable createDynamicObject = null;
for(AmxInstance instance : Shoebill.get().getAmxInstanceManager().getAmxInstances()) {
        createDynamicObject = instance.getNative("CreateDynamicObject");
        if(createDynamicObject != null) {
                //found CreateDynamicObject native, call it like this:
                createDynamicObject.call(18421, ....); //normal pawn arguments. Make sure you put a f after a Float value, like this: 13.0f or 0f
                break;
       }
}
Please use the shoebill-updater, because the launcher, the plugin and the runtime has been changed. Run update-shoebill.bat/sh (located in the root-directory of your server) and it will download the newest files from our servers.


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - stokdam - 25.01.2015

Quote:
Originally Posted by mk124
Посмотреть сообщение
These are my settings, and I can access DynamicSampObject and it's members:


<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>

<repository>
<id>gtaun-public-repo</id>
<name>GTAUN Public Repository</name>
<url>http://repo.gtaun.net/content/groups/public</url>
</repository>
</repositories>

and the dependency:

<dependency>
<groupId>net.gtaun</groupId>
<artifactId>shoebill-streamer</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

The dynamic object is located in this package: net.gtaun.shoebill.object.*
Other people can access it too, which IDE are you using? Maybe you need to reimport the maven project.
I downloaded shoebill-streamer from the github repository and added it to my projects and now eclipse can resolve the dependency.


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - mk124 - 25.01.2015

Ok, so it's working now?


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - stokdam - 25.01.2015

Yes.


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - mk124 - 25.01.2015

I just made a little video on how to setup a project in IntelliJ IDEA 14:
https://www.youtube.com/watch?v=g2SOqax3Euw


Re: [SNAPSHOT][Java 8] Shoebill 1.0 - SA-MP Java Development Kit - SetupDLL - 26.01.2015

I'm getting "Unknown command" messages, but cmds work correctly