示例#1
0
        public static EFPenalty Create(EFPenalty.PenaltyType type = EFPenalty.PenaltyType.Ban, EFClient originClient = null, EFClient targetClient = null, DateTime?occurs = null, string reason = null)
        {
            originClient ??= ClientGenerators.CreateDatabaseClient(clientId: 1);
            targetClient ??= ClientGenerators.CreateDatabaseClient(clientId: 2);
            occurs ??= DateTime.UtcNow;
            reason ??= "test";

            return(new EFPenalty()
            {
                Offender = targetClient,
                Punisher = originClient,
                When = occurs.Value,
                Offense = reason,
                Type = type,
                LinkId = targetClient.AliasLinkId
            });
        }
示例#2
0
        public static GameEvent GenerateEvent(GameEvent.EventType type, string data, Server owner)
        {
            switch (type)
            {
            case GameEvent.EventType.Command:
                return(new GameEvent
                {
                    Origin = ClientGenerators.CreateDatabaseClient(),
                    Data = data,
                    Message = data,
                    Owner = owner
                });

            default:
                throw new NotImplementedException();
            }
        }