.:: 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)

Pierre-Marie Baty 29-12-2003 20:22

I'm STEAMed up !!!
 
NNNNNNNAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHH

NNNNNNNNNNNNNNAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHH

the steam guys made an update to the HL SDK and they didnt notify anyone and they added functions in the engine interface and they just told the metamod guy and he released a new metamod and they changed it again and they released a patch and the patch doesnt work and even when you fix it and then you compile the new metamod then the new metamod doesnt work with 1.5 anymore and I lost the old metamod and now none of my plugins work and theres nothing to do but to upgrade to steam and I dont want to upgrade to steam because steam wont work because of 56k and even the SDK is not updated and now we're all forced to use steam becasue else it does not work DDDDDDDDAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHH :'( :'( :'(


CHALLENGE OF THE DAY !!!


figure out a way to make the new metamod 1.17 work BOTH with Steam AND with the old 1.5 servers. Possibly by shortening the new enginefuncs when it detects 1.5. Or whatever else. I don't care. Just want something that WORKS.

If I find the solution I'll post the patch here.

In the meanwhile, if you see a steam guy down the street, KILL HIM, MASSACRE HIM, CUT HIM IN PIECES AND FEED THEM TO THE ANTS >:(

@$3.1415rin 29-12-2003 20:39

Re: I'm STEAMed up !!!
 
sure, i'll do so 8) ... but if he offeres me a free cable connection I might change my mind 8D

botmeister 29-12-2003 21:03

Re: I'm STEAMed up !!!
 
The biggest problem with STEAM is that it turns the software it deposits on your computer into a never ending "work in progress", or in otherwords a never ending "beta" version. The problem with a "beta" is that it will unexpectantly change, and when that happens whatever was built on top of it gets messed up, so you cannot build anything on top of it, which means, we'll be forever futzing around with patching our mods to work with the latest version of a work in progress.

I knew this problem would happen right after I first read Valve's description of the wonders of STEAM.

I doubt the intention is to kill our mods, as it seems the free advertising Valve gets from free products such as Admin Mod, etc is a benifit to their sales, instead I think there is understanding of how to properly build and release software. It should be released in well defined and stable stages, each clearly labeld as being "final" or "not final". User can then upgrade to either the stable version, or the unstable version by choice. With STEAM *all* updates are by definition "unstable" and even worse, the updates are *forced* on to the users, i.e., if you choose not to upgrade, you can no longer use the software at all!

The concept of STEAM is not really the problem, since adjustements can be made to it to allow beta upgrades or final upgrades, where users can chose to upgrade to a beta version, or to a final version. The final versions would be released far less frequently, while betas could be released as often as it desired. In addition, STEAM should allow for two version, the beta and the final to coexist on the same computer at the same time. I doubt we'd see such sophistication from STEAM for a very long time, if ever, since it appears the concept of final vs beta was never biult into the product, therefore they will likely have to rework the entire system to allow for it.

I think the ultimate question, is what can we do (or should we even bother) to solve the problem of working on a continuos stream of unstable and unpredictable releases?

stefanhendriks 29-12-2003 21:05

Re: I'm STEAMed up !!!
 
pmb...

i tested realbot_mm.dll lately (compiled it myself btw). it works in CS 1.5 and CS 1.6.

All i did was plugging the realbot_mm in and it worked :) anyway, it started the server... :)

Pierre-Marie Baty 30-12-2003 02:07

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

I impress myself sometimes.

Sent this email to Will Day:
Code:

Hi Will, me again :)
 
I have worked out a very simple fix that makes metamod 1.17 backwards
compatible with both steam servers and non-steam servers, even with the
latest enginefuncs patch from Alfred at Valve. Metamod detects Steam and
automatically adapts its enginefuncs interface to the version of the engine
and gamedll it is used with. Interested ?
 
 
in h_export.cpp, somewhere at the top of the file :
--------------------------------------------------
// Pierre-Marie Baty -- STEAM/NOSTEAM auto-adaptative fix -- START
mBOOL is_steam = mFALSE;
// Pierre-Marie Baty -- STEAM/NOSTEAM auto-adaptative fix -- END
-------------------------------------------------
 
 
in h_export.cpp, GiveFnptrsToDll() function :
(last 3 code lines are context lines)
-------------------------------------------------
void WINAPI GiveFnptrsToDll(enginefuncs_t *pengfuncsFromEngine,
globalvars_t *pGlobals)
{
// Pierre-Marie Baty -- STEAM/NOSTEAM auto-adaptative fix -- START
FILE *fp;
 
is_steam = mFALSE; // assume Steam is not present by default
 
// to check whether Steam is installed or not, I test Steam-specific
files.
// 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
}
 
