초기커밋
This commit is contained in:
155
GameServer/z.Backup/BuildingManager.cs
Normal file
155
GameServer/z.Backup/BuildingManager.cs
Normal file
@@ -0,0 +1,155 @@
|
||||
//using System;
|
||||
//using System.Collections.Concurrent;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Diagnostics.CodeAnalysis;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using System.Threading.Tasks;
|
||||
//using ServerCommon;
|
||||
//using ServerCore; using ServerBase;
|
||||
//using Nettention.Proud;
|
||||
//using Amazon.DynamoDBv2.Model;
|
||||
//using System.Drawing;
|
||||
|
||||
//namespace GameServer
|
||||
//{
|
||||
// internal class BuildingManager
|
||||
// {
|
||||
// private static readonly BuildingManager _instance = new BuildingManager();
|
||||
// static BuildingManager() { }
|
||||
// private BuildingManager() { }
|
||||
// public static BuildingManager Instance { get { return _instance; } }
|
||||
|
||||
// ConcurrentDictionary<int, BuildingEntity> Buildings = new ConcurrentDictionary<int, BuildingEntity>(); // 랜드에 설정된 빌딩 정보만 가진다
|
||||
|
||||
// public async Task<bool> LoadDB()
|
||||
// {
|
||||
// var buildingIdList = LandManager.Instance.GetBuildingIdList();
|
||||
// var buildingEntityList = await GameServerApp.Instance.MainDB.GetBuildingEntityList(buildingIdList);
|
||||
// if(buildingEntityList == null)
|
||||
// {
|
||||
// Log.getLogger().error("entityList == null");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// foreach (var buildingEntity in buildingEntityList)
|
||||
// {
|
||||
// if (!Buildings.TryAdd(buildingEntity.PK_Id, buildingEntity))
|
||||
// {
|
||||
// Log.getLogger().error($"DB BuildingData buildingid : {buildingEntity.PK_Id} - add fail");
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// foreach (var prop in buildingEntity.Attr.PropInfo)
|
||||
// {
|
||||
// MapManager.Instance.UpdateProp(prop.Key, prop.Value);
|
||||
// }
|
||||
// }
|
||||
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// public void SendInfo(HostID hostId)
|
||||
// {
|
||||
// ClientToGame clientToGame = new ClientToGame();
|
||||
// clientToGame.Message = new ClientToGameMessage();
|
||||
// clientToGame.Message.BuildingInfoNoti = new ClientToGameMessage.Types.BuildingInfoNoti();
|
||||
|
||||
// foreach (var building in Buildings.Values)
|
||||
// {
|
||||
// BuildingInfo buildingInfo = new BuildingInfo();
|
||||
|
||||
// buildingInfo.Id = building.PK_Id;
|
||||
// buildingInfo.Owner = building.Attr.Owner;
|
||||
// buildingInfo.Name = building.Attr.Name;
|
||||
// buildingInfo.Description = building.Attr.Description;
|
||||
|
||||
// foreach (var instance in building.Attr.FloorInfo)
|
||||
// {
|
||||
// SlotInfo slotInfo = new SlotInfo();
|
||||
|
||||
// slotInfo.Slot = instance.Key;
|
||||
// slotInfo.Id = instance.Value;
|
||||
|
||||
// buildingInfo.RoomList.Add(slotInfo);
|
||||
// }
|
||||
|
||||
// clientToGame.Message.BuildingInfoNoti.List.Add(buildingInfo);
|
||||
// }
|
||||
|
||||
// GameServer.Instance.Send(hostId, RmiContext.ReliableSend, clientToGame);
|
||||
// }
|
||||
|
||||
// public List<int> GetRoomIdList()
|
||||
// {
|
||||
// List<int> returnList = new();
|
||||
|
||||
// foreach (var building in Buildings.Values)
|
||||
// {
|
||||
// foreach (var instance in building.Attr.FloorInfo)
|
||||
// {
|
||||
// returnList.Add(instance.Value);
|
||||
// }
|
||||
// }
|
||||
|
||||
// return returnList;
|
||||
// }
|
||||
|
||||
// public bool GetBuildingEntity(int buildingId, [MaybeNullWhen(false)] out BuildingEntity outEntity)
|
||||
// {
|
||||
// return Buildings.TryGetValue(buildingId, out outEntity);
|
||||
// }
|
||||
|
||||
// public bool ExchangeBuilding(BuildingEntity newBuildingEntity, int oldBuildingId, [MaybeNullWhen(false)] out BuildingEntity oldBuildingEntity)
|
||||
// {
|
||||
// oldBuildingEntity = default;
|
||||
|
||||
// if (!Buildings.TryAdd(newBuildingEntity.PK_Id, newBuildingEntity))
|
||||
// {
|
||||
// Log.getLogger().error($"add fail buildingid : {newBuildingEntity.PK_Id}");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if (!Buildings.TryRemove(oldBuildingId, out oldBuildingEntity))
|
||||
// {
|
||||
// Buildings.TryRemove(newBuildingEntity.PK_Id, out _);
|
||||
|
||||
// Log.getLogger().error($"remove fail buildingid : {oldBuildingId}");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// //public bool UpdateLFProp(string buildingId, string anchorGuid, string itemGuid)
|
||||
// //{
|
||||
// // if (!GetBuildingEntity(buildingId, out var buildingEntity))
|
||||
// // {
|
||||
// // Log.getLogger().error($"get fail buildingid : {buildingId}");
|
||||
// // return false;
|
||||
// // }
|
||||
|
||||
// // buildingEntity.Attr.PropInfo[anchorGuid] = itemGuid;
|
||||
|
||||
// // return true;
|
||||
// //}
|
||||
|
||||
// public bool UpdateInstance(int buildingId, int floor, int instanceId)
|
||||
// {
|
||||
// if (!GetBuildingEntity(buildingId, out var buildingEntity))
|
||||
// {
|
||||
// Log.getLogger().error($"get fail buildingid : {buildingId}");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// buildingEntity.Attr.FloorInfo[floor] = instanceId;
|
||||
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// public void ForcedUpdateBuilding(BuildingEntity entity)
|
||||
// {
|
||||
// Buildings[entity.PK_Id] = entity;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
Reference in New Issue
Block a user