Skip to content

Commit

Permalink
Update to 0.4.2
Browse files Browse the repository at this point in the history
- Fixed a bug about Redis Data Fetch
- Add custom Redis URL & Redis Connect Password support
- "Team123it.Arcaea.MarveCube.Controllers.ExtController.DownloadSongData()" is now obsolete (use project "Team123it.Arcaea.MarveCube.Standalone" instead)
  • Loading branch information
Misaka12456 committed May 2, 2022
1 parent 69c90b4 commit ef64cbb
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>MarveCube.Standalone</AssemblyName>
<Version>0.4.1</Version>
<Version>0.4.0</Version>
<Company>123 Open-Source Organization</Company>
<Product>Arcaea Server 2(123 Marvelous Cube) Standalone Version</Product>
<AssemblyVersion>0.4.1</AssemblyVersion>
<AssemblyVersion>0.4.2</AssemblyVersion>
<FileVersion>0.4.0</FileVersion>
<Copyright>(C)Copyright 2015-2022 123 Open-Source Organization. All rights reserved.</Copyright>
<AssemblyTitle>123 Marvelous Cube Standalone Version</AssemblyTitle>
Expand Down
1 change: 1 addition & 0 deletions Team123it.Arcaea.MarveCube/Controllers/ExtController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ public Task<IActionResult> GetSongImage([FromQuery]string songid)
}));
}

