作为一个原批原神玩家,早就听说了私服的存在,无聊的我今天决定尝试一波。
搭建服务器
玩别人的私服多没意思啊,这种东西还是要自己搭建。
原神私服相关的信息在百度上是找不到的,法师的话可以在谷歌上找,不会魔法的话bing也可以凑合一下。
这个私服并不是原神的服务端泄漏然后广为流传,而是有人分析了原神游戏和服务器之间的通信,做了一个模拟服务端和游戏通信的程序。
这个项目是Github上的Grasscutter。
它需要搭配上数据包Grasscutter_Resources一起使用。
Grasscutter是Java写的,需要Java17版本,存储玩家数据需要一个数据库程序MongoDB
连接私服需要稍稍修改一下客户端,Collei Launcher是个很好的工具,而且还自带了代理。
上面这些东西都很好弄,谷歌搜一下,是有人已经做好整合包的。
接下来才是重点,这个服务器的网络应该怎么设置。
在首次启动服务端之后会生成配置文件config.json。
服务端会开放两个端口,一个是UDP22102游戏端口,进入游戏之后用的,一个是TCP443获取服务器状态,发送登录请求用的。
{
"folderStructure": {
"resources": "./resources/",
"data": "./data/",
"packets": "./packets/",
"scripts": "./resources/Scripts/",
"plugins": "./plugins/"
},
"databaseInfo": {
"server": {
"connectionUri": "mongodb://localhost:27017",// 连接mongodb数据库
"collection": "grasscutter"
},
"game": {
"connectionUri": "mongodb://localhost:27017",// 连接mongodb数据库
"collection": "grasscutter"
}
},
"language": {
"language": "zh_CN",
"fallback": "en_US",
"document": "EN"
},
"account": {
"autoCreate": true,// 登录没有注册的帐号会自动注册
"EXPERIMENTAL_RealPassword": false,// 是否验证密码的正确性,false:形同虚设
"defaultPermissions": [// 默认玩家有的权限
"*"
],
"maxPlayer": 100// 最大玩家数量
},
"server": {
"debugWhitelist": [],
"debugBlacklist": [],
"runMode": "HYBRID",
"http": {// 登录游戏的端口,是一个https服务器。
"bindAddress": "0.0.0.0",// 监听的网卡,0.0.0.0是所有网卡
"bindPort": 443,// 监听的登录端口
"accessAddress": "127.0.0.1",// 这个需要改成登录游戏用的地址,可以是域名,比如内网映射了的话,这里应该是填内网映射之后的地址
"accessPort": 0,// 这个需要改成映射之后登录游戏的端口,0是上面监听的端口
"encryption": {
"useEncryption": true,
"useInRouting": true,
"keystore": "./keystore.p12",
"keystorePassword": "123456"
},
"policies": {
"cors": {
"enabled": true,
"allowedOrigins": [
"*"
]
}
},
"files": {// 可以当https服务器用
"indexFile": "./index.html",
"errorFile": "./404.html"
}
},
"game": {// 游戏的端口
"bindAddress": "0.0.0.0",//同上
"bindPort": 22102,// 同上
"accessAddress": "127.0.0.1",// 同上
"accessPort": 0,// 同上
"loadEntitiesForPlayerRange": 100,
"enableScriptInBigWorld": true,
"enableConsole": true,
"kcpInterval": 20,
"logPackets": "NONE",
"gameOptions": {
"inventoryLimits": {
"weapons": 2000,
"relics": 2000,
"materials": 2000,
"furniture": 2000,
"all": 30000
},
"avatarLimits": {
"singlePlayerTeam": 4,// 单人模式队伍角色数量
"multiplayerTeam": 4// 多人模式队伍角色数量
},
"sceneEntityLimit": 1000,
"watchGachaConfig": false,
"enableShopItems": true,
"staminaUsage": true,
"energyUsage": false,
"fishhookTeleport": true,
"resinOptions": {
"resinUsage": true,
"cap": 160,
"rechargeTime": 480
},
"rates": {
"adventureExp": 1.0,
"mora": 1.0,
"leyLines": 1.0
}
},
"joinOptions": {
"welcomeEmotes": [
2007,
1002,
4010
],
"welcomeMessage": "欢迎,这里是峰峰的私服",
"welcomeMail": {// 欢迎邮件
"title": "欢迎来私服呢",
"content": "抽吧!",
"sender": "服务器",
"items": [
{
"itemId": 102,
"itemCount": 1880200,
"itemLevel": 1
},
{
"itemId": 202,
"itemCount": 1000000,
"itemLevel": 1
},
{
"itemId": 223,
"itemCount": 648,
"itemLevel": 1
}
]
}
},
"serverAccount": {// 作为控制台的虚拟玩家属性
"avatarId": 10000046,
"nameCardId": 210001,
"adventureRank": 8000,
"worldLevel": 6666,
"nickName": "服务器",
"signature": "不是个原批"
}
},
"dispatch": {
"regions": [// 游戏地址,如果这里不止一个的话会提示选择游戏服务器
{
"Name": "0",// 是和资源文件对应的
"Title": "0",// 给玩家看的
"Ip": "127.0.0.1",
"Port": 22102
},
{
"Name": "1",
"Title": "1",
"Ip": "127.0.0.1",
"Port": 22102
},
{
"Name": "2",
"Title": "2",
"Ip": "127.0.0.1",
"Port": 22102
},
{
"Name": "3",
"Title": "3",
"Ip": "127.0.0.1",
"Port": 22102
},
{
"Name": "4",
"Title": "4",
"Ip": "127.0.0.1",
"Port": 22102
},
{
"Name": "3.1",
"Title": "3.1",
"Ip": "127.0.0.1",
"Port": 22102
},
{
"Name": "3.2",
"Title": "3.2",
"Ip": "127.0.0.1",
"Port": 22102
},
{
"Name": "2.8",
"Title": "2.8",
"Ip": "127.0.0.1",
"Port": 22102
}
],
"defaultName": "1",
"logRequests": "NONE"
}
},
"version": 4
}
配置中上面两个accessAddress以及下面的regions一定要和内网映射之后的对应好(没有映射就填监听的地址)
游戏体验
搭建服务器在网络配置上卡了我很久,最终还是成功了。
果然还是处在高层的软件友好啊,不像某机顶盒,怎么弄都无解。
游戏体验呢,可以说是毫无游戏体验可言。
首先大部分的地方都没有怪,空荡荡一片,任务啦活动啦不用想,深境螺旋前面还能打,后面分上半下半就不能玩了。
但是拿来体验角色什么的还是可以的。