Exemplo n.º 1
0
        //select current player
        public DTO.OPlayer CurrentPlayer(string name)
        {
            var player = (from r in dc.Players
                          where r.PlayerName == name
                          select r).Single();

            DTO.OPlayer CurrentPlayer = new DTO.OPlayer();

            CurrentPlayer.PlayerName = player.PlayerName;
            CurrentPlayer.PlayerId   = player.PlayerId;

            return(CurrentPlayer);
        }
Exemplo n.º 2
0
        public void SubscribeToLobbyRoom(DTO.OPlayer player, int lobby)
        {
            try
            {
                PlayLobby pLobby = new PlayLobby();
                pLobby.LobbyId  = lobby;
                pLobby.PlayerId = (int)player.PlayerId;

                dc.PlayLobbies.InsertOnSubmit(pLobby);
                dc.SubmitChanges();
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 3
0
        public void StartPlay(DTO.OPlayer hostPlayer)
        {
            var lst = from l in dc.PlayLobbies
                      where l.HostPlayer == hostPlayer.PlayerId
                      select new { l.LobbyId };


            var update = (from l in dc.Lobbies
                          where l.LobbyId == lst.Single().LobbyId
                          select l).Single();

            update.IsWaitingForPlayers = 0;

            dc.SubmitChanges();
        }
Exemplo n.º 4
0
        public void CreatePlayLobby(DTO.OPlayer host, int lobby)
        {
            try
            {
                PlayLobby pLobby = new PlayLobby();
                pLobby.HostPlayer = (int)host.PlayerId;
                pLobby.LobbyId    = lobby;
                pLobby.PlayerId   = (int)host.PlayerId;

                dc.PlayLobbies.InsertOnSubmit(pLobby);
                dc.SubmitChanges();
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 5
0
 DTO.GameObject ILobbyService.SendGameUpdate(DTO.OPlayer player)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
 void ILobbyService.StartPlay(DTO.OPlayer hostPlayer)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 7
0
 void ILobbyService.SubscribeToLobbyRoom(DTO.OPlayer player, int lobby, int host)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 8
0
 void ILobbyService.CreatePlayLobby(DTO.OPlayer host, int lobby)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 9
0
 public DTO.GameObject SendGameUpdate(DTO.OPlayer player)
 {
     throw new NotImplementedException();
 }