{"id":20759728,"url":"https://github.com/kralamoure/retroproto","last_synced_at":"2025-10-26T04:03:15.077Z","repository":{"id":59144666,"uuid":"269873753","full_name":"kralamoure/retroproto","owner":"kralamoure","description":"A library that implements the network protocol of Dofus Retro, for the communication between client and server. It defines the id and structure of the protocol messages, and it provides functionality for their serialization and deserialization.","archived":false,"fork":false,"pushed_at":"2022-05-14T02:59:05.000Z","size":765,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-17T10:07:40.133Z","etag":null,"topics":["dofus","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kralamoure.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}},"created_at":"2020-06-06T05:02:30.000Z","updated_at":"2023-09-08T13:18:05.000Z","dependencies_parsed_at":"2022-09-13T22:51:20.600Z","dependency_job_id":null,"html_url":"https://github.com/kralamoure/retroproto","commit_stats":null,"previous_names":["kralamoure/d1proto"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kralamoure%2Fretroproto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kralamoure%2Fretroproto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kralamoure%2Fretroproto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kralamoure%2Fretroproto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kralamoure","download_url":"https://codeload.github.com/kralamoure/retroproto/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234465623,"owners_count":18837993,"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":["dofus","go","golang"],"created_at":"2024-11-17T10:07:50.136Z","updated_at":"2025-09-27T23:30:19.648Z","avatar_url":"https://github.com/kralamoure.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# retroproto\n\n`retroproto` is a library that implements the network protocol of Dofus Retro, for the communication between client and\nserver. It defines the id and structure of the protocol messages, and it provides functionality for their serialization\nand deserialization.\n\n## Requirements:\n\n- [Git](https://git-scm.com/)\n- [Go](https://golang.org/)\n\n## Installation\n\n```sh\ngo get github.com/kralamoure/retroproto\n```\n\n## Examples\n\n### Deserialize a client message\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/kralamoure/retroproto\"\n\t\"github.com/kralamoure/retroproto/msgcli\"\n)\n\nfunc main() {\n\tpacket := \"AAXxRamboPLxX|1|0|3635424|855309|16053493\"\n\n\tid, _ := retroproto.MsgCliIdByPkt(packet)       // \"AA\"\n\textra := strings.TrimPrefix(packet, string(id)) // \"XxRamboPLxX|1|0|3635424|855309|16053493\"\n\n\tswitch id {\n\tcase retroproto.AccountAddCharacter:\n\t\tmessage := \u0026msgcli.AccountAddCharacter{}\n\t\tmessage.Deserialize(extra)\n\n\t\tfmt.Printf(\"%+v\", *message) // {Name:XxRamboPLxX Class:1 Sex:0 Color1:3778e0 Color2:0d0d0d Color3:f4f4f5}\n\t}\n}\n```\n\n### Deserialize a server message\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/kralamoure/retroproto\"\n\t\"github.com/kralamoure/retroproto/msgsvr\"\n)\n\nfunc main() {\n\tpacket := \"HCfdbijergrfklvdnsdfgviojsidesokpm\"\n\n\tid, _ := retroproto.MsgSvrIdByPkt(packet)       // \"HC\"\n\textra := strings.TrimPrefix(packet, string(id)) // \"fdbijergrfklvdnsdfgviojsidesokpm\"\n\n\tswitch id {\n\tcase retroproto.AksHelloConnect:\n\t\tmessage := \u0026msgsvr.AksHelloConnect{}\n\t\tmessage.Deserialize(extra)\n\n\t\tfmt.Printf(\"%+v\", *message) // {Salt:fdbijergrfklvdnsdfgviojsidesokpm}\n\t}\n}\n```\n\n### Serialize a client message\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/kralamoure/retroproto/msgcli\"\n)\n\nfunc main() {\n\tmessage := msgcli.AccountAddCharacter{\n\t\tName:   \"XxRamboPLxX\",\n\t\tClass:  1,\n\t\tSex:    0,\n\t\tColor1: \"3778e0\",\n\t\tColor2: \"0d0d0d\",\n\t\tColor3: \"f4f4f5\",\n\t}\n\n\textra, _ := message.Serialized()\n\n\t// Note: packets for msgcli.AccountVersion and msgcli.AccountCredential should not include their protocol ID \n\tpacket := fmt.Sprintf(\"%s%s\", message.ProtocolId(), extra)\n\n\tfmt.Print(packet) // \"AAXxRamboPLxX|1|0|3635424|855309|16053493\"\n}\n```\n\n### Serialize a server message\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/kralamoure/retroproto/msgsvr\"\n)\n\nfunc main() {\n\tmessage := msgsvr.AksHelloConnect{Salt: \"fdbijergrfklvdnsdfgviojsidesokpm\"}\n\n\textra, _ := message.Serialized()\n\n\tpacket := fmt.Sprintf(\"%s%s\", message.ProtocolId(), extra)\n\n\tfmt.Print(packet) // \"HCfdbijergrfklvdnsdfgviojsidesokpm\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkralamoure%2Fretroproto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkralamoure%2Fretroproto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkralamoure%2Fretroproto/lists"}