.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   I'm STEAMed up !!! (http://forums.bots-united.com/showthread.php?t=79)

Austin 31-12-2003 10:40

Re: I'm STEAMed up !!!
 
Quote:

Originally Posted by Pierre-Marie Baty
w000H00H00H00H00000000t!!!!

// if you know a more orthodox way of doing this, please tell me.
// test file, if found = STEAM Linux/Win32 dedicated server
fp = fopen ("valve/steam.inf", "rb");
if (fp != NULL)
{
fclose (fp); // test was successful, close it
is_steam = mTRUE; // this file is typical from a STEAM DS install
}

A more orthodox way of testing if a file exists instead of trying to open it?
Sure:

#include <sys/stat.h>

struct _stat buf;
if( _stat( "valve/steam.inf", &buf ) == 0 )
{
//file exists
}

:)


Quote:

Originally Posted by Pierre-Marie Baty
Hey thanks Austin :)

is it portable ?

Totally,
Standard c lib stuff.

Pierre-Marie Baty 31-12-2003 11:43

Re: I'm STEAMed up !!!
 
Hey thanks Austin :)

is it portable ?

stefanhendriks 31-12-2003 12:05

Re: I'm STEAMed up !!!
 
@pmb, i tried ur .dsp file. Still the same errors i get. Kinda nuts making me now. ARGh

botmeister 02-01-2004 17:57

Re: I'm STEAMed up !!!
 
NOTE: The patch will also work for CS 1.6 servers that do not use the Steam cache.

stefanhendriks 02-01-2004 17:57

Re: I'm STEAMed up !!!
 
yup :) already tested it. Works like a charm! :D

botmeister 03-01-2004 00:58

Re: I'm STEAMed up !!!
 
Quote:

Originally Posted by Austin
A more orthodox way of testing if a file exists instead of trying to open it?
Sure:

#include <sys/stat.h>

struct _stat buf;
if( _stat( "valve/steam.inf", &buf ) == 0 )
{
//file exists
}

:)




Totally,
Standard c lib stuff.

As for portability, I think _stat is Win32 only, while fopen is cross platform.

BAStumm 03-01-2004 02:41

Re: I'm STEAMed up !!!
 
I've had lengthy discussion with alfred reynolds about this. The changes needed in metamod to work with steam are minor, without them you will get sparadic crashes which are hard to debug. Its also important to note that 1.17 mm on the metamod site is NOT fixed for steam, alfred posted what needed to be changed to the valve mailing lists which included Sequence.cpp and an updated eiface.h IIRC and he also included some diff txt files which can be used with "patch" (under linux) to fix metamod. A precompiled metamod was also provided by alfred but you still need to fix your mm source and your SDK source with the stuff alfred mentioned. You can find this info by searching google or one of the valve mail list archive sites.

BAStumm 03-01-2004 02:46

Re: I'm STEAMed up !!!
 
errr Sequence.h and eiface.h are the files... Sorry.

http://bs-linux.com/Sequence.h
http://bs-linux.com/eiface.h
http://bs-linux.com/metamod_1.17_diff

the patch command under linux will apply the differences to your current files, no idea how you do this under windows though :(

If you want pre-patched metamod files let me know...

BAStumm 03-01-2004 02:49

Re: I'm STEAMed up !!!
 
http://bs-linux.com/engine_api.cpp
http://bs-linux.com/engine_api.h

Those are the modified metamod source files

Pierre-Marie Baty 03-01-2004 04:06

Re: I'm STEAMed up !!!
 
we did apply this patch by hand already :)

Unfortunately we can't seem to be able to get a hand on that famous "metamod SDK", which would be according to the legends in groups.yahoo.com a Half-Life SDK that Will Day would be keeping up to date to have it compile on newer compilers than those used by Valve in the paleolithic ages. Such a pearl is supposed to be available to download from the metamod site, but we can't seem to find it...

....HEEEEEEEEEEEEELP!!!!!!!!!!!!!!!! :'(


All times are GMT +2. The time now is 03:37.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.