Really nice! I really like @steffcheff Emulator, already i love the name, is so creative ..
Really nice! I really like @steffcheff Emulator, already i love the name, is so creative ..
Seems I have made a small mistake in that code, now it will generate exceptions, but I have another fix for that :)...
Replace:
With:Code:public void kick(final boolean soft) { if (this.isBot() && !this.isPet()) { this.room.removeBotFromRoom(this); return; }
- - - Updated - - -Code:public void kick(final boolean soft) { if (this.isBot()) { this.room.removeBotFromRoom(this); return; }
Thats a good choice, just because its anoying to have an empty list. Like the idea =)!
For Bot (public void kick(final boolean soft) {)
if (this.isBot() && !this.isPet()) {
For Pet(public void takePet() {)
Are you a developer or what?
if (this.isBot() && this.isPet()) {
@EvilCoder idk how this emulator is coded, but if Every PET is a PetBot, so i think you doesn't need to check if the Pet is also a Bot, because he is.
So best approach:
Code:public void takePet() { if (this.isPet()) { this.room.removeBotFromRoom(this); } } public void kick(final boolean soft) { if (this.isBot()) { this.room.removeBotFromRoom(this); return; }
The rooms of a popular list are sorted and managed by org.stevewinfield.suja.idk.game.navigator.NavigatorList, that is executed by org.stevewinfield.suja.idk.game.navigator.tasks.SortNavigatorTask every 2 seconds.
In Phoenix (and later Butterfly versions as well I think) all rooms are sorted on every single request which is quite inefficient in my opinion.
Cheers,
Steve Winfield
As I said: org.stevewinfield.suja.idk.game.navigator.NavigatorList
Cheers,Code:if (this.size == 50 && this.lowestPlayers < playersTotal) { this.lowestPlayers = playersTotal; this.rooms.remove(this.lowestRoom); // SEE HERE this.lowestRoom = room; this.writerUpdateNeeded = true; this.rooms.add(room); }
Steve Winfield
Last edited by steffchef; 05-01-16 at 10:25 AM.
This is a bit confusing...
1. I already replied with what you just said in your message.
2. There are 2 type of bots, where you can also have the "Help Guide Bot" in your room and should be kicked upon leaving the room but not the pets.
3. If you have read the source you can see that "this.room.removeBotFromRoom(this);" will instantly put the roombot on room_id = -1. Meaning that it will leave the room, if you do that for the pet, you need to put them in your room everytime you enter the room.
Make an onKick() method in an interface and have users, pets & bots interface that or extend from some kind of base class. Then the implementation can be done differently for each type.
It would be even better to split it all up and to improve the abstraction by structuring it like..
RoomObject (removable) > RoomFloorObject > RoomEntity (kickable)
RoomPlayer extends RoomEntity
RoomBot extends RoomEntity
RoomPet extends RoomBot
I would have done it differently if I had known better in the beginning.
Cheers,
Steve Winfield
Such a shame, after running it for a week, stuff starting to crash. With nobody online.
Code:[New I/O worker #11] ERROR - Failed to handle packet java.lang.NullPointerException at org.stevewinfield.suja.idk.network.sessions.Session.tryAuthenticate(Session.java:253) at org.stevewinfield.suja.idk.communication.handshake.readers.AuthenticatePlayerReader.parse(AuthenticatePlayerReader.java:47) at org.stevewinfield.suja.idk.communication.MessageHandler.handleMessage(MessageHandler.java:451) at org.stevewinfield.suja.idk.network.codec.NetworkDecoder.decode(NetworkDecoder.java:47) at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:425) at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303) at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at org.jboss.netty.channel.SimpleChannelHandler.messageReceived(SimpleChannelHandler.java:142) at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
Will this emulator still get updates?
The concept with the plugins looks very interesting. Never saw that on a emulator before.
I'm thinking to use this for my future project. For myself I would edit it, but updates from the developer itself would be very cool.