Ejemplo n.º 1
0
        public void successLoginTest()
        {
            SystemUser user = db.getUserByName("test2");

            sl.removeUser(4, user.id);
            sl.removeUser(5, user.id);
            sl.Logout(db.getUserByName("test2").id);
            object m = sl.Login("test2", "2");

            Assert.IsInstanceOfType(m, typeof(SystemUser));
        }
Ejemplo n.º 2
0
        private static void removeUser(ClientInfo client, JObject jsonObject)
        {
            var gameIdToken = jsonObject["gameId"];
            var userIdToken = jsonObject["userId"];

            if (((gameIdToken == null) || (gameIdToken.Type != JTokenType.Integer)) ||
                ((userIdToken == null) || (userIdToken.Type != JTokenType.Integer)))
            {
                throw new ArgumentException("Error: Parameters Mismatch at Check.");
            }

            var gameId = (int)gameIdToken;
            var userId = (int)userIdToken;

            Console.WriteLine("Leave game. parameters are: gameId: {0}, userId: {1}", gameId, userId);

            SendMessage(client, new { response = sl.removeUser(gameId, userId) });
        }
Ejemplo n.º 3
0
 public object removeUserFromGame(SystemUser user, int game)
 {
     return(sl.removeUser(game, user.id));
 }