public MRKToSPlayer(MRKToSUser user, MRKToSMatch match, int id)
 {
     User      = user;
     Match     = match;
     ID        = id;
     m_Roles   = new List <MRKToSRole>();
     m_Scrolls = new Dictionary <MRKToSRoleID, MRKToSScroll>(); //TODO import from user
 }
Exemple #2
0
        static void Main(string[] args)
        {
            MRKToSLogger.RegisterLogger((t, m) => WriteLine($"[LOGGER] [{t}] {m}"));

            MRKToSGamemode      gamemodeCustom = new MRKToSGamemode("Custom", MRKToSRoleID.Bodyguard, MRKToSRoleID.Bodyguard);
            MRKToSMatchSettings settings       = new MRKToSMatchSettings(1, (uint)gamemodeCustom.RoleList.Count, 60, 10, gamemodeCustom);
            MRKToSMatch         match          = new MRKToSMatch(settings, new MatchListener(), null);

            ms_Match = match;

            match.Start();

            Dictionary <string, MRKToSUser> users = new Dictionary <string, MRKToSUser>();

            while (true)
            {
                if (match.MatchState == MRKToSMatch.State.Waiting)
                {
                    Write("Join: ");
                    string user  = ReadLine();
                    string _user = user.Replace("_", "");

                    if (!users.ContainsKey(_user))
                    {
                        users[_user] = new MRKToSUser(_user, 0);
                    }

                    if (user.Contains("_"))
                    {
                        match.DequeueUser(users[_user]);
                    }
                    else
                    {
                        match.QueueUser(users[_user]);
                    }
                }
            }
        }