// test file, if found = STEAM Win32 listenserver
fp = fopen ("FileSystem_Steam.dll", "rb");
if (fp != NULL)
{
        fclose (fp); // test was successful, close it
        is_steam = mTRUE; // this file is typical from a STEAM client/LS
}
 
if (is_steam)
        memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(g_engfuncs));
else
        memcpy(&g_engfuncs, pengfuncsFromEngine, 144 * sizeof(unsigned
__int32));
// Pierre-Marie Baty -- STEAM/NOSTEAM auto-adaptative fix -- END
 
gpGlobals = pGlobals;
Engine.funcs = &g_engfuncs;
Engine.globals = pGlobals;
---------------------------------------------------
 
 
in metamod.cpp, metamod_startup() function :
(first 3 comment lines are context lines)
--------------------------------------------------
// Copy, and store pointer in Engine struct. Yes, we could just store
// the actual engine_t struct in Engine, but then it wouldn't be a
// pointer to match the other g_engfuncs.
 
// Pierre-Marie Baty -- STEAM/NOSTEAM auto-adaptative fix -- START
extern mBOOL is_steam;
if (is_steam)
        memcpy(&g_plugin_engfuncs, Engine.funcs, sizeof(g_plugin_engfuncs));
else
        memcpy(&g_plugin_engfuncs, Engine.funcs, 144 * sizeof(unsigned
__int32));
// Pierre-Marie Baty -- STEAM/NOSTEAM auto-adaptative fix -- END
----------------------------------------------------
 
Sorry for the syntax of these patchs, but someone has yet to port the GNU
diff utility to Windows... I should perhaps give it a go one of these days
;-)
 
If you want to know why I shorten the length of the enginefuncs interface to
144 int32's when Steam is not detected, it's because the last enginefuncs
interface we had before the Steam guys changed it, was made of 144 function
pointers. These 144 function pointers make the "classical" enginefuncs
interface a non-steam HLDS and gameDLL know. The remaining functions in the
structure are only used by Steam engines and gamedlls ; but if you try to
stuff them to a non-steam server, chances are that the server will crash.
 
I would *really* *really* *really* like to see this change in the next
metamod, Will... I had to do it because there are a LOT of people who
are still using non-steam servers, please don't drop metamod support for
non-steam servers. :-)
 
--
Pierre-Marie Baty
pm@bots-united.com

you can use this info to patch your metamod 1.17, even with the latest patch from Valve, it'll be 100% backwards-compatible with CS 1.5 and non-steam servers in general :)

stefanhendriks 30-12-2003 16:07

Re: I'm STEAMed up !!!
 
if only i could compile metamod, i would immidiatly aply this patch myself! :)

stilll odd, i can run steam without metamod 1.17, perhaps its due i run a listen server? Or perhaps some trouble will be caused later.. :)

stefanhendriks 30-12-2003 16:51

Re: I'm STEAMed up !!!
 
Pierre:
Code:

// Pierre-Marie Baty -- STEAM/NOSTEAM auto-adaptative fix -- START
extern mBOOL is_steam;
if (is_steam)
        memcpy(&g_plugin_engfuncs, Engine.funcs, sizeof(g_plugin_engfuncs));
else
        memcpy(&g_plugin_engfuncs, Engine.funcs, 144 * sizeof(unsigned
__int32));
// Pierre-Marie Baty -- STEAM/NOSTEAM auto-adaptative fix -- END

i thought __int32 was not compatible in Linux? Perhaps you should add a check for win32 then:

Code:

extern mBOOL is_steam;
    if (is_steam)
        memcpy(&g_plugin_engfuncs, Engine.funcs, sizeof(g_plugin_engfuncs));
    else
    {
        // Keep it WIN32/Linux compatible - STEFAN
        #ifdef _WIN32
            memcpy(&g_plugin_engfuncs, Engine.funcs, 144 * sizeof(unsigned __int32));
        #elif defined(linux)
            memcpy(&g_plugin_engfuncs, Engine.funcs, 144 * sizeof(int));
        #endif
    }

