Raised This Month: $ Target: $400
 0% 

port serverplugin_sample to CS:GO


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jimihendrix
Member
Join Date: May 2007
Old 09-19-2012 , 07:53   port serverplugin_sample to CS:GO
Reply With Quote #1

Hi
i test to port hl2sdk sample plugin serverplugin_sample to CSGO (i dont see sample in hl2sdk-csgo)
http://hg.alliedmods.net/hl2sdks

PHP Code:
class CEmptyServerPlugin: public IServerPluginCallbacks , public IGameEventListener2
{
public:
    
CEmptyServerPlugin();
    ~
CEmptyServerPlugin();

    
// IServerPluginCallbacks methods
    
virtual bool            Load(    CreateInterfaceFn interfaceFactoryCreateInterfaceFn gameServerFactory  ) = 0;
    
virtual void            Unloadvoid ) = 0;
    
virtual void            Pausevoid ) = 0;
    
virtual void            UnPausevoid ) = 0
    
virtual const char     *GetPluginDescriptionvoid ) = 0;      
    
virtual void            LevelInitchar const *pMapName ) = 0;
    
virtual void            ServerActivateedict_t *pEdictListint edictCountint clientMax ) = 0;
    
virtual void            GameFramebool simulating ) = 0;
    
virtual void            LevelShutdownvoid ) = 0;
    
virtual void            ClientActiveedict_t *pEntity ) = 0;
    
virtual void            ClientFullyConnectedict_t *pEntity ) = 0;
    
virtual void            ClientDisconnectedict_t *pEntity ) = 0;
    
virtual void            ClientPutInServeredict_t *pEntitychar const *playername ) = 0;
    
virtual void            SetCommandClientint index ) = 0;
    
virtual void            ClientSettingsChangededict_t *pEdict ) = 0;

    
virtual PLUGIN_RESULT    ClientConnectbool *bAllowConnectedict_t *pEntity, const char *pszName, const char *pszAddresschar *rejectint maxrejectlen ) = 0;
    
virtual PLUGIN_RESULT    ClientCommandedict_t *pEntity, const CCommand &args ) = 0;

    
virtual PLUGIN_RESULT    NetworkIDValidated( const char *pszUserName, const char *pszNetworkID ) = 0;
    
virtual void            OnQueryCvarValueFinishedQueryCvarCookie_t iCookieedict_t *pPlayerEntityEQueryCvarValueStatus eStatus, const char *pCvarName, const char *pCvarValue ) = 0;
    
virtual void            OnEdictAllocatededict_t *edict ) = 0;
    
virtual void            OnEdictFreed( const edict_t *edict  ) = 0;    

    
virtual void FireGameEventIGameEvent *event ) = 0;
    
virtual int     GetEventDebugIDvoid ) = 0;

private:
    
int m_iClientCommandIndex;
}; 
i have error c2259
cannot instantiate abstract class
in this line
CEmptyServerPlugin g_EmtpyServerPlugin;

in my plugin for port i have same error
how i fix it?
i add: COMPILER_MSVC;COMPILER_MSVC32;
vs2010

thanks
jimihendrix is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 09-19-2012 , 10:13   Re: port serverplugin_sample to CS:GO
Reply With Quote #2

actually there is i even managed to compile it just fine by adding 2 defines related to msvc
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
jimihendrix
Member
Join Date: May 2007
Old 09-19-2012 , 14:50   Re: port serverplugin_sample to CS:GO
Reply With Quote #3

Quote:
Originally Posted by Zephyrus View Post
actually there is i even managed to compile it just fine by adding 2 defines related to msvc
yes i add COMPILER_MSVC;COMPILER_MSVC32; to precompile options in msvc for remove all errors
i only have
cannot instantiate abstract class
in this line
CEmptyServerPlugin g_EmtpyServerPlugin


Last edited by jimihendrix; 09-19-2012 at 14:53.
jimihendrix is offline
donrevan
AlliedModders Donor
Join Date: Jul 2010
Old 09-19-2012 , 14:59   Re: port serverplugin_sample to CS:GO
Reply With Quote #4

Isn't the MM:S plugin "sample_mm" basicly the same as serverplugin_sample?
donrevan is offline
jimihendrix
Member
Join Date: May 2007
Old 09-19-2012 , 17:10   Re: port serverplugin_sample to CS:GO
Reply With Quote #5

yes, but my mod use MM and VSP

i think with simple fix compile ok, but i dont see the error

i add all references for IServerPluginCallbacks ,IGameEventListener2
jimihendrix is offline
Old and Slow
Senior Member
Join Date: May 2005
Location: Arlington, Texas
Old 09-19-2012 , 22:32   Re: port serverplugin_sample to CS:GO
Reply With Quote #6

I had to add the code to implement this method:

Code:
virtual int     GetEventDebugID( void ) = 0;
something like this:

Code:
int ]plugin-name]::GetEventDebugID ()
{
#if SOURCE_ENGINE >= SE_LEFT4DEAD
    return (EVENT_DEBUG_ID_INIT);
#else
    return (0);
#endif
}
You need to make sure that all of the virtual functions that end in
Code:
) = 0;
are implemented.
__________________
.......Chuck |TxA| Old and Slow [AARP]

Last edited by Old and Slow; 09-19-2012 at 22:33.
Old and Slow is offline
jimihendrix
Member
Join Date: May 2007
Old 09-20-2012 , 04:06   Re: port serverplugin_sample to CS:GO
Reply With Quote #7

Quote:
Originally Posted by Old and Slow View Post
I had to add the code to implement this method:

Code:
virtual int     GetEventDebugID( void ) = 0;
something like this:

Code:
int ]plugin-name]::GetEventDebugID ()
{
#if SOURCE_ENGINE >= SE_LEFT4DEAD
    return (EVENT_DEBUG_ID_INIT);
#else
    return (0);
#endif
}
You need to make sure that all of the virtual functions that end in
Code:
) = 0;
are implemented.
thanks for all replys
yes, look my code, all its ok but i have error

Last edited by jimihendrix; 09-20-2012 at 14:52.
jimihendrix 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:31.


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