public CommandPostEntitySnapshot(INetEntity entity, NetCreatableInfo info, SnapshotSystem snapshotSystem) : base(entity, info, snapshotSystem) { x = AddPrimitiveField <float>(); y = AddPrimitiveField <float>(); z = AddPrimitiveField <float>(); }
public SnapshotNetComponent(AOSClient client) : base(client) { snapshotSystem = new SnapshotSystem(client); charSnapshotSystem = new CharacterSnapshotSystem(this, snapshotSystem); objectComponent = client.GetComponent <ObjectNetComponent>(); objectComponent.OnCreatableInstantiated += ObjectComponent_OnCreatableInstantiated; objectComponent.OnCreatableDestroyed += ObjectComponent_OnCreatableDestroyed; DashCMD.AddScreen(new DashCMDScreen("snapshot", "Displays information about the snapshot system.", true, (screen) => { screen.WriteLine("Snapshot Round-Trip Time: {0}s", rtt); screen.WriteLine("Last Outbound Snapshot:", ConsoleColor.Cyan); screen.WriteLine("PacketHeader: {0} bytes", lastOutboundPacketStats.PacketHeader); screen.WriteLine("Acks: {0} bytes", lastOutboundPacketStats.Acks); screen.WriteLine("PlayerData: {0} bytes", lastOutboundPacketStats.PlayerData); screen.WriteLine("Total: {0} bytes", lastOutboundPacketStats.Total); }) { SleepTime = 30 }); DashCMD.SetCVar("cl_tickrate", DEFAULT_TICKRATE); DashCMD.SetCVar("cl_await_sv_snap", false); //DashCMD.SetCVar("cl_tickrate", 25); //DashCMD.SetCVar("cl_await_sv_snap", true); syncTime = tickrate; }
public ClientMPPlayer(MasterRenderer renderer, World world, Camera camera, Vector3 position, Team team) : base(renderer, world, camera, position, team) { this.camera = camera; camfx = new CameraFX(this, camera); // Setup ClientInput Snapshot AOSClient client = AOSClient.Instance; SnapshotNetComponent snc = client.GetComponent <SnapshotNetComponent>(); SnapshotSystem ss = snc.SnapshotSystem; ClientSnapshot = new ClientPlayerSnapshot(ss, client.ServerConnection); Camera.Active.FOV = Camera.Active.DefaultFOV; Camera.Active.FPSMouseSensitivity = Camera.Active.DefaultFPSMouseSensitivity; Camera.Active.ArcBallMouseSensitivity = Camera.Active.DefaultArcBallMouseSensitivity; CreateStarterBackpack(); AudioBuffer hitAudioBuffer = AssetManager.LoadSound("Impacts/hit-player-local.wav"); if (hitAudioBuffer != null) { hitAudioSource = new AudioSource(hitAudioBuffer); hitAudioSource.IsSourceRelative = true; hitAudioSource.Gain = 0.2f; } AudioBuffer flashlightAudioBuffer = AssetManager.LoadSound("Player/flashlight.wav"); if (flashlightAudioBuffer != null) { flashlightAudioSource = new AudioSource(flashlightAudioBuffer); flashlightAudioSource.IsSourceRelative = true; flashlightAudioSource.Gain = 0.2f; } AudioBuffer jumpAudioBuffer = AssetManager.LoadSound("Player/jump.wav"); if (jumpAudioBuffer != null) { jumpAudioSource = new AudioSource(jumpAudioBuffer); jumpAudioSource.IsSourceRelative = true; jumpAudioSource.Gain = 0.2f; } AudioBuffer landAudioBuffer = AssetManager.LoadSound("Player/land.wav"); if (landAudioBuffer != null) { landAudioSource = new AudioSource(landAudioBuffer); landAudioSource.IsSourceRelative = true; landAudioSource.Gain = 0.2f; } walkingAudioSource = new CyclicAudioSource("Player/footstep.wav", 8, 0f); runningAudioSource = new CyclicAudioSource("Player/run.wav", 12, 0f); }
public CharacterSnapshotSystem(SnapshotNetComponent snapshotComponent, SnapshotSystem deltaSnapshotSystem) { this.snapshotComponent = snapshotComponent; this.deltaSnapshotSystem = deltaSnapshotSystem; players = new Dictionary <ushort, ClientPlayer>(); DashCMD.SetCVar("log_css", false); }
public SnapshotNetComponent(AOSServer server) : base(server) { snapshotSystem = new SnapshotSystem(server); charSnapshotSystem = new CharacterSnapshotSystem(this, snapshotSystem); ConnectionStates = new Dictionary <NetConnection, NetConnectionSnapshotState>(); objectComponent = server.GetComponent <ObjectNetComponent>(); objectComponent.OnCreatableInstantiated += ObjectComponent_OnCreatableInstantiated; objectComponent.OnCreatableDestroyed += ObjectComponent_OnCreatableDestroyed; DashCMD.AddScreen(new DashCMDScreen("snapshot", "Displays information about the snapshot system.", true, (screen) => { try { foreach (KeyValuePair <NetConnection, NetConnectionSnapshotState> pair in ConnectionStates) { SnapshotStats stats = pair.Value.Stats; screen.WriteLine("[{0}]:", pair.Key); screen.WriteLine("Snapshot Round-Trip Time: {0}", pair.Value.RoundTripTime); screen.WriteLine("PacketHeader: {0} bytes", stats.PacketHeader); screen.WriteLine("Acks: {0} bytes", stats.Acks); screen.WriteLine("PlayerData: {0} bytes", stats.PlayerData); screen.WriteLine("TerrainData: {0} bytes", stats.TerrainData); screen.WriteLine("Total: {0} bytes", stats.Total); screen.WriteLine(""); } } catch (Exception) { } }) { SleepTime = 30 }); DashCMD.SetCVar("sv_tickrate", DEFAULT_TICKRATE); DashCMD.SetCVar("sv_await_cl_snap", false); DashCMD.SetCVar <ushort>("ag_max_cl_tickrate", 100); DashCMD.SetCVar("ag_cl_force_await_snap", false); //DashCMD.SetCVar("sv_tickrate", 25); //DashCMD.SetCVar("sv_await_cl_snap", true); //DashCMD.SetCVar<ushort>("ag_max_cl_tickrate", 30); //DashCMD.SetCVar("ag_cl_force_await_snap", true); }
public NetEntitySnapshot CreateSnapshot(NetCreatableInfo info, SnapshotSystem snapshotSystem) { return(new CommandPostEntitySnapshot(this, info, snapshotSystem)); }
public NetConnectionSnapshotState(SnapshotSystem snapshotSystem, NetConnection conn) { WorldSnapshot = new WorldSnapshot(snapshotSystem, conn); Connection = conn; Stats = new SnapshotStats(); }