With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
Discuss & improve the game engine.

Moderators: sparcdr, torhu, Tequila

Client side changes

Postby Allied » Thu Apr 02, 2009 1:53 am

Hey all,

I have a question regarding server/client compatibility. What if I've modified the client code, exclusively the executable and not the VM - would this client work fine with servers? Eg, not a cheat. I know it passes the pure test, but I don't know what else would be classified as illegal.

Thanks in advance,
Allied
User avatar
Allied
Quick Draw
 
Posts: 67
Joined: Tue Feb 24, 2009 8:27 pm



Postby /dev/random » Thu Apr 02, 2009 9:44 am

As long as you don't change the protocol version or netcode everything should work fine. Client and server exchange protocol version and file checksums while connecting.

What do you mean by "illegal"? It is easy to modify the engine to cheat. I assume it is about your surround sound? That's not a cheat I guess :wink:
User avatar
/dev/random
Smokin' Amigo!
 
Posts: 410
Joined: Thu Jan 22, 2009 1:58 pm



Postby Allied » Thu Apr 02, 2009 8:29 pm

/dev/random wrote:What do you mean by "illegal"? It is easy to modify the engine to cheat. I assume it is about your surround sound? That's not a cheat I guess :wink:


It started with looking into recompiling with a different SDK to try get surround working via Directsound but after looking into the code I was interested in making a chat filter system. Before I go to too much bother I wanted to find out if any client side modification would be regarded as a cheat, hence "illegal".
User avatar
Allied
Quick Draw
 
Posts: 67
Joined: Tue Feb 24, 2009 8:27 pm



Postby /dev/random » Thu Apr 02, 2009 9:30 pm

If you hadn't told us about it, we would never have known about your evil plans :D
What exactly do you plan to do? It is usually easier to modify the gamecode. Then ask the devteam whether they will include your patch :)
User avatar
/dev/random
Smokin' Amigo!
 
Posts: 410
Joined: Thu Jan 22, 2009 1:58 pm



Postby Allied » Thu Apr 02, 2009 10:01 pm

/dev/random wrote:If you hadn't told us about it, we would never have known about your evil plans :D
What exactly do you plan to do? It is usually easier to modify the gamecode. Then ask the devteam whether they will include your patch :)


Lol, ignorance is bliss hm? ;)

I would modify the cl_cgame.c source file (since this is part of the client and not the VM), in CL_CgameSystemCalls the CG_PRINT case. I'd add a check in that place linked up to a text file.
User avatar
Allied
Quick Draw
 
Posts: 67
Joined: Tue Feb 24, 2009 8:27 pm



Postby sparcdr » Fri Apr 03, 2009 8:31 pm

You can backpeddle the snd*.c/.h files for DirectSound if you want... it was around revision 25 where it was buildable on SVN. You can then replace most other files with newer and fix a few files like q_shared.h which would cause the build to fail because of OpenAL calls. I've got a fairly recent (r125) noal build here but no promises.
sparcdr
SG Team
 
Posts: 334
Joined: Wed Jun 13, 2007 3:41 pm



Postby Allied » Fri Apr 03, 2009 10:19 pm

I think it probably wouldn't be worth the effort to try get a Directsound client.

I have a question regarding what I'm working on though, how do I load a file? I'd like to load the filter text file, preferably in the cl_cgame.c source file so as to keep it as together as possible. I've tried FS_ReadFile but it just doesn't seem to be able to load the file.
User avatar
Allied
Quick Draw
 
Posts: 67
Joined: Tue Feb 24, 2009 8:27 pm



Postby /dev/random » Fri Apr 03, 2009 10:45 pm

Iirc you first have to get a file handle via FS_FOpenFileAppend or similar, then read/write with FS_Read/FS_Write and finally close the handle with FS_FCloseFile.
User avatar
/dev/random
Smokin' Amigo!
 
Posts: 410
Joined: Thu Jan 22, 2009 1:58 pm



Postby Allied » Sat Apr 04, 2009 9:06 pm

/dev/random wrote:Iirc you first have to get a file handle via FS_FOpenFileAppend or similar, then read/write with FS_Read/FS_Write and finally close the handle with FS_FCloseFile.


FS_ReadFile appears to do all of that. What path does it look in for the specified file?
User avatar
Allied
Quick Draw
 
Posts: 67
Joined: Tue Feb 24, 2009 8:27 pm



Postby mLy! » Sat Apr 04, 2009 9:59 pm

