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