State of Profit

There is now a list with all of your stations and you can go to them by clicking on them (no more losing stations!). If you teleport to a station that’s far away you might need to wait a few seconds before you can see the land.

As a side effect I found an issue that can cause the containers not to show and fixed it too.

A list with the vehicles is up next, might even come today :slight_smile:

Mike


High quality: true
OpenGL renderer: GeForce 8800 GT/PCI/SSE2
OpenGL vendor: NVIDIA Corporation
OpenGL version: 3.3.0
VBO extension: true
java.lang.NoClassDefFoundError: org/lwjgl/util/glu/GLU
	at com.stateofprofit.client.f.f.cc(Unknown Source)
	at com.stateofprofit.client.f.f.init(Unknown Source)
	at com.stateofprofit.client.f.f.execute(Unknown Source)
	at com.stateofprofit.client.a.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.util.glu.GLU
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 4 more
java.lang.NoClassDefFoundError: org/lwjgl/util/glu/GLU
	at com.stateofprofit.client.f.a.aq(Unknown Source)
	at com.stateofprofit.client.f.f.loop(Unknown Source)
	at com.stateofprofit.client.f.f.execute(Unknown Source)
	at com.stateofprofit.client.a.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.util.glu.GLU
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 4 more
java.lang.NoClassDefFoundError: org/lwjgl/util/glu/GLU
	at com.stateofprofit.client.d.e.a(Unknown Source)
	at com.stateofprofit.client.f.f.ar(Unknown Source)
	at com.stateofprofit.client.f.f.bY(Unknown Source)
	at com.stateofprofit.client.f.f.loop(Unknown Source)
	at com.stateofprofit.client.f.f.execute(Unknown Source)
	at com.stateofprofit.client.a.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.util.glu.GLU
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 6 more
java.lang.NoClassDefFoundError: org/lwjgl/util/glu/GLU
	at com.stateofprofit.client.f.a.aq(Unknown Source)
	at com.stateofprofit.client.f.f.loop(Unknown Source)
	at com.stateofprofit.client.f.f.execute(Unknown Source)
	at com.stateofprofit.client.a.run(Unknown Source)
java.lang.NullPointerException
	at com.stateofprofit.client.f.f.bY(Unknown Source)
	at com.stateofprofit.client.f.f.loop(Unknown Source)
	at com.stateofprofit.client.f.f.execute(Unknown Source)
	at com.stateofprofit.client.a.run(Unknown Source)
java.lang.NoClassDefFoundError: org/lwjgl/util/glu/GLU
	at com.stateofprofit.client.f.a.aq(Unknown Source)
	at com.stateofprofit.client.f.f.loop(Unknown Source)
	at com.stateofprofit.client.f.f.execute(Unknown Source)
	at com.stateofprofit.client.a.run(Unknown Source)
java.lang.NullPointerException
	at com.stateofprofit.client.f.f.bY(Unknown Source)
	at com.stateofprofit.client.f.f.loop(Unknown Source)
	at com.stateofprofit.client.f.f.execute(Unknown Source)
	at com.stateofprofit.client.a.run(Unknown Source)
...

:-\

Seems that there is a problem with the GLU library.

Humm… it works on two computers here… Maybe remove the downloaded files and redownload the client? I doubt you downloaded it exactly when I uploaded the new version, but I don’t see another reason why it used to work and doesn’t anymore.

If you’re on windows it’s stored somewhere around C:\Users[Username]\AppData\Local\Temp\lwjglcache\stateofprofit.com

Reproduced it (has to do with moving far away from the station and then close again). Will fix it after I’m done with the goto vehicles. [EDIT] Fixed

Your wish is my command, off to look at the mini map and whatever bugs you guys find (best testers ever! :))

Mike

Fetching landscape stuck at 50% on both PC. No error.

Here too. =(

It was a deadlock on the server caused by a person logging out when a message was sent about a vehicle update. Fixed it and made sure it won’t happen again, also fixed a bug that would stop a person from logging in when the previous session didn’t get closed correctly.

Mike

After second load, stuck on “Determining packages to load”, no errors in console.

Thanks, I think I’ll install eclipse on the server so I can run the server in debug mode, running into way too many server issues that don’t log and that I can’t reproduce…

Mike

And suddenly it works again :stuck_out_tongue:

Did you detach the I/O threads from the logic?

It’s way easier to get a stable server if all logic runs in 1 thread.

I restarted the java server :slight_smile:

I’m running old style IO, when a person logs in two threads get created, one for listening and one for sending. When the listening one gets a message it performs the logic on it and goes back to listening. To be able to support many players I don’t have a queue with the incoming messages that pick them all up in a single thread. I’ve been considering it as it’d save me a lot of synchronize blocks, but I’m not sure what it’ll do to timely answers when many people connect. Thoughts?

If you’re going for the thread-per-client approach, you only need 1 thread per client :stuck_out_tongue: the thread should both read and write to and from server. Once something is read, you can respond right away.

I had that first but seeing as I also send messages without it being replies (vehicle left station, city growth, someone built something where you’re looking and so on) I need two threads or a slow connection from one client might block other people from getting the messages timely.

Mike

How would one slow connection affect other people receiving timely messages, and how would two threads solve this problem? Could you elaborate more?

You should really use queues to detach the I/O from the logic. It will most likely solve a lot of bugs you cannot reproduce locally.

The problem is that is exponentially harder to make a multithreaded solution than it is to make a singlethreaded solution work.

Use basic structures like the ArrayBlockingQueue for extreme performance, but I doubt you need anything better than java.util.Vector.

Even better is that once you moved the logic from the I/O threads, you can get away with tiny thread-stacksizes (like 64K instead of the default 1MB). This allows you to scale the amount of concurrent players with factor 16 (if RAM is your bottleneck).

Isn’t send (not using NIO) blocking until the recipient has recieved the data?

Thanks for the clarification, I’ll switch over to that (shouldn’t be too hard).

ArrayBlockingQueue looks amazing, too bad I didn’t know about that before I wrote my own using ArrayList!

The server is now running in eclipse debug mode, I warn thee server bugs!

Mike

ArrayList is easily synchronized using:

mySyncList = java.util.Collections.synchronizedList(myArrayList)

That looks way neater than my synchronize blocks :wink:

This forum is the best btw, it’s so nice to not only have people that share the interest in games, but that also can come with (very) constructive ideas and solutions based upon the deepest part of the technologies used!

Mike

It blocks until the operation finishes, but since it’s all multi-threaded anyways, one blocking thread shouldn’t affect another?

EDIT: Oh do you think that write operations block so long that read operations will be delayed greatly?

Yup, either the read operations or when a message needs to be sent to 500 people it might take quite long until the 500th person gets the message if it all needs to happen consecutively instead of at the same time.

Mike