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

We are looking for people that want to make Shoebill greater. If you interested in taking part of Shoebill's development, please contact me.





Join us on Slack!




Shoebill provides multiple ways to run your server. You can simply download our full server package for SA-MP 0.3.7 R2. In this package, everything you need is included (except java). We also provide a simple package, without the server executable, you might want to download this when you want to use a custom version of the SA-MP server. We also provide a wrapper for Mac OS X. You just need to simply double-click it, and shoebill will run on your Mac!
  • Full server package (0.3.7 R2): Download
  • Basic server package (compatible with 0.3.7 R2): Download
  • Mac wrapper (everything included, 0.3.7 R2): Download



Shoebill is a project, which allows you to write your filterscripts and gamemodes in Java. You have full-access to all
Java libraries and functions and even some more. Thanks to Shoebill's great inbuilt data about SA-MP and GTA:SA,
you won't have to search for vehicle or interior ids, because everything is built in, and also available at runtime.
Shoebill also provides a great way to handle Dialogs and many other utility functions.

  • Support the new features of Java 8
  • Object-Oriented
  • Event-Driven
  • Support Unicode/Codepage, client can have multiple encoding by setting codepage
  • Support Shoebill Plugin (Java) extension development
  • Provide service manager to support componentized development
  • Use slf4j as log interface, Use log4j as log implement
  • Use YAML as config and provide the appropriate tools
  • Provide launcher program to avoid BootStrap ClassLoader being polluted
  • Dependency Manager based on resources and libraries of Maven repository
  • Support SA-MP 0.3.7
  • Coexist with other Pawn-Gamemodes
  • Provide AMX interface


Shoebill is mainly lead by three people:
mk124: Started the Shoebill project and laid the foundation of the Shoebill you know today.
123marvin123: Joined in April 2014 the Shoebill project. Updated the Shoebill project since mk124 had no time anymore.
JingLin (inactive): Helped mk124 in the beginning.

Acknowledgement:
June, 258921, Shindo, Yiyin, ba2001, hitman249, Meta, Joe Zhao, 52_PLA, Zito, Julian
And those who are always supporting and using Shoebill.


Shoebill is using the Java Native Interface to enable you to build your gamemodes in Java. No client modification
is need for shoebill to run or players to play on your java flavored server. Everything is server-side.

Shoebill provides a dependency manager which is based on the Maven stock, it allows the automatic updating
of snapshot versions of the API / Runtimes / Related dependencies.

There is also a updater for the native plugin and the dependency-manger & launcher. If you want to use these,
please execute update-shoebill.bat / update-shoebill.sh and it will download the newest files.
Please make sure you update your resources.yml depending which files have been updated.

Introduction of projects:
ShoebillPlugin - Native plugin for sa-mp server
shoebill-launcher - Boot program
shoebill-dependency-manager - Dependency management based on Maven repository
shoebill-utilities - Misc. utility library (Internal use)
util-event - Event library developed for Shoebill
shoebill-api - Shoebill API interface
shoebill-runtime - Shoebill runtime library
shoebill-common - Common tool library
example-vehicle-manager-plugin - Example of Shoebill Plugin for developers
example-lvdm - Example of Shoebill Gamemode for developers

Introduction of the folder / file structure:
plugins/Shoebill.dll - SA-MP Native Plugin for Windows
plugins/Shoebill - SA-MP Native Plugin for Linux
gamemodes/Shoebill.amx - AMX entry for Shoebill
filterscripts/ShoebillFS.amx - Empty FS for solving the problem of malfunction of RCON commands
shoebill/bootstrap - Here are the jars located that are needed to start Shoebill
shoebill/repository - Here are the downloaded artifacts from dependency manager located
shoebill/libraries - Here you can paste custom libs that are not in maven repo
shoebill/gamemodes - Here you can paste your gamemode
shoebill/plugins - Here you can paste additional plugins to make your server more awesome
shoebill/shoebill.yml - Shoebill configuration file (with comments inside)
shoebill/resources.yml - In this file you can specify your gamemode, plugins and runtimes (with comments inside)
shoebill/jvm_options - The parameters for the JVM
shoebill/codepages.txt - A List of Windows codepages, which need to be used in Linux


