{"id":22208240,"url":"https://github.com/popcron/intercom","last_synced_at":"2026-04-15T16:03:42.772Z","repository":{"id":111700669,"uuid":"242442362","full_name":"popcron/intercom","owner":"popcron","description":"Gets 2 applications to talk to each other","archived":false,"fork":false,"pushed_at":"2020-02-24T03:18:40.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-11T22:25:27.219Z","etag":null,"topics":["csharp","dotnet","unity"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/popcron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-23T02:15:59.000Z","updated_at":"2020-02-24T03:18:42.000Z","dependencies_parsed_at":"2024-06-25T15:15:26.535Z","dependency_job_id":null,"html_url":"https://github.com/popcron/intercom","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/popcron/intercom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/popcron%2Fintercom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/popcron%2Fintercom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/popcron%2Fintercom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/popcron%2Fintercom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/popcron","download_url":"https://codeload.github.com/popcron/intercom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/popcron%2Fintercom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000701,"owners_count":26082806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","unity"],"created_at":"2024-12-02T19:16:50.109Z","updated_at":"2025-10-08T19:45:49.410Z","avatar_url":"https://github.com/popcron.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Intercom\nUsed for making two applications communicate with each other by using shared memory buffers. An example use case of this is avoiding Unity destroying everything when a domain reload happens (compiling while playing the game), by off loading the important code into a seperate process and then relaying it back to the main application.\n\n## Requirements\n- .NET Framework 4.5\n- Git\n\n## Installation\nTo install for local use, download this repo and copy everything from this repository to `\u003cYourUnityProject\u003e/Packages/Popcron Intercom` folder.\n\nIf using 2018.3.x or higher, you can add a new entry to the manifest.json file in your Packages folder:\n```json\n\"com.popcron.intercom\": \"https://github.com/popcron/intercom.git\"\n```\n\n*Note: Nothing actually stops you from using this in any other .NET environment, since this library has no dependencies.**\n\n## How to\nBoth application A and B need to use the same unique identifier (so that they could find each other). So when creating a new instance of an intercom, ensure that the identifier passed is the same for both sides. However, the first parameter, which is the Foo or Bar setting, one application must be Foo, and the other must be Bar (doesnt matter which one).\n```cs\nIntercom intercom = new Intercom(IntercomSide.Foo, \"Game1\"); //in Game1.exe\n```\n```cs\nIntercom intercom = new Intercom(IntercomSide.Bar, \"Game2\"); //in Game2.exe\n```\n\n**Basically:**\n1. When application A starts, make new intercom with Foo\n2. When application B starts, make new intercom there with Bar\n3. Tada!\n\n## Sending methods\nTo send a method, call `Intercom.Invoke(methodName, parameters)` method.\n\nInvoking a method isnt going to be instant, so if you need to ensure that the code after the invoke line is actually ran after the method is ran on the other side, then you can use the `InvokeTask` variant of the method instead to wait for that period.\n```cs\nIntercom intercom = new Intercom(IntercomSide.Foo, \"Game1\");\nawait intercom.InvokeTask(\"Game.DeleteSave\");\n\n//this will run after the Game.DeleteSave method ran in the other application\nCreateCustomSaveFile();\n```\n*Note: Invoking methods that are meant to be awaitable on the other side, are not going to be awaited for.*\n\n## Receiving methods\nDecorating a method with the `[Invokey]` attribute will let the intercom system know that this **static** method can be automatically called upon, assuming the name and parameters match. Yes, duplicates of these are allowed.\n\nIf you'd like to raw dog this, you can alternatively pass a method as a delegate to the `Poll` method, which will then call upon that method for you to process with manually.\n\n```cs\nIntercom intercom = new Intercom(IntercomSide.Foo, \"Game1\");\nwhile (true)\n{\n    intercom.Poll(OnInvoked);\n    await Task.Delay(1);\n}\n\n//will get called when the other application sends something our way\nprivate void OnInvoke(Invocation inv)\n{\n    if (inv.MethodName == \"Boo\") //do whatcha want\n    {\n    \n    }\n}\n```\n## Custom serializer\nIn the case of Unity, you might not want to use the default binary formatter in favour of the built in `JsonUtility` class, or whatever you'd like really. To do this, inherit from the `Serializer` class, implement the abstract methods, and provide your intercom objects with a new instance of your custom serializer.\n```cs\nIntercom intercom = new Intercom(IntercomSide.Foo, \"Game1\");\nintercom.Serializer = new JsonSerializer(); // \u003c--- your custom thingy\n```\n\n## License\nMIT, do whatever you want.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpopcron%2Fintercom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpopcron%2Fintercom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpopcron%2Fintercom/lists"}