{"id":13732181,"url":"https://github.com/sp4cerat/Game-NET","last_synced_at":"2025-05-08T06:31:38.610Z","repository":{"id":98829012,"uuid":"45306483","full_name":"sp4cerat/Game-NET","owner":"sp4cerat","description":"RPC Network Library for Multiplayer Games","archived":false,"fork":false,"pushed_at":"2015-11-06T07:04:15.000Z","size":1468,"stargazers_count":74,"open_issues_count":0,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-02T19:22:02.183Z","etag":null,"topics":[],"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/sp4cerat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-31T15:17:01.000Z","updated_at":"2024-03-12T00:52:10.000Z","dependencies_parsed_at":"2023-03-13T15:54:21.655Z","dependency_job_id":null,"html_url":"https://github.com/sp4cerat/Game-NET","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sp4cerat%2FGame-NET","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sp4cerat%2FGame-NET/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sp4cerat%2FGame-NET/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sp4cerat%2FGame-NET/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sp4cerat","download_url":"https://codeload.github.com/sp4cerat/Game-NET/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213757423,"owners_count":15634176,"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-08-03T02:01:48.469Z","updated_at":"2024-08-03T02:09:14.439Z","avatar_url":"https://github.com/sp4cerat.png","language":"C++","readme":"### Game NET - A Simple RPC Network Library (C++11)\n\n***Write a simple server / client RPC system in just 10+20 lines of code.***\n\n***Write a multiplayer game with client / server in 300+300 lines of code.***\n\n#### License : MIT\n#### http://opensource.org/licenses/MIT\n\n**Summary** \n\nThe library provides basic client / server network functionalities for games using RPCs. The major strength of the library is the template based RPC class. It allows to register and call RPCs effortless. It further includes a tutorial game server and game client (each around 300  lines of code ) for a very simple multiplayer shooting game as a proof of concept.\n\n**Network RPC Lib Features**\n\n* Register RPCs in one line. The RPC class autodetects all paramters from the function pointer\n* RPC Data-type mismatch or wrong parameter count is printed as error to ease debugging (#define RPC_DEBUG)\n* Numbers are automatically sent as the smallest possible datatype (byte, short , .. )\n* Supports GLM datatypes for use in 3D Games\n* Supported Datatypes : (u)char,(u)short,(u)int,float,double,vector,map, GLM vec,mat and quat\n* Support for nested Datatypes like map [ string , vector ]\n* Reliable and unreliable calls possible\n* Hack-safe. Illegal packets (trying to create buffer overruns or such) are discarded.\n* Basic range compression (enet)\n* Function pointers of remote functions are not required\n* Based on ENet\n* Tested on Cygwin, Linux and Windows\n* C++11 based \n\n**Network RPC Lib Limitations**\n\n* RPCs cannot be class member functions\n* No encryption\n* Only void functions supported. Non-void functions were tested but complicated everything.\n* Client to Client connections are not supported\n\n**Example Game Features**\n\n* Lobby \n* Multiple Games\n* Handle spwaning/removing of game objects\n* Simple Shooting functionality\n* Intentionally textmode for simplicity\n\n**Benchmark**\n\nA first simple test on localhost (Core i7 Notebook) gave:\n \n1 Call / Network Update:\n \n* 69.000 unreliable RPC calls/sec [client.call_ex(0,\"hello_server\", \"Greetings\")]\n* 74.000 reliable RPC calls/sec  [client.call_ex(1,\"hello_server\", \"Greetings\")]\n \n10 Calls grouped / Network Update\n \n* 144.000 unreliable RPC calls/sec [client.call_ex(0,\"hello_server\", \"Greetings\")]\n* 310.000 reliable RPC calls/sec  [client.call_ex(1,\"hello_server\", \"Greetings\")]\n\n20 Calls grouped / Network Update\n \n* 142.000 unreliable RPC calls/sec [client.call_ex(0,\"hello_server\", \"Greetings\")]\n* 364.000 reliable RPC calls/sec  [client.call_ex(1,\"hello_server\", \"Greetings\")]\n\nNote that this is not about the response time\n\n**Example Usage**\n\nCall Server Function:\n\nClient Side:\n\n    NetClient client;\n    \n    void set_pos(vec3 pos)\n    {\n        // do something\n        exit(0);\n    }\n    \n    int main()\n    {\n        rpc_register_remote(client.get_rpc(), login);\n        rpc_register_local(client.get_rpc(), set_pos);\n        client.connect(\"localhost\", 12345);\n        client.call(\"login\", \"myname\", \"pass\");\n        while(1) client.process();\n        //client.disconnect();\n    }\n\nServer Side:\n\n    NetServer server;\n    \n    void login(uint clientid, string name, string password)\n    {\n        // clientid is the first parameter for server functions\n        server.call(clientid, \"set_pos\", vec3(1,2,3));    \n    }\n    \n    int main()\n    {\n        rpc_register_local(server.get_rpc(), login);\n        rpc_register_remote(server.get_rpc(), set_pos);    \n        server.start();\n        core_sleep(10000) ; // wait client to do stuff\n        server.stop();\n    }\n    \n    \n\n![Screenshot1](https://github.com/sp4cerat/Game-NET/blob/master/screenshots/game.png?raw=true)\n![Screenshot2](https://github.com/sp4cerat/Game-NET/blob/master/screenshots/lobby.png?raw=true)\n\nRPC System, how its done: http://cpp.sh/9jc5\n\n(C) by Sven Forstmann in 2015\n","funding_links":[],"categories":["Networking"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsp4cerat%2FGame-NET","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsp4cerat%2FGame-NET","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsp4cerat%2FGame-NET/lists"}