Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions admin/src/all.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,26 @@ export interface UpdateBearItemDataDto {

export interface RequestAllBearItemsDto {}

export interface RequestSpinAvailabilityDto {}

export interface RequestSpinWheelItemsDto {}

export interface SpinWheelDto {}

export interface SpinAvailabilityDto {
canSpin: boolean;
remainingCooldownSeconds: number;
}

export interface SpinWheelItemsDto {
items: BearItemDto[];
}

export interface SpinResultDto {
wonItem: BearItemDto;
cooldownSeconds: number;
}

export interface CampusEventDto {
id: string;
title: string;
Expand Down
33 changes: 33 additions & 0 deletions admin/src/components/ServerApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ export class ServerApi {
return this.send('equipBearItem', data) as Promise<boolean | undefined>;
}

requestSpinAvailability(data: dto.RequestSpinAvailabilityDto) {
return this.send('requestSpinAvailability', data) as Promise<
boolean | undefined
>;
}

requestSpinWheelItems(data: dto.RequestSpinWheelItemsDto) {
return this.send('requestSpinWheelItems', data) as Promise<
number | undefined
>;
}

spinWheel(data: dto.SpinWheelDto) {
return this.send('spinWheel', data) as Promise<boolean | undefined>;
}

requestAllBearItems(data: dto.RequestAllBearItemsDto) {
return this.send('requestAllBearItems', data) as Promise<
number | undefined
Expand Down Expand Up @@ -432,6 +448,23 @@ export class ServerApi {
this.socket.on('updatePurchaseResult', data => callback(data));
}

onUpdateSpinAvailabilityData(
callback: (data: dto.SpinAvailabilityDto) => void,
) {
this.socket.removeAllListeners('updateSpinAvailabilityData');
this.socket.on('updateSpinAvailabilityData', data => callback(data));
}

onUpdateSpinWheelItemsData(callback: (data: dto.SpinWheelItemsDto) => void) {
this.socket.removeAllListeners('updateSpinWheelItemsData');
this.socket.on('updateSpinWheelItemsData', data => callback(data));
}

onUpdateSpinResultData(callback: (data: dto.SpinResultDto) => void) {
this.socket.removeAllListeners('updateSpinResultData');
this.socket.on('updateSpinResultData', data => callback(data));
}

onTimerStarted(callback: (data: dto.TimerStartedDto) => void) {
this.socket.removeAllListeners('timerStarted');
this.socket.on('timerStarted', data => callback(data));
Expand Down
5 changes: 5 additions & 0 deletions game/assets/wheel/Pointer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions game/assets/wheel/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions game/assets/wheel/equipnow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions game/assets/wheel/ferris-wheel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions game/assets/wheel/orangepiece.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions game/assets/wheel/orangestopped.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions game/assets/wheel/redpiece.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions game/assets/wheel/redstopped.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions game/assets/wheel/spinbutton.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading