So, Pathogen is finally online.
It took a lot of work. It's not fully finished, but it appears to be working. When I test it with several windows on one computer it works but then stops receiving packets from the other player when I switch between the windows a few times. When I tested it with 3 windows some player was getting packets and another wasn't, so I can't tell. Hopefully it'll work when people try it out.
I half-finished the chat feature. Because I manually check for each character typed in instead of using a native windows edit box, I didn't include all the characters yet and you can only type upper-case letters. The space bar is missing for one. That's because I only finished the letters and numbers (enough for the login name and password to work).
One of the last parts I was finishing was the encryption. On Windows when I was testing it earlier I used a SHA1 encryption algorithm that I found on the internet. Appearantly the Amazon linux server uses wide-characters instead of narrow characters (like you can set an option to use multi-byte characters when compiling in Visual Studio?) So I had to rewrite the algorithm using int8_t's and uint8_t's instead of chars and unsigned chars. In the end it produced the right result the first time but generated a different hash the second time it was used. So I was able to use the gcrypt library instead to generate the hash on linux. And I had a hard time just downloading the lib because I didn't know whether it was libgcrypt-devel or libgcrypt-dev... See, I forgot the name already. And I had to add and option when compiling with g++ to link(?) the library. The encryption is needed to confirm the encrypted password in the database, of course, so that I don't store the plain-text passwords in the database.
Rearranging the files to compile on linux was pretty easy. Because I don't know how to work with makefiles and dependencies I had to arrange all the source code so that I just had to compile one .cpp file that included all the other code as .h files. Then all I had to do was compile it using one line through Git Bash.
As I mentioned, the server is running on a micro instance on Amazon Web Services. I control the server through the Git Bash shell.
I made the code compilable on Linux and Windows using only one set of source code. I used a bunch of #ifdef directives to check which code needs to be compiled. The first header file I include in main.h is compile.h which checks whether we're compiling on Windows or Linux and sets _SERVER appropriately (if it's Windows, _SERVER is undefined, and if it's Linux, _SERVER is defined). I include Linux-specific headers in case of _SERVER and use the Linux networking code and use the server control paths. Basically, all the graphics and WinMain and client side stuff is removed from the server code.
Debugging it was pretty easy. I used two Git Bash windows. One was to upload source files and the other was SSH logged in to the Linux and was used to compile, run, and quit the program and to check the log file. I had to get through a hundred errors by now probably to get it to compile all these times.
The program is running right now in fact. I have PHP execute a shell command to check if the process is running and it then displays whether the server is running or not on the website. It's actually not correct right now and shows the server as running all the time but I'll fix that later. It was working on Windows when I used wmic for the process.
I added a UDP ack system too. Every packet, except position and velocity, rotation, movement must be acknowledged or else it will be resent every 3 seconds. This means that even if the acknowledgment doesn't get through it will be resent. This causing some problems I noticed as it appears like a client said something twice when they only said it once. The movement is also jerky, but it's playable. When moving the character appears to look in another direction unless the player is rotating and sending those packets. Not sure why that is.
You can move, look around, shoot, jump, crouch and use a flashlight, although other players wont see te flashlight yet because I haven't gotten multiple light sources to work in OpenGL yet. There's no shaders right now because I couldn't get it to get it to work with the lightmaps of the Quake 3 BSP map.
The map is just a plain field right now but I'm going to model it on my neighborhood later. I will add doors too later. And right now the options you choose (whether to spawn as a zombie or human and which model to use) aren't in effect yet but will be added in a future version.
It took a lot of work. It's not fully finished, but it appears to be working. When I test it with several windows on one computer it works but then stops receiving packets from the other player when I switch between the windows a few times. When I tested it with 3 windows some player was getting packets and another wasn't, so I can't tell. Hopefully it'll work when people try it out.
I half-finished the chat feature. Because I manually check for each character typed in instead of using a native windows edit box, I didn't include all the characters yet and you can only type upper-case letters. The space bar is missing for one. That's because I only finished the letters and numbers (enough for the login name and password to work).
One of the last parts I was finishing was the encryption. On Windows when I was testing it earlier I used a SHA1 encryption algorithm that I found on the internet. Appearantly the Amazon linux server uses wide-characters instead of narrow characters (like you can set an option to use multi-byte characters when compiling in Visual Studio?) So I had to rewrite the algorithm using int8_t's and uint8_t's instead of chars and unsigned chars. In the end it produced the right result the first time but generated a different hash the second time it was used. So I was able to use the gcrypt library instead to generate the hash on linux. And I had a hard time just downloading the lib because I didn't know whether it was libgcrypt-devel or libgcrypt-dev... See, I forgot the name already. And I had to add and option when compiling with g++ to link(?) the library. The encryption is needed to confirm the encrypted password in the database, of course, so that I don't store the plain-text passwords in the database.
Rearranging the files to compile on linux was pretty easy. Because I don't know how to work with makefiles and dependencies I had to arrange all the source code so that I just had to compile one .cpp file that included all the other code as .h files. Then all I had to do was compile it using one line through Git Bash.
As I mentioned, the server is running on a micro instance on Amazon Web Services. I control the server through the Git Bash shell.
I made the code compilable on Linux and Windows using only one set of source code. I used a bunch of #ifdef directives to check which code needs to be compiled. The first header file I include in main.h is compile.h which checks whether we're compiling on Windows or Linux and sets _SERVER appropriately (if it's Windows, _SERVER is undefined, and if it's Linux, _SERVER is defined). I include Linux-specific headers in case of _SERVER and use the Linux networking code and use the server control paths. Basically, all the graphics and WinMain and client side stuff is removed from the server code.
Debugging it was pretty easy. I used two Git Bash windows. One was to upload source files and the other was SSH logged in to the Linux and was used to compile, run, and quit the program and to check the log file. I had to get through a hundred errors by now probably to get it to compile all these times.
The program is running right now in fact. I have PHP execute a shell command to check if the process is running and it then displays whether the server is running or not on the website. It's actually not correct right now and shows the server as running all the time but I'll fix that later. It was working on Windows when I used wmic for the process.
I added a UDP ack system too. Every packet, except position and velocity, rotation, movement must be acknowledged or else it will be resent every 3 seconds. This means that even if the acknowledgment doesn't get through it will be resent. This causing some problems I noticed as it appears like a client said something twice when they only said it once. The movement is also jerky, but it's playable. When moving the character appears to look in another direction unless the player is rotating and sending those packets. Not sure why that is.
You can move, look around, shoot, jump, crouch and use a flashlight, although other players wont see te flashlight yet because I haven't gotten multiple light sources to work in OpenGL yet. There's no shaders right now because I couldn't get it to get it to work with the lightmaps of the Quake 3 BSP map.
The map is just a plain field right now but I'm going to model it on my neighborhood later. I will add doors too later. And right now the options you choose (whether to spawn as a zombie or human and which model to use) aren't in effect yet but will be added in a future version.
Create a custom theme




