SES-69 Added controllers and comments #17
@ -1,14 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.ViewModels.CharacterViewModels
|
||||
namespace SessionCompanion.ViewModels.CharacterViewModels
|
||||
{
|
||||
public class CharacterBasicStatsViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Identyfikator psotaci
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Nazwa postaci
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Poziom postaci
|
||||
/// </summary>
|
||||
public int Level { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Aktualna ilość życia postaci
|
||||
/// </summary>
|
||||
public int CurrentHealthPoints { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.ViewModels.CharacterViewModels
|
||||
namespace SessionCompanion.ViewModels.CharacterViewModels
|
||||
{
|
||||
public class CharacterForLoginViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Identyfikator psotaci
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Id użytkownika do którego przypisana jest postać
|
||||
/// </summary>
|
||||
public int UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Nazwa postaci
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Nazwa klasy postaci
|
||||
/// </summary>
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Poziom postaci
|
||||
/// </summary>
|
||||
public int Level { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.ViewModels.CharacterViewModels
|
||||
namespace SessionCompanion.ViewModels.CharacterViewModels
|
||||
{
|
||||
public class CharacterViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Identyfikator psotaci
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Id użytkownika do którego przypisana jest postać
|
||||
/// </summary>
|
||||
public int UserId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace SessionCompanion.Hubs
|
||||
{
|
||||
public class SessionHub : Hub
|
||||
@ -23,7 +23,10 @@ namespace SessionCompanion.Hubs
|
||||
ConnectedCharacters.Remove(Context.ConnectionId);
|
||||
}
|
||||
else
|
||||
{
|
||||
Groups.RemoveFromGroupAsync(Context.ConnectionId, "GameMaster");
|
||||
}
|
||||
|
||||
Clients.All.SendAsync("GoodBye", "Player has left the game");
|
||||
return base.OnDisconnectedAsync(exception);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user