feat: initial commit - HJHA game server full source
6 major server modules (PdkFriendServer/GlobalSever/ServerCore/GameModule/GameNetModule) + game logic (GameFix/GameDAL/ServerData) + network layer (NetWorkMessage) + data layer (ObjectModel) + utilities (MrWu/Core/Config/CloudAPI/dll) + adapters (zyxAdapter/base) .NET 8.0 C# solution, 16 projects, 958 source files
This commit is contained in:
35
GameDAL/db/redis/RedisDataBaseExtensions.cs
Normal file
35
GameDAL/db/redis/RedisDataBaseExtensions.cs
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 由SharpDevelop创建。
|
||||
* 用户: Administrator
|
||||
* 日期: 2018-12-07
|
||||
* 时间: 15:34
|
||||
*
|
||||
* 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
|
||||
*/
|
||||
using System;
|
||||
using StackExchange.Redis;
|
||||
|
||||
namespace Server.DB.Redis {
|
||||
public partial class IDatabaseProxy {
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="flags"></param>
|
||||
/// <returns></returns>
|
||||
public TimeSpan? KeyIdleTime(RedisKey key, CommandFlags flags = CommandFlags.None) {
|
||||
return FDBOpera(db.KeyIdleTime, key, flags);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class RedisDataBaseExtensions {
|
||||
static readonly RedisValue IDLETIME = "IDLETIME";
|
||||
public static TimeSpan? KeyIdleTime(this IDatabase db, RedisKey key, CommandFlags flags = CommandFlags.None) {
|
||||
var rabbitdb = db as RedisDatabase;
|
||||
var msg = Message.Create(db.Database, flags, RedisCommand.OBJECT, IDLETIME, key);
|
||||
return rabbitdb.ExecuteSync(msg, ResultProcessor.TimeSpanFromSeconds);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user