예제 #1
0
 public static GlobalPlayerData GetData(string name)
 {
     if (!PlayerDataList.Datas.IsEmpty)
     {
         foreach (var i in PlayerDataList.Datas)
         {
             if (i.Key == name)
             {
                 return i.Value;
             }
         }
     }
     GlobalPlayerData n = new GlobalPlayerData();
     Datas.TryAdd(name, n);
     return n;
 }
예제 #2
0
        public static GlobalPlayerData GetData(string name)
        {
            if (!Datas.IsEmpty)
            {
                foreach (var i in Datas)
                {
                    if (i.Key == name)
                    {
                        return(i.Value);
                    }
                }
            }
            var n = new GlobalPlayerData();

            Datas.TryAdd(name, n);
            return(n);
        }
예제 #3
0
 public bool TryJoin(Player player, GlobalPlayerData iPlayerData, World world, Player i)
 {
     if (!iPlayerData.Solo)
     {
         if (!iPlayerData.UsingGroup)
         {
             player.Client.Reconnect(new ReconnectPacket()
             {
                 Host = "",
                 Port = 2050,
                 GameId = world.Id,
                 Name = world.Name,
                 Key = Empty<byte>.Array,
             });
             return true;
         }
         else
         {
             foreach (var o in iPlayerData.JGroup)
             {
                 if (o.Value == player.Client.Account.Name.ToLower())
                 {
                     player.Client.Reconnect(new ReconnectPacket()
                     {
                         Host = "",
                         Port = 2050,
                         GameId = world.Id,
                         Name = world.Name,
                         Key = Empty<byte>.Array,
                     });
                     return true;
                 }
             }
             player.SendInfo("Not in " + i.Client.Account.Name + "'s group!");
             return true;
         }
     }
     else
     {
         player.SendInfo("Player is going solo!");
         return true;
     }
 }
예제 #4
0
 public bool TryJoin(Player player, GlobalPlayerData iPlayerData, World world, Player i)
 {
     if (world.Id == -60)
     {
         player.SendInfo("Sorry but that user is in a restricted area!");
         return true;
     }
     if (world.Name == "Admin Room")
     {
         if (!iPlayerData.Solo || player.Client.Account.Rank > 3)
         {
             if (!iPlayerData.UsingGroup)
             {
                 player.Client.Reconnect(new ReconnectPacket
                 {
                     Host = "",
                     Port = 2050,
                     GameId = world.Id,
                     Name = world.Name,
                     Key = Empty<byte>.Array
                 });
                 return true;
             }
             if (iPlayerData.JGroup.Any(o => o.Value == player.Client.Account.Name.ToLower()))
             {
                 player.Client.Reconnect(new ReconnectPacket
                 {
                     Host = "",
                     Port = 2050,
                     GameId = world.Id,
                     Name = world.Name,
                     Key = Empty<byte>.Array
                 });
                 return true;
             }
             player.SendInfo("Not in " + i.Client.Account.Name + "'s group!");
             return true;
         }
         player.SendInfo("Player is going solo!");
         return true;
     }
     player.SendInfo("Sorry but that user is in a restricted area!");
     return true;
 }