Raised This Month: $ Target: $400
 0% 

[ORPHEU] Efficiency Help!!!!!!!!!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asur
Member
Join Date: Dec 2014
Old 12-31-2015 , 00:49   [ORPHEU] Efficiency Help!!!!!!!!!
Reply With Quote #1

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 .

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.
asur is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 12-31-2015 , 11:23   Re: [ORPHEU] Efficiency Help!!!!!!!!!
Reply With Quote #2

i dont know why you would use orpheu for such a simple task...
__________________
Depresie is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-31-2015 , 12:16   Re: [ORPHEU] Efficiency Help!!!!!!!!!
Reply With Quote #3

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.
__________________
Bugsy is offline
asur
Member
Join Date: Dec 2014
Old 01-01-2016 , 05:25   Re: [ORPHEU] Efficiency Help!!!!!!!!!
Reply With Quote #4

Quote:
Originally Posted by Depresie View Post
i dont know why you would use orpheu for such a simple task...
Quote:
Originally Posted by Bugsy View Post
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
asur 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 10:10.


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