Colors hack

Is there something that doesn't work right? Do you need help with something? Post about it here.
User avatar
Gunter
Administrator
Posts: 238
Joined: Mon Dec 10, 2007 8:45 pm
Favorite FvF Class: Gunter

Colors hack

Post by Gunter »

I'm really not certain of the inner workings of the Quake engines, since I've never looked at that code, but this is my understanding.

When trying to use colors 14 and 15, both the client and the server are working against you.

If you try to change to those funky colors, the server goes "Nope" and sets you at color 13 instead.

If the server has support for the colors hacked in, then you can change to those colors, but on level changes, your client will stop and look and go, "WTF color am I? Nope" and change you back to a legal color.... It's because your client doesn't set it's internal _cl_color variable to those funny colors, because it thinks the server won't allow it anyway (I think). In that case, I use the "colors" command to directly set _cl_color so that your Quake client doesn't see a conflict so doesn't try to change anything.

My hacky method in the case where the server doesn't support the colors, is just to manually force the server to send the WriteByte thing to all connected clients to tell everyone you have changed to funky colors. But that means that it only affects people who are connected when that happens. I also just added in a forced setting of your "team" since the server won't be setting that automatically either -- that's what affects your "pack particle" color.

Of course, with the server not allowing those colors, at level change, the server goes, "Man, WTF color are you?? Nope!"

So now I've made it even more hacky.... I save your funky colors when you use the "colors" command, and upon loading a new level, I do the WriteByte 12 seconds after you enter the server (when it says "press 9 or 0 to suck ass, blah blah") -- the delay is to make sure everyone has time to connect and see it.

Though, again, that won't affect anyone who connects after that point....

I guess I could also send the WriteBye every time you died... which would mean anyone connected at that time would be sure to see your funny colors....

I guess I should really see if Pol can hack it into the server.... That would work much better. I'm not sure if that will happen....

But I've got it all hacky now so you won't have to keep inputting your color yourself. Unless someone new connects and you are trying to show off before the next level change....
ImageImageImage <- Try my Pogo Piggle games for Android!
User avatar
Gunter
Administrator
Posts: 238
Joined: Mon Dec 10, 2007 8:45 pm
Favorite FvF Class: Gunter

Re: Colors hack

Post by Gunter »

Well, I stayed up way too late hacking away at this.

Quake has... very limited but inscrutable math functions that seem to produce incorrect results, with no good way to debug and find out where the problem is occurring....

But I think I eventually got it all hacked up and working fairly well.

Each new client that connects will look for anyone with funky colors, and have them re-run the WriteByte to make sure everyone sees their funky colors....


Now that I've spent so many hours on it, I'm sure Polarite will make the easy, 1-line hack to the server and make all my work moot!


Also, what's up with the forum running so sluggishly? Bleh! Hap pays a good $10 a year for this hosting! You'd think it would be more reliable :lol:
ImageImageImage <- Try my Pogo Piggle games for Android!
User avatar
teknoskillz
Level 1
Posts: 12
Joined: Mon Aug 01, 2011 8:56 pm
Favorite FvF Class: Monk
Location: NY - USA
Contact:

Re: Colors hack

Post by teknoskillz »

On the colors - Well I thought this issue was more to do with the eng server side and what kind of client connects to it.

As a test, you could fire up another instance of the server on another port using Manquake as the engine:
ftp://ftp.runequake.com/quake/engines/manquake/latest/

Sometimes having a dev server on another port comes in handy, just only let your trusted testers and devs know the port.


Ya, forum is very slow, could maybe be the sql db needs optimizing? They are always updating mysql and other stuff, also if Pol is
your server admin, he may need to do :

sudo apt-get update # Fetches the list of available updates
sudo apt-get upgrade # Strictly upgrades the current packages
sudo apt-get dist-upgrade # Installs updates (new ones)

If you have sudo admin privileges, then you could do this yourself at the command prompt but I would guess Pol ought to be doing it
if he has other stuff running, some things may not always be good to upgrade.
Gunter wrote:Well, I stayed up way too late hacking away at this.

Quake has... very limited but inscrutable math functions that seem to produce incorrect results, with no good way to debug and find out where the problem is occurring....

But I think I eventually got it all hacked up and working fairly well.

Each new client that connects will look for anyone with funky colors, and have them re-run the WriteByte to make sure everyone sees their funky colors....


Now that I've spent so many hours on it, I'm sure Polarite will make the easy, 1-line hack to the server and make all my work moot!


Also, what's up with the forum running so sluggishly? Bleh! Hap pays a good $10 a year for this hosting! You'd think it would be more reliable :lol:
Post Reply