[PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

Page 4 of 5 FirstFirst 12345 LastLast
Results 46 to 60 of 72
  1. #46
    git bisect -m ovflowd is offline
    MemberRank
    Sep 2011 Join Date
    2,191Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    Quote Originally Posted by EvilCoder View Post
    I have discovered a small bug with pets. When you place a pet the room_id of the pets get saved and when you leave the room, the room_id gets set back to -1 (so the pet is back in your hand). However... When you enter the "stop" command during your session in the room with the pet, in the next relog of the client+server the pet is still there.

    So basically, on EVERY room LEAVE, the pet gets put back to -1 in the database for a room_id.

    Other than that its a very nice emulator. Hopefully somebody can give me a fix for the pet issue and I will certainly use it for production.

    - - - Updated - - -

    Seems I have already fixed the issue :)! It was with the kick void. When you leave the room it instantly trigger the removeBotFromRoom, where is defined to put -1 in room_id. Fixed by creating a new TakeBot void, and adding:

    Code:
    public void takePet() {
            if (this.isBot() && this.isPet()) {
            this.room.removeBotFromRoom(this);
            }
        }
    
        public void kick(final boolean soft) {
            if (this.isBot() && !this.isPet()) {
                    this.room.removeBotFromRoom(this);
                    return;
            }
    And changing the packethandler to use takePet, for picking up pets.
    Really nice! I really like @steffcheff Emulator, already i love the name, is so creative ..

  2. #47
    1 + 3 + 3 = 7 EvilCoder is offline
    MemberRank
    Jul 2009 Join Date
    /home/mvdworpLocation
    334Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    Quote Originally Posted by Yoshi View Post
    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:
    Code:
    public void kick(final boolean soft) {
            if (this.isBot() && !this.isPet()) {
                    this.room.removeBotFromRoom(this);
                    return;
            }
    With:
    Code:
    public void kick(final boolean soft) {
            if (this.isBot()) {
                    this.room.removeBotFromRoom(this);
                    return;
            }
    - - - Updated - - -

    Quote Originally Posted by steffchef View Post
    Exactly.

    Cheers,
    Steve Winfield
    Thats a good choice, just because its anoying to have an empty list. Like the idea =)!

  3. #48
    j’aime ma famille dominic is offline
    MemberRank
    Aug 2012 Join Date
    ~/Location
    611Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    Quote Originally Posted by steffchef View Post
    Exactly.

    Cheers,
    Steve Winfield
    Where exactly are these checks located?

  4. #49
    git bisect -m ovflowd is offline
    MemberRank
    Sep 2011 Join Date
    2,191Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    Quote Originally Posted by Dominic View Post
    Where exactly are these checks located?
    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;
            }

  5. #50
    j’aime ma famille dominic is offline
    MemberRank
    Aug 2012 Join Date
    ~/Location
    611Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    Quote Originally Posted by ovflowd View Post
    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;
            }
    That was not anywhere near my question.

  6. #51
    Proficient Member steffchef is offline
    MemberRank
    May 2011 Join Date
    Munich, GermanyLocation
    176Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    Quote Originally Posted by Dominic View Post
    Where exactly are these checks located?
    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

  7. #52
    j’aime ma famille dominic is offline
    MemberRank
    Aug 2012 Join Date
    ~/Location
    611Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    Quote Originally Posted by steffchef View Post
    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
    But where are the rooms being removed from the popular rooms list?

  8. #53
    Proficient Member steffchef is offline
    MemberRank
    May 2011 Join Date
    Munich, GermanyLocation
    176Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    Quote Originally Posted by Dominic View Post
    But where are the rooms being removed from the popular rooms list?
    As I said: org.stevewinfield.suja.idk.game.navigator.NavigatorList

    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);
    }
    Cheers,
    Steve Winfield
    Last edited by steffchef; 05-01-16 at 10:25 AM.

  9. #54
    1 + 3 + 3 = 7 EvilCoder is offline
    MemberRank
    Jul 2009 Join Date
    /home/mvdworpLocation
    334Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    Quote Originally Posted by ovflowd View Post
    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;
            }
    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.

  10. #55
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,609Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    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.

  11. #56
    Proficient Member steffchef is offline
    MemberRank
    May 2011 Join Date
    Munich, GermanyLocation
    176Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    Quote Originally Posted by The General View Post
    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

  12. #57
    git bisect -m ovflowd is offline
    MemberRank
    Sep 2011 Join Date
    2,191Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    Quote Originally Posted by EvilCoder View Post
    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.
    Oh Exactly. But the Guide Bot must be automatically kicked out after he explanning all the things. And not after the room unloads, or user kick him (optional), or unload commands..

    I'm wrong?

  13. #58
    1 + 3 + 3 = 7 EvilCoder is offline
    MemberRank
    Jul 2009 Join Date
    /home/mvdworpLocation
    334Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    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)

  14. #59
    Apprentice ppntn is offline
    MemberRank
    Jan 2016 Join Date
    LondonLocation
    12Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    Quote Originally Posted by EvilCoder View Post
    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)
    I'm assuming it wasn't able to fetch the players table properly. You should check if the auth_token is null when trying to sign in.
    Under if (row.next()) {
    Add "System.out.println(row.getInt("id"));" to test what's nulling out. :]

  15. #60
    Novice JHD is offline
    MemberRank
    Jan 2016 Join Date
    2Posts

    Re: [PRE-SHUFFLE] IDK Java Emulator v2 [SCRATCH]

    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.



Page 4 of 5 FirstFirst 12345 LastLast

Advertisement