I assume (int) is here 32 bits for Linux. Perhaps there is a neater way to make sure it is always 32 bits. Btw, i figured in metamod there is no __int32 used anywhere at all besides in this patch ;)

Pierre-Marie Baty 30-12-2003 22:07

Re: I'm STEAMed up !!!
 
Good point, Stefan ! Ah well, I suppose Will will know what to change himself :D

BTW to compile metamod, be aware that the .dsp file that comes with it hasn't been updated for AGES since Will Day only uses Linux ; chances are that it doesn't work at all. I made mine, it's attached below. Use it and I guarantee it will work better :)

metamod.dsp:
Code:

# Microsoft Developer Studio Project File - Name="metamod" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=metamod - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "metamod.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "metamod.mak" CFG="metamod - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "metamod - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "metamod - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF  "$(CFG)" == "metamod - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "release"
# PROP Intermediate_Dir "release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "METAMOD_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I ".." /I "..\..\..\devtools\sdk\Single-Player Source\common" /I "..\..\..\devtools\sdk\Single-Player Source\engine" /I "..\..\..\devtools\sdk\Single-Player Source\dlls" /I "..\..\..\devtools\sdk\Single-Player Source\pm_shared" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "METAMOD_EXPORTS" /FR /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /def:".\metamod.def"
# SUBTRACT LINK32 /verbose
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Copying files...
PostBuild_Cmds=copy release\metamod.dll ..\..\dlls > nul copy release\metamod.dll ..\..\..\asheep\addons\metamod\dlls > nul copy release\metamod.dll ..\..\..\cstrike\addons\metamod\dlls > nul copy release\metamod.dll ..\..\..\dmc\addons\metamod\dlls > nul copy release\metamod.dll ..\..\..\gearbox\addons\metamod\dlls > nul copy release\metamod.dll ..\..\..\ricochet\addons\metamod\dlls > nul copy release\metamod.dll ..\..\..\tfc\addons\metamod\dlls > nul copy release\metamod.dll ..\..\..\tod\addons\metamod\dlls > nul copy release\metamod.dll ..\..\..\ts\addons\metamod\dlls > nul copy release\metamod.dll ..\..\..\valve\addons\metamod\dlls > nul copy release\metamod.dll ..\..\..\wasteland\addons\metamod\dlls > nul copy release\metamod.dll ..\..\..\rcrowbar\addons\metamod\dlls > nul
# End Special Build Tool
!ELSEIF  "$(CFG)" == "metamod - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "debug"
# PROP Intermediate_Dir "debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "METAMOD_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ".." /I "..\..\..\devtools\sdk\Single-Player Source\common" /I "..\..\..\devtools\sdk\Single-Player Source\engine" /I "..\..\..\devtools\sdk\Single-Player Source\dlls" /I "..\..\..\devtools\sdk\Single-Player Source\pm_shared" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "METAMOD_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /def:".\metamod.def" /pdbtype:sept
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Copying files...
PostBuild_Cmds=copy debug\metamod.dll ..\..\dlls\debug > nul copy debug\metamod.dll ..\..\..\asheep\addons\metamod\dlls > nul copy debug\metamod.dll ..\..\..\cstrike\addons\metamod\dlls > nul copy debug\metamod.dll ..\..\..\dmc\addons\metamod\dlls > nul copy debug\metamod.dll ..\..\..\gearbox\addons\metamod\dlls > nul copy debug\metamod.dll ..\..\..\ricochet\addons\metamod\dlls > nul copy debug\metamod.dll ..\..\..\tfc\addons\metamod\dlls > nul copy debug\metamod.dll ..\..\..\tod\addons\metamod\dlls > nul copy debug\metamod.dll ..\..\..\ts\addons\metamod\dlls > nul copy debug\metamod.dll ..\..\..\valve\addons\metamod\dlls > nul copy debug\metamod.dll ..\..\..\wasteland\addons\metamod\dlls > nul copy debug\metamod.dll ..\..\..\rcrowbar\addons\metamod\dlls > nul
# End Special Build Tool
!ENDIF
# Begin Target
# Name "metamod - Win32 Release"
# Name "metamod - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\api_info.cpp
# End Source File
# Begin Source File
SOURCE=..\commands_meta.cpp
# End Source File
# Begin Source File
SOURCE=..\conf_meta.cpp
# End Source File
# Begin Source File
SOURCE=..\dllapi.cpp
# End Source File
# Begin Source File
SOURCE=..\engine_api.cpp
# End Source File
# Begin Source File
SOURCE=..\game_support.cpp
# End Source File
# Begin Source File
SOURCE=..\h_export.cpp
# End Source File
# Begin Source File
SOURCE=..\linkent.cpp
# End Source File
# Begin Source File
SOURCE=..\linkgame.cpp
# End Source File
# Begin Source File
SOURCE=..\linkplug.cpp
# End Source File
# Begin Source File
SOURCE=..\log_meta.cpp
# End Source File
# Begin Source File
SOURCE=..\metamod.cpp
# End Source File
# Begin Source File
SOURCE=..\mhook.cpp
# End Source File
# Begin Source File
SOURCE=..\mlist.cpp
# End Source File
# Begin Source File
SOURCE=..\mplugin.cpp
# End Source File
# Begin Source File
SOURCE=..\mqueue.cpp
# End Source File
# Begin Source File
SOURCE=..\mreg.cpp
# End Source File
# Begin Source File
SOURCE=..\mutil.cpp
# End Source File
# Begin Source File
SOURCE=..\osdep.cpp
# End Source File
# Begin Source File
SOURCE=..\reg_support.cpp
# End Source File
# Begin Source File
SOURCE=..\sdk_util.cpp
# End Source File
# Begin Source File
SOURCE=..\studioapi.cpp
# End Source File
# Begin Source File
SOURCE=..\support_meta.cpp
# End Source File
# Begin Source File
SOURCE=..\thread_logparse.cpp
# End Source File
# Begin Source File
SOURCE=..\vdate.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\api_info.h
# End Source File
# Begin Source File
SOURCE=..\commands_meta.h
# End Source File
# Begin Source File
SOURCE=..\conf_meta.h
# End Source File
# Begin Source File
SOURCE=..\dllapi.h
# End Source File
# Begin Source File
SOURCE=..\engine_api.h
# End Source File
# Begin Source File
SOURCE=..\game_support.h
# End Source File
# Begin Source File
SOURCE=..\games.h
# End Source File
# Begin Source File
SOURCE=..\h_export.h
# End Source File
# Begin Source File
SOURCE=..\info_name.h
# End Source File
# Begin Source File
SOURCE=..\linkent.h
# End Source File
# Begin Source File
SOURCE=..\log_meta.h
# End Source File
# Begin Source File
SOURCE=..\meta_api.h
# End Source File
# Begin Source File
SOURCE=..\metamod.h
# End Source File
# Begin Source File
SOURCE=..\mhook.h
# End Source File
# Begin Source File
SOURCE=..\mlist.h
# End Source File
# Begin Source File
SOURCE=..\mplugin.h
# End Source File
# Begin Source File
SOURCE=..\mqueue.h
# End Source File
# Begin Source File
SOURCE=..\mreg.h
# End Source File
# Begin Source File
SOURCE=..\mutil.h
# End Source File
# Begin Source File
SOURCE=..\osdep.h
# End Source File
# Begin Source File
SOURCE=..\plinfo.h
# End Source File
# Begin Source File
SOURCE=..\reg_support.h
# End Source File
# Begin Source File
SOURCE=..\sdk_util.h
# End Source File
# Begin Source File
SOURCE=..\support_meta.h
# End Source File
# Begin Source File
SOURCE=..\thread_logparse.h
# End Source File
# Begin Source File
SOURCE=..\tqueue.h
# End Source File
# Begin Source File
SOURCE=..\types_meta.h
# End Source File
# Begin Source File
SOURCE=..\vdate.h
# End Source File
# Begin Source File
SOURCE=..\vers_meta.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=..\res_meta.rc
# End Source File
# End Group
# End Target
# End Project


