Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Refactor/Scripting Support] Bug fixes to function signatures
- Use specific object return types when known. Scripting has no trouble with this. Channel.GetUserEx(Username, [SearchLimit]) Channel.GetUser(Username, [SearchLimit]) Channel.Clone() ClanMemberObj.Clone() Clan.GetMember(Username) Clan.GetUser(Username) Clan.Clone() FriendObj.Clone() Queue.Item(Index) Queue.ItemByID(Index) SSC.GetScriptControl() SSC.GetUserStats(Statstring) SSC.Logger() SSC.Quotes() SSC.Config() SSC.Channel() SSC.Clan() SSC.Friends() SSC.Queue() SSC.OSVersion() SSC.GetScriptModule(ScriptName) SSC.CreateCommand(Name, ScriptName) SSC.OpenCommand(Name, ScriptName) SSC.DeleteCommand(Name, ScriptName) SSC.Scripts() SSC.DataBufferEx() UserObj.Clone() modScripting.Scripts() - Use ByVal parameters to avoid "type mismatch" errors in many cases if you don't happen to remember to use a particular cast. Though in some cases they are not script-facing, this can help avoid unexpected obscure issues ("it's better practice to do this"). Channel.CheckUser(Username, [CurrentUser]) clsCommandObjStatic.IsValidCommandName(CommandName) <internal> DBEntry.CreatedOn [let] DBEntry.ModifiedOn [let] DBEntry.LastSeen [let] DataBuffer.InsertNTString(String, [Encoding]) Database.AddEntry(DBEntry) Database.RemoveEntry(DBEntry) Database.ContainsEntry(Name, [Type]) clsDatabase.GetEntryAccess(DBEntry) <internal> Database.CanUserModifyEntry(Name, DBEntry) clsDatabase.GetEntryData(DBEntry) <internal> clsDatabase.CheckOperation(OpsString) <internal> Logger.Datestamp(TimeDate) Logger.Timestamp(TimeDate) SSC.CRC32(Data) SSC.SHA1(Data, [InHex], [Spacer]) frmScript.ObjCount([ObjType]) modBNCS.GetCDKeyCount([Product]) <internal> modBNCS.GetLogonSystem([Product]) <internal> modCommandsOps.GetOpsCount([Ignore]) <internal> modOtherCode.StringFormat* <internal> modUnsignedConversions.* <internal> - When ByRef parameters are required, use Variant to avoid "type mismatch" errors, and do the casting on VB6's end. Database.GetEntry(Name, [ByRef Type]) SSC.GetDBEntry(Name, [ByRef Rank], [ByRef Flags], [ByRef Type]) Fixes issue where old scripts were not compatible with recent versions. SSC.GetStdDBEntry(Name, [ByRef Rank], [ByRef Flags], [ByRef Type]) SSC.GetWindowCursorPos(ByRef X, ByRef Y) SSC.StringFormat(Format, ParamArray Params()) SSC.ResolveHostName(HostName, [ByRef ErrCode]) - Convert to/from arrays of Variant. Clan.Create(ClanTag, ClanName, Users()) Converts to String() using standard modScripting function. SSC.RequestUserData(Username, Keys()) Converts to String(). Fixes issue where there was no way to pass a script-constructed array. SSC.GetAllFonts() Converts to Variant(). Fixes issue where you had to iterate over the fonts in order to get the values without error. - Database.GetEntries(NameList(), [Type]) Now takes a Variant array instead of a collection. This allows scripts to pass in an array of names constructed on the scripting side. - Database.GetEntriesFromCollection(NameCol, [Type]) Now exists to take a VB6-constructed Collection. This can be used, for example, by passing another DBEntry's .Groups property. - Queue.Push() changed to a Sub since no return value was returned. - SSC.ClearScreen() changed to a Sub since returning vbNullString was silly. - SSC.StrConvEx() changed to accept Variant input. - SSC.GetCurrentUsername() and SSC.GetCurrentServerIP() now specify their return types. - Removed unused SSC.Dispose().
- Loading branch information
Showing
21 changed files
with
333 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.