{"id":20572022,"url":"https://github.com/netease/pomelo-unityclient-socket","last_synced_at":"2025-04-09T18:17:47.673Z","repository":{"id":8159531,"uuid":"9580830","full_name":"NetEase/pomelo-unityclient-socket","owner":"NetEase","description":"pomele dotnet client","archived":false,"fork":false,"pushed_at":"2023-08-16T06:09:59.000Z","size":6761,"stargazers_count":170,"open_issues_count":19,"forks_count":111,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-04-09T18:17:43.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NetEase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2013-04-21T14:49:56.000Z","updated_at":"2024-07-31T08:44:35.000Z","dependencies_parsed_at":"2024-02-06T03:31:59.336Z","dependency_job_id":null,"html_url":"https://github.com/NetEase/pomelo-unityclient-socket","commit_stats":{"total_commits":27,"total_committers":2,"mean_commits":13.5,"dds":0.4814814814814815,"last_synced_commit":"e4a3b70593839204e91a280f27a3a092d1d18a2b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetEase%2Fpomelo-unityclient-socket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetEase%2Fpomelo-unityclient-socket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetEase%2Fpomelo-unityclient-socket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetEase%2Fpomelo-unityclient-socket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NetEase","download_url":"https://codeload.github.com/NetEase/pomelo-unityclient-socket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085321,"owners_count":21045139,"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","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":[],"created_at":"2024-11-16T05:18:04.265Z","updated_at":"2025-04-09T18:17:47.649Z","avatar_url":"https://github.com/NetEase.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"pomelo-unityclient-socket\n=============================\nThis is the pomelo dotnet client, support pomelo 0.3 and the new communicate protocol.It is based on native socket.\nThe project is based on some libraries as follows:\n\n* [simple-json](https://github.com/facebook-csharp-sdk/simple-json) An open source json library\n\n## Demo\n\n* [Unity3D demo](https://github.com/NetEase/pomelo-unitychat-socket) A pomelo-chat client use unity 3D.\n* [dotnet demo](https://github.com/NetEase/pomelo-dotnetchat-console) A pomelo-chat client use console and write by c#.\n\n## How to use\nTo use the dotnetClient, just include ./dist/*.dll in your project.\n\n## API\n\nInitialize pomelo client\n\n```c#\nusing namespace Pomelo.DotNetClient\nstring host=\"127.0.0.1\";//(www.xxx.com/127.0.0.1/::1/localhost etc.)\nint port=3014;\nPomeloClient pclient = new PomeloClient();\n\n//listen on network state changed event\npclient.NetWorkStateChangedEvent += (state) =\u003e\n{\n    Console.WriteLine(state);\n};\n\npclient.initClient(host, port, () =\u003e\n{\n    //The user data is the handshake user params\n    JsonObject user = new JsonObject();\n    pclient.connect(user, data =\u003e\n    {\n     \t//process handshake call back data\n    });\n});\n\n```\n\nUse request and response\n```c#\npclient.request(route, message, (data)=\u003e{\n    //process the data\n});\n```\n\nNotify server without response\n\n```c#\npclient.notify(route, messge);\n```\n\nAdd event listener, process broadcast message\n```c#\npclient.on(route, (data)=\u003e{\n    //process the data\n});\n```\nDisconnect the client.\n```c#\npclient.disconnect();\n```\n\nprotobuf surpported type:`uInt32, int32, sInt32, float, double, string.`\n\nThe dotnet client support dictionary compress and protbuf encode. The use these function, just set the flag at server side.\n##License\n(The MIT License)\n\nCopyright (c) 2012-2013 NetEase, Inc. and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the 'Software'),\nto deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetease%2Fpomelo-unityclient-socket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetease%2Fpomelo-unityclient-socket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetease%2Fpomelo-unityclient-socket/lists"}