From d2e5617198c535f6c49c1b461a302f2070f911cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=84=9C?= Date: Wed, 3 Apr 2024 16:01:01 +0900 Subject: [PATCH] =?UTF-8?q?hash=ED=98=95=ED=83=9C=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=EB=B0=8F=20=EB=8B=A4=EC=9D=8C=20=EC=9E=91=EC=97=85=20=EB=A9=94?= =?UTF-8?q?=EB=AA=A8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/Service/Login.cs | 4 +++- Server/System/Redis.cs | 13 ++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Server/Service/Login.cs b/Server/Service/Login.cs index ed6fa2f..0845786 100644 --- a/Server/Service/Login.cs +++ b/Server/Service/Login.cs @@ -16,7 +16,9 @@ namespace Server.Service public override string Process() { - + //string uniqueSessionId = Guid.NewGuid().ToString(); 이러한 형태를 사용해 key값을 저장 + //서버에서 데이터를 받아 user의 데이터들을 redis에 저장 + //이러한 형태로 세션을 관리. User user; bool newUser = false; #region 로그인 diff --git a/Server/System/Redis.cs b/Server/System/Redis.cs index 21bf4ee..08f3672 100644 --- a/Server/System/Redis.cs +++ b/Server/System/Redis.cs @@ -193,7 +193,7 @@ namespace Server.System SetHash(item.Key, item.Value, keys); } - public Dictionary GetHash(params string[] keys) + public Dictionary GetAllHash(params string[] keys) { Dictionary hash = new Dictionary(); if (local) @@ -211,6 +211,17 @@ namespace Server.System return hash; } + public object GetHash(string field ,params string[] keys) + { + if (local) + { + Dictionary hashs = new Dictionary(hashType[KeySet(keys)]); + return hashs[field]; + } + else + return db.HashGet(KeySet(keys), field); + } + private string KeySet(string[] keys) { return string.Join(":", keys);