best chat filter would be "/cg_globalchatheight 0" I guess :p
My Latest fragmovies:
Winning BB cup
User avatar
mLy!
Gunslinger
 
Posts: 218
Joined: Wed Feb 11, 2009 8:46 pm



Postby Tequila » Sat Apr 04, 2009 10:07 pm

If you have few good ideas for the engine you can just propose a patch and we will may be integrate it if the official sources. If you have a lot of ideas, propose few as patch, then we would allow you to open a branch or just update the trunk if you deserve ;) To deserve, you just have to remember to be as open as the sources...

About FS_Read/FS_Write, the path where it look in will depends on your system. On windows, it should just be the game folder, in unix systems, you'll have also user dedicated folder... Btw the better way for you know where to put your file is to start the game and check the console at the very beginning and you'll find a list of paths the game will search in.

About cheat coding, we are planing some few new stuffs to fight cheaters for the next coming release, so just forget that if you planed it :evil: :twisted: :P

Yeah-ha
User avatar
Tequila
SG Team
 
Posts: 1100
Joined: Thu Nov 15, 2007 11:33 pm
Location: Montpellier, France



Postby Allied » Sun Apr 05, 2009 12:06 am

mLy! wrote:best chat filter would be "/cg_globalchatheight 0" I guess :p


That's not exactly the definition of a filter, more of a annihilator. ;). Wouldn't be too practical for team games such as bank robbery.

Tequila wrote:If you have few good ideas for the engine you can just propose a patch and we will may be integrate it if the official sources. If you have a lot of ideas, propose few as patch, then we would allow you to open a branch or just update the trunk if you deserve ;) To deserve, you just have to remember to be as open as the sources...


I can't say I have many, or even a few good ideas. All I have right now is this filter proposal :).

Tequila wrote:About FS_Read/FS_Write, the path where it look in will depends on your system. On windows, it should just be the game folder, in unix systems, you'll have also user dedicated folder... Btw the better way for you know where to put your file is to start the game and check the console at the very beginning and you'll find a list of paths the game will search in.


Ok, it said the working directory was the base SG folder - and that's where I placed my file. However ReadFile is just returning -1 and not loading the file. The ReadFile call is in CL_InitCGame by the way.

Tequila wrote:About cheat coding, we are planing some few new stuffs to fight cheaters for the next coming release, so just forget that if you planed it :evil: :twisted: :P


And after I'd go to all the trouble of making this workaround for pure servers! :cry: . Just kidding, I'm glad to hear that - makes it easier for legitimate people like myself to make changes.
User avatar
Allied
Quick Draw
 
Posts: 67
Joined: Tue Feb 24, 2009 8:27 pm



Postby Tequila » Sun Apr 05, 2009 12:18 am

Allied wrote:
Tequila wrote:About FS_Read/FS_Write, the path where it look in will depends on your system. On windows, it should just be the game folder, in unix systems, you'll have also user dedicated folder... Btw the better way for you know where to put your file is to start the game and check the console at the very beginning and you'll find a list of paths the game will search in.


Ok, it said the working directory was the base SG folder - and that's where I placed my file. However ReadFile is just returning -1 and not loading the file. The ReadFile call is in CL_InitCGame by the way.


Well, when engine uses PK3 files, only files with some extensions can be read from the game folder. Try to rename your file with ".cfg" or ".dat" extension if it hasn't an allowed one.
User avatar
Tequila
SG Team
 
Posts: 1100
Joined: Thu Nov 15, 2007 11:33 pm
Location: Montpellier, France



Postby Allied » Mon Apr 06, 2009 5:04 pm

Thanks for the help all, I finally got it loaded :).

Using a combination of FileExists and SV_FileExists I made sure what location to keep the file in. Changing the extension doesn't change anything. I'm not exactly sure what's up with ReadFile - but by using FS_SV_FOpenFileRead, FS_Read, and FS_CloseFile the file is being loaded successfully now.
User avatar
Allied
Quick Draw
 
Posts: 67
Joined: Tue Feb 24, 2009 8:27 pm



Postby /dev/random » Mon Apr 06, 2009 7:59 pm

Don't forget the extension. If it is not .dat or .cfg then you won't be able to load it on pure servers.
User avatar
/dev/random
Smokin' Amigo!
 
Posts: 410
Joined: Thu Jan 22, 2009 1:58 pm



Next

Return to Code

Show Sidebar
Show Sidebar

User Control Panel

cron