New scripting language support: Java

Started by maxorator, Apr 02, 2016, 10:11 PM

Previous topic - Next topic

EK.IceFlake


KAKAN

oh no

Stormeus


Thijn


EK.IceFlake


Thijn

Quote from: NE.CrystalBlue on Apr 09, 2016, 07:16 PM
Quote from: Thijn on Apr 08, 2016, 05:18 PM
Quote from: Stormeus on Apr 08, 2016, 09:52 AM
Quote from: KAKAN on Apr 08, 2016, 09:25 AM
Quote from: NE.CrystalBlue on Apr 08, 2016, 09:01 AMpl0x .net?
No. Windows only plugins are not allowed.

.NET is cross-platform using Mono.
"cross-platform"
I don't find anything special about these words...
Using mono isn't making .NET cross platform. It's hacking something to work on another platform. It's ugly to say the least...

NewK

@maxorator I've noticed that Player does not have a IsFrozen property similar to the Squirrel plugin, has this not been implemented yet or is this done differently with this java plugin?

maxorator

Quote from: NewK on Apr 11, 2016, 10:01 PM@maxorator I've noticed that Player does not have a IsFrozen property similar to the Squirrel plugin, has this not been implemented yet or is this done differently with this java plugin?
player.setOption(PlayerOption.Controllable, false);

BABA1

Quote from: NewK on Apr 11, 2016, 10:01 PM@maxorator I've noticed that Player does not have a IsFrozen property similar to the Squirrel plugin, has this not been implemented yet or is this done differently with this java plugin?

New pro static void functions have been med. :D

NewK

#39
@maxorator , not sure if you're still around at the moment, but I found a few bugs, whether these are in the plugin itself or the server I'll leave that to your judgement :)

First is the createCheckPoint method
//trying to create a sphere for 1 player creates a checkpoint instead
boolean isSphere = true;
CheckPoint cp = server.createCheckPoint(player, 2, isSphere, player.getPosition(), new Colour(0xFFDB5555), 2);

//trying to create a sphere for all players doesn't work and returns null
boolean isSphere = true;
CheckPoint cp = server.createCheckPoint(null, 2, isSphere, player.getPosition(), new Colour(0xFFDB5555), 2);
System.out.println(cp == null); //true

//trying to create a checkpoint for all players doesn't work and returns null
boolean isSphere = false;
CheckPoint cp = server.createCheckPoint(null, 2, isSphere, player.getPosition(), new Colour(0xFFDB5555), 2);
System.out.println(cp == null); //true

Next is the server.getAllPlayers()method:
The method behaves weirdly under the following scenario:
Player1 joins the server - at this point, server.getAllPlayers() returns an array of length 1 with one Player instance inside it
Player2 joins the server - at this point, server.getAllPlayers() returns an array of length 2 with two Player instances inside it
Player1 leaves the server - at this point, server.getAllPlayers() returns an array of length 1 with one Player instance inside it, but it's
null

If I want to fetch Player2's Player instance I can't loop through alll the players in the server using the method to find it since the instance inside the array is null so I won't be able to find it, however, if I know this player's ID I can still fetch it with server.getPlayer(id) and it won't be null then.

Last, is an issue with the radar blips. I've been told this also happens with the squirrel plugin but it's very very rare and very hard to reproduce. Using the Java plugin it always happens and can be reproduced at anytime. The issue is as follows: When I use a custom image to create a radar blip it will be placed with no issues. However, if a player leaves the server and rejoins, he won't be able to see the custom radar blip that I created, instead he will see blip 39, the "W" from radio wave in its place. For this player my custom blip will show as blip 39, but for all the other players inside the server they will still see the custom blip, that is, until they leave the server and rejoin it. If I try to re-create the custom blips after these players rejoin the server, they will once again be able to see the correct custom blip instead of blip 39. I believe there's something going with the OnPlayerConnect event that's causing this, because I've tried to re-create (delete and then create) these blips inside this event right when the players join the server and what happens is that the delete works, but not the create. I then tested (still inside this event) to add a 200ms timer to run before the create method is called and this seems to work. This issue has also been identified by murdock in his topic:
Quote from: Murdock on Aug 30, 2015, 12:07 AM
  • Sometimes custom mapicons will not appear and the icon of Wave103 (id 39) will show for all icons instead (rarely occurs so hard to reproduce)
So I'm inclined to think this a bug in the server rather than the plugin but I can't really tell for sure.


Hope this helps finish the plugin, other than those problems I'd say the plugin's pretty solid so far.

KAKAN

@NewK, that's not the only bugs, there are many a bugs around. Try asking @Murdock if you want a list.
oh no

NewK

Quote from: KAKAN on Jul 05, 2016, 01:03 PM@NewK, that's not the only bugs, there are many a bugs around. Try asking @Murdock if you want a list.
You clearly did not understand my reply. The bugs I posted above (with the exception of that last one), are bugs in the Java plugin, not the Squirrel plugin. Some of the bugs that murdock identified, are bugs in the Squirrel plugin or the actual server. The ones I posted above are specific to the java plugin only (once again with the exception of that radar blips bug)

KAKAN

Quote from: NewK on Jul 05, 2016, 01:59 PM
Quote from: KAKAN on Jul 05, 2016, 01:03 PM@NewK, that's not the only bugs, there are many a bugs around. Try asking @Murdock if you want a list.
You clearly did not understand my reply. The bugs I posted above (with the exception of that last one), are bugs in the Java plugin, not the Squirrel plugin. Some of the bugs that murdock identified, are bugs in the Squirrel plugin or the actual server. The ones I posted above are specific to the java plugin only (once again with the exception of that radar blips bug)
Yes, I'm talking about Java plugin. There are many bugs in that plugin. Murdock was using it, so he knows it well.
oh no

NewK

Quote from: KAKAN on Jul 05, 2016, 04:22 PM
Quote from: NewK on Jul 05, 2016, 01:59 PM
Quote from: KAKAN on Jul 05, 2016, 01:03 PM@NewK, that's not the only bugs, there are many a bugs around. Try asking @Murdock if you want a list.
You clearly did not understand my reply. The bugs I posted above (with the exception of that last one), are bugs in the Java plugin, not the Squirrel plugin. Some of the bugs that murdock identified, are bugs in the Squirrel plugin or the actual server. The ones I posted above are specific to the java plugin only (once again with the exception of that radar blips bug)
Yes, I'm talking about Java plugin. There are many bugs in that plugin. Murdock was using it, so he knows it well.
No, you don't know what you're talking about, murdock uses the Squirrel plugin.
[20:04] <NewK> hey
[20:20] <Murdock> he
[20:30] <NewK> do you use the java plugin?
[20:44] <Murdock> nop

Can you stop making things up now?

maxorator

#44
Fixed:
  • Server#getAll*() methods returning null elements.
  • Server#createCheckPoint() not working with null player.
  • Server#createCheckPoint() worldId and isSphere parameters being mixed up internally.
  • Player#getAnimation() not doing the right thing.
  • Player#getColour() and Player#getColourHex() throwing an exception.

Added:
  • CheckPoint#isSphere() method.