Shoebill is being developed on GitHub: GitHub
Our CI Jenkins server can be found here (for manual jar download): Jenkins
Our Website can be found here: Shoebill
Our API-Documentation can be found here: Shoebill API-Documentation
Our Shoebill Common-API Documentation can be found here: Shoebill Common API-Doc


Watch our YouTube Instruction Videos: Take a look at our development examples: Look at our Wiki and use our project generator:
Reply
#2

Why creating gamemode with this API is better than do it in pawn? Speed? Posibilities? Just for fun? I really dont know, can somebody explain it?
Reply
#3

Nice, Make 124.
Reply
#4

Quote:
Originally Posted by Yiin
View Post
Why creating gamemode with this API is better than do it in pawn? Speed? Posibilities? Just for fun? I really dont know, can somebody explain it?
amenities and features
and the speed
Reply
#5

edit: Changed my mind. Useful like pancakes in an empty mouth.
Reply
#6

Quote:
Originally Posted by ikkentim
View Post
Same response from me as on the .NET sa-mp coding.

It can't trigger custom natives(plugins, etc) properly.
Im 99% sure it can't be efficient.
However, since I think it is unnecessary, Shoebill doesn't provide the support of accessing AMX now.
If I implement the feature of accessing AMX in Shoebill, it seems like this:

Code:
AmxFunction func = amxInstance.getNative("print");
int ret = func.call("test");
// ...
amxInstance.registerNative("SendClientMessageWithShoebill", func);
As a consequence, though Shoebill doesn't provide this feature (maybe never), it can be implemented if I want.
What's more, You can also make a native plugin and call the native / public functions you need in it, and then provide Java Plugin the native methods by JNI.
Reply
#7

I don't know why the topic has few replies. That makes me frustrated. Could someone told me the reason why
Reply
#8

It's probably because not much users want to program in Java....
Reply
#9

It's really awesome to have ability to program in other languages. I would certainly use it, but... I hate Java, it looks very messy for me. I don't like pawn very much, it hasn't got great features, like pointers. I prefer C(pawn and C are very similar), if there would be ability to program using C, I would certainly use it.
And what is the reason for only a few comments? Look at the scripting help section... People are trying to script something, they think they can. They think they can script server even if they don't have programming skills, they think they are strong enough. And there aren't many people who knows a lot of Java in this community and if they use it, there won't be many people who will try to help.
Anyway, great job. I haven't used Java a lot, is memory hacking possible with this? Is it possible to use it in this(just asking)?
Reply
#10

Quote:
Originally Posted by zgintasz
View Post
It's really awesome to have ability to program in other languages. I would certainly use it, but... I hate Java, it looks very messy for me. I don't like pawn very much, it hasn't got great features, like pointers. I prefer C(pawn and C are very similar), if there would be ability to program using C, I would certainly use it.
And what is the reason for only a few comments? Look at the scripting help section... People are trying to script something, they think they can. They think they can script server even if they don't have programming skills, they think they are strong enough. And there aren't many people who knows a lot of Java in this community and if they use it, there won't be many people who will try to help.
Anyway, great job. I haven't used Java a lot, is memory hacking possible with this? Is it possible to use it in this(just asking)?
I think i knew the reason, thank you.
But i'm sorry to say, this Development Kit can't use on memory hacking.
Method proxy just design for its own Java API.

If you want to program in C, you may check Zeex's remarkable project:
https://github.com/Zeex/sampgdk

BTW: I do like C, but Java is cool as well, for example:
VehicleDialog.java
VehicleListDialog.java
Reply
#11

Great! I'm looking forward to this new version

Correct me if I'm wrong but does Java 8 even exists? Last time I checked it was Java 7.
Reply
#12

@mk124
Can you implement something like this:
Dialog::createList("Spawn Vehicle", "Okay", "Oh no")
->addRow("Stallion", 439)
->addRow("Pizzaboy", 44
->addRow("Turismo", 451)
->addRow("Flatbed", 455)
->addRow("Yankee", 456)
->on("Success", function($player, $dialog, $id) {
[...]
$vehicle = Vehicle::create($id, $pos->x, $pos->y, $pos->z, $facing);
[...]
})->showPlayer($player);

I mean, that you can give something like a vehicle ID with the ListItem like addRow("Stallion", 439) and then you can receive that Value(439) in the OnDialogResponse Event?
Reply
#13

Quote:
Originally Posted by 123marvin123
View Post
@mk124
Can you implement something like this:
Dialog::createList("Spawn Vehicle", "Okay", "Oh no")
->addRow("Stallion", 439)
->addRow("Pizzaboy", 44
->addRow("Turismo", 451)
->addRow("Flatbed", 455)
->addRow("Yankee", 456)
->on("Success", function($player, $dialog, $id) {
[...]
$vehicle = Vehicle::create($id, $pos->x, $pos->y, $pos->z, $facing);
[...]
})->showPlayer($player);

I mean, that you can give something like a vehicle ID with the ListItem like addRow("Stallion", 439) and then you can receive that Value(439) in the OnDialogResponse Event?
You can achieve something similiar to this by yourself. When you have a STYLE_LIST dialog the string which player selected is in the variable "inputtext".

I believe you could extend the dialog class by adding an "addRow" method and just storing the data in a map that maps from listitem to the value entered. Then OnDialogResponse getDialog().getRowValue(listitem).
Reply
#14

@dusk
Cool, I got it working like this:
class ListDialog {
[...]
private Map<String, Object> rows = new HashMap<>();
[...]
public void addItem(String displayText, Object tag) {
ListItems.add(displayText);
rows.put(displayText, tag);
}
public Object getRow(String rowName) {
return rows.get(rowName);
}
}
Reply
#15

Quote:
Originally Posted by dusk
View Post
Great! I'm looking forward to this new version

Correct me if I'm wrong but does Java 8 even exists? Last time I checked it was Java 7.
Please check this page:
http://www.oracle.com/technetwork/ja...ads/index.html

Quote:
Originally Posted by 123marvin123
View Post
@mk124
Can you implement something like this:
Dialog::createList("Spawn Vehicle", "Okay", "Oh no")
->addRow("Stallion", 439)
->addRow("Pizzaboy", 44
->addRow("Turismo", 451)
->addRow("Flatbed", 455)
->addRow("Yankee", 456)
->on("Success", function($player, $dialog, $id) {
[...]
$vehicle = Vehicle::create($id, $pos->x, $pos->y, $pos->z, $facing);
[...]
})->showPlayer($player);

I mean, that you can give something like a vehicle ID with the ListItem like addRow("Stallion", 439) and then you can receive that Value(439) in the OnDialogResponse Event?
My solution is:
https://github.com/GTAUN/wl-vehicle-...istDialog.java

The key code is:
Code:
int[] vehicleModelIds = ArrayUtils.toPrimitive(VehicleModel.getIds().toArray(new Integer[0]));
Code:
for (int modelId : modelIds) dialogListItems.add(new DialogListItemVehicle(modelId));
Code:
public class DialogListItemVehicle extends DialogListItem
{
	private final int modelId;
	private final long driveCount;
	private final long globalDriveCount;

	public DialogListItemVehicle(int modelId)
	{
		final LocalizedStringSet stringSet = vehicleManagerService.getLocalizedStringSet();
		this.modelId = modelId;

		final String name = VehicleModel.getName(modelId);
		final int seats = VehicleModel.getSeats(modelId);

		PlayerVehicleStatistic stat = vehicleManagerService.getPlayerVehicleStatistic(player, modelId);
		GlobalVehicleStatistic globalStat = vehicleManagerService.getGlobalVehicleStatistic(modelId);

		driveCount = stat.getDriveCount();
		globalDriveCount = globalStat.getDriveCount();

		this.itemString = stringSet.format(player, "Dialog.VehicleCreateListDialog.Item", name, modelId, seats, driveCount, globalDriveCount);
	}

	@Override
	public void onItemSelect()
	{
		final LocalizedStringSet stringSet = vehicleManagerService.getLocalizedStringSet();

		player.playSound(1057, player.getLocation());

		Vehicle vehicle = vehicleManagerService.createOwnVehicle(player, modelId);
		vehicle.putPlayer(player, 0);
		player.sendMessage(Color.LIGHTBLUE, stringSet.format(player, "Dialog.VehicleCreateListDialog.CreateMessage", VehicleModel.getName(vehicle.getModelId())));
		destroy();
	}
}
The final Screenshots:

Reply
#16

Nice, how long will it take until you are ready to release the new Milestone ?
Reply
#17

Quote:
Originally Posted by 123marvin123
View Post
Nice, how long will it take until you are ready to release the new Milestone ?
Currently I'm not sure, sorry.
I will release as soon as possible.

p.s.
More simple example:
Code:
public class SpawnVehicleDialog extends AbstractPageListDialog
{
 public SpawnVehicleDialog(Player player, Shoebill shoebill, EventManager eventManager)
 {
  super(player, shoebill, eventManager, null);
  this.caption = "Spawn Vehicle";
 }

 public void addModel(final int modelId)
 {
  String vehicleName = VehicleModel.getName(modelId);
  dialogListItems.add(new DialogListItem(vehicleName)
  { 
   @Override
   public void onItemSelect()
   {
    Vehicle veh = shoebill.getSampObjectFactory().createVehicle(modelId, player.getLocation(), 0, 0, 0);
    player.setVehicle(veh);
   }
  });
 }
}
then
Code:
SpawnVehicleDialog dialog = new SpawnVehicleDialog(player, shoebill, eventManager);
dialog.addModel(451);
dialog.addModel(439);
// ......
dialog.show();
Requirements library: shoebill-common
(Source) https://github.com/GTAUN/shoebill-common
(Build) http://ci.gtaun.net/job/shoebill-common/
Reply
#18

Yea, thats really easy
Btw: I've got one Problem:
I use your Vehicle Manager Plugin, and in my Gamemode i've got some Dialogs.
I use the DialogResponseEvent and check if the dialogID from the event is, for example the loginDialog.
And it works great, but when i open the Dialog from the Plugin, the ID is wrong.
I think you know what I mean. In normal Pawn it happens when you mix filterscripts with Dialogs and Dialogs in your Gamemode.


And Second, is it possible to acces the OnPlayerGive/TakeDamage Event?

//Edit: Is it possible to start a GUI from the Script? Like a JFrame?
Reply
#19

Quote:
Originally Posted by 123marvin123
View Post
Yea, thats really easy
Btw: I've got one Problem:
I use your Vehicle Manager Plugin, and in my Gamemode i've got some Dialogs.
I use the DialogResponseEvent and check if the dialogID from the event is, for example the loginDialog.
And it works great, but when i open the Dialog from the Plugin, the ID is wrong.
I think you know what I mean. In normal Pawn it happens when you mix filterscripts with Dialogs and Dialogs in your Gamemode.


And Second, is it possible to acces the OnPlayerGive/TakeDamage Event?

//Edit: Is it possible to start a GUI from the Script? Like a JFrame?
1. Milestone 2 has no way to coexist with other PAWN scripts.
2. Unless you modify the code to support it, otherwise please wait for the Shoebill 1.0 M1, sorry
3. YES! But not recommended.

BTW, in the future, the code might look like this
Code:
DialogItemNameSupplier nameSupplier = (Integer i) -> VehicleModel.getName(i);
OnDialogItemSelected callback = (Integer i) -> factory.createVehicle(i, player.getLocation(), 0, 0, 0);
PagedListDialog.create()
 .caption("Spawn Vehicle")
 .item(nameSupplier, callback, 439)
 .item(nameSupplier, callback, 451)
 .item(nameSupplier, callback, 456)
 // ......
 .item("Naughty little option", () -> player.playSound(1057, player.getLocation()))
 .build(player)
 .show();
Reply
#20

"1. Milestone 2 has no way to coexist with other PAWN scripts.", I mean that the Event for the onItemClicked is not getting called when i have Dialogs in my Main Java File. It's like the Ids of the Dialogs are getting switched. The only Pawn File I use is the Shoebill.amx.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)