frandallfarmer / neohabitat

Repository for the NeoClassical Habitat Server Project
http://neohabitat.org
MIT License
230 stars 42 forks source link

QLink connection issue preventing connection to Habitat server #392

Closed StuBlad closed 1 year ago

StuBlad commented 1 year ago

As mentioned on the Slack and my Discord server, with the changes both @AmandaJonesAway and @hheimbuerger made to get the Docker container working again, we are still unable to successfully connect to the Habitat service.

When you launch the client, type your avatar name into the launcher and press return, a connection is established to the QLink reloaded service, but it fails out when you flip disks and press return.

This is a blocker to running a NeoHabitat server and for the eventual move to The MADE's infrastructure.

Here's the output from QLink Reloaded during this process.

INFO  org.jbrain.qlink.HabilinkListener  - Incoming connection received
DEBUG org.jbrain.qlink.HabilinkProxy  - Received Habilink line: {"to":"bridge","op":"LOGIN","name":"stu"}
DEBUG org.jbrain.qlink.HabilinkProxy  - Received Habilink line:
DEBUG org.jbrain.qlink.HabilinkProxy  - New Habilink login with username: stu
DEBUG org.jbrain.qlink.HabilinkListener  - Habilink user 'stu' logged in; starting QConnection/QSession
DEBUG org.jbrain.qlink.connection.QConnection  - Setting QConnection username: stu
DEBUG org.jbrain.qlink.connection.QConnection  - Sending Queued Actions
DEBUG org.jbrain.qlink.state.Authentication  - Defining master NEWUSER dialog
INFO  org.jbrain.qlink.QLinkServer  - Adding session to session list: stu
INFO  org.jbrain.qlink.QLinkServer  - Adding session to session map: stu
INFO  org.jbrain.qlink.connection.QConnection  - Starting link thread
DEBUG org.jbrain.qlink.connection.QConnection  - Received packet: 5A 31 42 91 40 7F 7E 26
INFO  org.jbrain.qlink.connection.QConnection  - CRC check failed, sending sequence error
org.jbrain.qlink.cmd.CRCException: 12944!=41617
 at org.jbrain.qlink.cmd.AbstractCheckedCommand.<init>(AbstractCheckedCommand.java:43)
 at org.jbrain.qlink.cmd.Ping.<init>(Ping.java:31)
 at org.jbrain.qlink.cmd.CommandFactory.newInstance(CommandFactory.java:49)
 at org.jbrain.qlink.connection.QConnection.run(QConnection.java:177)
