[hlcoders] controlling spectatormode/mp_forcecamera per user? or blocking entity transmission?
Hey, In a serverplugin (for cstrike) is there any way to trick a dead player into a different spectatormode, as if mp_forcecamera is set to 1? Or a way to prevent the entity transmission to the specified client at a specified time. I'm thinking hooking gameevents and but not sure if that would work. What would work is to hook the cvar-replication code and make the changes there but I have no idea how. And you can't legally do it since the plugin api is not as flexible as good old metamod. I had to do the same thing in HL1, and couldn't. Then I got inspired by a plugin hullu made, and hooked AddToFullPack (post-gamedll) and blocked the player entities before transmission. It worked perfectly, the players spectating couldn't spectate anymore. Is there any way to achieve the same effect in Source? The thing i'm trying to do is to prevent the gamecenter-cheat-effect some of my regulars do. Two or more people join the server from the same gamecenter and look at each other's screens, so one's playing and the other one's showing him the positions of the enemies, etc. Currently my plugin detects this (more than one client with the same ip address) and turns on mp_forcecamera. But other players and also my admins (who often spectate players and ban cheaters, which we get a lot) complain. Any ideas? -- disq ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re[2]: [hlcoders] load plugin and debug
Hello, Monday, February 28, 2005, 5:38:38 AM, you wrote: BAS> Thanks kindly, I was missing a few files for the compile. mathlib.o for BAS> one. gots me a few bots running round a dedicated dm server now. btw, you BAS> mentioned min/max stuff, is there a min/max bot cvar setting for auto BAS> join/leave like other bots? I hadn't looked at the code much yet and after BAS> spending 12 hours today working on gcc upgrades and trying to compile this BAS> first example plugin I'm completely wiped out. i don't know, try "cvarlist bot_" :) i was speaking strictly about the "#include minmax.h" stuff you need to reorder to get it to compile on linux. (well, at least on slackware) -- disq ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] load plugin and debug
Hello, the correct syntax would be like this: "Plugin" { "file" "../cstrike/addons/serverplugin_empty" } if the .so/.dll file is located in cstrike/addons/ or you can just use "file" "serverplugin_empty" and place the file in mainsourcedir/bin/ btw, my plugin won't load if i don't compile in the *_bot.cpp/.o parts. (it fails to load even when i compile in the bot stuff and don't initialize the botmanager) Monday, February 28, 2005, 4:21:30 AM, you wrote: BAS> This is driving me crazy. I've searched and searched and tried everything BAS> I've found to no avail. Trying to just compile the serverplugin_empty.so. BAS> It compiles fine with or without the bot.cpp included. so I copy it to BAS> hl2mp/addons and use a file called empty.vdf in same dir that says: -- disq ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re[2]: [hlcoders] make plugin (linux)
Hello, Monday, February 28, 2005, 12:38:06 AM, you wrote: BAS> http://www.sourcewiki.org/wiki/index.php/Compiling_Debian actually i just adjusted the paths in the main "Makefile" and i'm using that to compile my plugin. the only other thing i had to do was to change the order of some "#include" statements in some of the headers to get it (the min/max stuff) to compile in linux. ah also make sure you add "." to LD_LIBRARY_PATH (well, "LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH make" works for me) or it won't be able to find the shared objects (.so's) while linking. example makefile vars for serverplugin_empty: NAME=serverplugin_empty MOD_PROJ=../utils/serverplugin_sample/serverplugin_empty.vcproj MOD_CONFIG=serverplugin_empty_ReleaseWin32 GAME_DIR=/path/to/source/installation/dir just remember, if you're developing the stuff on linux you have to edit the .vcproj files manually to and add your files and dependency objects. (or else it either won't compile or srcds won't be able to load the plugin) -- disq ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re[2]: [hlcoders] unloading plugins, playerinfomanager and cvars
Hello, Friday, February 25, 2005, 2:41:42 PM, you wrote: MvdZ> You pass an integer to the constructor of the second, it should be a MvdZ> string, like the first one. Thanks, fixed it. Tho i'm still disappointed with the plugin API, especially concommands not getting unregistered when plugins are unloaded, etc. issues i've seen are: 1. the destructor never gets called on plugin unload. 2. no way to unregister plugin commands (and cvars), without messing with the (internal) concommand linked list of the engine. I added a g_plugin_isloaded boolean var, which i set to false on ::Unload(), and the concommands return immediately if it's false. 3. unload a plugin, update the binary file (.so) and then reload it. you'll see it loaded the old version, again. (or it might just crash) to update a plugin binary without restarting the server, you have to first plugin_unload, copy the new .so with a different name (like plugin2_i486.so) and then plugin_load the new file. needless to say after a few trials your "addons" dir is flooded with unused binaries. 4. if a plugin can't be loaded you don't see the error message. alfred was looking into this tho. anyway, hope valve resolves these issues. -- disq ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] unloading plugins, playerinfomanager and cvars
Hi, I'm having some problems on my serverplugin and i need some help. here are the issues: 1. When i unload my plugin via plugin_unload, it's CON_COMMANDS and cvar are still in place. Is there something I should do in MyPlugin::Unload() to unregister the concommands/cvars? (also the plugin might be still running, i didn't check that) 2. The code below is from the function that is called on plugin load, to populate a struct array "serverPlayers[]" with the currently connected player information. It is called in the constructor so you can unload/load a new version while the map is running and players connected. But it's crashing, take a look: (..snip..) for(int i=0;i<65;i++) { edict_t *pEntity = engine->PEntityOfEntIndex(i); if (!pEntity || pEntity->IsFree()) continue; IPlayerInfo *playerinfo=playerinfomanager->GetPlayerInfo(pEntity); if (!playerinfo) continue; //crashes right here! if (!playerinfo->IsConnected()) continue; // } (..snip..) I'm not a big fan of saving playerList/maxClients that are passed to serverActivate, because it won't be called if the plugin is loaded after the server initialization. My plugin needs to be loadable/unloadable any time (so I can develop without disturbing the server crowd) 3. The code seems to crash if i register more than one CVAR, but i'm still investigating that. Code is like this: static ConVar myp_cvar1("myp_cvar1", "", FCVAR_PLUGIN | FCVAR_PROTECTED, "first cvar"); static ConVar myp_cvar2("myp_cvar2", 1, FCVAR_PLUGIN | FCVAR_PROTECTED, "second cvar"); //crash here! Any suggestions? I'm developing this plugin on Linux. (it took some effort to get it to compile already :p ) It's currently in testing on two of my servers without these three features and it's running without any problems for a few days now. Thanks, -- disq ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders