Skip to content

Commit

Permalink
Allow skipping registration when google account already exists (#209)
Browse files Browse the repository at this point in the history
* Remove useless if

* Skip register

* Fix device login url

* Fix flutter warnings

* Comment out useless code

* Update api key

* Fixed room leaks

* Fix failing test

* Added formatting

* fix bool

* Real time leaderboard

* Fixed loading issue

* Ran flutter fix

* Fixed formatting

* Fixed message

* Fix test failures

* Fix formatting

* New google services

* Fix loading for leaderboard

* Fix navigator issues

* Fixed spam updates

* Launcher icons

* Set favicon

* Fix icon stretch

* Fix favicon

* Update username leaderboard

* Change naming
  • Loading branch information
neketka authored Apr 28, 2024
1 parent bea615e commit 59e48d0
Show file tree
Hide file tree
Showing 83 changed files with 707 additions and 660 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ npx prisma studio
npm run updateapi
```

### Format all code files

```
npm run formatall
```

### Start the frontend (for debugging)

```
Expand Down
Binary file modified admin/public/favicon.ico
Binary file not shown.
52 changes: 22 additions & 30 deletions admin/src/all.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ export interface RequestAchievementDataDto {

export interface LoginDto {
idToken: string;
latF: number;
longF: number;
noRegister: boolean;
latF?: number;
longF?: number;
username?: string;
year?: string;
college?: string;
Expand Down Expand Up @@ -152,18 +153,6 @@ export interface SetCurrentChallengeDto {
challengeId: string;
}

export interface LeaderDto {
userId: string;
username: string;
score: number;
}

export interface UpdateLeaderDataDto {
eventId: string;
offset: number;
users: LeaderDto[];
}

export interface UpdateErrorDto {
id: string;
message: string;
Expand All @@ -183,6 +172,25 @@ export interface RequestEventDataDto {
export interface RequestEventLeaderDataDto {
offset: number;
count: number;
eventId?: string;
}

export interface LeaderDto {
userId: string;
username: string;
score: number;
}

export interface UpdateLeaderDataDto {
eventId?: string;
offset: number;
users: LeaderDto[];
}

export interface UpdateLeaderPositionDto {
playerId: string;
newTotalScore: number;
newEventScore: number;
eventId: string;
}

Expand Down Expand Up @@ -295,22 +303,6 @@ export interface UpdateOrganizationDataDto {

export interface CloseAccountDto {}

export interface SetUsernameDto {
newUsername: string;
}

export interface SetCollegeDto {
newCollege: string;
}

export interface SetMajorDto {
newMajor: string;
}

export interface SetGraduationYearDto {
newYear: string;
}

export interface BanUserDto {
userId: string;
isBanned: boolean;
Expand Down
4 changes: 3 additions & 1 deletion admin/src/components/Challenges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ function toForm(challenge: ChallengeDto) {
{
name: "Image URL",
characterLimit: 2048,
value: challenge.imageUrl ?? "https://upload.wikimedia.org/wikipedia/commons/b/b1/Missing-image-232x150.png",
value:
challenge.imageUrl ??
"https://upload.wikimedia.org/wikipedia/commons/b/b1/Missing-image-232x150.png",
},
{
name: "Awarding Distance (meters)",
Expand Down
11 changes: 7 additions & 4 deletions admin/src/components/ServerApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ export class ServerApi {
this.send("completedChallenge", data);
}

requestGlobalLeaderData(data: dto.RequestGlobalLeaderDataDto) {
this.send("requestGlobalLeaderData", data);
}

updateChallengeData(data: dto.UpdateChallengeDataDto) {
this.send("updateChallengeData", data);
}
Expand Down Expand Up @@ -193,4 +189,11 @@ export class ServerApi {
this.socket.removeAllListeners("updateOrganizationData");
this.socket.on("updateOrganizationData", (data) => callback(data));
}

onUpdateLeaderPosition(
callback: (data: dto.UpdateLeaderPositionDto) => void
) {
this.socket.removeAllListeners("updateLeaderPosition");
this.socket.on("updateLeaderPosition", (data) => callback(data));
}
}
42 changes: 25 additions & 17 deletions game/android/app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,30 @@
"certificate_hash": "d6e7da6b98f7884510d3826068e668c5bb7ec89b"
}
},
{
"client_id": "757523123677-mdis2048vo39u7bjg7rjtm9r28a1tsto.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.cornellgo.CornellGO",
"certificate_hash": "48942102c610163af43caab359452832e7bdc189"
}
},
{
"client_id": "757523123677-s7lm7n8b1vmppnh92pige13uvp722jma.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.cornellgo.CornellGO",
"certificate_hash": "e8ec9df2de92f3ff018926aba9448be15c464a4e"
}
},
{
"client_id": "757523123677-2nv6haiqnvklhb134cgg5qe8bia4du4q.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDSKPt3T-sBGcaS5vQGw-FDkgOBTryxhUQ"
"current_key": "AIzaSyCNuTQ0eTjwXde0NMNMFaO6c3u5AYlNiXA"
},
{
"current_key": "AIzaSyBBGoQlbjlNCBfxiob-mkm1TCougaHqcu4"
Expand All @@ -42,10 +58,10 @@
"client_type": 3
},
{
"client_id": "757523123677-cso74eimkjqkcuce69nrf4c637k3db6t.apps.googleusercontent.com",
"client_id": "757523123677-5uct36sksguq3v4ngeec8ofc31ipf8hl.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.cornellgo.game"
"bundle_id": "com.cornellgo.CornellGO"
}
}
]
Expand All @@ -61,19 +77,11 @@
},
"oauth_client": [
{
"client_id": "757523123677-lhftm1kuh7k0uqkhc62d378um4nb5e3g.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.cornellgo.game",
"certificate_hash": "d6e7da6b98f7884510d3826068e668c5bb7ec89b"
}
},
{
"client_id": "757523123677-q8o2d3tahsmm9i68j1sf33ka49qsgalq.apps.googleusercontent.com",
"client_id": "757523123677-q8lt36h21g5kcmvvqe07f5krldkb4k4i.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.cornellgo.game",
"certificate_hash": "98efe77cdeb1f8f17e7c3634a8700ae7361aaa08"
"certificate_hash": "e8ec9df2de92f3ff018926aba9448be15c464a4e"
}
},
{
Expand All @@ -83,7 +91,7 @@
],
"api_key": [
{
"current_key": "AIzaSyDSKPt3T-sBGcaS5vQGw-FDkgOBTryxhUQ"
"current_key": "AIzaSyCNuTQ0eTjwXde0NMNMFaO6c3u5AYlNiXA"
},
{
"current_key": "AIzaSyBBGoQlbjlNCBfxiob-mkm1TCougaHqcu4"
Expand All @@ -97,10 +105,10 @@
"client_type": 3
},
{
"client_id": "757523123677-cso74eimkjqkcuce69nrf4c637k3db6t.apps.googleusercontent.com",
"client_id": "757523123677-5uct36sksguq3v4ngeec8ofc31ipf8hl.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.cornellgo.game"
"bundle_id": "com.cornellgo.CornellGO"
}
}
]
Expand All @@ -109,4 +117,4 @@
}
],
"configuration_version": "1"
}
}
2 changes: 1 addition & 1 deletion game/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<application android:label="CornellGO!" android:icon="@mipmap/ic_launcher">
<application android:label="CornellGO!" android:icon="@mipmap/launcher_icon">

<meta-data android:name="com.google.android.geo.API_KEY"
android:value="@string/ANDROID_MAP_API_KEY" />
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/assets/images/main_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions game/lib/achievements/achievement_cell.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:game/preview/preview.dart';
import 'package:flutter_svg/flutter_svg.dart';

class LoadingBar extends StatelessWidget {
Expand Down
2 changes: 0 additions & 2 deletions game/lib/achievements/achievements_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import 'package:game/model/event_model.dart';
import 'package:game/model/group_model.dart';
import 'package:game/utils/utility_functions.dart';
import 'package:game/model/tracker_model.dart';
import 'package:game/model/achievement_model.dart';
import 'package:game/model/user_model.dart';
import 'package:provider/provider.dart';

class AchievementCellDto {
Expand Down
Loading

0 comments on commit 59e48d0

Please sign in to comment.