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

Quote:
Originally Posted by dusk
Посмотреть сообщение
Yes I do. Both 64bit and 32bit.
And the JAVA_HOME/JRE_HOME variable has been set to 32-bit JDK/JRE8?
Please use console command "echo %JAVA_HOME%" or "echo %JRE_HOME%" to confirm.

btw:
JRE_HOME is a high priority.
If you do not want to change the system variables, you can edit the startup.bat file, and add:
set "JAVA_HOME=PATH to 32-bit JDK8"
Reply
#42

I can use another plguins (native & callback's) in java without editing source Shoebill plugin
Reply
#43

@AirKite: What do you mean exactly? You want to use other plugins like MapAndreas with Shoebill? If this is your goal, you need to wait for version 1.1. This features is currently not supported.
Reply
#44

No JavaDoc for "common" package?
Reply
#45

Quote:
Originally Posted by dusk
Посмотреть сообщение
No JavaDoc for "common" package?
Added.
But if you use Eclipse or IDEA, they can be automatically downloaded documents.

Looks like this:

Reply
#46

Quote:
Originally Posted by 123marvin123
Посмотреть сообщение
@AirKite: What do you mean exactly? You want to use other plugins like MapAndreas with Shoebill? If this is your goal, you need to wait for version 1.1. This features is currently not supported.
Ok, when release?
Reply
#47

@AirKite: Maybe 1 ~ 1.5 Months
Reply
#48

Mk124 managed it to let the MapAndreas Heightmap work with Shoebill.
You need the following class: http://pastebin.com/i9JW5Kt6

You need to put the SAfull.hmap into the data folder of your gamemode / plugin.

To use it you need to create a new instance of the MapAndreas class.
Like this:
Код:
MapAndreas mapAndreas = new MapAndreas(new File(getDataDir(), "SAfull.hmap"));
To use it you can do things like that:
Код:
float z = mapAndreas.findZ(player.getLocation().x, player.getLocation().y);
When you finished your work with MapAndreas you can destroy the instance with:
Код:
mapAndreas.close();
Shoebill won't load the File into memory, so shoebill is not taking more memory then usual!
It was really important to us, because the SA-MP Plugin takes 80mb.
Besides the low memory usage, Shoebill is 4~ times faster in finding the Z then PAWN.

Speedtests:

Java:
Result: 190ms
Код:
MapAndreas mapAndreas = new MapAndreas(new File(LvdmGamemode.getInstance().getDataDir(), "SAfull.hmap"));
long milli = System.currentTimeMillis();
for(int i = 0; i < 10000000; i++) {
    mapAndreas.findZ(i%3000, i/3000);
}
player.sendMessage(Color.RED, "* Ms: " + (System.currentTimeMillis() - milli));
Pawn:
Result: 1004ms
Код:
new Float:z;
new tick = GetTickCount();
for(new i = 0; i < 10000000; i++) {
    MapAndreas_FindZ_For2DCoord(i%3000, i/3000,z);
}
printf("Difference: %i ms", GetTickCount() - tick);
Reply
#49

My Gamemode based on Shoebill:
https://sampforum.blast.hk/showthread.php?tid=516885
Reply
#50

Quote:
Originally Posted by 123marvin123
Посмотреть сообщение
Java:
Result: 190ms

Pawn:
Result: 1004ms
Wow... it's Pawn testing with Plugin oO
Reply
#51

You've got to love OOP.

I would love to rewrite ARRIBA in Java, but who has the time. Nonetheless, this is very well thought of.
I may look into this one day, good one.
Reply
#52

@AirKite: Yes, the pawn test was with the plugin from Kalcor.
@Dr.Einstein: We are glad, that you think about rewriting your gamemode with the API
Reply
#53

Quote:
Originally Posted by 123marvin123
Посмотреть сообщение
Yes, the pawn test was with the plugin from Kalcor
123marvin123, great! i'm waiting 1.1 version =)

hm... in Shoebill 1.0 i can use MultiThread Query (MySQL) by any means?
Reply
#54

@AirKite: What do you mean by MultiThread Query? You can use all java code that you could usually use in a normal java application.
If you want to make a Thread you should do:
Код:
new Thread(() -> System.out.println("This messages comes from a other Thread !")).start();
Or if you want to make a new Shoebill Thread you should do:
Код:
Shoebill.get().runOnSampThread(() -> {
    for(Player player1 : Player.getHumans()) {
        player1.sendMessage(Color.GREEN, "You got this message from a other thread!");
    }
});
Reply
#55

Quote:
Originally Posted by 123marvin123
Посмотреть сообщение
@AirKite: What do you mean by MultiThread Query? You can use all java code that you could usually use in a normal java application.
If you want to make a Thread you should do:
Код:
new Thread(() -> System.out.println("This messages comes from a other Thread !")).start();
Or if you want to make a new Shoebill Thread you should do:
Код:
Shoebill.get().runOnSampThread(() -> {
    for(Player player1 : Player.getHumans()) {
        player1.sendMessage(Color.GREEN, "You got this message from a other thread!");
    }
});
Ok, but how i can connect to MySQL Server?
Reply
#56

First, you need the mysql connector. Put this into your pom.xml:
Код:
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.30</version>
</dependency>
Then you can create a Connection instance like this:
Код:
private Connection connection;
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection("jdbc:mysql://localhost/database", username, password);
Statement stmnt = connection.createStatement();
stmnt.executeUpdate(..);
ResultSet resultSet = stmnt.executeQuery(..);
Reply
#57

Yet another framework which makes all current released GM, FS and other pawn scripts unusable...
No one is going to use this..
Reply
#58

@LeaveMe: It won't make all released GM unusable. In 1.1 it will coexists with pawn Gamemodes and plugins.
Shoebill is currently not designed to work with other Gamemodes together. Gamemodes written in Java should be used as the main gamemode. There are many advantages Java brings with it, maybe you just don't know Java.
Reply
#59

Great work Marvin - now I'm thinking of migrating my (small) game mode over to Shoebill as I'm much more experienced with Java!
Reply
#60

@CaveDweller: That's really nice to hear! If you have any problems, you can ask us here and we will try to help you. Also, we will try to release 1.1 as soon as possible, so other Pawn-Gamemodes & Filterscripts can work together
Reply


Forum Jump:


Users browsing this thread: 34 Guest(s)