Ejemplo n.º 1
0
        public void CreateUser(string username)
        {
            var userExists = users.Values.FirstOrDefault(x => x.Name.Equals(username)) != null;
            if (!userExists) {
                var user = new GameUser(username, GetMD5Hash(username)) {
                    ClientId = Context.ClientId
                };

                users.Add(Context.ClientId, user);

                Caller.Name = user.Name;
                Caller.Id = user.Id;
                Caller.Hash = user.Hash;

                Caller.addUser(user);

                return;
            }
            Caller.usernameExists();
        }
Ejemplo n.º 2
0
        public void FakeIt()
        {
            var homeuser = new GameUser("HomeUser", GetMD5Hash("HomeUser")) {
                ClientId = Context.ClientId
            };
            var awayuser = new GameUser("AwayUser", GetMD5Hash("AwayUser")) {
                ClientId = Context.ClientId
            };

            Caller.Name = homeuser.Name;
            Caller.Id = homeuser.Id;
            Caller.Hash = homeuser.Hash;

            users["Homeuser"] = homeuser;
            users["AwayUser"] = awayuser;

            Game game = new Game {
                HomeUser = homeuser,
                AwayUser = awayuser
            };
            games[game.Id] = game;

            game.Start();

            Caller.startGame(game);
            Caller.addActionMessage("Fake match started", "sys");
            Caller.DebugMode = true;
        }