AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ORPHEU] Efficiency Help!!!!!!!!! (https://forums.alliedmods.net/showthread.php?t=276950)

asur 12-31-2015 00:49

[ORPHEU] Efficiency Help!!!!!!!!!
 
Well guys I have silly question to ask about orpheu as I started playing with it nd i know the basics of orpheu concept but still some doubts are there . :oops:

Well suppose I want to block "chooseteam" command.
It can be done in 2 ways as following :

1. register_clcmd()
PHP Code:

register_clcmd"chooseteam""Hook_chooseteam")

public 
Hook_chooseteam(id)
     return 
PLUGIN_HANDLED 

2. Orpheu
PHP Code:

public plugin_init()
    
OrpheuRegisterHookOrpheuGetFunction("HandleMenu_ChooseTeam"), "HandleMenuTeam" )

public 
HandleMenuTeam(idmenu_choose)
    return 
OrpheuSupercede 

PHP Code:

{
    
"name"      "HandleMenu_ChooseTeam",
    
"library"   "mod",
    
"arguments" :
    [
        {
            
"type"  "CBasePlayer *"
        
},
        {
            
"type"  "int"
        
}
    ],
    
"identifiers":
    [
        {
            
"os"    "windows",
            
"mod"   "cstrike",
            
"value" : [0x83,0xEC,"*",0x8B,0x0D,"*","*","*","*",0x53,0x55,0x56,0x8B,0x74,0x24]
        },
        {
            
"os"    "linux",
            
"mod"   "cstrike",
            
"value" "_Z21HandleMenu_ChooseTeamP11CBasePlayeri"
        
}
    ]


My question is which of the 2 ways will be faster?
As my prediction is that orpheu will be faster as it is directly hooking the function but still if any1 can guide me please. :)

Depresie 12-31-2015 11:23

Re: [ORPHEU] Efficiency Help!!!!!!!!!
 
i dont know why you would use orpheu for such a simple task...

Bugsy 12-31-2015 12:16

Re: [ORPHEU] Efficiency Help!!!!!!!!!
 
You do not have to use orpheu just for the sake of using it. If the outcome is exactly the same with both, then do what is simpler..in this case with register_clcmd(). This also eliminates the dependency of a user having to install the orpheu library file. In some cases you have to use orpheu because it can do magical things that other hooks can't.

asur 01-01-2016 05:25

Re: [ORPHEU] Efficiency Help!!!!!!!!!
 
Quote:

Originally Posted by Depresie (Post 2378461)
i dont know why you would use orpheu for such a simple task...

Quote:

Originally Posted by Bugsy (Post 2378476)
You do not have to use orpheu just for the sake of using it. If the outcome is exactly the same with both, then do what is simpler..in this case with register_clcmd(). This also eliminates the dependency of a user having to install the orpheu library file. In some cases you have to use orpheu because it can do magical things that other hooks can't.

Well i was just experimenting but was in doubt that wether orpheu works faster than the normal way or not :).
Thanks


All times are GMT -4. The time now is 09:31.

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