mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-20 01:46:11 +00:00
When a game has just been created, it does not yet have any players in them, and as a result you can't get the host or its connection id when this event is called. This makes it annoying to link between this event and the IGameCreationEvent that came just before it. Having this link is useful for the usecase of a game code allocation plugin that allocates codes from a pool, and needs to return codes to a pool if these codes weren't picked.
20 lines
388 B
C#
20 lines
388 B
C#
using Impostor.Api.Events;
|
|
using Impostor.Api.Games;
|
|
using Impostor.Api.Net;
|
|
|
|
namespace Impostor.Server.Events
|
|
{
|
|
public class GameCreatedEvent : IGameCreatedEvent
|
|
{
|
|
public GameCreatedEvent(IGame game, IClient? host)
|
|
{
|
|
Game = game;
|
|
Host = host;
|
|
}
|
|
|
|
public IGame Game { get; }
|
|
|
|
public IClient? Host { get; }
|
|
}
|
|
}
|