fix : playerID == hashkey 통일 / long => int로 변경
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using LiteNetLib;
|
||||
using LiteNetLib;
|
||||
using MMOserver.Utils;
|
||||
|
||||
namespace MMOserver.Game.Channel;
|
||||
@@ -9,7 +9,7 @@ public class ChannelManager : Singleton<ChannelManager>
|
||||
private List<Channel> channels = new List<Channel>();
|
||||
|
||||
// 채널별 유저 관리 (유저 key, 채널 val)
|
||||
private Dictionary<long, int> connectUsers = new Dictionary<long, int>();
|
||||
private Dictionary<int, int> connectUsers = new Dictionary<int, int>();
|
||||
|
||||
public ChannelManager()
|
||||
{
|
||||
@@ -34,7 +34,7 @@ public class ChannelManager : Singleton<ChannelManager>
|
||||
return channels;
|
||||
}
|
||||
|
||||
public void AddUser(int channelId, long userId, Player player, NetPeer peer)
|
||||
public void AddUser(int channelId, int userId, Player player, NetPeer peer)
|
||||
{
|
||||
// 유저 추가
|
||||
connectUsers.Add(userId, channelId);
|
||||
@@ -42,7 +42,7 @@ public class ChannelManager : Singleton<ChannelManager>
|
||||
channels[channelId].AddUser(userId, player, peer);
|
||||
}
|
||||
|
||||
public bool RemoveUser(long userId)
|
||||
public bool RemoveUser(int userId)
|
||||
{
|
||||
// 채널에 없는 유저면 스킵
|
||||
if (!connectUsers.TryGetValue(userId, out int channelId))
|
||||
@@ -61,7 +61,7 @@ public class ChannelManager : Singleton<ChannelManager>
|
||||
return false;
|
||||
}
|
||||
|
||||
public int HasUser(long userId)
|
||||
public int HasUser(int userId)
|
||||
{
|
||||
int channelId = -1;
|
||||
if (connectUsers.ContainsKey(userId))
|
||||
@@ -77,7 +77,7 @@ public class ChannelManager : Singleton<ChannelManager>
|
||||
return channelId;
|
||||
}
|
||||
|
||||
public Dictionary<long, int> GetConnectUsers()
|
||||
public Dictionary<int, int> GetConnectUsers()
|
||||
{
|
||||
return connectUsers;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user