René's URL Explorer Experiment


Title: [ENH] Add LuaObject(UserData) · Issue #1 · GmodNET/Extensions · GitHub

Open Graph Title: [ENH] Add LuaObject(UserData) · Issue #1 · GmodNET/Extensions

X Title: [ENH] Add LuaObject(UserData) · Issue #1 · GmodNET/Extensions

Description: Description I want to add easy UserData support to GmodDotNet LuaObject is a inheritable class that allows to push and pop c#-style userdata. It already implements some basic metamethods such as __gc and __tostring, with virtual methods ...

Open Graph Description: Description I want to add easy UserData support to GmodDotNet LuaObject is a inheritable class that allows to push and pop c#-style userdata. It already implements some basic metamethods such as __...

X Description: Description I want to add easy UserData support to GmodDotNet LuaObject is a inheritable class that allows to push and pop c#-style userdata. It already implements some basic metamethods such as __...

Opengraph URL: https://github.com/GmodNET/Extensions/issues/1

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH] Add LuaObject(UserData)","articleBody":"### Description\r\nI want to add easy UserData support to GmodDotNet\r\n\r\n`LuaObject` is a inheritable class that allows to push and pop c#-style userdata. It already implements some basic metamethods such as `__gc` and `__tostring`, with virtual methods `Destroy` and `Name` for child classes to override.\r\nAt the module startup, every class inherited from `LuaObject` and with `[UserData(string Name)]` attribute would be registered.\r\nRegistering luaobject consists of steps:\r\n\r\n1. Create metatable using `lua.CreateMetatable` using name from `[UserData]` attribute\r\n2. Write TypeName, TypeId from `CreateMetaTable` and Type to internal Dictionary\r\n3. Get all static methods with signature `int (ILua lua)` and `[MetaMethod]` attribute from the class and push them as metamethods\r\n4. Create table and push all static methods with the same signature but without `[MetaMethod]` attribute\r\n5. Make new table an `__index` for metatable\r\n\r\n### Usage\r\nCreating LuaObject\r\n```cs\r\n    [UserData(Name = \"MyLuaObject\")]\r\n    public class MyLuaObject : LuaObject\u003cMyLuaObject\u003e\r\n    {\r\n        public override string Name() =\u003e \"MyLuaObject\";\r\n        public override void Destroy() =\u003e Console.WriteLine(\"Garbage collected!\");\r\n        public int SomeInt = 5;\r\n        private static int ReturnNumber(ILua lua)\r\n        {\r\n            var self = Pop(lua);\r\n            lua.PushNumber(self.SomeInt);\r\n            return 1;\r\n        }\r\n    }\r\n```\r\n\r\nPushing and poping\r\n```cs\r\n    int SomePushLuaMethod(ILua lua)\r\n    {\r\n        MyLuaObject obj = new MyLuaObject();\r\n        obj.Push(lua);\r\n        return 1;\r\n    }\r\n    int SomePopLuaMethod(ILua lua)\r\n    {\r\n        MyLuaObject obj = MyLuaObject.Pop(1); // Pop first argument\r\n        Console.WriteLine(obj.SomeInt);\r\n    }\r\n```\r\nUsage in lua is as follows:\r\n```lua\r\n    local myObj = SomePushLuaMethod()\r\n    print(myObj:ReturnNumber())\r\n    SomePopLuaMethod(myObj) -- 5 in console\r\n    myObj = nil --__gc would be called, also calling Destroy virtual method\r\n```","author":{"url":"https://github.com/JenyaRostov","@type":"Person","name":"JenyaRostov"},"datePublished":"2021-06-04T19:37:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/1/Extensions/issues/1"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e1c315fe-c9e1-1f81-b2ee-9b213f957958
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA0A6:1AC9BC:321BB1E:45D9DB6:6A63486D
html-safe-nonce260734f5931c918dab9e4cb86570176d407e17f144a66c7a820f99277156538b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMEE2OjFBQzlCQzozMjFCQjFFOjQ1RDlEQjY6NkE2MzQ4NkQiLCJ2aXNpdG9yX2lkIjoiNzQ3MjAwNzYwNjUzMjUyNDE0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac053fcf3e119d375c6895967fef205547aa9a74358cb06b12e83b3b90d449000f
hovercard-subject-tagissue:957304263
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/GmodNET/Extensions/1/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c4433ff5bf2eb07ae6feed328e9e791103c869288cdea12f78dbb7112a869b6a/GmodNET/Extensions/issues/1
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c4433ff5bf2eb07ae6feed328e9e791103c869288cdea12f78dbb7112a869b6a/GmodNET/Extensions/issues/1
og:image:altDescription I want to add easy UserData support to GmodDotNet LuaObject is a inheritable class that allows to push and pop c#-style userdata. It already implements some basic metamethods such as __...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameJenyaRostov
hostnamegithub.com
expected-hostnamegithub.com
None59e55daad7174ca59d63c6974d58276ccb5477442e550bebb3c035e1bef11c94
turbo-cache-controlno-preview
go-importgithub.com/GmodNET/Extensions git https://github.com/GmodNET/Extensions.git
octolytics-dimension-user_id69189476
octolytics-dimension-user_loginGmodNET
octolytics-dimension-repository_id391443093
octolytics-dimension-repository_nwoGmodNET/Extensions
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id391443093
octolytics-dimension-repository_network_root_nwoGmodNET/Extensions
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release990295d92a4cc7b63fbbd83a046217cd7d77d49c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/GmodNET/Extensions/issues/1#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FGmodNET%2FExtensions%2Fissues%2F1
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FGmodNET%2FExtensions%2Fissues%2F1
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=GmodNET%2FExtensions
Reloadhttps://github.com/GmodNET/Extensions/issues/1
Reloadhttps://github.com/GmodNET/Extensions/issues/1
Reloadhttps://github.com/GmodNET/Extensions/issues/1
Please reload this pagehttps://github.com/GmodNET/Extensions/issues/1
GmodNET https://github.com/GmodNET
Extensionshttps://github.com/GmodNET/Extensions
Notifications https://github.com/login?return_to=%2FGmodNET%2FExtensions
Fork 0 https://github.com/login?return_to=%2FGmodNET%2FExtensions
Star 1 https://github.com/login?return_to=%2FGmodNET%2FExtensions
Code https://github.com/GmodNET/Extensions
Issues 1 https://github.com/GmodNET/Extensions/issues
Pull requests 0 https://github.com/GmodNET/Extensions/pulls
Actions https://github.com/GmodNET/Extensions/actions
Projects https://github.com/GmodNET/Extensions/projects
Security and quality 0 https://github.com/GmodNET/Extensions/security
Insights https://github.com/GmodNET/Extensions/pulse
Code https://github.com/GmodNET/Extensions
Issues https://github.com/GmodNET/Extensions/issues
Pull requests https://github.com/GmodNET/Extensions/pulls
Actions https://github.com/GmodNET/Extensions/actions
Projects https://github.com/GmodNET/Extensions/projects
Security and quality https://github.com/GmodNET/Extensions/security
Insights https://github.com/GmodNET/Extensions/pulse
[ENH] Add LuaObject(UserData)https://github.com/GmodNET/Extensions/issues/1#top
https://github.com/GlebChili
https://github.com/JenyaRostov
JenyaRostovhttps://github.com/JenyaRostov
on Jun 4, 2021https://github.com/GmodNET/Extensions/issues/1#issue-957304263
GlebChilihttps://github.com/GlebChili
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.