├── pkg └── utils │ ├── filelock_windows.go │ └── filelock_unix.go ├── overwrite ├── mods.ini ├── breaking-news.html ├── config.ini ├── servers.ini ├── index.html ├── local-trans.js ├── zh-CN.json └── nipplejs.js ├── go.mod ├── views └── 404page.html ├── .gitignore ├── config ├── config.json └── hack-map.json ├── README.md ├── go.sum ├── LICENSE └── cmd └── main.go /pkg/utils/filelock_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | 3 | package utils 4 | 5 | import "os" 6 | 7 | func LockFile(f *os.File) error { 8 | return nil 9 | } 10 | 11 | func UnlockFile(f *os.File) error { 12 | return nil 13 | } 14 | -------------------------------------------------------------------------------- /pkg/utils/filelock_unix.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package utils 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | func LockFile(f *os.File) error { 11 | return syscall.Flock(int(f.Fd()), syscall.LOCK_EX) 12 | } 13 | 14 | func UnlockFile(f *os.File) error { 15 | return syscall.Flock(int(f.Fd()), syscall.LOCK_UN) 16 | } 17 | -------------------------------------------------------------------------------- /overwrite/mods.ini: -------------------------------------------------------------------------------- 1 | [General] 2 | 1=athse 3 | 4 | [athse] 5 | ID=athse 6 | Name=Scorched Earth 7 | Description=A mature overhaul of RA2, with an emphasis on the best combat experience. 8 | Author=G-E 9 | Version=Rev.2023.06.11 10 | Website=https://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai 11 | Download=athse/athse-snapshot-06112023.rar 12 | DownloadSize=112948223 13 | -------------------------------------------------------------------------------- /overwrite/breaking-news.html: -------------------------------------------------------------------------------- 1 |

游玩单机AI请前往 主菜单-单机模式!有任何问题请微信关注公众号 思牛逼

2 |

网页红井™随意输入两串字符串就能登陆!不会向您索要任何个人信息,更不会强制您加群后才能游玩,谨防诈骗!