DEBUG org.jbrain.qlink.connection.QConnection  - Sending org.jbrain.qlink.cmd.SequenceError
DEBUG org.jbrain.qlink.connection.QConnection  - Sending packet data at sequence 16: 5A D1 4E C1 4D 10 10 25 0D
DEBUG org.jbrain.qlink.connection.QConnection  - Received packet: 5A C1 4B 81 45 11 10 20 53 47
DEBUG org.jbrain.qlink.connection.QConnection  - Received org.jbrain.qlink.cmd.action.ResumeService(SG)
DEBUG org.jbrain.qlink.connection.QConnection  - Received incoming packet with sequence number: 16
DEBUG org.jbrain.qlink.connection.QConnection  - Sending Queued Actions
DEBUG org.jbrain.qlink.QSession  - org.jbrain.qlink.state.Authentication: Executing org.jbrain.qlink.cmd.action.ResumeService(SG)
DEBUG org.jbrain.qlink.state.AbstractState  - Resuming service
DEBUG org.jbrain.qlink.connection.QConnection  - Sending Queued Actions
DEBUG org.jbrain.qlink.connection.QConnection  - Received packet: 5A 11 4E 61 4C 12 10 25
DEBUG org.jbrain.qlink.connection.QConnection  - Received org.jbrain.qlink.cmd.SequenceError
DEBUG org.jbrain.qlink.connection.QConnection  - Received incoming packet with sequence number: 16
DEBUG org.jbrain.qlink.connection.QConnection  - Resetting counters
DEBUG org.jbrain.qlink.connection.QConnection  - Sending Queued Actions
DEBUG org.jbrain.qlink.connection.QConnection  - Received packet: 5A 11 4F 21 4C 12 10 26
DEBUG org.jbrain.qlink.connection.QConnection  - Received org.jbrain.qlink.cmd.Ping
DEBUG org.jbrain.qlink.connection.QConnection  - Received incoming packet with sequence number: 16
DEBUG org.jbrain.qlink.connection.QConnection  - Sending Queued Actions
DEBUG org.jbrain.qlink.connection.QConnection  - Sending org.jbrain.qlink.cmd.ResetAck
DEBUG org.jbrain.qlink.connection.QConnection  - Sending packet data at sequence 16: 5A 71 4E 01 4D 10 12 24 0D
DEBUG org.jbrain.qlink.connection.QConnection  - Received packet: 5A A1 4A B1 49 13 10 20 55 E0 00 03 32 30 30 00
DEBUG org.jbrain.qlink.connection.QConnection  - Received org.jbrain.qlink.cmd.action.HabitatAction(U?)
DEBUG org.jbrain.qlink.connection.QConnection  - Received incoming packet with sequence number: 16
DEBUG org.jbrain.qlink.connection.QConnection  - Sending Queued Actions
DEBUG org.jbrain.qlink.connection.QConnection  - Creating new Habilink HabitatConnection for user: stu
ERROR org.jbrain.qlink.connection.QConnection  - Unchecked Exception error
java.lang.NullPointerException
 at org.jbrain.qlink.connection.HabitatConnection.<init>(HabitatConnection.java:153)
 at org.jbrain.qlink.connection.HabitatConnection.<init>(HabitatConnection.java:49)
 at org.jbrain.qlink.connection.QConnection.getHabitatConnection(QConnection.java:359)
 at org.jbrain.qlink.connection.QConnection.run(QConnection.java:214)
DEBUG org.jbrain.qlink.connection.QConnection  - Sending Disconnect Action to server
DEBUG org.jbrain.qlink.QSession  - org.jbrain.qlink.state.Authentication: Executing org.jbrain.qlink.cmd.action.LostConnection(SZ)
INFO  org.jbrain.qlink.QSession  - Terminating server instance
INFO  org.jbrain.qlink.QLinkServer  - Removing session from session list: stu
INFO  org.jbrain.qlink.QLinkServer  - Removing 'Stu' from online user list
DEBUG org.jbrain.qlink.connection.QConnection  - Terminating link
AmandaJonesAway commented 1 year ago

I can't remember which of many changes I ended up doing fixed that particular error, but I got it working, as far as I can tell! Client connects and is presented with the Immigration locale, and I can wander about, open and close the door, etc. :) https://github.com/AmandaJonesAway/neohabitat

hheimbuerger commented 1 year ago

I got it working, as far as I can tell! Client connects and is presented with the Immigration locale, and I can wander about, open and close the door, etc. :)

Wow, amazing, great job!

ottj commented 1 year ago

I can't remember which of many changes I ended up doing fixed that particular error, but I got it working, as far as I can tell! Client connects and is presented with the Immigration locale, and I can wander about, open and close the door, etc. :) https://github.com/AmandaJonesAway/neohabitat

Fantastic, it does indeed work now! I can build everything, run the containers and connect the client. However, as soon as I move the avatar outside the door in the immigration locale the client disconnects:

`

date stream content
2023-03-28T21:05:07.555197304Z stdout warn: Error [ERR_STREAM_WRITE_AFTER_END]: write after end
2023-03-28T21:05:07.389179996Z stdout warn: Error [ERR_STREAM_WRITE_AFTER_END]: write after end
2023-03-28T21:05:07.220085576Z stdout - 2023/03/28 21:05:07.219 EVN comm-cli : TCP(1) died: java.io.EOFException
2023-03-28T21:05:07.219699162Z stdout - 2023/03/28 21:05:07.218 EVN comm-cli : TCP(1) remote disconnect
2023-03-28T21:05:07.211882865Z stdout debug: Disconnecting Habiproxy connection on: 172.18.0.4:42686 (unknown)
2023-03-28T21:05:07.211563863Z stdout debug: {Bridge being shutdown...}
2023-03-28T21:05:07.211217945Z stdout debug: Elko port disconnected...
2023-03-28T21:05:07.210396183Z stdout debug: Client disconnected for Client 172.18.0.4:42686 (unknown), moving session to ASLEEP
2023-03-28T21:05:07.208191736Z stdout debug: Habitat client disconnected.
2023-03-28T21:05:07.207771886Z stdout - 2023/03/28 21:05:07.206 EVN cont (User.connectionDied:User.java:159) User 'user-testuser-2007421091341094457' connection died: TCP(0)
2023-03-28T21:05:07.207393890Z stdout debug: Connecting: undefined:undefined <-> 172.18.0.4:42686
2023-03-28T21:05:07.206965341Z stdout - 2023/03/28 21:05:07.205 EVN cont : shutting down Context 'context-hatchery'
2023-03-28T21:05:07.206444668Z stdout - 2023/03/28 21:05:07.204 EVN comm-cli : TCP(1) new connection from 172.18.0.4:49630
2023-03-28T21:05:07.206369407Z stdout - 2023/03/28 21:05:07.204 EVN cont : User 'user-testuser-2007421091341094457' exits Context 'context-hatchery'
2023-03-28T21:05:07.206079289Z stdout - 2023/03/28 21:05:07.203 EVN cont (User.disconnect:User.java:186) exiting User 'user-testuser-2007421091341094457'
2023-03-28T21:05:07.205175875Z stdout debug: Server connection established on: 172.18.0.4:42686 (unknown)
2023-03-28T21:05:07.202711787Z stdout debug: Habiproxy client connected at: 172.18.0.4:42686
2023-03-28T21:05:07.202663584Z stdout debug: {Bridge being shutdown...}
2023-03-28T21:05:07.202513559Z stdout debug: Elko port disconnected...
2023-03-28T21:05:07.202096426Z stdout - 2023/03/28 21:05:07.201 EVN comm-cli : TCP(0) died: java.io.EOFException
2023-03-28T21:05:07.200994418Z stdout - 2023/03/28 21:05:07.200 EVN comm-cli : TCP(0) remote disconnect
2023-03-28T21:05:07.197832479Z stdout debug: Disconnecting Habiproxy connection on: 172.18.0.4:42674 (testuser)
2023-03-28T21:05:07.197554390Z stdout debug: Destroying connection: 172.18.0.4:42674
2023-03-28T21:05:07.197408459Z stdout debug: Client 172.18.0.4:42674 (testuser) received changeContext, disconnecting...
2023-03-28T21:05:07.197028347Z stdout debug: Processing Server message for Client 172.18.0.4:42674 (testuser): {"type":"changeContext","context":"context-Downtown_4d","immediate":false}
2023-03-28T21:05:07.194725124Z stdout - 2023/03/28 21:05:07.193 MSG comm-cli : TCP(0) <- {"type":"changeContext", "context":"context-Downtown_4d", "immediate":false}

`

StuBlad commented 1 year ago

At the time of writing, there is an issue writing to the database when you exit the hatchery/immigration region.

When you first connect to Habitat, your avatar is temporary and not written to the database properly until you exit the hatchery/immigration region. It's being looked at now to see why this is the case, but a place to look is in /bridge/Habitat2ElkoBridge.js.

Specifically in

I've not been able to check if you can login using one of the pre-existing users in the db folder, but it would be good to see if that allows you to login and move around.

StuBlad commented 1 year ago

I'm closing this issue because it's been resolved on @AmandaJonesAway 's fork of NeoHabitat. There are still issues to be handled but I'll follow up with another issue for that.

frandallfarmer commented 1 year ago

Normally, I wouldn't mark an issue as closed until it is merged with the main branch.

On Fri, Mar 31, 2023 at 2:44 PM StuBlad @.***> wrote:

Closed #392 https://github.com/frandallfarmer/neohabitat/issues/392 as completed.

— Reply to this email directly, view it on GitHub https://github.com/frandallfarmer/neohabitat/issues/392#event-8902119230, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACM4EDCSPLDPJYCNXKNKQDW65F4DANCNFSM6AAAAAAWEKIJJM . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>