Download server/models/Game.js from eznd/bao: direct link, hf CLI and curl.
- Browser
- Download file 786 Bytes
-
https://huggingface.co/spaces/eznd/bao/resolve/main/server/models/Game.js
- Command line
-
hf download hf://spaces/eznd/bao/server/models/Game.js
-
curl -L -o Game.js https://huggingface.co/spaces/eznd/bao/resolve/main/server/models/Game.js
786 Bytes
| const mongoose = require('mongoose'); | |
| const gameSchema = new mongoose.Schema({ | |
| player1Id: { type: mongoose.Schema.Types.ObjectId, ref: 'Profile', required: true }, | |
| player2Id: { type: mongoose.Schema.Types.ObjectId, ref: 'Profile', default: null }, | |
| gameState: { type: mongoose.Schema.Types.Mixed, required: true }, | |
| status: { type: String, enum: ['waiting', 'active', 'finished'], default: 'waiting' }, | |
| vsAi: { type: Boolean, default: false }, | |
| isPrivate: { type: Boolean, default: false }, | |
| inviteeId: { type: mongoose.Schema.Types.ObjectId, ref: 'Profile', default: null }, | |
| inviteCode: { type: String, default: null }, | |
| }, { timestamps: true }); | |
| gameSchema.index({ inviteCode: 1 }, { sparse: true }); | |
| module.exports = mongoose.model('Game', gameSchema); | |