Skip to content

Commit

Permalink
Merge pull request #21 from MLH-Fellowship/hot_fixes
Browse files Browse the repository at this point in the history
fix/game
  • Loading branch information
avarayr authored Oct 28, 2020
2 parents 8dd7d47 + 263332f commit dd91039
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/core/service/remote_datasource/remote_datasource.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class RemoteDataSourceProvider implements RemoteDataSourceProviderI {
final RoomModel room = await getRoom(joinCode);

final newStartTime =
DateTime.now().add(const Duration(seconds: Consts.trafficLightDelay));
DateTime.now().toUtc().add(const Duration(seconds: Consts.trafficLightDelay));
final newEndTime = newStartTime.add(Duration(seconds: room.duration));

print(newStartTime);
Expand Down
4 changes: 2 additions & 2 deletions lib/core/service/utils/consts.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Consts {
static const int trafficLightDelay = 4;
static const int multiplayerUpdateInterval = 3;
static const int trafficLightDelay = 5;
static const int multiplayerUpdateInterval = 2;

static const int joinCodeLength = 4;
static const int maxNicknameLength = 12;
Expand Down
2 changes: 1 addition & 1 deletion lib/models/room_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RoomModel {
}

/// Constructs a new [DateTime] instance based on [startTime]
DateTime get startTimeObj => DateTime.tryParse(startTime);
DateTime get startTimeObj => DateTime.tryParse(startTime).toLocal();

/// Constructs a new [DateTime] instance based on [endTime]
DateTime get endTimeObj => DateTime.tryParse(endTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class _MultiPlayerModePageState extends State<MultiPlayerModePage> {
);
},
),
if (model.isGameOver)
if (model.isGameOver && widget.args.isHost)
DecoratedBoxWidget(
body: const Center(
child: Text(
Expand Down

0 comments on commit dd91039

Please sign in to comment.