Beispiel #1
0
 public Networking(IEngineServer engineServer, IGlobalVars globals, IEngineModel engineModel, IEntityDictionary entityDictionary, ITrace trace)
 {
     EngineServer     = engineServer ?? throw new ArgumentNullException(nameof(engineServer));
     Globals          = globals ?? throw new ArgumentNullException(nameof(globals));
     EngineModel      = engineModel ?? throw new ArgumentNullException(nameof(engineModel));
     EntityDictionary = entityDictionary ?? throw new ArgumentNullException(nameof(entityDictionary));
     Trace            = trace ?? throw new ArgumentNullException(nameof(trace));
 }
 public EngineOverrides(
     EngineFuncs engineFuncs,
     IGlobalVars globals,
     EntityDictionary entityDictionary,
     EngineServer engineServer,
     IEntities entities
     )
 {
     EngineFuncs      = engineFuncs ?? throw new ArgumentNullException(nameof(engineFuncs));
     Globals          = globals ?? throw new ArgumentNullException(nameof(globals));
     EntityDictionary = entityDictionary ?? throw new ArgumentNullException(nameof(entityDictionary));
     EngineServer     = engineServer ?? throw new ArgumentNullException(nameof(engineServer));
     Entities         = entities ?? throw new ArgumentNullException(nameof(entities));
 }
Beispiel #3
0
        public static void MakeInvVectors(Vector vec, IGlobalVars pgv)
        {
            MakeVectors(vec);

            pgv.RightVector *= -1;

            var forward = pgv.ForwardVector;
            var right   = pgv.RightVector;
            var up      = pgv.UpVector;

            Utils.Swap(ref forward.y, ref right.x);
            Utils.Swap(ref forward.z, ref up.x);
            Utils.Swap(ref right.z, ref up.y);

            pgv.ForwardVector = forward;
            pgv.RightVector   = right;
            pgv.UpVector      = up;
        }
 public DLLFunctions(
     EngineFuncs engineFuncs,
     IGlobalVars globals,
     EntityDictionary entityDictionary,
     IServerInterface serverInterface,
     IEntities entities,
     IGameClients gameClients,
     INetworking networking,
     IPersistence persistence,
     IPlayerPhysics playerPhysics)
 {
     EngineFuncs      = engineFuncs ?? throw new ArgumentNullException(nameof(engineFuncs));
     Globals          = globals ?? throw new ArgumentNullException(nameof(globals));
     EntityDictionary = entityDictionary ?? throw new ArgumentNullException(nameof(entityDictionary));
     ServerInterface  = serverInterface ?? throw new ArgumentNullException(nameof(serverInterface));
     Entities         = entities ?? throw new ArgumentNullException(nameof(entities));
     GameClients      = gameClients ?? throw new ArgumentNullException(nameof(gameClients));
     Networking       = networking ?? throw new ArgumentNullException(nameof(networking));
     Persistence      = persistence ?? throw new ArgumentNullException(nameof(persistence));
     PlayerPhysics    = playerPhysics ?? throw new ArgumentNullException(nameof(playerPhysics));
 }
Beispiel #5
0
 /// <summary>
 /// Creates the string pool
 /// </summary>
 /// <param name="globals">Used to get the base address for string offsets</param>
 internal StringPool(IGlobalVars globals)
 {
     Globals = globals ?? throw new ArgumentNullException(nameof(globals));
 }
        internal static bool IsClient(Edict edict, IEntityDictionary entityDictionary, IGlobalVars globalVars)
        {
            if (edict == null)
            {
                return(false);
            }

            var index = entityDictionary.EntityIndex(edict);

            return(0 < index && index <= globalVars.MaxClients);
        }
Beispiel #7
0
 internal void SetGlobals(IGlobalVars globals)
 {
     Globals = globals ?? throw new ArgumentNullException(nameof(globals));
 }
 public ServerInterface(IGlobalVars globals, IEntityDictionary entityDictionary)
 {
     Globals          = globals ?? throw new ArgumentNullException(nameof(globals));
     EntityDictionary = entityDictionary ?? throw new ArgumentNullException(nameof(entityDictionary));
 }
Beispiel #9
0
        public EngineServer(EngineFuncs engineFuncs, IStringPool stringPool, EntityDictionary entityDictionary, IGlobalVars globals, IFileSystem fileSystem)
        {
            EngineFuncs      = engineFuncs ?? throw new ArgumentNullException(nameof(engineFuncs));
            StringPool       = stringPool ?? throw new ArgumentNullException(nameof(stringPool));
            EntityDictionary = entityDictionary ?? throw new ArgumentNullException(nameof(entityDictionary));
            Globals          = globals ?? throw new ArgumentNullException(nameof(globals));
            FileSystem       = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem));

            Log.Message("Getting game directory");

            GameDirectory = EngineFuncs.GetGameDirHelper();

            Log.Message($"Game directory is \"{GameDirectory}\"");
        }