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