세션 처리 작업 완료
This commit is contained in:
parent
a3e981310f
commit
1eae79e617
|
|
@ -5,6 +5,7 @@ using Server.Manager;
|
||||||
using NLog;
|
using NLog;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using Server.SQL.Excel;
|
using Server.SQL.Excel;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace Server.Service
|
namespace Server.Service
|
||||||
{
|
{
|
||||||
|
|
@ -15,6 +16,16 @@ namespace Server.Service
|
||||||
|
|
||||||
private void SaveSQL(ItemManager item)
|
private void SaveSQL(ItemManager item)
|
||||||
{
|
{
|
||||||
|
Statics.userSQL.Update(req.user);
|
||||||
|
|
||||||
|
Dictionary<string, object> saveUser = new Dictionary<string, object>();
|
||||||
|
saveUser.Add("nickname", req.user.nickname);
|
||||||
|
saveUser.Add("gold", req.user.gold);
|
||||||
|
saveUser.Add("free_cash", req.user.free_cash);
|
||||||
|
saveUser.Add("pay_cash", req.user.pay_cash);
|
||||||
|
Statics.redis.SetHash(saveUser, "UserInfo", req.uuid);
|
||||||
|
|
||||||
|
|
||||||
Statics.userSQL.SaveChanges();
|
Statics.userSQL.SaveChanges();
|
||||||
Statics.resetShopItemSQL.SaveChanges();
|
Statics.resetShopItemSQL.SaveChanges();
|
||||||
Statics.shopItemSQL.SaveChanges();
|
Statics.shopItemSQL.SaveChanges();
|
||||||
|
|
@ -23,7 +34,7 @@ namespace Server.Service
|
||||||
|
|
||||||
public override string Process()
|
public override string Process()
|
||||||
{
|
{
|
||||||
User user = Statics.userSQL.SelectUuid(req.uuid);
|
User user = req.user;
|
||||||
eBuyType buy_type;
|
eBuyType buy_type;
|
||||||
int buy;
|
int buy;
|
||||||
int reward;
|
int reward;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace Server.Service
|
||||||
|
|
||||||
public override string Process()
|
public override string Process()
|
||||||
{
|
{
|
||||||
User user = Statics.userSQL.SelectUuid(req.uuid);
|
User user = req.user;
|
||||||
List<DeckInfo> deckInfo = Statics.deckInfoSQL.SelectUid(user.id);
|
List<DeckInfo> deckInfo = Statics.deckInfoSQL.SelectUid(user.id);
|
||||||
List<DeckUnitInfo> deckUnitInfo = Statics.deckUnitInfoSQL.SelectUid(user.id);
|
List<DeckUnitInfo> deckUnitInfo = Statics.deckUnitInfoSQL.SelectUid(user.id);
|
||||||
//실제 존재하는 유닛인지 확인
|
//실제 존재하는 유닛인지 확인
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,11 @@ namespace Server.Service
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool GetRedis()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DownlodeResp : Resp
|
public class DownlodeResp : Resp
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace Server.Service
|
||||||
|
|
||||||
public override string Process()
|
public override string Process()
|
||||||
{
|
{
|
||||||
User user = Statics.userSQL.SelectUuid(req.uuid);
|
User user = req.user;
|
||||||
Equipment equipment = Statics.equipmentrSQL.SelectItem(user.id, req.equipment_id);
|
Equipment equipment = Statics.equipmentrSQL.SelectItem(user.id, req.equipment_id);
|
||||||
DeckUnitInfo deckUnitInfo = Statics.deckUnitInfoSQL.SelectItem(user.id, req.unit_id);
|
DeckUnitInfo deckUnitInfo = Statics.deckUnitInfoSQL.SelectItem(user.id, req.unit_id);
|
||||||
Equipment equipitem = null;
|
Equipment equipitem = null;
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,8 @@ namespace Server.Service
|
||||||
Statics.redis.SetList(loginUUID, "LoginUsers");
|
Statics.redis.SetList(loginUUID, "LoginUsers");
|
||||||
Dictionary<string, object> userInfo = new Dictionary<string, object>();
|
Dictionary<string, object> userInfo = new Dictionary<string, object>();
|
||||||
userInfo.Add("id", user.id);
|
userInfo.Add("id", user.id);
|
||||||
|
userInfo.Add("uuid", user.uuid);
|
||||||
|
userInfo.Add("mail", user.mail);
|
||||||
userInfo.Add("nickname ", user.nickname);
|
userInfo.Add("nickname ", user.nickname);
|
||||||
userInfo.Add("gold ", user.gold);
|
userInfo.Add("gold ", user.gold);
|
||||||
userInfo.Add("free_cash", user.free_cash);
|
userInfo.Add("free_cash", user.free_cash);
|
||||||
|
|
@ -309,6 +311,10 @@ namespace Server.Service
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
public override bool GetRedis()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LoginResp : Resp
|
public class LoginResp : Resp
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,19 @@ namespace Server.Service
|
||||||
private NicknameChangeReq req;
|
private NicknameChangeReq req;
|
||||||
private void SaveSQL()
|
private void SaveSQL()
|
||||||
{
|
{
|
||||||
Statics.userSQL.SaveChanges();
|
Statics.userSQL.Update(req.user);
|
||||||
|
|
||||||
|
Dictionary<string, object> saveUser = new Dictionary<string, object>();
|
||||||
|
saveUser.Add("nickname", req.user.nickname);
|
||||||
|
saveUser.Add("gold", req.user.gold);
|
||||||
|
saveUser.Add("free_cash", req.user.free_cash);
|
||||||
|
saveUser.Add("pay_cash", req.user.pay_cash);
|
||||||
|
Statics.redis.SetHash(saveUser, "UserInfo", req.uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string Process()
|
public override string Process()
|
||||||
{
|
{
|
||||||
User user = Statics.userSQL.SelectUuid(req.uuid);
|
User user = req.user;
|
||||||
string newNickname = req.newNickname;
|
string newNickname = req.newNickname;
|
||||||
string regular = @"^[가-힣a-zA-Z0-9\s]*$";
|
string regular = @"^[가-힣a-zA-Z0-9\s]*$";
|
||||||
string defaultNick = Statics.dynamicDataSQL.SelectName("defaultNick").value;
|
string defaultNick = Statics.dynamicDataSQL.SelectName("defaultNick").value;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace Server.Service
|
||||||
|
|
||||||
public override string Process()
|
public override string Process()
|
||||||
{
|
{
|
||||||
User user = Statics.userSQL.SelectUuid(req.uuid);
|
User user = req.user;
|
||||||
List<StoryProgress> storyProgress = Statics.storyProgressSQL.SelectUid(user.id);
|
List<StoryProgress> storyProgress = Statics.storyProgressSQL.SelectUid(user.id);
|
||||||
StoryProgress story = storyProgress.Find(n => n.story_data_id == req.story_id);
|
StoryProgress story = storyProgress.Find(n => n.story_data_id == req.story_id);
|
||||||
int chapter = 1;
|
int chapter = 1;
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ namespace Server.System
|
||||||
{
|
{
|
||||||
Dictionary<string, object> hash = Statics.redis.GetAllHash("UserInfo", uuid);
|
Dictionary<string, object> hash = Statics.redis.GetAllHash("UserInfo", uuid);
|
||||||
user.id = (int)hash["id"];
|
user.id = (int)hash["id"];
|
||||||
|
user.uuid = (string)hash["uuid"];
|
||||||
|
user.mail = (string)hash["mail"];
|
||||||
user.nickname = (string)hash["nickname"];
|
user.nickname = (string)hash["nickname"];
|
||||||
user.gold = (int)hash["gold"];
|
user.gold = (int)hash["gold"];
|
||||||
user.free_cash = (int)hash["free_cash"];
|
user.free_cash = (int)hash["free_cash"];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue