{"id":20372638,"url":"https://github.com/txchen/scichicken","last_synced_at":"2025-04-13T09:51:42.815Z","repository":{"id":72709024,"uuid":"125575606","full_name":"txchen/scichicken","owner":"txchen","description":"Scientific chicken dinner","archived":false,"fork":false,"pushed_at":"2018-04-24T01:41:27.000Z","size":327,"stargazers_count":146,"open_issues_count":2,"forks_count":195,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-27T01:12:51.654Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/txchen.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}},"created_at":"2018-03-16T22:20:17.000Z","updated_at":"2025-01-08T07:34:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"d5b9eca9-4e96-41da-86d4-34611174c606","html_url":"https://github.com/txchen/scichicken","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/txchen%2Fscichicken","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Fscichicken/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Fscichicken/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txchen%2Fscichicken/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/txchen","download_url":"https://codeload.github.com/txchen/scichicken/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248695301,"owners_count":21146952,"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-15T01:14:12.859Z","updated_at":"2025-04-13T09:51:42.795Z","avatar_url":"https://github.com/txchen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sci Chicken\n\nA PUBG pcap playback system that does not hog CPU/GPU, works with version 3.7.19.\n\n## Sniff\n\nYou need an extra computer to be the man in the middle, to ensure your safety. I personally use MacOS, but Linux or windows should work as well.\n\nSuppose your gaming pc is `192.168.0.200`, and your middle machine. is `192.168.0.100`, first, set the network gateway to `192.168.0.100` on your gaming windows machine.\n\nThen, enable forwarding and nat on your middle machine. Here is how I do on MacOS:\n\n```bash\nsudo sysctl -w net.inet.ip.forwarding=1\n# my network interface is en5\necho \"nat on en5 inet from 192.168.0.0/24 to any -\u003e 192.168.0.100\" | sudo pfctl -v -ef -\n```\n\nFor linux, I believe it is something like:\n\n```bash\nsudo sysctl -w net.inet.ip.forwarding=1\nsudo iptables -t nat --append POSTROUTING --out-interface eth0 -j MASQUERADE\n```\n\nFor windows, I don't know. But I believe it will not be hard to do so.\n\nYour gaming pc should be able to connect to internet now. Open your game, enter lobby.\n\nNow, run this project on your middle machine:\n\n```bash\n# enter the project dir\nnpm i\n# optional, if you want to see prettier log\nnpm i -g pino\n# run. my network interface is en5\nnode index.js sniff en5 192.168.0.200 | pino\n```\n\nOpen the browser, and start the game, hope you can win. The good thing about web UI is, you can share the link to your team members. Check out ngrok or localtunnel.\n\n## Playback\n\nIf your gaming pc's IP is 192.168.0.200, then capture the packets with bpf `(src host 192.168.0.200 and udp dst portrange 7000-7999) or (dst host 192.168.0.200 and udp src portrange 7000-7999)` and save the file as `xxxx.pcap`. You can use wireshark or tcpdump to do this.\n\nThen we can playback the session:\n\n```bash\nnode index.js playback '/yourdir/xxx.pcap'\n```\n\nThe session will be in paused state, check out the API in `./backend/api.js`. You can use playback API to control it.\n\nFor example, if you want to fast forward to a certain point, call the API with this payload:\n\n```json\n{\n  \"action\" : \"start\",\n  \"speed\": \"20000.0\",\n  \"restart\": \"true\",\n  \"eventCount\": \"44000\"\n}\n```\n\nThis can be helpful when you want to tune the UI.\n\n## Testing scripts\n\nWhen I need to debug the parsing logic, I use this script, very handy:\n\n```bash\nLOGLEVEL=warn node test-getcmd-pcapfile.js '/yourdir/yourpcapfile.pcap'\n```\n\n## UI tuning\n\nCurrent UI is in Chinese, it should be pretty straightforward to change to any language.\n\nOnce you have the correct data in gamestate.js, the rest work like UI stuff is all easy shit. This project uses openlayers v4 to draw the map UI. You can use a pcapfile with playback mode, fast forward to a point, and then adjust UI elements.\n\nCheck out the `npm run fedev` script, it will auto refresh the UI when you change app.js.\n\n## Contribution\n\nThere must be some bugs in the current version. But please don't send pull requests to me since I will no longer maintain this project. Fork and enjoy yourself!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxchen%2Fscichicken","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftxchen%2Fscichicken","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxchen%2Fscichicken/lists"}