stefanhendriks 30-12-2003 22:25

Re: I'm STEAMed up !!!
 
ok, will try. Btw, could you not use that as attachement? rofl :D

Pierre-Marie Baty 30-12-2003 23:07

Re: I'm STEAMed up !!!
 
yeah, just that the forum didn't want me to attach .dsp files... and I was too lazy to zip it ;)
erm, sorry :)

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!!!!!!!!!!!!!!!! :'(

BAStumm 03-01-2004 05:30

Re: I'm STEAMed up !!!
 
according to alfred (the original metamod author and now employee of valve) all you need is the modified files I posted above to have an up to date sdk (from 2.3). I've had no compile issues with metamod and the sdk since applying alfreds patches.

Austin 03-01-2004 06:23

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

Originally Posted by botmeister
As for portability, I think _stat is Win32 only, while fopen is cross platform.

Oops, been in Windoze to long..
Use this:

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


I think this is much better since fopen can fail for a number of reasons when the file actually exists.

stefanhendriks 03-01-2004 10:20

Re: I'm STEAMed up !!!
 
the metamod.org site is down all the time. Perhaps we should host metamod for the sake of keeping it online.

Nova 03-01-2004 10:24

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

Originally Posted by stefanhendriks
the metamod.org site is down all the time. Perhaps we should host metamod for the sake of keeping it online.

Well if we do THAT the traffic is going to be INCREDIBLE ... but would be worht considering, great publicity ...

Sargeant.Rock 27-02-2004 07:34

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

Originally Posted by Pierre-Marie Baty
Sorry for the syntax of these patchs, but someone has yet to port the GNU
diff utility to Windows... I should perhaps give it a go one of these days
;-)

GNUWin32, diffutils 8)

http://sourceforge.net/project/showf...ckage_id=16423

download and install, add X:\Program Files\gnuwin32\bin to your system path (where X is the drive you chose to install diffutils), and there you go... Diff from the command prompt to your heart's content...:)

I am trying to port Marine Bot (the only real bot for Firearms) into a MetaMod compatible plugin. I have the source code from the latest test release of MB, I have the latest (2.3) HL SDK I could find, and I downloaded your MetaMod 1.17sp source. I have searched the web over, and perused these forums for over 3 hours now, and can find no instructions anywhere on what I have to do to to my Marine Bot source files to make them into a MetaMod plugin. Any help or suggestions would be greatly appreciated. BTW, this will initially be a Linux only plugin, as I don't have enough hard-drive space left on my Windows box to install Visual Studio .NET and compile for Windows.???:(

Pierre-Marie Baty 27-02-2004 08:47

Re: I'm STEAMed up !!!
 
I believe the safe way is first to understand perfectly how a metamod plugin works. To achieve this, download some simple plugins and look closely at their source code. I would recommend mine, since for each I try to keep the same structure (except the most complicated ones such as the bots). There are, basically, two interfaces in the HL engine, and metamod provides hooks for both. Once you get used to what these interfaces are, how they work and how to hook them, you can give a go porting your bot to metamod. Download one of the current metamod bot's source code and keep it as a reference on how to do things when you're really stuck.

And BTW, when your bot is a metamod plugin, you can compile it for Windows with MinGW32, or if you're a real geek do like Will Day and cross-compile it for Windows directly on your linux box ;)

Anyway, thanks for the diffutils !

stefanhendriks 27-02-2004 10:46

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

Originally Posted by Nova
Well if we do THAT the traffic is going to be INCREDIBLE ... but would be worht considering, great publicity ...

hehe, thats my point ;) the more publicity the better :)

Pierre-Marie Baty 27-02-2004 14:21

Re: I'm STEAMed up !!!
 
mh, perhaps it might be a smart idea to ask Will Day before even talking of stuff like that, what do you think ?

stefanhendriks 27-02-2004 16:35

Re: I'm STEAMed up !!!
 
sure, its just that the idea is nice. Of course some aproval by Will Day would be handy :)

Onno Kreuzinger 27-02-2004 18:51

Re: I'm STEAMed up !!!
 
Hi,
i did not tell, but "our" meamod does compile with gcc 3.2 PMB, i just don't know why we should, or shoudl we? There are plenty of warnings, but thats just cosmetic. If needed i could beautify it..
The probability of problems with linux rental servers is bigger when using gcc 3.2. so using gcc 2.95.3 is just the safe way where my thoughts...

i'm just installing the cross compile stuff, so then metamod won't be a problem to have for both platforms ;-)
i will also try to make hpb_bot for win32 in linux. i acctualy never compiled win stuff on win, besides java stuff, but thats no win32 stuff *g*

OT:
guys the server is having a leak, a memory leak, the hlds is beyond 400mb ram, i wont kill it so someone who wants to can have a look at.

OT2:
we seem to got rid of the swap problem. it was the swap partition, the server is running on low mem for atleast 24 hrs and no crash or swap_free error in the logs for 10 days.

cheers memed

