Commit 0
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class BlacklistedToken
|
||||
{
|
||||
[BsonId]
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string Id { get; set; }
|
||||
public string Token { get; set; }
|
||||
public DateTime Expiry { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class ChangeRoleRequest
|
||||
{
|
||||
public string Username { get; set; }
|
||||
public string NewRole { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class CreateItemRequest
|
||||
{
|
||||
public string LocationId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class CreateLocationRequest
|
||||
{
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
public int Z { get; set; }
|
||||
|
||||
public string N { get; set; }
|
||||
public string NE { get; set; }
|
||||
public string E { get; set; }
|
||||
public string SE { get; set; }
|
||||
public string S { get; set; }
|
||||
public string SW { get; set; }
|
||||
public string W { get; set; }
|
||||
public string NW { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Models/CreatePlayerRequest.cs
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class CreatePlayerRequest
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string LocationId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class CreateSpawnableRequest
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int SpawnRate { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class LoginRequest
|
||||
{
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class MoveRequest
|
||||
{
|
||||
public string Direction { get; set; } // N, NE, E, SE, S, SW, W, NW
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class RegisterRequest
|
||||
{
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string Email { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class TeleportRequest
|
||||
{
|
||||
public string PlayerId { get; set; }
|
||||
public string LocationId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class Item
|
||||
{
|
||||
[BsonId]
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string Id { get; set; }
|
||||
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string LocationId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class Location
|
||||
{
|
||||
[BsonId]
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string Id { get; set; }
|
||||
|
||||
public string LocationType { get; set; } = "World";
|
||||
|
||||
public int? X { get; set; }
|
||||
public int? Y { get; set; }
|
||||
public int? Z { get; set; }
|
||||
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string N { get; set; }
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string NE { get; set; }
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string E { get; set; }
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string SE { get; set; }
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string S { get; set; }
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string SW { get; set; }
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string W { get; set; }
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string NW { get; set; }
|
||||
|
||||
public List<string> Players { get; set; } = [];
|
||||
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public List<string> Content { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Models/Player.cs
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class Player
|
||||
{
|
||||
[BsonId]
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string Id { get; set; }
|
||||
|
||||
public string UserId { get; set; } // Linked to user
|
||||
public string Name { get; set; } // In-game player name
|
||||
public string LocationId { get; set; } // Current location (nullable)
|
||||
public string InventoryLocationId { get; set; } // Inventory location (nullable)
|
||||
public int Climbing { get; set; } = 3; // Climbing skill level (default 3)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class Spawnable
|
||||
{
|
||||
[BsonId]
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
public int SpawnRate { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace GameAuthApi.Models;
|
||||
|
||||
public class User
|
||||
{
|
||||
[BsonId]
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Username { get; set; }
|
||||
public string PasswordHash { get; set; }
|
||||
public string Role { get; set; } = "player";
|
||||
public string RefreshToken { get; set; }
|
||||
public DateTime RefreshTokenExpiry { get; set; }
|
||||
public string Email { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user