[Obsolete("该API&方法已弃用。请改用 Team123it.Arcaea.MarveCube.Standalone 独立下载服务器程序。")]
[HttpGet("song/download/{songId:required}/{fileName:required}")]
public async Task<IActionResult> DownloadSongData([FromQuery]string token, [FromRoute]string songId, [FromRoute]string fileName)
{
Expand Down
2 changes: 1 addition & 1 deletion Team123it.Arcaea.MarveCube/Core/QueryLimit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static bool DoQueryLimit(this HttpRequest req,string apikey)
{
limitTimes++;
db.KeyDelete(apikey);
db.SetAdd(apikey, limitTimes);
db.StringSet(apikey, limitTimes);
db.KeyExpire(apikey, new TimeSpan(0, 0, 1));
return true;
}
Expand Down
10 changes: 6 additions & 4 deletions Team123it.Arcaea.MarveCube/FirstStartData/ConfigExample.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* 请在手动初始化 123 Marvelous Cube(下称"123 MarveCube") 之前(FirstStart模块未完成之前手动初始化)按照注释将配置信息填写完整,
/* 请在手动初始化 Arcaea Server 2 之前(FirstStart模块未完成之前手动初始化)按照注释将配置信息填写完整,
并将该文件改名为config.json(大小写敏感)复制到"程序根目录/data/"下 */
{
"settings": {
Expand All @@ -7,8 +7,8 @@
"isOverrideAprilFools": false, // 是否覆盖愚人节模块检查(true时服务器永久开放愚人节模块; false时仅服务器时间4.1时开放)
"isWorldEventMapTesting": false, // 是否正在测试世界模式限时地图(true时设置的测试员(见下)将可以进入不在活动时间范围内的限时地图)
"eventMapTestPlayers": [], // 世界模式限时地图测试玩家的用户id列表
"minSupportVer": "3.10.0", // 最低支持的Arcaea客户端版本
"latestVersion": "3.12.6", // Arcaea客户端的最新版本
"minSupportVer": "3.10.6", // 最低支持的Arcaea客户端版本
"latestVersion": "3.12.8", // Arcaea客户端的最新版本
"aprilFoolsStartTime": -1, // 愚人节开放的UNIX时间戳(单位为秒)(优先级高于上文的"服务器时间",低于"isOverrideAprilFools"的设置)
"topRankLimit": 200 //Top玩家(#框)的最大排名限制(最高可填写为200)
},
Expand All @@ -22,7 +22,9 @@
"standaloneKey": "12345678901234567890123456789012", // 独立下载服务器请求主服务器(获取下载Token)的时候使用的Key
"standaloneToken": "abcdefghijklmnopqrstuvwxyz789012", // 独立下载服务器解密下载URL参数时使用的解密Token(即上文的"下载Token")
"listenPort": 80, // 主服务器的监听端口
"redisPort": 6379, // 本机Redis服务器的连接端口
"redisURL": "Redis服务器的IP/域名(默认为localhost)",
"redisPort": 6379, // Redis服务器的连接端口
"redisPswd": "Redis服务器连接时使用的密码(留空视为无密码,默认为空)",
"linkPlayEndpoint": "Link Play多人游玩模块的UDP服务器终结点(Endpoint)地址(必须是IPv4地址)",
"linkPlayPort": 21495 // Link Play多人游玩模块的UDP服务器连接端口
}
Expand Down
9 changes: 7 additions & 2 deletions Team123it.Arcaea.MarveCube/GlobalProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,13 @@ public static string MDatabaseConnectURL
var settings = JObject.Parse(File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "data", "config.json"), Encoding.UTF8));
var dbConnURL = new StringBuilder();
var config = settings.Value<JObject>("config");
string mdbConnURL = "localhost:" + config.Value<uint>("redisPort");
return mdbConnURL;
string redisURL = config.TryGetValue("redisURL", out var redisURLToken) && !string.IsNullOrWhiteSpace((string?)redisURLToken) ? (string)redisURLToken! : "localhost";
string mdbConnFullURL = $"{redisURL}:{config.Value<uint>("redisPort")}";
if (config.TryGetValue("redisPswd", out var redisPswdToken) && !string.IsNullOrWhiteSpace((string?)redisPswdToken))
{
mdbConnFullURL += $",password={redisPswdToken}";
}
return mdbConnFullURL;
}
catch (Exception ex)
{
Expand Down
4 changes: 2 additions & 2 deletions Team123it.Arcaea.MarveCube/Processors/Front/Multiplayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static JObject CreateRoom(int userId, JObject clientSongMap)
{ "userId", new JArray(userId) },
{ "allowSongs", clientSongMap }
};
db.SetAdd($"Arcaea-LinkPlay-{roomCode}", roomRedisData.ToString());
db.StringSet($"Arcaea-LinkPlay-{roomCode}", roomRedisData.ToString());
var r = new JObject()
{
{"roomCode", roomCode},
Expand Down Expand Up @@ -123,7 +123,7 @@ public static JObject JoinRoom(string roomCode, int userId, JObject clientSongMa
roomRedisData.Add("playerId", playerIdsList);
roomRedisData.Add("userId", userIdsList);
roomRedisData.Add("allowSongs", finalMap);
db.SetAdd($"Arcaea-LinkPlay-{roomCode}", roomRedisData.ToString());
db.StringSet($"Arcaea-LinkPlay-{roomCode}", roomRedisData.ToString());
var r = new JObject()
{
{"roomCode", roomCode},
Expand Down
5 changes: 0 additions & 5 deletions Team123it.Arcaea.MarveCube/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ public static void Initialization(string[] args)

public static IHostBuilder CreateHostBuilder(string[] args)
{
//X509Certificate2? x509ca = null;
//if (HttpsCertificatePassword != null)
//{
// x509ca = new X509Certificate2(File.ReadAllBytes(Path.Combine(AppContext.BaseDirectory, "data", "https.pfx")), HttpsCertificatePassword);
//}
var config = new ConfigurationBuilder()
.Build();
return Host.CreateDefaultBuilder(args)
Expand Down
6 changes: 3 additions & 3 deletions Team123it.Arcaea.MarveCube/Team123it.Arcaea.MarveCube.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>MarveCube</AssemblyName>
<Version>0.4.1</Version>
<Version>0.4.2</Version>
<Company>123 Open-Source Organization</Company>
<Product>Arcaea Server 2(123 Marvelous Cube Open-Source Version)</Product>
<AssemblyVersion>0.4.1</AssemblyVersion>
<FileVersion>0.4.1</FileVersion>
<AssemblyVersion>0.4.2</AssemblyVersion>
<FileVersion>0.4.2</FileVersion>
<Copyright>(C)Copyright 2015-2022 123 Open-Source Organization. All rights reserved.</Copyright>
<AssemblyTitle>Arcaea Server 2 - High-Speed Protable Arcaea API Server</AssemblyTitle>
<Platforms>x64;ARM64</Platforms>
Expand Down

0 comments on commit ef64cbb

Please sign in to comment.