Pierre-Marie Baty 27-02-2004 19:59

Re: I'm STEAMed up !!!
 
About the memory leak, what are the plugins currently running ?

Onno Kreuzinger 27-02-2004 20:13

Re: I'm STEAMed up !!!
 
meta list
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] HPB_Bot RUN - hpb_bot_mm_i386. v4.0.0 ini Start ANY
[ 2] RealBot RUN - realbot_mm_i386. v2093 ini Start ANY
[ 3] HLIRC RUN - hlirc_mm_i386.so v4.0 ini ANY ANY
[ 4] Adminmod RUN - admin_MM_i386.so v2.50.58 ini Start Start

*atomrofl* i will exchange the realbot oldie *g* but it was a good proof to my swap theory 8D

now its:
meta list
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] HPB_Bot RUN - hpb_bot_mm_i386. v4.0.0 ini Start ANY
[ 2] RealBot RUN - realbot_mm_i386. v3005 ini Start ANY
[ 3] HLIRC RUN - hlirc_mm_i386.so v4.0 ini ANY ANY
[ 4] Adminmod RUN - admin_MM_i386.so v2.50.58 ini Start Start

anybody oposes installing a ping booster on the cs part of the server ?

oh damn it friday and they realy do the update now
jipie lets frag, it worked like expected =)

ok thre cross build fails, there are a lot of ver types messed up, ahh i just hate that
Code:

  engine_api.cpp: In function `void* mm_PvAllocEntPrivateData(edict_t*, int)':
  engine_api.cpp:391: error: invalid conversion from `void*(*)(edict_t*, long
    int)' to `void*(*)(edict_t*, int)'
  engine_api.cpp:391: error: invalid conversion from `void*(*)(edict_t*, long
    int)' to `void*(*)(edict_t*, int)'
  engine_api.cpp:391: error: invalid conversion from `void*(*)(edict_t*, long
    int)' to `void*(*)(edict_t*, int)'
  engine_api.cpp: In function `unsigned int mm_FunctionFromName(const char*)':
  engine_api.cpp:479: error: invalid conversion from `uint32 (*)(const char*)' to
    `unsigned int (*)(const char*)'
  engine_api.cpp:479: error: invalid conversion from `uint32 (*)(const char*)' to
    `unsigned int (*)(const char*)'
  engine_api.cpp:479: error: invalid conversion from `uint32 (*)(const char*)' to
    `unsigned int (*)(const char*)'
  engine_api.cpp: In function `const char* mm_NameForFunction(unsigned int)':
  engine_api.cpp:483: error: invalid conversion from `const char*(*)(long
    unsigned int)' to `const char*(*)(unsigned int)'
  engine_api.cpp:483: error: invalid conversion from `const char*(*)(long
    unsigned int)' to `const char*(*)(unsigned int)'
  engine_api.cpp:483: error: invalid conversion from `const char*(*)(long
    unsigned int)' to `const char*(*)(unsigned int)'
  engine_api.cpp: In function `int mm_RandomLong(int, int)':
  engine_api.cpp:534: error: invalid conversion from `int32 (*)(long int, long
    int)' to `int (*)(int, int)'
  engine_api.cpp:534: error: invalid conversion from `int32 (*)(long int, long
    int)' to `int (*)(int, int)'
  engine_api.cpp:534: error: invalid conversion from `int32 (*)(long int, long
    int)' to `int (*)(int, int)'
  engine_api.cpp: At global scope:
  engine_api.cpp:1045: error: invalid conversion from `void*(*)(edict_t*, int)'
    to `void*(*)(edict_t*, long int)'
  engine_api.cpp:1045: error: invalid conversion from `unsigned int (*)(const
    char*)' to `uint32 (*)(const char*)'
  engine_api.cpp:1045: error: invalid conversion from `const char*(*)(unsigned
    int)' to `const char*(*)(long unsigned int)'
  engine_api.cpp:1045: error: invalid conversion from `int (*)(int, int)' to `
    int32 (*)(long int, long int)'
  make: *** [debug.win32/engine_api.o] Error 1

hmm thats ugly, this seems to be a problem with the updates und mingw ...
http://www.bubblemod.org/forums/viewtopic.php?t=656

so the updates just broke mingw ?
would be to bad, allthough the error just looks like a simple typedef mistake.
sorry i'm low on time now, i will chek that later this weekend


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

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