Exemple #1
0
        public ClientServer(SendMappings sendMappings, string name, NetConnection connection)
        {
            Name       = name ?? throw new ArgumentNullException(nameof(name));
            Connection = connection ?? throw new ArgumentNullException(nameof(connection));

            _pendingMessages = new PendingMessages(sendMappings ?? throw new ArgumentNullException(nameof(sendMappings)));
        }
Exemple #2
0
        private ServerClient(
            SendMappings sendMappings,
            NetConnection connection,
            ITime engineTime,
            NetworkObjectListTransmitter objectListTransmitter,
            int index,
            int userId,
            string name)
        {
            _sendMappings = sendMappings ?? throw new ArgumentNullException(nameof(sendMappings));
            Connection    = connection ?? throw new ArgumentNullException(nameof(connection));

            _engineTime = engineTime ?? throw new ArgumentNullException(nameof(engineTime));

            if (objectListTransmitter == null)
            {
                throw new ArgumentNullException(nameof(objectListTransmitter));
            }

            FrameListTransmitter = objectListTransmitter.CreateTransmitter(this);

            Index  = index;
            UserId = userId;
            Name   = name ?? throw new ArgumentNullException(nameof(name));

            _reliableMessages   = new PendingMessages(_sendMappings);
            _unreliableMessages = new PendingMessages(_sendMappings);
        }
Exemple #3
0
 public static ServerClient CreateClient(
     SendMappings sendMappings,
     NetConnection connection,
     ITime engineTime,
     NetworkObjectListTransmitter objectListTransmitter,
     int index,
     int userId,
     string name)
 {
     return(new ServerClient(sendMappings, connection, engineTime, objectListTransmitter, index, userId, name));
 }