Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Toggle ability to stub undefined natives #5

Open
jaredballou opened this issue Aug 4, 2016 · 6 comments
Open

Toggle ability to stub undefined natives #5

jaredballou opened this issue Aug 4, 2016 · 6 comments

Comments

@jaredballou
Copy link

Is it possible to have a "debug toggle" or something similar to attempt execution of a plugin via the runtime to warn instead of dying when hitting an undefined native? Ideally, I'd like to be able to have it spit out a list of the native calls it was not able to run, so that the plugin would attempt to continue running and show me the natives we need to implement. I understand that this would break the ability to accurately run the plugin, but I think this might be a good way to let us push through tests of the implemented functions, and produce a useful output that can be sent to us so that we can see what natives PySMX users want to see implemented.

@jaredballou
Copy link
Author

What I am thinking of doing is having a class that reads all the Inc files in the include directory, and spits out properly formatted and documented @Native stubs that accept the parameters and print them. Then those can be used as a base to work from.

@jaredballou
Copy link
Author

Just stubbing some out so I can understand how this thing works. But, if you can help me do one archetype function from each include, and have it save some basic mapping that is usable, I can start doing the other natives. https://github.com/jaredballou/pysmx/blob/master/smx/sourcemod.py if you want to peek.

@theY4Kman
Copy link
Owner

FYI: I've revisited the native system, and brought it into py3 world. Now, instead of manually specifying @native('cell', 'int', ...), type annotations are used. I'm slowly adding more natives, and I'm using pawn-docgen's DB to grab the list of all natives.

Here's the list so far, with check marks for implemented ones:

Natives List
admin.inc                    DumpAdminCache                       
admin.inc                    AddCommandOverride                   
admin.inc                    GetCommandOverride                   
admin.inc                    UnsetCommandOverride                 
admin.inc                    CreateAdmGroup                       
admin.inc                    FindAdmGroup                         
admin.inc                    SetAdmGroupAddFlag                   
admin.inc                    GetAdmGroupAddFlag                   
admin.inc                    GetAdmGroupAddFlags                  
admin.inc                    SetAdmGroupImmunity                  
admin.inc                    GetAdmGroupImmunity                  
admin.inc                    SetAdmGroupImmuneFrom                
admin.inc                    GetAdmGroupImmuneCount               
admin.inc                    GetAdmGroupImmuneFrom                
admin.inc                    AddAdmGroupCmdOverride               
admin.inc                    GetAdmGroupCmdOverride               
admin.inc                    RegisterAuthIdentType                
admin.inc                    CreateAdmin                          
admin.inc                    GetAdminUsername                     
admin.inc                    BindAdminIdentity                    
admin.inc                    SetAdminFlag                         
admin.inc                    GetAdminFlag                         
admin.inc                    GetAdminFlags                        
admin.inc                    AdminInheritGroup                    
admin.inc                    GetAdminGroupCount                   
admin.inc                    GetAdminGroup                        
admin.inc                    SetAdminPassword                     
admin.inc                    GetAdminPassword                     
admin.inc                    FindAdminByIdentity                  
admin.inc                    RemoveAdmin                          
admin.inc                    FlagBitsToBitArray                   
admin.inc                    FlagBitArrayToBits                   
admin.inc                    FlagArrayToBits                      
admin.inc                    FlagBitsToArray                      
admin.inc                    FindFlagByName                       
admin.inc                    FindFlagByChar                       
admin.inc                    FindFlagChar                         
admin.inc                    ReadFlagString                       
admin.inc                    CanAdminTarget                       
admin.inc                    CreateAuthMethod                     
admin.inc                    SetAdmGroupImmunityLevel             
admin.inc                    GetAdmGroupImmunityLevel             
admin.inc                    SetAdminImmunityLevel                
admin.inc                    GetAdminImmunityLevel                
adminmenu.inc                GetAdminTopMenu                      
adminmenu.inc                AddTargetsToMenu2                    
adt_array.inc                CreateArray                          
adt_array.inc                ClearArray                           
adt_array.inc                CloneArray                           
adt_array.inc                ResizeArray                          
adt_array.inc                GetArraySize                         
adt_array.inc                PushArrayCell                        
adt_array.inc                PushArrayString                      
adt_array.inc                PushArrayArray                       
adt_array.inc                GetArrayCell                         
adt_array.inc                GetArrayString                       
adt_array.inc                GetArrayArray                        
adt_array.inc                SetArrayCell                         
adt_array.inc                SetArrayString                       
adt_array.inc                SetArrayArray                        
adt_array.inc                ShiftArrayUp                         
adt_array.inc                RemoveFromArray                      
adt_array.inc                SwapArrayItems                       
adt_array.inc                FindStringInArray                    
adt_array.inc                FindValueInArray                     
adt_array.inc                GetArrayBlockSize                    
adt_stack.inc                CreateStack                          
adt_stack.inc                PushStackCell                        
adt_stack.inc                PushStackString                      
adt_stack.inc                PushStackArray                       
adt_stack.inc                PopStackCell                         
adt_stack.inc                PopStackString                       
adt_stack.inc                PopStackArray                        
adt_stack.inc                IsStackEmpty                         
adt_stack.inc                GetStackBlockSize                    
adt_trie.inc                 CreateTrie                           
adt_trie.inc                 SetTrieValue                         
adt_trie.inc                 SetTrieArray                         
adt_trie.inc                 SetTrieString                        
adt_trie.inc                 GetTrieValue                         
adt_trie.inc                 GetTrieArray                         
adt_trie.inc                 GetTrieString                        
adt_trie.inc                 RemoveFromTrie                       
adt_trie.inc                 ClearTrie                            
adt_trie.inc                 GetTrieSize                          
adt_trie.inc                 CreateTrieSnapshot                   
adt_trie.inc                 TrieSnapshotLength                   
adt_trie.inc                 TrieSnapshotKeyBufferSize            
adt_trie.inc                 GetTrieSnapshotKey                   
basecomm.inc                 BaseComm_IsClientGagged              
basecomm.inc                 BaseComm_IsClientMuted               
basecomm.inc                 BaseComm_SetClientGag                
basecomm.inc                 BaseComm_SetClientMute               
bitbuffer.inc                BfWriteBool                          
bitbuffer.inc                BfWriteByte                          
bitbuffer.inc                BfWriteChar                          
bitbuffer.inc                BfWriteShort                         
bitbuffer.inc                BfWriteWord                          
bitbuffer.inc                BfWriteNum                           
bitbuffer.inc                BfWriteFloat                         
bitbuffer.inc                BfWriteString                        
bitbuffer.inc                BfWriteEntity                        
bitbuffer.inc                BfWriteAngle                         
bitbuffer.inc                BfWriteCoord                         
bitbuffer.inc                BfWriteVecCoord                      
bitbuffer.inc                BfWriteVecNormal                     
bitbuffer.inc                BfWriteAngles                        
bitbuffer.inc                BfReadBool                           
bitbuffer.inc                BfReadByte                           
bitbuffer.inc                BfReadChar                           
bitbuffer.inc                BfReadShort                          
bitbuffer.inc                BfReadWord                           
bitbuffer.inc                BfReadNum                            
bitbuffer.inc                BfReadFloat                          
bitbuffer.inc                BfReadString                         
bitbuffer.inc                BfReadEntity                         
bitbuffer.inc                BfReadAngle                          
bitbuffer.inc                BfReadCoord                          
bitbuffer.inc                BfReadVecCoord                       
bitbuffer.inc                BfReadVecNormal                      
bitbuffer.inc                BfReadAngles                         
bitbuffer.inc                BfGetNumBytesLeft                    
clientprefs.inc              RegClientCookie                      
clientprefs.inc              FindClientCookie                     
clientprefs.inc              SetClientCookie                      
clientprefs.inc              GetClientCookie                      
clientprefs.inc              SetAuthIdCookie                      
clientprefs.inc              AreClientCookiesCached               
clientprefs.inc              SetCookiePrefabMenu                  
clientprefs.inc              SetCookieMenuItem                    
clientprefs.inc              ShowCookieMenu                       
clientprefs.inc              GetCookieIterator                    
clientprefs.inc              GetCookieAccess                      
clientprefs.inc              GetClientCookieTime                  
clients.inc                  GetMaxClients                        
clients.inc                  GetMaxHumanPlayers                   
clients.inc                  GetClientCount                       
clients.inc                  GetClientName                        
clients.inc                  GetClientIP                          
clients.inc                  GetClientAuthString                  
clients.inc                  GetClientAuthId                      
clients.inc                  GetSteamAccountID                    
clients.inc                  GetClientUserId                      
clients.inc                  IsClientConnected                    
clients.inc                  IsClientInGame                       
clients.inc                  IsClientInKickQueue                  
clients.inc                  IsClientAuthorized                   
clients.inc                  IsFakeClient                         
clients.inc                  IsClientSourceTV                     
clients.inc                  IsClientReplay                       
clients.inc                  IsClientObserver                     
clients.inc                  IsPlayerAlive                        
clients.inc                  GetClientInfo                        
clients.inc                  GetClientTeam                        
clients.inc                  SetUserAdmin                         
clients.inc                  GetUserAdmin                         
clients.inc                  AddUserFlags                         
clients.inc                  RemoveUserFlags                      
clients.inc                  SetUserFlagBits                      
clients.inc                  GetUserFlagBits                      
clients.inc                  CanUserTarget                        
clients.inc                  RunAdminCacheChecks                  
clients.inc                  NotifyPostAdminCheck                 
clients.inc                  CreateFakeClient                     
clients.inc                  SetFakeClientConVar                  
clients.inc                  GetClientHealth                      
clients.inc                  GetClientModel                       
clients.inc                  GetClientWeapon                      
clients.inc                  GetClientMaxs                        
clients.inc                  GetClientMins                        
clients.inc                  GetClientAbsAngles                   
clients.inc                  GetClientAbsOrigin                   
clients.inc                  GetClientArmor                       
clients.inc                  GetClientDeaths                      
clients.inc                  GetClientFrags                       
clients.inc                  GetClientDataRate                    
clients.inc                  IsClientTimingOut                    
clients.inc                  GetClientTime                        
clients.inc                  GetClientLatency                     
clients.inc                  GetClientAvgLatency                  
clients.inc                  GetClientAvgLoss                     
clients.inc                  GetClientAvgChoke                    
clients.inc                  GetClientAvgData                     
clients.inc                  GetClientAvgPackets                  
clients.inc                  GetClientOfUserId                    
clients.inc                  KickClient                           
clients.inc                  KickClientEx                         
clients.inc                  ChangeClientTeam                     
clients.inc                  GetClientSerial                      
clients.inc                  GetClientFromSerial                  
commandfilters.inc           RemoveMultiTargetFilter              
commandline.inc              GetCommandLine                       
commandline.inc              GetCommandLineParam                  
commandline.inc              GetCommandLineParamInt               
commandline.inc              GetCommandLineParamFloat             
commandline.inc              FindCommandLineParam                 
console.inc                  ServerCommand                        
console.inc                  ServerCommandEx                      
console.inc                  InsertServerCommand                  
console.inc                  ServerExecute                        
console.inc                  ClientCommand                        
console.inc                  FakeClientCommand                    
console.inc                  FakeClientCommandEx                  
console.inc                  FakeClientCommandKeyValues           
console.inc                  PrintToServer                        ✔️
console.inc                  PrintToConsole                       
console.inc                  ReplyToCommand                       
console.inc                  GetCmdReplySource                    
console.inc                  SetCmdReplySource                    
console.inc                  IsChatTrigger                        
console.inc                  ShowActivity2                        
console.inc                  ShowActivity                         
console.inc                  ShowActivityEx                       
console.inc                  FormatActivitySource                 
console.inc                  RegServerCmd                         
console.inc                  RegConsoleCmd                        
console.inc                  GetCmdArgs                           
console.inc                  GetCmdArg                            
console.inc                  GetCmdArgString                      
console.inc                  GetCommandIterator                   
console.inc                  GetCommandFlags                      
console.inc                  SetCommandFlags                      
console.inc                  FindFirstConCommand                  
console.inc                  FindNextConCommand                   
console.inc                  AddServerTag                         
console.inc                  RemoveServerTag                      
console.inc                  AddCommandListener                   
console.inc                  RemoveCommandListener                
convars.inc                  FindConVar                           
convars.inc                  HookConVarChange                     
convars.inc                  UnhookConVarChange                   
convars.inc                  GetConVarBool                        
convars.inc                  SetConVarBool                        
convars.inc                  GetConVarInt                         ✔️
convars.inc                  SetConVarInt                         
convars.inc                  GetConVarFloat                       ✔️
convars.inc                  SetConVarFloat                       
convars.inc                  GetConVarString                      ✔️
convars.inc                  SetConVarString                      
convars.inc                  ResetConVar                          
convars.inc                  GetConVarDefault                     
convars.inc                  GetConVarFlags                       
convars.inc                  SetConVarFlags                       
convars.inc                  GetConVarBounds                      
convars.inc                  SetConVarBounds                      
convars.inc                  GetConVarName                        
convars.inc                  SendConVarValue                      
convars.inc                  QueryClientConVar                    
core.inc                     IsNullVector                         
core.inc                     IsNullString                         
core.inc                     VerifyCoreVersion                    
core.inc                     MarkNativeAsOptional                 
cstrike.inc                  CS_RespawnPlayer                     
cstrike.inc                  CS_SwitchTeam                        
cstrike.inc                  CS_DropWeapon                        
cstrike.inc                  CS_TerminateRound                    
cstrike.inc                  CS_GetTranslatedWeaponAlias          
cstrike.inc                  CS_GetWeaponPrice                    
cstrike.inc                  CS_GetClientClanTag                  
cstrike.inc                  CS_SetClientClanTag                  
cstrike.inc                  CS_GetTeamScore                      
cstrike.inc                  CS_SetTeamScore                      
cstrike.inc                  CS_GetMVPCount                       
cstrike.inc                  CS_SetMVPCount                       
cstrike.inc                  CS_GetClientContributionScore        
cstrike.inc                  CS_SetClientContributionScore        
cstrike.inc                  CS_GetClientAssists                  
cstrike.inc                  CS_SetClientAssists                  
cstrike.inc                  CS_AliasToWeaponID                   
cstrike.inc                  CS_WeaponIDToAlias                   
cstrike.inc                  CS_IsValidWeaponID                   
cstrike.inc                  CS_UpdateClientModel                 
cstrike.inc                  CS_ItemDefIndexToID                  
cstrike.inc                  CS_WeaponIDToItemDefIndex            
datapack.inc                 CreateDataPack                       
datapack.inc                 WritePackCell                        
datapack.inc                 WritePackFloat                       
datapack.inc                 WritePackString                      
datapack.inc                 WritePackFunction                    
datapack.inc                 ReadPackCell                         
datapack.inc                 ReadPackFloat                        
datapack.inc                 ReadPackString                       
datapack.inc                 ReadPackFunction                     
datapack.inc                 ResetPack                            
datapack.inc                 GetPackPosition                      
datapack.inc                 SetPackPosition                      
datapack.inc                 IsPackReadable                       
dbi.inc                      SQL_Connect                          
dbi.inc                      SQL_CheckConfig                      
dbi.inc                      SQL_GetDriver                        
dbi.inc                      SQL_ReadDriver                       
dbi.inc                      SQL_GetDriverIdent                   
dbi.inc                      SQL_GetDriverProduct                 
dbi.inc                      SQL_SetCharset                       
dbi.inc                      SQL_GetAffectedRows                  
dbi.inc                      SQL_GetInsertId                      
dbi.inc                      SQL_GetError                         
dbi.inc                      SQL_FormatQuery                      
dbi.inc                      SQL_FastQuery                        
dbi.inc                      SQL_Query                            
dbi.inc                      SQL_PrepareQuery                     
dbi.inc                      SQL_FetchMoreResults                 
dbi.inc                      SQL_HasResultSet                     
dbi.inc                      SQL_GetRowCount                      
dbi.inc                      SQL_GetFieldCount                    
dbi.inc                      SQL_FieldNumToName                   
dbi.inc                      SQL_FieldNameToNum                   
dbi.inc                      SQL_FetchRow                         
dbi.inc                      SQL_MoreRows                         
dbi.inc                      SQL_Rewind                           
dbi.inc                      SQL_FetchString                      
dbi.inc                      SQL_FetchFloat                       
dbi.inc                      SQL_FetchInt                         
dbi.inc                      SQL_IsFieldNull                      
dbi.inc                      SQL_FetchSize                        
dbi.inc                      SQL_BindParamInt                     
dbi.inc                      SQL_BindParamFloat                   
dbi.inc                      SQL_BindParamString                  
dbi.inc                      SQL_Execute                          
dbi.inc                      SQL_LockDatabase                     
dbi.inc                      SQL_UnlockDatabase                   
dbi.inc                      SQL_IsSameConnection                 
dbi.inc                      SQL_TConnect                         
dbi.inc                      SQL_TQuery                           
dbi.inc                      SQL_CreateTransaction                
dbi.inc                      SQL_AddQuery                         
dhooks.inc                   DHookAddEntityListener               
dhooks.inc                   DHookRemoveEntityListener            
dhooks.inc                   DHookCreate                          
dhooks.inc                   DHookCreateDetour                    
dhooks.inc                   DHookCreateFromConf                  
dhooks.inc                   DHookSetFromConf                     
dhooks.inc                   DHookEnableDetour                    
dhooks.inc                   DHookDisableDetour                   
dhooks.inc                   DHookAddParam                        
dhooks.inc                   DHookEntity                          
dhooks.inc                   DHookGamerules                       
dhooks.inc                   DHookRaw                             
dhooks.inc                   DHookRemoveHookID                    
dhooks.inc                   DHookGetParam                        
dhooks.inc                   DHookGetParamVector                  
dhooks.inc                   DHookGetParamString                  
dhooks.inc                   DHookSetParam                        
dhooks.inc                   DHookSetParamVector                  
dhooks.inc                   DHookSetParamString                  
dhooks.inc                   DHookGetReturn                       
dhooks.inc                   DHookGetReturnVector                 
dhooks.inc                   DHookGetReturnString                 
dhooks.inc                   DHookSetReturn                       
dhooks.inc                   DHookSetReturnVector                 
dhooks.inc                   DHookSetReturnString                 
dhooks.inc                   DHookGetParamObjectPtrVar            
dhooks.inc                   DHookSetParamObjectPtrVar            
dhooks.inc                   DHookGetParamObjectPtrVarVector      
dhooks.inc                   DHookSetParamObjectPtrVarVector      
dhooks.inc                   DHookGetParamObjectPtrString         
dhooks.inc                   DHookIsNullParam                     
dhooks.inc                   DHookGetParamAddress                 
entity.inc                   GetMaxEntities                       
entity.inc                   GetEntityCount                       
entity.inc                   IsValidEntity                        
entity.inc                   IsValidEdict                         
entity.inc                   IsEntNetworkable                     
entity.inc                   CreateEdict                          
entity.inc                   RemoveEdict                          
entity.inc                   RemoveEntity                         
entity.inc                   GetEdictFlags                        
entity.inc                   SetEdictFlags                        
entity.inc                   GetEdictClassname                    
entity.inc                   GetEntityNetClass                    
entity.inc                   ChangeEdictState                     
entity.inc                   GetEntData                           
entity.inc                   SetEntData                           
entity.inc                   GetEntDataFloat                      
entity.inc                   SetEntDataFloat                      
entity.inc                   GetEntDataEnt                        
entity.inc                   SetEntDataEnt                        
entity.inc                   GetEntDataEnt2                       
entity.inc                   SetEntDataEnt2                       
entity.inc                   GetEntDataVector                     
entity.inc                   SetEntDataVector                     
entity.inc                   GetEntDataString                     
entity.inc                   SetEntDataString                     
entity.inc                   FindSendPropOffs                     
entity.inc                   GetEntProp                           
entity.inc                   SetEntProp                           
entity.inc                   GetEntPropFloat                      
entity.inc                   SetEntPropFloat                      
entity.inc                   GetEntPropEnt                        
entity.inc                   SetEntPropEnt                        
entity.inc                   GetEntPropVector                     
entity.inc                   SetEntPropVector                     
entity.inc                   GetEntPropString                     
entity.inc                   SetEntPropString                     
entity.inc                   GetEntPropArraySize                  
entity.inc                   GetEntityAddress                     
entity_prop_stocks.inc       GetEntityFlags                       
entity_prop_stocks.inc       SetEntityFlags                       
events.inc                   HookEvent                            
events.inc                   HookEventEx                          
events.inc                   UnhookEvent                          
events.inc                   CreateEvent                          
events.inc                   FireEvent                            
events.inc                   CancelCreatedEvent                   
events.inc                   GetEventBool                         
events.inc                   SetEventBool                         
events.inc                   GetEventInt                          
events.inc                   SetEventInt                          
events.inc                   GetEventFloat                        
events.inc                   SetEventFloat                        
events.inc                   GetEventString                       
events.inc                   SetEventString                       
events.inc                   GetEventName                         
events.inc                   SetEventBroadcast                    
files.inc                    BuildPath                            ✔️
files.inc                    OpenDirectory                        
files.inc                    ReadDirEntry                         
files.inc                    OpenFile                             ✔️
files.inc                    DeleteFile                           
files.inc                    ReadFileLine                         
files.inc                    ReadFile                             
files.inc                    ReadFileString                       
files.inc                    WriteFile                            
files.inc                    WriteFileString                      
files.inc                    WriteFileLine                        
files.inc                    IsEndOfFile                          
files.inc                    FileSeek                             
files.inc                    FilePosition                         
files.inc                    FileExists                           
files.inc                    RenameFile                           
files.inc                    DirExists                            
files.inc                    FileSize                             
files.inc                    FlushFile                            
files.inc                    RemoveDir                            
files.inc                    CreateDirectory                      
files.inc                    SetFilePermissions                   
files.inc                    GetFileTime                          
files.inc                    LogToOpenFile                        
files.inc                    LogToOpenFileEx                      
float.inc                    float                                
float.inc                    FloatMul                             ✔️
float.inc                    FloatDiv                             ✔️
float.inc                    FloatAdd                             ✔️
float.inc                    FloatSub                             ✔️
float.inc                    FloatFraction                        ✔️
float.inc                    RoundToZero                          ✔️
float.inc                    RoundToCeil                          ✔️
float.inc                    RoundToFloor                         ✔️
float.inc                    RoundToNearest                       ✔️
float.inc                    FloatCompare                         ✔️
float.inc                    SquareRoot                           ✔️
float.inc                    Pow                                  ✔️
float.inc                    Exponential                          ✔️
float.inc                    Logarithm                            ✔️
float.inc                    Sine                                 ✔️
float.inc                    Cosine                               ✔️
float.inc                    Tangent                              ✔️
float.inc                    FloatAbs                             ✔️
float.inc                    ArcTangent                           
float.inc                    ArcCosine                            ✔️
float.inc                    ArcSine                              ✔️
float.inc                    ArcTangent2                          ✔️
float.inc                    __FLOAT_GT__                         
float.inc                    __FLOAT_GE__                         
float.inc                    __FLOAT_LT__                         
float.inc                    __FLOAT_LE__                         
float.inc                    __FLOAT_EQ__                         
float.inc                    __FLOAT_NE__                         
float.inc                    __FLOAT_NOT__                        
float.inc                    GetURandomInt                        
float.inc                    GetURandomFloat                      
float.inc                    SetURandomSeed                       
functions.inc                GetFunctionByName                    
functions.inc                CreateGlobalForward                  
functions.inc                CreateForward                        
functions.inc                GetForwardFunctionCount              
functions.inc                AddToForward                         
functions.inc                RemoveFromForward                    
functions.inc                RemoveAllFromForward                 
functions.inc                Call_StartForward                    
functions.inc                Call_StartFunction                   
functions.inc                Call_PushCell                        
functions.inc                Call_PushCellRef                     
functions.inc                Call_PushFloat                       
functions.inc                Call_PushFloatRef                    
functions.inc                Call_PushArray                       
functions.inc                Call_PushArrayEx                     
functions.inc                Call_PushNullVector                  
functions.inc                Call_PushString                      
functions.inc                Call_PushStringEx                    
functions.inc                Call_PushNullString                  
functions.inc                Call_Finish                          
functions.inc                Call_Cancel                          
functions.inc                CreateNative                         
functions.inc                ThrowNativeError                     
functions.inc                GetNativeStringLength                
functions.inc                GetNativeString                      
functions.inc                SetNativeString                      
functions.inc                GetNativeCell                        
functions.inc                GetNativeFunction                    
functions.inc                GetNativeCellRef                     
functions.inc                SetNativeCellRef                     
functions.inc                GetNativeArray                       
functions.inc                SetNativeArray                       
functions.inc                IsNativeParamNullVector              
functions.inc                IsNativeParamNullString              
functions.inc                RequestFrame                         
geoip.inc                    GeoipCode2                           
geoip.inc                    GeoipCode3                           
geoip.inc                    GeoipRegionCode                      
geoip.inc                    GeoipContinentCode                   
geoip.inc                    GeoipCountry                         
geoip.inc                    GeoipCountryEx                       
geoip.inc                    GeoipContinent                       
geoip.inc                    GeoipRegion                          
geoip.inc                    GeoipCity                            
geoip.inc                    GeoipTimezone                        
geoip.inc                    GeoipLatitude                        
geoip.inc                    GeoipLongitude                       
geoip.inc                    GeoipDistance                        
halflife.inc                 LogToGame                            
halflife.inc                 SetRandomSeed                        
halflife.inc                 GetRandomFloat                       
halflife.inc                 GetRandomInt                         
halflife.inc                 IsMapValid                           
halflife.inc                 FindMap                              
halflife.inc                 GetMapDisplayName                    
halflife.inc                 IsDedicatedServer                    
halflife.inc                 GetEngineTime                        
halflife.inc                 GetGameTime                          
halflife.inc                 GetGameTickCount                     
halflife.inc                 GetGameFrameTime                     
halflife.inc                 GetGameDescription                   
halflife.inc                 GetGameFolderName                    
halflife.inc                 GetCurrentMap                        
halflife.inc                 PrecacheModel                        
halflife.inc                 PrecacheSentenceFile                 
halflife.inc                 PrecacheDecal                        
halflife.inc                 PrecacheGeneric                      
halflife.inc                 IsModelPrecached                     
halflife.inc                 IsDecalPrecached                     
halflife.inc                 IsGenericPrecached                   
halflife.inc                 PrecacheSound                        
halflife.inc                 IsSoundPrecached                     
halflife.inc                 CreateDialog                         
halflife.inc                 GuessSDKVersion                      
halflife.inc                 GetEngineVersion                     
halflife.inc                 PrintToChat                          
halflife.inc                 PrintCenterText                      
halflife.inc                 PrintHintText                        
halflife.inc                 ShowVGUIPanel                        
halflife.inc                 CreateHudSynchronizer                
halflife.inc                 ShowSyncHudText                      
halflife.inc                 ClearSyncHud                         
halflife.inc                 ShowHudText                          
halflife.inc                 EntIndexToEntRef                     
halflife.inc                 EntRefToEntIndex                     
halflife.inc                 MakeCompatEntRef                     
halflife.inc                 GetClientsInRange                    
halflife.inc                 GetServerAuthId                      
halflife.inc                 GetServerSteamAccountId              
handles.inc                  CloseHandle                          ✔️
handles.inc                  CloneHandle                          
handles.inc                  IsValidHandle                        
keyvalues.inc                CreateKeyValues                      
keyvalues.inc                KvSetString                          
keyvalues.inc                KvSetNum                             
keyvalues.inc                KvSetUInt64                          
keyvalues.inc                KvSetFloat                           
keyvalues.inc                KvSetColor                           
keyvalues.inc                KvSetVector                          
keyvalues.inc                KvGetString                          
keyvalues.inc                KvGetNum                             
keyvalues.inc                KvGetFloat                           
keyvalues.inc                KvGetColor                           
keyvalues.inc                KvGetUInt64                          
keyvalues.inc                KvGetVector                          
keyvalues.inc                KvJumpToKey                          
keyvalues.inc                KvJumpToKeySymbol                    
keyvalues.inc                KvGotoFirstSubKey                    
keyvalues.inc                KvGotoNextKey                        
keyvalues.inc                KvSavePosition                       
keyvalues.inc                KvDeleteKey                          
keyvalues.inc                KvDeleteThis                         
keyvalues.inc                KvGoBack                             
keyvalues.inc                KvRewind                             
keyvalues.inc                KvGetSectionName                     
keyvalues.inc                KvSetSectionName                     
keyvalues.inc                KvGetDataType                        
keyvalues.inc                KeyValuesToFile                      
keyvalues.inc                FileToKeyValues                      
keyvalues.inc                StringToKeyValues                    
keyvalues.inc                KvSetEscapeSequences                 
keyvalues.inc                KvNodesInStack                       
keyvalues.inc                KvCopySubkeys                        
keyvalues.inc                KvFindKeyById                        
keyvalues.inc                KvGetNameSymbol                      
keyvalues.inc                KvGetSectionSymbol                   
lang.inc                     LoadTranslations                     
lang.inc                     SetGlobalTransTarget                 
lang.inc                     GetClientLanguage                    
lang.inc                     GetServerLanguage                    
lang.inc                     GetLanguageCount                     
lang.inc                     GetLanguageInfo                      
lang.inc                     SetClientLanguage                    
lang.inc                     GetLanguageByCode                    
lang.inc                     GetLanguageByName                    
lang.inc                     TranslationPhraseExists              
lang.inc                     IsTranslatedForLanguage              
logging.inc                  LogMessage                           
logging.inc                  LogToFile                            
logging.inc                  LogToFileEx                          
logging.inc                  LogAction                            
logging.inc                  LogError                             
logging.inc                  AddGameLogHook                       
logging.inc                  RemoveGameLogHook                    
mapchooser.inc               NominateMap                          
mapchooser.inc               RemoveNominationByMap                
mapchooser.inc               RemoveNominationByOwner              
mapchooser.inc               GetExcludeMapList                    
mapchooser.inc               GetNominatedMapList                  
mapchooser.inc               CanMapChooserStartVote               
mapchooser.inc               InitiateMapChooserVote               
mapchooser.inc               HasEndOfMapVoteFinished              
mapchooser.inc               EndOfMapVoteEnabled                  
menus.inc                    CreateMenu                           
menus.inc                    DisplayMenu                          
menus.inc                    DisplayMenuAtItem                    
menus.inc                    RemoveMenuItem                       
menus.inc                    RemoveAllMenuItems                   
menus.inc                    MenuShufflePerClient                 
menus.inc                    MenuSetClientMapping                 
menus.inc                    GetMenuSelectionPosition             
menus.inc                    GetMenuItemCount                     
menus.inc                    SetMenuPagination                    
menus.inc                    GetMenuPagination                    
menus.inc                    GetMenuStyle                         
menus.inc                    SetMenuTitle                         
menus.inc                    GetMenuTitle                         
menus.inc                    CreatePanelFromMenu                  
menus.inc                    GetMenuExitButton                    
menus.inc                    SetMenuExitButton                    
menus.inc                    GetMenuExitBackButton                
menus.inc                    SetMenuExitBackButton                
menus.inc                    SetMenuNoVoteButton                  
menus.inc                    CancelMenu                           
menus.inc                    GetMenuOptionFlags                   
menus.inc                    SetMenuOptionFlags                   
menus.inc                    IsVoteInProgress                     
menus.inc                    CancelVote                           
menus.inc                    VoteMenu                             
menus.inc                    SetVoteResultCallback                
menus.inc                    CheckVoteDelay                       
menus.inc                    IsClientInVotePool                   
menus.inc                    RedrawClientVoteMenu                 
menus.inc                    GetMenuStyleHandle                   
menus.inc                    CreatePanel                          
menus.inc                    CreateMenuEx                         
menus.inc                    GetClientMenu                        
menus.inc                    CancelClientMenu                     
menus.inc                    GetMaxPageItems                      
menus.inc                    GetPanelStyle                        
menus.inc                    SetPanelTitle                        
menus.inc                    DrawPanelItem                        
menus.inc                    DrawPanelText                        
menus.inc                    CanPanelDrawFlags                    
menus.inc                    SetPanelKeys                         
menus.inc                    SendPanelToClient                    
menus.inc                    GetPanelTextRemaining                
menus.inc                    GetPanelCurrentKey                   
menus.inc                    SetPanelCurrentKey                   
menus.inc                    RedrawMenuItem                       
menus.inc                    InternalShowMenu                     
nextmap.inc                  SetNextMap                           
nextmap.inc                  GetNextMap                           
nextmap.inc                  ForceChangeLevel                     
nextmap.inc                  GetMapHistorySize                    
nextmap.inc                  GetMapHistory                        
profiler.inc                 CreateProfiler                       
profiler.inc                 StartProfiling                       
profiler.inc                 StopProfiling                        
profiler.inc                 GetProfilerTime                      
profiler.inc                 EnterProfilingEvent                  
profiler.inc                 LeaveProfilingEvent                  
profiler.inc                 IsProfilingActive                    
protobuf.inc                 PbReadInt                            
protobuf.inc                 PbReadFloat                          
protobuf.inc                 PbReadBool                           
protobuf.inc                 PbReadString                         
protobuf.inc                 PbReadColor                          
protobuf.inc                 PbReadAngle                          
protobuf.inc                 PbReadVector                         
protobuf.inc                 PbReadVector2D                       
protobuf.inc                 PbGetRepeatedFieldCount              
protobuf.inc                 PbSetInt                             
protobuf.inc                 PbSetFloat                           
protobuf.inc                 PbSetBool                            
protobuf.inc                 PbSetString                          
protobuf.inc                 PbSetColor                           
protobuf.inc                 PbSetAngle                           
protobuf.inc                 PbSetVector                          
protobuf.inc                 PbSetVector2D                        
protobuf.inc                 PbAddInt                             
protobuf.inc                 PbAddFloat                           
protobuf.inc                 PbAddBool                            
protobuf.inc                 PbAddString                          
protobuf.inc                 PbAddColor                           
protobuf.inc                 PbAddAngle                           
protobuf.inc                 PbAddVector                          
protobuf.inc                 PbAddVector2D                        
protobuf.inc                 PbRemoveRepeatedFieldValue           
protobuf.inc                 PbReadMessage                        
protobuf.inc                 PbReadRepeatedMessage                
protobuf.inc                 PbAddMessage                         
regex.inc                    CompileRegex                         
regex.inc                    MatchRegex                           
regex.inc                    GetRegexSubString                    
sdkhooks.inc                 SDKHook                              
sdkhooks.inc                 SDKHookEx                            
sdkhooks.inc                 SDKUnhook                            
sdktools.inc                 StartPrepSDKCall                     
sdktools.inc                 PrepSDKCall_SetVirtual               
sdktools.inc                 PrepSDKCall_SetSignature             
sdktools.inc                 PrepSDKCall_SetAddress               
sdktools.inc                 PrepSDKCall_SetFromConf              
sdktools.inc                 PrepSDKCall_SetReturnInfo            
sdktools.inc                 PrepSDKCall_AddParameter             
sdktools.inc                 EndPrepSDKCall                       
sdktools.inc                 SDKCall                              
sdktools.inc                 GetPlayerResourceEntity              
sdktools_client.inc          InactivateClient                     
sdktools_client.inc          ReconnectClient                      
sdktools_engine.inc          SetClientViewEntity                  
sdktools_engine.inc          SetLightStyle                        
sdktools_engine.inc          GetClientEyePosition                 
sdktools_entinput.inc        AcceptEntityInput                    
sdktools_entoutput.inc       HookEntityOutput                     
sdktools_entoutput.inc       UnhookEntityOutput                   
sdktools_entoutput.inc       HookSingleEntityOutput               
sdktools_entoutput.inc       UnhookSingleEntityOutput             
sdktools_entoutput.inc       FireEntityOutput                     
sdktools_functions.inc       RemovePlayerItem                     
sdktools_functions.inc       GivePlayerItem                       
sdktools_functions.inc       GetPlayerWeaponSlot                  
sdktools_functions.inc       IgniteEntity                         
sdktools_functions.inc       ExtinguishEntity                     
sdktools_functions.inc       TeleportEntity                       
sdktools_functions.inc       ForcePlayerSuicide                   
sdktools_functions.inc       SlapPlayer                           
sdktools_functions.inc       FindEntityByClassname                
sdktools_functions.inc       GetClientEyeAngles                   
sdktools_functions.inc       CreateEntityByName                   
sdktools_functions.inc       DispatchSpawn                        
sdktools_functions.inc       DispatchKeyValue                     
sdktools_functions.inc       DispatchKeyValueFloat                
sdktools_functions.inc       DispatchKeyValueVector               
sdktools_functions.inc       GetClientAimTarget                   
sdktools_functions.inc       GetTeamCount                         
sdktools_functions.inc       GetTeamName                          
sdktools_functions.inc       GetTeamScore                         
sdktools_functions.inc       SetTeamScore                         
sdktools_functions.inc       GetTeamClientCount                   
sdktools_functions.inc       GetTeamEntity                        
sdktools_functions.inc       SetEntityModel                       
sdktools_functions.inc       GetPlayerDecalFile                   
sdktools_functions.inc       GetPlayerJingleFile                  
sdktools_functions.inc       GetServerNetStats                    
sdktools_functions.inc       EquipPlayerWeapon                    
sdktools_functions.inc       ActivateEntity                       
sdktools_functions.inc       SetClientInfo                        
sdktools_functions.inc       SetClientName                        
sdktools_functions.inc       GivePlayerAmmo                       
sdktools_functions.inc       SetEntityCollisionGroup              
sdktools_functions.inc       EntityCollisionRulesChanged          
sdktools_functions.inc       SetEntityOwner                       
sdktools_functions.inc       LookupEntityAttachment               
sdktools_functions.inc       GetEntityAttachment                  
sdktools_gamerules.inc       GameRules_GetProp                    
sdktools_gamerules.inc       GameRules_SetProp                    
sdktools_gamerules.inc       GameRules_GetPropFloat               
sdktools_gamerules.inc       GameRules_SetPropFloat               
sdktools_gamerules.inc       GameRules_GetPropEnt                 
sdktools_gamerules.inc       GameRules_SetPropEnt                 
sdktools_gamerules.inc       GameRules_GetPropVector              
sdktools_gamerules.inc       GameRules_SetPropVector              
sdktools_gamerules.inc       GameRules_GetPropString              
sdktools_gamerules.inc       GameRules_SetPropString              
sdktools_sound.inc           PrefetchSound                        
sdktools_sound.inc           GetSoundDuration                     
sdktools_sound.inc           FadeClientVolume                     
sdktools_sound.inc           StopSound                            
sdktools_sound.inc           GetDistGainFromSoundLevel            
sdktools_sound.inc           AddAmbientSoundHook                  
sdktools_sound.inc           AddNormalSoundHook                   
sdktools_sound.inc           RemoveAmbientSoundHook               
sdktools_sound.inc           RemoveNormalSoundHook                
sdktools_sound.inc           PrecacheScriptSound                  
sdktools_stringtables.inc    FindStringTable                      
sdktools_stringtables.inc    GetNumStringTables                   
sdktools_stringtables.inc    GetStringTableNumStrings             
sdktools_stringtables.inc    GetStringTableMaxStrings             
sdktools_stringtables.inc    GetStringTableName                   
sdktools_stringtables.inc    FindStringIndex                      
sdktools_stringtables.inc    ReadStringTable                      
sdktools_stringtables.inc    GetStringTableDataLength             
sdktools_stringtables.inc    GetStringTableData                   
sdktools_stringtables.inc    SetStringTableData                   
sdktools_stringtables.inc    AddToStringTable                     
sdktools_stringtables.inc    LockStringTables                     
sdktools_tempents.inc        AddTempEntHook                       
sdktools_tempents.inc        RemoveTempEntHook                    
sdktools_tempents.inc        TE_Start                             
sdktools_tempents.inc        TE_IsValidProp                       
sdktools_tempents.inc        TE_WriteNum                          
sdktools_tempents.inc        TE_ReadNum                           
sdktools_tempents.inc        TE_WriteFloat                        
sdktools_tempents.inc        TE_ReadFloat                         
sdktools_tempents.inc        TE_WriteVector                       
sdktools_tempents.inc        TE_ReadVector                        
sdktools_tempents.inc        TE_WriteAngles                       
sdktools_tempents.inc        TE_WriteFloatArray                   
sdktools_tempents.inc        TE_Send                              
sdktools_trace.inc           TR_GetPointContents                  
sdktools_trace.inc           TR_GetPointContentsEnt               
sdktools_trace.inc           TR_ClipCurrentRayToEntity            
sdktools_trace.inc           TR_ClipCurrentRayToEntityEx          
sdktools_trace.inc           TR_GetFraction                       
sdktools_trace.inc           TR_GetFractionLeftSolid              
sdktools_trace.inc           TR_GetStartPosition                  
sdktools_trace.inc           TR_GetEndPosition                    
sdktools_trace.inc           TR_GetEntityIndex                    
sdktools_trace.inc           TR_GetDisplacementFlags              
sdktools_trace.inc           TR_GetSurfaceName                    
sdktools_trace.inc           TR_GetSurfaceProps                   
sdktools_trace.inc           TR_GetSurfaceFlags                   
sdktools_trace.inc           TR_GetPhysicsBone                    
sdktools_trace.inc           TR_AllSolid                          
sdktools_trace.inc           TR_StartSolid                        
sdktools_trace.inc           TR_DidHit                            
sdktools_trace.inc           TR_GetHitGroup                       
sdktools_trace.inc           TR_GetHitBoxIndex                    
sdktools_trace.inc           TR_GetPlaneNormal                    
sdktools_trace.inc           TR_PointOutsideWorld                 
sdktools_variant_t.inc       SetVariantBool                       
sdktools_variant_t.inc       SetVariantString                     
sdktools_variant_t.inc       SetVariantInt                        
sdktools_variant_t.inc       SetVariantFloat                      
sdktools_variant_t.inc       SetVariantVector3D                   
sdktools_variant_t.inc       SetVariantPosVector3D                
sdktools_variant_t.inc       SetVariantColor                      
sdktools_variant_t.inc       SetVariantEntity                     
sdktools_voice.inc           SetClientListeningFlags              
sdktools_voice.inc           GetClientListeningFlags              
sdktools_voice.inc           SetClientListening                   
sdktools_voice.inc           GetClientListening                   
sdktools_voice.inc           SetListenOverride                    
sdktools_voice.inc           GetListenOverride                    
sdktools_voice.inc           IsClientMuted                        
sorting.inc                  SortIntegers                         
sorting.inc                  SortFloats                           
sorting.inc                  SortStrings                          
sorting.inc                  SortCustom1D                         
sorting.inc                  SortCustom2D                         
sorting.inc                  SortADTArray                         
sorting.inc                  SortADTArrayCustom                   
sourcemod.inc                GetMyHandle                          
sourcemod.inc                GetPluginIterator                    
sourcemod.inc                MorePlugins                          
sourcemod.inc                ReadPlugin                           
sourcemod.inc                GetPluginStatus                      
sourcemod.inc                GetPluginFilename                    ✔️
sourcemod.inc                IsPluginDebugging                    
sourcemod.inc                GetPluginInfo                        
sourcemod.inc                FindPluginByNumber                   
sourcemod.inc                SetFailState                         
sourcemod.inc                ThrowError                           
sourcemod.inc                LogStackTrace                        
sourcemod.inc                GetTime                              
sourcemod.inc                FormatTime                           
sourcemod.inc                LoadGameConfigFile                   
sourcemod.inc                GameConfGetOffset                    
sourcemod.inc                GameConfGetKeyValue                  
sourcemod.inc                GameConfGetAddress                   
sourcemod.inc                GetSysTickCount                      
sourcemod.inc                AutoExecConfig                       
sourcemod.inc                RegPluginLibrary                     
sourcemod.inc                LibraryExists                        
sourcemod.inc                GetExtensionFileStatus               
sourcemod.inc                SetMapListCompatBind                 
sourcemod.inc                GetFeatureStatus                     
sourcemod.inc                LoadFromAddress                      
sourcemod.inc                StoreToAddress                       
string.inc                   strlen                               ✔️
string.inc                   StrContains                          ✔️
string.inc                   strcmp                               ✔️
string.inc                   strncmp                              ✔️
string.inc                   strcopy                              ✔️
string.inc                   Format                               
string.inc                   FormatEx                             
string.inc                   VFormat                              
string.inc                   StringToInt                          
string.inc                   StringToIntEx                        
string.inc                   StringToInt64                        
string.inc                   IntToString                          
string.inc                   Int64ToString                        
string.inc                   StringToFloat                        
string.inc                   StringToFloatEx                      
string.inc                   FloatToString                        
string.inc                   BreakString                          ✔️
string.inc                   TrimString                           ✔️
string.inc                   SplitString                          
string.inc                   ReplaceString                        
string.inc                   ReplaceStringEx                      
string.inc                   GetCharBytes                         
string.inc                   IsCharAlpha                          
string.inc                   IsCharNumeric                        
string.inc                   IsCharSpace                          
string.inc                   IsCharMB                             
string.inc                   IsCharUpper                          
string.inc                   IsCharLower                          
string.inc                   StripQuotes                          
textparse.inc                SMC_CreateParser                     
textparse.inc                SMC_ParseFile                        
textparse.inc                SMC_GetErrorString                   
textparse.inc                SMC_SetParseStart                    
textparse.inc                SMC_SetParseEnd                      
textparse.inc                SMC_SetReaders                       
textparse.inc                SMC_SetRawLine                       
tf2.inc                      TF2_IgnitePlayer                     
tf2.inc                      TF2_RespawnPlayer                    
tf2.inc                      TF2_RegeneratePlayer                 
tf2.inc                      TF2_AddCondition                     
tf2.inc                      TF2_RemoveCondition                  
tf2.inc                      TF2_SetPlayerPowerPlay               
tf2.inc                      TF2_DisguisePlayer                   
tf2.inc                      TF2_RemovePlayerDisguise             
tf2.inc                      TF2_StunPlayer                       
tf2.inc                      TF2_MakeBleed                        
tf2.inc                      TF2_GetResourceEntity                
tf2.inc                      TF2_GetClass                         
tf2.inc                      TF2_IsHolidayActive                  
tf2.inc                      TF2_IsPlayerInDuel                   
tf2.inc                      TF2_RemoveWearable                   
timers.inc                   CreateTimer                          ✔️
timers.inc                   KillTimer                            
timers.inc                   TriggerTimer                         
timers.inc                   GetTickedTime                        
timers.inc                   GetMapTimeLeft                       
timers.inc                   GetMapTimeLimit                      
timers.inc                   ExtendMapTimeLimit                   
timers.inc                   GetTickInterval                      
timers.inc                   IsServerProcessing                   
topmenus.inc                 CreateTopMenu                        
topmenus.inc                 LoadTopMenuConfig                    
topmenus.inc                 GetTopMenuInfoString                 
topmenus.inc                 GetTopMenuObjName                    
topmenus.inc                 RemoveFromTopMenu                    
topmenus.inc                 DisplayTopMenu                       
topmenus.inc                 DisplayTopMenuCategory               
topmenus.inc                 FindTopMenuCategory                  
topmenus.inc                 SetTopMenuTitleCaching               
usermessages.inc             GetUserMessageType                   
usermessages.inc             GetUserMessageId                     
usermessages.inc             GetUserMessageName                   
usermessages.inc             StartMessage                         
usermessages.inc             StartMessageEx                       
usermessages.inc             EndMessage                           
usermessages.inc             HookUserMessage                      
usermessages.inc             UnhookUserMessage                    
vector.inc                   GetVectorLength                      
vector.inc                   GetVectorDistance                    
vector.inc                   GetVectorDotProduct                  
vector.inc                   GetVectorCrossProduct                
vector.inc                   NormalizeVector                      
vector.inc                   GetAngleVectors                      
vector.inc                   GetVectorAngles                      
vector.inc                   GetVectorVectors

@theY4Kman
Copy link
Owner

I dumped the MySQL DB to a sqlite DB, as well: pawn-docgen.sqlite3.zip

@theY4Kman
Copy link
Owner

Well, as it turns out, pawn-docgen misses a bunch of natives (I think due to them being multi-lined), and it doesn't split the signature up by params. So, I'm just writing my own slim, purpose-built parser using Lark and regex. It's coming along well, and is converting all natives and enums over to their pysmx equivalents. I still have to write the grammar/parser/formatter for methodmaps, and implement the Array and Pointer convenience types for the native params. All in all, though, it turned out to be easier than I expected. And now I'm curious if I couldn't build out a full lark grammar for SourcePawn. (Honestly, it's always the old-style tags that fuck things up... there's a bunch of ambiguities that seem to require hand-crafted parsing.)

@theY4Kman
Copy link
Owner

Aight, I finished up the stubgen and pushed stubs for all unimplemented natives. To run the stubgen yourself, install pysmx with its extra:

pip install pysmx[stubgen]

I mainly wrote it for myself, so it uses features only available in Python 3.11, meaning you'll need that, too.

To run it:

pysmx_stubgen path/to/output/dir/

(It currently doesn't have any terminal output, nor a cmdline option for setting the include dir — it just uses the one from pysmx.)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants