Slyther icon indicating copy to clipboard operation
Slyther copied to clipboard

Error with server.

Open a632283395 opened this issue 9 years ago • 11 comments

image During I connect the server. There is a error. BTW.I dont know how to run the server in your script after build. So i edited the bat to image for start the server. And that error has showed.

When I run the slyther-master.bat after the building(no edit),there is another error.

I dont know how to start the server in right way.

I've just built the codes. If the way I start was wrong. Could u show me how to start the server? or not.Please check the wrong.THX!

a632283395 avatar Oct 19 '16 00:10 a632283395

The server is not finished.

Gegy avatar Oct 19 '16 05:10 Gegy

I cannot reproduce this.

Gegy avatar Oct 19 '16 05:10 Gegy

I mean.... how can I start the server or if the server,can run yet.

a632283395 avatar Oct 20 '16 11:10 a632283395

What you are doing seems to be correct, however I can't reproduce this.

Gegy avatar Oct 20 '16 14:10 Gegy

Okay..thanks. Could you please write a wiki or document? It's good for leaner as me.

a632283395 avatar Oct 20 '16 17:10 a632283395

You can reproduce that with this: 1.build with gradle on the windows. 2.Edit the slyther-master.bat on line 68. Change the classpath to net.gegy1000.slyther.server.ServerMain. 3.Then run the bat. I think the server will run. 4.And open the slither.io change the forceserver to the server which running the server. 5.At last the server will show the error.

Another thing: When I run the bat(without edit). It will show an error with client. image image

a632283395 avatar Oct 20 '16 19:10 a632283395

Very late reply, but: http://hopper.minecraft.net/help/pixel-format-not-accelerated/ This isn't Minecraft, but the same applies.

Gegy avatar Apr 01 '17 13:04 Gegy

Any updates on the server? I've seen a similar error when working on this. I initially started the server using a modification to the launch script similar to @a632283395, but I figured out how to get Gradle to build a launch script for me (see build.gradle on my fork's dev branch).

However, when I got my server to launch, I got the same error seen initially here. I found that the server was not processing the "secret handshake" correctly when either the slither.io web client or the Java client in this project sends its connect command 'c', which the server incorrectly interprets as a MessageSetAngle, but the client's snake doesn't exist yet, so the snake is what causes the NullPointerException. As far as I can tell, the server is supposed to respond with the pre-init message (message type 6) based on the protocol documentation.

@a632283395 I was looking at your stacktraces, and your client error appears to be graphics related, while your server error appears to be the same bug that I saw. Here is my stacktrace (I added a few debug statements):

[me@srv-osiris Slyther]$ ../Slyther-0.0.0/bin/slyther-server
[08:33:26 INFO ] [ServerNetworkManager]: Server started on port 7635
[08:33:55 DEBUG] [main]: Initiating a new connection.
[08:33:56 DEBUG] [main]: Message received! Type: 99, limit: 1
[08:33:56 DEBUG] [main]: MessageSetAngle read() buffer: 99
[08:33:56 DEBUG] [main]: MessageSetAngle read() client.snake: null
Exception in thread "main" java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
        at net.gegy1000.slyther.game.Game.runTasks(Game.java:43)
        at net.gegy1000.slyther.server.SlytherServer.update(SlytherServer.java:94)
        at net.gegy1000.slyther.server.SlytherServer.<init>(SlytherServer.java:84)
        at net.gegy1000.slyther.server.ServerMain.main(ServerMain.java:5)
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        at net.gegy1000.slyther.game.Game.runTasks(Game.java:41)
        ... 3 more
Caused by: java.lang.NullPointerException
        at net.gegy1000.slyther.network.message.client.MessageSetAngle.read(MessageSetAngle.java:32)
        at net.gegy1000.slyther.server.ServerNetworkManager.lambda$onMessage$2(ServerNetworkManager.java:70)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at net.gegy1000.slyther.game.Game.runTasks(Game.java:40)
        ... 3 more
^C[me@srv-osiris Slyther]$ 

Since I added debug statements, the line numbers in my stack trace are in reference to computergeek125/Slyther@2e3024958bcca0dc1945e22fb403d876b210e25e.

computergeek125 avatar Nov 01 '17 13:11 computergeek125

The server hasn't been updated with the changes that the client was. RE'ing logic that you can only see the results of is tricky, and I've mostly given up at this point. Currently the server only supports basic snake movement and a leaderboard. I may pick the server up again in the future.

As for the error, I find this very weird. I still can't reproduce it.

Gegy avatar Nov 01 '17 13:11 Gegy

@computergreek125 thanks for ur tracing, it is best for us to use the sources. However, I think the writer had been abondoned and the codes had been uncompatable with the slother.io.

a632283395 avatar Nov 03 '17 17:11 a632283395

I've got my server back up to what @gegy1000 says it can do (albeit with a duct tape fix I am going to remedy in the future). If/when I finish I'll PR it.

computergeek125 avatar Nov 06 '17 14:11 computergeek125