3 | 反馈问题、交友开黑,请此加入群聊【网页红井交流群114514群】 -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module ra2web-proxy 2 | 3 | go 1.22.5 4 | 5 | require ( 6 | github.com/PuerkitoBio/goquery v1.9.2 7 | github.com/andybalholm/brotli v1.1.0 8 | github.com/klauspost/compress v1.17.11 9 | github.com/rs/zerolog v1.33.0 10 | golang.org/x/sync v0.1.0 11 | ) 12 | 13 | require ( 14 | github.com/andybalholm/cascadia v1.3.2 // indirect 15 | github.com/mattn/go-colorable v0.1.13 // indirect 16 | github.com/mattn/go-isatty v0.0.19 // indirect 17 | golang.org/x/net v0.27.0 // indirect 18 | golang.org/x/sys v0.22.0 // indirect 19 | ) 20 | -------------------------------------------------------------------------------- /views/404page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 404 Not Found 6 | 19 | 20 | 21 |

Page Not Found-404

22 |

请检查是否地址输入错误!

23 |

可以微信关注公众号 思牛逼 获取解决方案

24 |

RA2WEB ERROR PAGE

25 | 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # If you prefer the allow list template instead of the deny list, see community template: 2 | # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore 3 | 4 | # IDE config 5 | .idea 6 | 7 | # Binaries for programs and plugins 8 | *.exe 9 | *.exe~ 10 | *.dll 11 | *.so 12 | *.dylib 13 | 14 | # Test binary, built with `go test -c` 15 | *.test 16 | 17 | # Output of the go coverage tool, specifically when used with LiteIDE 18 | *.out 19 | 20 | # Dependency directories (remove the comment below to include it) 21 | # vendor/ 22 | 23 | # Go workspace file 24 | go.work 25 | 26 | # RA2WEB-PROXY Cache 27 | _cacheHacked 28 | _cacheRaw 29 | _cache 30 | 31 | -------------------------------------------------------------------------------- /overwrite/config.ini: -------------------------------------------------------------------------------- 1 | [General] 2 | discordUrl=https://discord.gg/yxkVn4wBad 3 | 4 | # Where game resources are located 5 | gameresBaseUrl=//res.ra2web.cn/v2/ 6 | mapsBaseUrl=//res.ra2web.cn/v2/map/ 7 | modsBaseUrl=//gameres.chronodivide.com/mod/ 8 | gameResArchiveUrl=https://xwis.net/dl/Red-Alert-2-Multiplayer.exe 9 | patchNotesUrl=//chronodivide.com/patch-notes.html 10 | ladderRulesUrl=//chronodivide.com/ladder-rules.html 11 | modSdkUrl=https://github.com/chronodivide/mod-sdk 12 | donateUrl="//chronodivide.com/#donate" 13 | breakingNewsUrl=/breaking-news.html 14 | oldClientsBaseUrl=/old/ 15 | quickMatchEnabled=yes 16 | 17 | # Chronodivde 人机开关 18 | botsEnabled=yes 19 | # Chronodivide 中国大区专供 20 | defaultLanguage=zh-CN 21 | 22 | viewport.width=1024 23 | viewport.height=768 -------------------------------------------------------------------------------- /config/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "main_target_url": "https://game.chronodivide.com/", 3 | "res_target_url": "https://wyhjres.bun.sh.cn/", 4 | "base_href": "", 5 | "main_entry_list": [ 6 | "www.ra2web.com", 7 | "ra2web.com", 8 | "game.ra2web.cn", 9 | "cn.ra2web.cn" 10 | ], 11 | "res_entry_list": [ 12 | "res.ra2web.com", 13 | "res.ra2web.cn", 14 | "res.ra2.bun.sh.cn" 15 | ], 16 | "api_endpoint": [ 17 | "api.game.ra2web.cn" 18 | ], 19 | "allowed_origins": [ 20 | "http://game.ra2web.cn", 21 | "https://game.ra2web.cn", 22 | "http://res.ra2web.cn", 23 | "http://ra2web.com", 24 | "http://www.ra2web.com", 25 | "http://res.ra2web.com", 26 | "https://ra2web.com", 27 | "https://www.ra2web.com", 28 | "https://res.ra2web.com", 29 | "https://cn.ra2web.cn", 30 | "http://cn.ra2web.cn" 31 | ], 32 | "http": { 33 | "port": 80 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /overwrite/servers.ini: -------------------------------------------------------------------------------- 1 | [eu1] 2 | label="Europe (EU1)" 3 | available=yes 4 | gameVersion=0.57 5 | wolUrl="wss://wol-eu1.chronodivide.com:443/127.0.0.1:4005" 6 | wladderUrl="https://wol-eu1.chronodivide.com/ladder" 7 | wgameresUrl="wss://wol-eu1.chronodivide.com:443/127.0.0.1:4807" 8 | gservUrl="wss://gserv-eu1.chronodivide.com:443" 9 | wolKeepAliveInGame=yes 10 | 11 | [sea1] 12 | label="South-East Asia (SG)" 13 | available=yes 14 | gameVersion=0.57 15 | wolUrl="wss://wol-sea1.chronodivide.com:443/127.0.0.1:4005" 16 | wladderUrl="https://wol-sea1.chronodivide.com/ladder" 17 | wgameresUrl="wss://wol-sea1.chronodivide.com:443/127.0.0.1:4807" 18 | gservUrl="wss://gserv-sea1.chronodivide.com:443" 19 | wolKeepAliveInGame=yes 20 | 21 | [sea2] 22 | label="South-East Asia (HK)" 23 | available=yes 24 | gameVersion=0.57 25 | wolUrl="wss://wol-sea2.chronodivide.com:443/127.0.0.1:4005" 26 | wladderUrl="https://wol-sea2.chronodivide.com/ladder" 27 | wgameresUrl="wss://wol-sea2.chronodivide.com:443/127.0.0.1:4807" 28 | gservUrl="wss://gserv-sea2.chronodivide.com:443" 29 | wolKeepAliveInGame=yes -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ra2web-proxy 2 | 3 | **ra2web-proxy** 是一个用于网页红警(品牌名 红色井界™)的边缘合规安全网关。它用于转发官方的 Chronodivide 客户端,并动态注入代码和内容,以满足区域合规要求。 4 | 5 | ## 功能 6 | 7 | 该项目的目的是提供一键启动网页红警代理转发网关的解决方案,使用户能够拥有自己的网页红警站点。 8 | 9 | ## 开始使用 10 | 11 | 要开始使用,请按照以下步骤进行操作: 12 | 13 | 1.使用 `go build` 命令构建项目。 14 | 2.在您的机器上运行 `ra2web-proxy` 可执行文件。 15 | 3.如果想要以 https 方式访问,参考 HTTPS 配置的部分。 16 | 17 | ## 开发 18 | 19 | 要参与项目的开发,请按照以下步骤进行操作: 20 | 21 | 1. 将仓库克隆到本地。 22 | 2. 在您的主机(Host)文件中配置以下条目: 23 | 24 | ``` 25 | 127.0.0.1 game.ra2web.cn 26 | 127.0.0.1 res.ra2web.cn 27 | 127.0.0.1 cn.ra2web.cn 28 | ``` 29 | 30 | 3.以 /cmd/main.go 为入口启动工程,访问 http://game.ra2web.cn 即可。 31 | 4.如果想要以 https 方式访问,参考 HTTPS 配置的部分。 32 | 33 | 34 | ## HTTPS 配置 35 | 36 | 如果想要以 https 方式访问,需要先生成 SSL 证书: 37 | 38 | ```bash 39 | openssl genrsa -out cert.key 2048 40 | openssl req -new -key cert.key -out cert.csr -subj "/CN=*.ra2web.cn" 41 | openssl x509 -req -days 365 -in cert.csr -signkey cert.key -out cert.crt 42 | ``` 43 | 44 | 然后修改 config/config.json,增加 https 配置: 45 | 46 | ```json 47 | { 48 | "https": { 49 | "port": 443, 50 | "cert": "cert.crt", 51 | "key": "cert.key" 52 | } 53 | } 54 | ``` 55 | 56 | > 注意:首次访问页面会报错,是因为自签证书导致域名 `cn.ra2web.cn` 和 `res.ra2web.cn` 不被浏览器信任,有两种解决方案: 57 | > * 使用正式的证书。 58 | > * 手动在浏览器访问这两个地址,让浏览器信任即可,只需要操作一次。 59 | > * https://cn.ra2web.cn 60 | > * https://res.ra2web.cn 61 | 62 | ## 下一步计划 63 | 64 | - [ ] 实现自动化的覆盖操作,例如 JSON 合并和配置文件 INI 合并。 65 | - [ ] 添加可视化管理界面。 66 | - [ ] 改进可观测性功能。 67 | - [ ] 实现自动化的功能注入。 68 | 69 | ## 贡献 70 | 71 | 请直接提交issue或者是提交pull request,项目依然在持续迭代中 72 | -------------------------------------------------------------------------------- /config/hack-map.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "hackAction": "addFile", 4 | "hackSource": "/lib/local-trans.js", 5 | "hackDetail": { 6 | "addFileSource": "/local-trans.js", 7 | "overwrite": true 8 | } 9 | }, 10 | { 11 | "hackAction": "addFile", 12 | "hackSource": "/lib/nipplejs.js", 13 | "hackDetail": { 14 | "addFileSource": "/nipplejs.js", 15 | "overwrite": true 16 | } 17 | }, 18 | { 19 | "hackAction": "addFile", 20 | "hackSource": "/breaking-news.html", 21 | "hackDetail": { 22 | "addFileSource": "/breaking-news.html", 23 | "overwrite": true 24 | } 25 | }, 26 | { 27 | "hackAction": "addFile", 28 | "hackSource": "/config.ini", 29 | "hackDetail": { 30 | "addFileSource": "/config.ini", 31 | "overwrite": true 32 | } 33 | }, 34 | { 35 | "hackAction": "addFile", 36 | "hackSource": "/servers.ini", 37 | "hackDetail": { 38 | "addFileSource": "/servers.ini", 39 | "overwrite": true 40 | } 41 | }, 42 | { 43 | "hackAction": "modifyHTMLFile", 44 | "hackSource": "/index.html", 45 | "hackDetail": { 46 | "modifyPointsList": [ 47 | { 48 | "action": "insert", 49 | "selector": "head meta:first-of-type", 50 | "position": "before", 51 | "content": "" 52 | }, 53 | { 54 | "action": "delete", 55 | "selector": "head script[src='https://www.googletagmanager.com/gtag/js?id=G-NT498QGSGZ']" 56 | }, 57 | { 58 | "action": "replace", 59 | "selector": "head title", 60 | "content": "New Title" 61 | }, 62 | { 63 | "action": "replaceJS", 64 | "selector": "script", 65 | "oldContent": "console.log('old');", 66 | "newContent": "console.log('new');" 67 | } 68 | ] 69 | } 70 | } 71 | ] -------------------------------------------------------------------------------- /overwrite/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 网页红井-联机对战平台 8 | 9 | 11 | 12 | 13 | 29 | 30 | 31 | 32 | 39 | 40 | 41 | 42 | 47 | 48 | 49 | 53 | 54 |
55 |
摇杆操作中,禁止其他操作
56 |
57 | 58 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4yPeE= 2 | github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk= 3 | github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= 4 | github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= 5 | github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= 6 | github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= 7 | github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= 8 | github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= 9 | github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= 10 | github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= 11 | github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= 12 | github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= 13 | github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= 14 | github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 15 | github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 16 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 17 | github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= 18 | github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= 19 | github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= 20 | github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= 21 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 22 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 23 | golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= 24 | golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 25 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 26 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 27 | golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= 28 | golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= 29 | golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= 30 | golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= 31 | golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= 32 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 33 | golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 34 | golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= 35 | golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 36 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 37 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 38 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 39 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 40 | golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 41 | golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 42 | golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 43 | golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 44 | golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 45 | golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 46 | golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= 47 | golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 48 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 49 | golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= 50 | golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= 51 | golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= 52 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 53 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 54 | golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= 55 | golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= 56 | golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= 57 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 58 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 59 | golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= 60 | golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= 61 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 62 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /overwrite/local-trans.js: -------------------------------------------------------------------------------- 1 | let translationMap = { 2 | "https://xwis.net/dl/Red-Alert-2-Multiplayer.exe": "dom-node:discordlink", 3 | "Ladder Season 2 is live. Play a \"Quick Match\" and get your rank badge now!": "这里是自定义房间大厅,你也可以从主菜单的‘快速匹配’选项来开启排位赛征程并获得徽章!现在天梯第二赛季已经开赛,尽情挑战吧!游玩人机请返回主菜单并选择 单机模式", 4 | "Having trouble with a command? Type /help to learn more about it.":"不了解聊天指令如何操作?输入/help并回车获取更多关于聊天指令的介绍。", 5 | "Ladder Season 2 is live. Play a \"Quick Match\" and get your rank badge now! ": "这里是自定义房间大厅,你也可以从主菜单的‘快速匹配’选项来开启排位赛征程并获得徽章!现在天梯第二赛季已经开赛,尽情挑战吧!游玩人机请返回主菜单并选择 单机模式", 6 | "Join us on Discord: https://discord.gg/uavJ34JTWY": "网页红井问题反馈,请微信关注公众号 思牛逼 获取", 7 | "您加入了美國指揮中心頻道":"您已返回房间大厅。问题反馈、游戏交流,欢迎微信关注公众号 思牛逼", 8 | "您已經與伺服器斷線了":"您已经与服务器断开连接,微信关注公众号 思牛逼 获取解决方案", 9 | "自訂戰役":"定制对局", 10 | "基地重新部署":"基地可重新部署", 11 | "升級工具箱": "随机宝箱", 12 | "部隊數": "初始作战单位", 13 | "資金":"初始资金", 14 | "遭遇戰模式": "单机模式", 15 | "於盟友建造場旁建設": "可在盟友建造场旁建造", 16 | "起始位置": "出生点", 17 | "播放": "启动", 18 | "您的密碼必須為八個字元長。": "你的密码必须为8个字符", 19 | "新帳號": "注册", 20 | "綽號": "账号", 21 | "快速配對競賽": "排位赛", 22 | "自訂競賽": "自定义房间", 23 | "巨砲": "巨炮", 24 | "法國的巨砲是究極防守武器,能發射長程破壞力驚人的砲彈。":"法国巨炮拥有惊人破坏力。可被V3火箭、驱逐舰、火箭飞行兵、天启坦克等单位克制,除此之外几乎是所向披靡。对了,小心被停电和红警魔鬼蓝天。", 25 | "傘兵": "空降部队", 26 | "美國擁有世上最佳的傘兵。興建一座空指部,空降傘兵到戰場的各個角落。": "美国可以建造空指部获取空降部队支援权限,每隔一段时间后可以在任意地点空投8名美国大兵。该支援可与占领科技机场后的伞兵同时存在!", 27 | "黑鷹戰機": "黑鹰战机", 28 | "黑鷹戰機是世界上最具威脅性的戰機之一。韓國軍隊一向受到這些戰技高超的戰機飛行員,和威力強大的戰轟機保護。": "韩国黑鹰战机与入侵者战机价格一样,但其装甲与火力远超入侵者战机。7架飞机可以瞬间摧毁敌方基地!", 29 | "坦克殺手": "坦克杀手", 30 | "德國坦克殺手能輕易消滅敵方車輛,但先進的穿甲砲對付敵方步兵或建築物則威力欠佳。": "德国坦克杀手可以轻松消灭敌方载具,尤其是消灭敌方矿车以摧毁敌方经济来源,但对付步兵和建筑犹如挠痒痒一样几乎伤害为零。受制于炮塔不能旋转,只能在小规模纯坦克作战情况下发挥优异的作用。", 31 | "狙擊手": "狙击手", 32 | "英國狙擊手能輕易在遠距離宰殺敵方步兵。": "英国狙击手可以轻松击杀敌方步兵于超远的距离。如果将其派驻到多功能步兵车,可以帮助步兵车尽快升级。对建筑和载具伤害如挠痒痒一样几乎为0.", 33 | "自爆卡車": "自爆卡车", 34 | "利比亞自爆卡車能摧毀敵方目標,引爆小型核彈。": "利比亚自爆卡车可以在接近敌人时引爆小型核弹,与敌人一起上西天。小心保护,不要让别人在自家引爆!", 35 | "輻射工兵": "辐射工兵", 36 | "伊拉克輻射工兵能用輻射砲射出的有毒輻射污染土地,以及毀滅敵方部隊。": "伊拉克辐射工兵可以远程瞬间融化敌人步兵和击杀载具。部署后可形成辐射场,批量损毁载具和融化步兵,但这种模式不会为他带来经验。", 37 | "恐怖份子": "恐怖分子", 38 | "古巴恐怖份子為蘇維埃犧牲性命在所不惜,會在身上綁上炸彈,直接衝入敵陣,再加以引爆,炸死自己和所有靠近的敵人。": "古巴恐怖分子可以灵活、快速地接近敌人并引爆炸药。当其进入盟军的多功能步兵车,将化身小型自爆卡车!从建筑的不同角度接近自爆伤害大有差异,也可以配合疯狂伊文绑上炸弹进入防空履带车,请尽情探索!", 39 | "俄國磁能坦克能發射出短距磁能彈,讓敵方車輛短路,甚至能以弧形穿越敵方圍牆。": "苏俄磁能坦克拥有均衡的速度和稍高于普通坦克的攻击,可以越过敌人围墙攻击,升级到精英级别后射出的闪电会分叉。", 40 | "OR": "或", 41 | "Prefetching assets...": "提前拉取资源中", 42 | "Connecting...": "连接中...", 43 | "Downloading...": "下载中...", 44 | "Loading...": "加载中...", 45 | "The download failed, please check your connection and try again later.": "下载失败,请检查你的网络连接并刷新重试。", 46 | "Locate original game assets": "定位游戏源文件(这将让你最快开始体验)", 47 | "If you have a copy of RA2 already installed, you can import it below. You can also download a free multiplayer-only RA2 archive from XWIS.net (official server) here:": "如果您已安装 RA2(红色警戒2) 副本,您可直接导入。您还可以从 XWIS.net(官方服务器)下载一个免费的仅限多人游戏的 RA2 存档,请用下载工具复制下面的链接下载:", 48 | "HINT: Use Right-click -> \"Save link as...\", then drop the downloaded file in the box below:Download size: ~200 MiB": "提示:右键点击链接->链接另存为,下载完毕后把东西拖入这个窗口。下载大小大约200MB", 49 | "Select folder...": "选择文件夹", 50 | "Select archive...": "选择归档包", 51 | "Supported archive formats: rar, tar, tar.gz, tar.bz2, tar.xz, zip, 7z, exe (sfx)": "支持的归档类型:rar, tar, tar.gz, tar.bz2, tar.xz, zip, 7z, exe (sfx)", 52 | "Drop the required game files hereOR": "将上面两类东西拖动到此,或者", 53 | "Main Menu": "主菜单", 54 | "https://discord.gg/yxkVn4wBad": "dom-node:discordlink", 55 | "Quick Match": "排位赛", 56 | "Custom Match": "自定义房间", 57 | "Demo Mode": "单机模式", 58 | "Replays": "回放", 59 | "Mods": "MOD", 60 | "Info & Credits": "信息与鸣谢", 61 | "Options": "选项与设置", 62 | "Fullscreen (Alt+F)": "全屏(Alt+F)", 63 | "Set up a game automatically": "自动、快速地开始游戏", 64 | "Join a lobby to select an opponent": "加入游戏大厅以自由选择对手", 65 | "Play a singleplayer match against a training dummy": "单人游戏以对抗训练用假对手", 66 | "Play back a recording of a previously played": "回放先前精彩的对抗过程", 67 | "Manage and play modified versions of the base game": "游玩其他的Mod版本,基于原生红色井界", 68 | "View additional information and credits": "查看更多的关于游戏的信息,和鸣谢", 69 | "Adjust game difficulty, audio / visual settings, and controls.": "调整游戏音频、视觉、控制设置", 70 | "Toggle full screen mode": "切换到全屏(进入对战后看到效果)", 71 | "Login": "登录", 72 | "Server": "大区", 73 | "Nickname": "昵称", 74 | "Password": "密码", 75 | "New Account": "新建账户", 76 | "Back": "返回", 77 | "Europe (EU1)": "欧洲一区", 78 | "South-East Asia (HK)": "中国香港一区", 79 | "South-East Asia (SG)": "新加坡一区", 80 | "OK": "确定", 81 | "Your password must be 8 letters long.": "你的密码必须等于8个字符", 82 | "Re-enter Password:": "再次输入密码", 83 | "Available Games": "活动的对局", 84 | "The games you can join.": "你可以加入的游戏(如果还有空位的话)", 85 | "You've been disconnected from the server": "你已掉线(网络原因或在大厅里长时间未活动)", 86 | "Play on another game server or region": "切换到其他大区游玩", 87 | "Observe": "旁观对局", 88 | "Observe an existing multiplayer game": "旁观一个已存在的多人游戏", 89 | "Create Game": "创建对局", 90 | "Creates a new multiplayer game.": "新建一个新的多人游戏", 91 | "Join Game": "加入对局", 92 | "Join an existing multiplayer game.": "加入一个已存在的多人游戏", 93 | "Change server": "切换大区", 94 | "Room Description": "房间描述", 95 | "Cancel": "取消", 96 | "Players": "玩家", 97 | "Side": "阵营", 98 | "Color": "颜色", 99 | "Start": "出生点", 100 | "Team": "队伍", 101 | "Closed": "关闭", 102 | "Short Game": "快速游戏", 103 | "MCV Repacks": "基地可重新部署", 104 | "Crates Appear": "随机宝箱", 105 | "Superweapons": "超级武器", 106 | "Host Teams": "房主决定成员队伍", 107 | "Game Speed": "游戏速度", 108 | "Credits": "初始资金", 109 | "Unit Count": "初始作战单位", 110 | "Build Off Ally ConYards": "可在盟友建造场旁建造", 111 | "Start Game": "开始游戏", 112 | "Customize Battle": "定制对局", 113 | "Host Screen": "房主视角", 114 | "Open": "打开", 115 | "Observer": "旁观者", 116 | "Open Observer": "允许旁观", 117 | "Game Type": "游戏类型", 118 | "Select Engagement": "选择作战配置", 119 | "Game Map": "游戏地图", 120 | "Use Map": "使用该地图", 121 | "Custom Map...": "自定义(上传地图)", 122 | "Search": "搜索", 123 | "Join Screen": "参与者视角", 124 | "Accept": "准备", 125 | "Skirmish Game": "模拟战斗", 126 | "Training dummy": "训练用敌人", 127 | "Select replay:": "选择回放", 128 | "Load": "读取", 129 | "Keep": "保持", 130 | "Import...": "导入", 131 | "Export...": "导出", 132 | "Delete": "删除", 133 | "Patch Notes": "版本更新说明", 134 | "Report a Bug": "问题与反馈", 135 | "Donate": "捐赠", 136 | "View Credits": "鸣谢", 137 | "Gameplay": "游玩", 138 | "Scroll Rate": "滚动速率", 139 | "Attack/Move Button": "攻击/移动", 140 | "Right Click Scrolling": "右键按住自由滚动", 141 | "Show Flyer Helper": "辅助确定飞行单位位置", 142 | "See Hidden Objects": "隐藏目标有特殊标记", 143 | "Target Lines": "目标指示线", 144 | "Graphics": "图形", 145 | "Resolution": "分辨率", 146 | "Models": "模型精度", 147 | "Dynamic Shadows": "动态阴影", 148 | "Sound": "声音", 149 | "Keyboard": "键盘", 150 | "Storage": "存储管理", 151 | "Resume Mission": "回到作战", 152 | "Abort Mission": "放弃作战", 153 | "Quit": "退出", 154 | "Random (???)": "随机 (???)", 155 | "America": "美国", 156 | "Korea": "韩国", 157 | "France": "法国", 158 | "Germany": "德国", 159 | "Great Britain": "英国", 160 | "Libya": "利比亚", 161 | "Iraq": "伊拉克", 162 | "Cuba": "古巴", 163 | "Russia": "苏俄", 164 | "Map Name ↓": "地图名称 ↓", 165 | "Map Name ↑": "地图名称 ↑", 166 | "Max Slots ↓": "最大玩家数 ↓", 167 | "Max Slots ↑": "最大玩家数 ↑", 168 | "Paradrop": "空降部队", 169 | "The USA has the best paratroopers in the world. Build an Airforce Command Center to drop paratroopers anywhere on the battlefield.": "美国可以建造空指部获取空降部队支援权限,每隔一段时间后可以在任意地点空投8名美国大兵。该支援可与占领科技机场后的伞兵同时存在!", 170 | "Black Eagle": "黑鹰战机", 171 | "The Black Eagles are the most dangerous fighter pilots in the world. Korean forces are always well protected by these deadly air men and their lethal fighter-bombers.": "韩国黑鹰战机与入侵者战机价格一样,但其装甲与火力远超入侵者战机。7架飞机可以瞬间摧毁敌方基地!", 172 | "Grand Cannon": "巨炮", 173 | "The French Grand Cannon is the ultimate defensive gun, firing at long range for massive damage.": "法国巨炮拥有惊人破坏力。可被V3火箭、驱逐舰、火箭飞行兵、天启坦克等单位克制,除此之外几乎是所向披靡。对了,小心被停电和红警魔鬼蓝天。", 174 | "Tank Destroyer": "坦克杀手", 175 | "The German Tank Destroyer can easily eliminate enemy vehicles. Its advanced armor-piercing gun is weak against enemy infantry and structures.": "德国坦克杀手可以轻松消灭敌方载具,尤其是消灭敌方矿车以摧毁敌方经济来源,但对付步兵和建筑犹如挠痒痒一样几乎伤害为零。受制于炮塔不能旋转,只能在小规模纯坦克作战情况下发挥优异的作用。", 176 | "Sniper": "狙击手", 177 | "The British Sniper can easily eliminate enemy infantry at great ranges.": "英国狙击手可以轻松击杀敌方步兵于超远的距离。如果将其派驻到多功能步兵车,可以帮助步兵车尽快升级。对建筑和载具伤害如挠痒痒一样几乎为0.", 178 | "Demolition Truck": "自爆卡车", 179 | "The Libyan Demolition Truck self-destructs on an enemy target, setting off a small nuclear bomb.": "利比亚自爆卡车可以在接近敌人时引爆小型核弹,与敌人一起上西天。小心保护,不要让别人在自家引爆!", 180 | "Desolator": "辐射工兵", 181 | "The Iraqi Desolator can poison land with toxic radiation or annihilate enemy troops with his powerful Rad-Cannon.": "伊拉克辐射工兵可以远程瞬间融化敌人步兵和击杀载具。部署后可形成辐射场,批量损毁载具和融化步兵,但这种模式不会为他带来经验。", 182 | "Terrorist": "恐怖分子", 183 | "The Cuban terrorist is a fanatic for the Soviet cause and will actually carry a bomb right up to the enemy before detonating it, destroying himself and anything nearby.": "古巴恐怖分子可以灵活、快速地接近敌人并引爆炸药。当其进入盟军的多功能步兵车,将化身小型自爆卡车!从建筑的不同角度接近自爆伤害大有差异,也可以配合疯狂伊文绑上炸弹进入防空履带车,请尽情探索!", 184 | "Tesla Tank": "磁能坦克", 185 | "Russian Tesla Tanks fire a short range Tesla Bolt that can short circuit enemy vehicles and even arc over enemy walls.": "苏俄磁能坦克拥有均衡的速度和稍高于普通坦克的攻击,可以越过敌人围墙攻击,升级到精英级别后射出的闪电会分叉。", 186 | "Not Ready": "取消准备", 187 | "Not ready": "取消准备", 188 | "Select Mode": "选择模式", 189 | "Ranked": "排位赛", 190 | "Unranked": "非排位赛", 191 | "Breaking News": "突发新闻", 192 | "Preferred Country": "选择阵营", 193 | "Preferred Color": "选择颜色", 194 | "Wins :": "胜利 :", 195 | "Losses :": "失败 :", 196 | "Disconnects :": "掉线 :", 197 | "Rank :": "段位 :", 198 | "Points :": "得分点 :", 199 | "Offline": "离线", 200 | "Play": "开始游戏", 201 | "View ladder": "查看排行榜", 202 | "The host wants to start the game. Press the flashing Accept button.": "房主准备开始游戏,请点击右侧菜单 准备 按钮!", 203 | "Master Volume": "主音量", 204 | "Music Volume": "音乐音量", 205 | "Voice Volume": "语音音量", 206 | "SFX Volume": "音效音量", 207 | "Ambient Volume": "环境音量", 208 | "UI Volume": "UI音量", 209 | "Credits Volume": "货币音量", 210 | "Multiplayer Score": "多人游戏得分", 211 | "Player": "玩家", 212 | "Kills": "击杀", 213 | "Losses": "损失", 214 | "Built": "建造", 215 | "Score": "得分", 216 | "Continue": "下一步" 217 | }; 218 | let transDOMMap = { 219 | "dom-node:discordlink": `点击链接加入群聊【网页红井交流群114514群】`, 220 | "dom-node:快速匹配": `排位赛` 221 | } 222 | 223 | document.addEventListener('DOMContentLoaded', (event) => { 224 | const observer = new MutationObserver((mutationsList) => { 225 | for (const mutation of mutationsList) { 226 | 227 | if (mutation.type === 'childList') { 228 | translateDOM(mutation.target); 229 | } 230 | } 231 | }); 232 | 233 | observer.observe(document.body, { childList: true, subtree: true }); 234 | }); 235 | 236 | function isNodeTransDom(value = "") { 237 | const valueType = value.split(':')[0] || "normal" 238 | if (valueType === "dom-node") { 239 | return true 240 | } else { 241 | return false 242 | } 243 | } 244 | function translateDOM(node) { 245 | if (node.nodeType === Node.ELEMENT_NODE) { 246 | const textContent = node.textContent; 247 | const textValue = translationMap[textContent] 248 | if (textValue) { 249 | if (isNodeTransDom(textValue)) { 250 | const tempTransDom = transDOMMap[textValue] 251 | node.innerHTML = tempTransDom || `
` 252 | } else { 253 | if (containsOnlyTextOrIsEmpty(node)) { 254 | node.textContent = textValue; 255 | } 256 | } 257 | } 258 | 259 | for (const child of node.childNodes) { 260 | translateDOM(child); 261 | } 262 | } 263 | } 264 | function containsOnlyTextOrIsEmpty(element) { 265 | // 获取所有子节点 266 | const childNodes = element.childNodes; 267 | 268 | // 如果没有子节点,那么元素是空的 269 | if (childNodes.length === 0) { 270 | return true; 271 | } 272 | 273 | // 检查所有子节点 274 | for (let i = 0; i < childNodes.length; i++) { 275 | // 如果有一个子节点是元素节点,那么返回false 276 | if (childNodes[i].nodeType === Node.ELEMENT_NODE) { 277 | return false; 278 | } 279 | } 280 | 281 | // 如果所有子节点都是文本节点,那么返回true 282 | return true; 283 | } 284 | function isStringOnlyWhitespace(str) { 285 | return /^\s*$/.test(str); 286 | } 287 | 288 | // 请求CSS文件 289 | fetch('https://cn.ra2web.cn/style.css?v=0.57.2') 290 | .then(response => { 291 | if (!response.ok) { 292 | throw new Error('Network response was not ok'); 293 | } 294 | return response.text(); 295 | }) 296 | .then(cssCode => { 297 | // 创建一个