Raised This Month: $51 Target: $400
 12% 

Module: Orpheu (v2.6.3)


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-29-2010 , 09:09   Re: Module: Orpheu2.1 (added memory hacking and virtual functions support)
Reply With Quote #41

From what I'm seeing It's not really the same for CS, though the part to retrieve -maxplayers value is the same.

You could easily replacing all the "32" reference, but I'm not sure that it would be enough.
__________________
Arkshine is offline
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 01-29-2010 , 09:17   Re: Module: Orpheu2.1 (added memory hacking and virtual functions support)
Reply With Quote #42

Anyway I ask, can slots be changed in runtime? (Since off course orpheu works in runtime)
01101101 is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 01-29-2010 , 09:55   Re: Module: Orpheu2.1 (added memory hacking and virtual functions support)
Reply With Quote #43

Changing the slots was once possible with a plugin that used memhack. I don't know if it still is but maybe. Making it bigger than 32 is almost impossible and you would also have to patch all the clients.
joaquimandrade is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 01-29-2010 , 10:39   Re: Module: Orpheu2.1 (added memory hacking and virtual functions support)
Reply With Quote #44

Quote:
Originally Posted by joaquimandrade View Post
Changing the slots was once possible with a plugin that used memhack. I don't know if it still is but maybe. Making it bigger than 32 is almost impossible and you would also have to patch all the clients.
Why patch clients?

As I understand, the client can connect and gets disconnected if server is full of players.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 01-29-2010 , 10:40   Re: Module: Orpheu2.1 (added memory hacking and virtual functions support)
Reply With Quote #45

Quote:
Originally Posted by joropito View Post
Why patch clients?

As I understand, the client can connect and gets disconnected if server is full of players.
Because, i guess, they have to store information from all the clients.
joaquimandrade is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 01-29-2010 , 16:09   Re: Module: Orpheu2.1 (added memory hacking and virtual functions support)
Reply With Quote #46

I was testing TFC (and it was the first time I played it ) so I'm sharing some files for functions of it.

This is the script I've tested it

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

#include <orpheu>

public plugin_precache()
{
    new 
OrpheuFunction:TeamFortress_Concuss OrpheuGetFunctionFromClass("player","TeamFortress_Concuss","CBaseEntity")
    
OrpheuRegisterHook(TeamFortress_Concuss,"OnTeamFortress_Concuss")
    
    new 
OrpheuFunction:TF_TakeConcussionBlast OrpheuGetFunctionFromClass("player","TeamFortress_TakeConcussionBlast","CBaseEntity")
    
OrpheuRegisterHook(TF_TakeConcussionBlast,"OnTF_TakeConcussionBlast")
}

public 
OnTeamFortress_Concuss(id,ent)
{
    static 
classname[32]
    
pev(ent,pev_classname,classname,31)
        
    
server_print("Concuss %d %s",id,classname)
    
client_print(0,print_console,"Concuss %d %s",id,classname)
}

public 
OnTF_TakeConcussionBlast(id,ent,Float:x)
{
    
OrpheuSetParam(3,1000.0)
        
    
server_print("Concuss %d %d",id,ent)
    
client_print(0,print_console,"Concuss %d %d %f",id,ent,x)

The change of the float parameter made me fly
Extract files to the folder "orpheu/configs"
Attached Files
File Type: sma Get Plugin or Get Source (orpheu.sma - 1012 views - 974 Bytes)
File Type: zip tfc.zip (2.9 KB, 216 views)
joaquimandrade is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-29-2010 , 18:33   Re: Module: Orpheu2.1 (added memory hacking and virtual functions support)
Reply With Quote #47

Even if you manage to make a more than 32 slots server, game will be buggy as lot of vars can only handle 32 clients like vars that handle a mask of players.
Eample i have in mind is HurtTouch from triggers.cpp :
Code:
	// HACKHACK -- In multiplayer, players touch this based on packet receipt.
	// So the players who send packets later aren't always hurt.  Keep track of
	// how much time has passed and whether or not you've touched that player
	if ( g_pGameRules->IsMultiplayer() )
	{
		if ( pev->dmgtime > gpGlobals->time )
		{
			if ( gpGlobals->time != pev->pain_finished )
			{// too early to hurt again, and not same frame with a different entity
				if ( pOther->IsPlayer() )
				{
					int playerMask = 1 << (pOther->entindex() - 1);

					// If I've already touched this player (this time), then bail out
					if ( pev->impulse & playerMask )
						return;

					// Mark this player as touched
					// BUGBUG - There can be only 32 players!
					pev->impulse |= playerMask;
				}
				else
				{
					return;
				}
			}
		}
		else
		{
			// New clock, "un-touch" all players
			pev->impulse = 0;
			if ( pOther->IsPlayer() )
			{
				int playerMask = 1 << (pOther->entindex() - 1);

				// Mark this player as touched
				// BUGBUG - There can be only 32 players!
				pev->impulse |= playerMask;
			}
		}
	}
That should not be the only place where such things exists.

And last, i think that 2 times some dudes found a way to change maxplayers, and those 2 times steam made an update to prevent it, and i think that would be unfair to change maxplayer if you rent a server.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 01-29-2010 , 18:36   Re: Module: Orpheu2.1 (added memory hacking and virtual functions support)
Reply With Quote #48

Quote:
Originally Posted by ConnorMcLeod View Post
Even if you manage to make a more than 32 slots server, game will be buggy as lot of vars can only handle 32 clients like vars that handle a mask of players.
Eample i have in mind is HurtTouch from triggers.cpp :
Yes, and in function that uses the constant MAX_PLAYERS or something like that.

I think the hardcoded limit of 32 players is associated with 32-bit processors and the code simplification.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 01-29-2010 , 19:17   Re: Module: Orpheu2.1 (added memory hacking and virtual functions support)
Reply With Quote #49

Quote:
Originally Posted by joropito View Post
Yes, and in function that uses the constant MAX_PLAYERS or something like that.

I think the hardcoded limit of 32 players is associated with 32-bit processors and the code simplification.
I don't get the relation of 32 players and 32 bit processors
01101101 is offline
Old 01-29-2010, 19:20
joropito
This message has been deleted by joropito. Reason: nvn
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-29-2010 , 19:23   Re: Module: Orpheu2.1 (added memory hacking and virtual functions support)
Reply With Quote #50

32-bit processors can only hold 32-bit values.

Binary:
1111 1111 1111 1111 1111 1111 1111 1111
Decimal:
4294967295

Parts of the game like Connor showed use bitsums of player indexes.
Code:
int playerMask = 1 << (pOther->entindex() - 1);
The max you can shift 1 left is 31 positions.

Binary:
1000 0000 0000 0000 0000 0000 0000 0000 (player id 32 -> 1<<(32-1) -> 1<<31)
Decimal:
2147483648

2147483648 is less than 4294967295.

Binary:
0001 0000 0000 0000 0000 0000 0000 0000 0000 (player id 33 -> 1<<(33-1) -> 1<<32)
Decimal:
4294967296

4294967296 is greater than 4294967295, thus causing errors since the 32-bit processor cannot hold such a large number.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 01-29-2010 at 19:26.
Exolent[jNr] is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode