Esempio 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);
        }
Esempio 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)
            {
            }
        }
Esempio 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();
        }
Esempio 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)
            {
            }
        }
Esempio n. 5
0
 DTO.GameObject ILobbyService.SendGameUpdate(DTO.OPlayer player)
 {
     throw new NotImplementedException();
 }
Esempio n. 6
0
 void ILobbyService.StartPlay(DTO.OPlayer hostPlayer)
 {
     throw new NotImplementedException();
 }
Esempio n. 7
0
 void ILobbyService.SubscribeToLobbyRoom(DTO.OPlayer player, int lobby, int host)
 {
     throw new NotImplementedException();
 }
Esempio n. 8
0
 void ILobbyService.CreatePlayLobby(DTO.OPlayer host, int lobby)
 {
     throw new NotImplementedException();
 }
Esempio n. 9
0
 public DTO.GameObject SendGameUpdate(DTO.OPlayer player)
 {
     throw new NotImplementedException();
 }