* Engine changes for more server-pushed lighting variables, but apparently this is a deprecated way of doing things anyway
* Removed two unecessary uses of virtual
* Clean up TeleportTo
* Change TeleportTo to allow teleporting to EntitiyUid
* Rename TeleportToPlayerCommand to TeleportToCommand
* Move duplicate parsing code to TryGetTransformFromUidOrUsername
Simulation input and Update() does not happen when prediction is disabled. Both of these can be re-opted in on a per-handler/system basis with a bool flag. Stuff like physics opts out of this now.
- Fix bug where MIDI renderers in other maps than the current map in IEyeManager would be silenced forever.
- Tracking an entity now sets the TrackingCoordinates to the entity's coordinates.
- MIDI renderers not in your same IEyeManager.CurrentMap or that have invalid coordinates will have their occlusion set to the max value, essentially becoming silenced. I feel like this is a much better solution than changing the volume, as things should be able to call Source.SetVolume without it being changed by positional audio shenanigans.
Added an option to defer field DI for RegisteredInstances until BuildGraph is called. This lets you register instances that contain dependency fields that are not instantiated yet.
* Console/SystemConsoleManager: Short-circuit console input handling when not interactive
* Console/SystemConsoleManager: Use a `Task` for reading input
Now with 100% less blocking (on the main thread, at least)
* Console/SystemConsoleManager: move command execution off the worker thread
* Shared/Utility: Define new FormattedMessage core types
* Shared/Utility: Move MarkupParser to a new namespace, update to new FormattedText
* Shared/Serialization: Temporary fix for FormattedMessageSerializer
* Scripting/ScriptInstanceShared: Move to new FormattedMessage.Builder
* Shared/Utility: Add a FormattedMessage loader to the .Builder
* Server/Scripting: Port SciptHost to FormattedMessage.Builder
* UserInterface/RichTextEntry: NOP out almost everything
not gonna bother fixing it until more groundwork is laid
* Shared/Utility: Expand Utility.Extensions a bit
strictly for pesonal reasons
* Client/UserInterface: Add the base TextLayout engine
* Client/Graphics: Add a Font Library manager
* Graphics/TextLayout: Finish up implementing the TextLayout engine
* Utility/FormattedMessage: Add yet another hack to keep the serializer in service
* Commands/Debug: Use FormattedMessage.Builder
* Console/Completions: Use FormattedMessage.Builder
* Utility/FormattedMessage: Add `AddMessage` methods
* Console/ScriptConsole: Use FormattedMessage.Builder
* Client/Log: Use FormattedMessage.Builder
* CustomControls/DebugConsole: Use FormattedMessage.Builder
* Controls/OutputPanel: Use FormattedMessage.Builder, NOP `Draw` pending rewrite
* Controls/RichTextLabel: Use FormattedMessage.Builder, NOP `Draw` pending rewrite
* UnitTesting: Update FormattedMessage/Markup Tests
They will NOT pass yet, but I don't care; it compiles.
* Utility/FormattedMessage: Fix some off-by-one Builder bugs
* Utility/FormattedMessage: Continue cleanup, test compliance
* Utility/FormattedMessage: Work around https://github.com/dotnet/roslyn/issues/57870
* Utility/FormattedMessage: Move ISectionable from TextLayout, implement it for FormattedMessage
* UserInterface/TextLayout: Add a `postcreate` function to set up new `TIn`s
Apparently Roslyn isn't big-brained enough to understand that a
closure of type `Func<T>` means that `var n = new(); return n;` requires
`new()` to return a `T`.
Ironically, it's significantly less cbt to add this than to convert
that big tuple in `Layout` in to a class or struct of some sort
(to initialize the `List<>`s).
* UserInterface/TextLayout: Throw if `Meta` isn't recognized
TODO warning go brrr
* Graphics/FontLibrary: Add a `DummyVariant`
* UserInterface/UITheme: Move to FontLibraries
* UserInterface/TextLayout: Move to an un-nested `ImmutableArray`
* UserInterface/RichTextEntry: Go ahead. Draw.
* Markup/Basic: Add extension & helpers for FormattedMessage.Builder
* Markup/Basic: Add `EscapeText` back in
A forgotten casualty of the great Markup separation of 2021
* Graphics/FontLibrary: Clean up bit magic, ensure that at least one font is picked
* Graphics/FontLibrary: Add diagnostics to the "no fonts" exception
* UserInterface/TextLayout: Scrap `Word`, return to `Offset`
* UserInterface/TextLayout: A whole bunch of hard-fought bugfixes
* Utility/FormattedMessage: Add a static, empty FormattedMessage
* Utility/FormattedMessage: Fix. Bugs.
* UserInterface/RichTextEntry: Bug fixin'
* UserInterface: CSS teim
* Markup/Basic: Add an optional "default" style to use
* Utility/FormattedMessage: I'm surprised I only made this mistake once.
* Log/DebugConsoleLogHandler: work around lack of a default style
* make adding entities in range optional
* Revert "make adding entities in range optional"
This reverts commit bd707b9f4e.
* remove AudioSystem filter modifications
* Add method to get worldpos and worldrot at the same time
Somewhat of a gain because it halves the number of GetComponent<TransformComponent> + _parent.IsValid() calls
* Remove redundant methods
* Also inverse
* Test
* Import
* Add benchmark
* Delete benchmark
SetLoop sets the amount of times to loop a song. If you set it to 1, it'll loop once, if you set it to -1, it'll loop infinitely. This should have been 0 from the start, so it doesn't loop when disabled.
* Optimise GetBroadphases
Only used in public APIs. Should be significantly faster as it doesn't iterate every fixture on a grid.
* Fix the staged stuff
A bad return statement meant that the associated grid was not being properly deleted.
This fix means the game won't effectively crash PVS if a grid entity is directly deleted.
* Add test pooling and global test setup
* WIP test pooling changes
* Make asynchronous tests the default again
* Finish fixing tests, make test threads background threads
* Un-pool tests with custom cvars
* Fix not changing FailureLogLevel cvar on instance return
* Fix error when overriding already overriden cvar
* Don't pool some physics integration tests
* Unpool engine tests, the technology just isn't there yet
* Remove explicit Pool = false from physics tests
* Change default pooling setting to false
* Didn't need this anyway
* Remove ConfigurationManager.ResetOverrides
* Bring back enum cvar override parsing
* Make integrationInstances name clearer > notPooledInstaces
Make clients ready and servers ready internal
* Add logging test instances
* Give more info on ran tests
* Show total clients and servers in test output
* Wipe LayerMap on SpriteComponent.AfterDeserialize
* Fix server not properly kicking clients
* Rider shut
* Make all test metrics report totals
* Format tests ran better
* Replace Console.WriteLine with TestContext.Out.WriteLine
* Fix two server test pooling info prints using total clients instead of total servers
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
Robust.Client.CEF Renamed to Robust.Client.WebView since CEF should really be an implementation detail.
Content is no longer responsible for initializing and managing the module, this is done automatically by the engine.
WebView is initialized by declaring it in a manifest.yml file in the game resources. In the future the launcher will read this same file to manage WebView module versions.
CefManager has been made private and the content-visible API is now IWebViewManager.
* Fix resizing moving the window beyond its minimum size and causing it to move visually
* Do a NaN-check the SetSize when resizing
* Use float instead to avoid conversion
As per PJB3005's suggestion
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
* Make autogenerated XAML fields public instead of protected
* Make field always public, remove stray commented out code
* Remove encapsulation for previously protected XAML UI fields
* Make access level settable
* Set access to public for DebugConsole LineEdit
* Address reviews and add documentation
* Remove documentation
* Address reviews
* Reduce FindGridsIntersecting allocations
I love struct enumerators
* Do slightly smarter pooling in EntityViewCulling
Even more alloc reductions
* Forgot to re-add this pooling
* Fix missing chunks
- Exception tolerance added
- UID is now passed in the arguments
- Is able to remove protected components if needed.
- Actually calls `ComponentDependencyManager` to let it know the component has been removed.
* Don't generate physics contacts for non-predicted bodies
These are all just handled on the server anyway so it's a significant waste of performance on the client for busy scenes.
* Significantly optimise broadphase updates
Cache all of the broadphase data properly now and also save the cache for physics step to boot.
* Fix cross-map broadphases
* Remove unnecessary clear
* fix
* Fixes
* Numerous ray fixes
In short, if you specify a shared type as a friend, any inheriting types will also count as friends, automatically. This could be abused but... That's why "sealed" exists, r-r-right?
Shadows now seem to remain pretty stable up to the point where nothing is stable.
Sounds good to me.
Now, I know what you're going to say. "But, but, Kraken *fren*!"
*sighs* No. Kraken BAD. Kraken harm spesspeople.
This won't help too much because serialization is extremely alloc-heavy and it causes tons of GC pressure, so GC will drastically reduce the effectiveness of parallelization. Still helps a bit though.
When you tried to spawn an anchored entity, it wouldn't spawn it in the position you specified, as the entity is anchored...
Now, we forcibly disable anchoring just for moving the entity, and restore the old anchor state when we're done.
Yes, this is a bad solution. No, I don't regret it: We need to get our shit together and have a way to forcibly teleport/move entities that are anchored for things like this.
* Fright night
* Shitty bounds working
* No more fixture leak
* Optimise TryFindGridAt
Should be O(1) now instead of the previous O(n) for number of fixtures
* ambush
* Merge stuffies
* Merge to master
* Fixes I guess
* Fix client sync
* Fix grid deserialization
* Jank test
* Fix deferral shitfuckery
* Optimise and remove
* Fixes
* Just werk dam u
* Optimisations
* Bunch of fixes
* FINALLY IT'S DONE
* Fixes
* Fix
* Comment
* Change serialization reading to only do type checks once per type
* Optimize for sealed types in arrays
* Oops the context
* Fix ISelfSerialize node type and null values
* Add int read test
* Remove nullability from constructor and property of DeserializedValue
* Add clearing readers to serialization shutdown
* Fix struct populate default values
Remove some notnull constraints
* Replace robust gen with normal il generator
* The real lookup flags
* Don't get anchored entities for PVS query
* Finish that implementation
* Immediate anchoring changes
* Woops some anchoring slippy
* Fix stupidity
* More gradual
* Remove thread-unsafe stuff
In case anyone notices I'm stupid
* Some day I'll stash instead lol
* Fix thread issue
* Werk
* Cvar for range too
* Explanation
* More comments
* Fix merge
* Avoid unnecessary TransformComponent cast in PVS
Haven't profiled if it's faster but it supports EntityUid better so whenever we deprecate IEntity we would've had to do this anyway.
* Avoid unnecessary MapPosition call
LocalToChunkIndices already checks for this and saves the additional conversion from EC -> map -> EC again
* Doc fixes
Rather than having the methods on the shapes themselves (whenever we eventually get them as structs) I just put them on a shapemanager instead as it seemed cleaner?
* The real lookup flags
* Don't get anchored entities for PVS query
* Finish that implementation
* Immediate anchoring changes
* Woops some anchoring slippy
* Address review
Now we only use the dictionary for storing entities, similar to components.
This means creating/deleting entities while enumerating them will throw, but that's probably fine since GetEntities() is barely used nowadays, and we have QueueDelete().
* Add support for grid chunk removals
Also allows grids to be removed when they have no more chunks remaining.
* No more crashing pog
* Slightly better
* Minor optimisations and fix bounds
* Avoid creating new chunks for anchoring
* chucky
* comment
* Tests
* Remove some logs
* Remove another log
* Review
* Fix client-side physics bodies getting stuck awake
Wasn't a huge perf hit but it could leak a bit. Also there's a bunch of E/C stuff in here and I'll deal with it later.
* Fix broadphase leak
* Fix robust server sim
* PVS is now aware of entity anchoring.
Misc PVS perf improvements.
* Fix master merge
* Optimise chunks intersecting
* Ensure anchored entity chunks are always sent
* Remove silly pool by me
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
* Add short-circuit for TryDistance
90% of the uses probably have the same parent hence we can avoid the more expensive ToMap calls for these.
* InRange too
Don't need to check every chunk's bounds when you can just do dictionary lookups. Should be an okay bonus for PVS and grid rendering on larger grids. Didn't make tests yet because all of the existing ones are mocked and painful to change.
* Fix grid collisions
* Fix this silliness
* Add test for grid collisions
* Fix FlagSerializer not working with 1 << 31
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
* MapManager now uses accurate bounds for grids
Instead of using the old WorldBounds (which was dirty for multiple reasons) it goes through physics instead using the actual fixtures attached to the grid.
* Fix nuke
* Test time
* AABB tests
* feex
* how is this failing aaa
* feex tests
* slightly better
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
* Add Friend classes to C# with the help of Analyzers and Attributes.
* Revert to netstandard2.0
* Use LINQ instead of ^1 for array
* Address review.
Oops, forgot to push.
* Fix containers that hold entities not on client
* Delete from ExpectedEntities when entity removed
* Fix ContainerSystem not registering on the server
* Move container state to entity system
Move client code to client
* Fix removal and clean up code
* Add test
* Add more checks to test
* Remove unneeded deletion event handler
When the child is deleted, if the entity does not exist on the client,
then HandleComponentState runs. If the entity does exist, then
HandleEntityInitialized would have run. Either way HandleEntityDeleted
is not needed.
* Renamed unexpected to removedExpected
The default value would be set to 0 as a placeholder from when the config var is first tracked as unregistered, which means that when we try to override it tries to parse it as an int always.
The issue is that currently moving around means any non-anchored entities have their positions updated to / from NaN. As you can imagine this is a performance nightmare for anything subscribing to it, especially considering it leads to the broadphase getting desynced for physics.
Realistically we need one of the alternatives Acruid has laid out because flooding the eventbus with NaNs will kill performance.
* Cache physics transforms internally
3 main points to cache them for:
1. Contact updates
2. Physics Islands solving
3. GetWorldManifold (though this is primarily for ss14).
Whenever multi-threading is done it will need adjustments to make sure no race conditions on accessing the transforms dictionary
* Also cache position and angle for GetWorldAABB
* Fix boogs
* woops
* ComponentNames are not sent over the network when components are created.
* Removed ComponentStates array from EntityState, now the state is stored directly inside the CompChange struct.
* Remove the unnecessary NetID property from ComponentState.
* Remove Component.NetworkSynchronizeExistence.
* Change GetNetComponents to return both the component and the component NetId.
* Remove public usages of the Component.NetID property.
* Adds the NetIDAttribute that can be applied to components.
* Removed Component.NetID.
* Revert changes to GetComponentState and how prediction works.
* Adds component netID automatic generation.
* Modifies ClientConsoleHost so that commands can be called before Initialize().
* Completely remove static NetIds.
* Renamed NetIDAttribute to NetworkedComponentAttribute.
* Fixing unit tests.
adds a typeserializer
adds null parser to read
adds another overload for deserializationresult.value
Co-authored-by: Paul <ritter.paul1+git@googlemail.com>
* Adds ServerOptions, improve GameControllerOptions, fix engine integration tests
* Do component auto-registration in engine integration tests by default
* Fix integration tests on content, register components ONLY if not contentstarted or options are null
* Add integration test for engine integration tests working correctly
* Move cvar overrides out of content and into engine.
FullState was getting updated before ResetPredictedEntities ran instead of after. So ResetPredictedEntities was applying data to stuff like containers that depends on entities that hadn't been made yet.
* Fix light pop-in
Doh
* Uniqueness
* Refactor to be less bad
* Better perf
* Fix perf problems
* Hide debug commands under preprocessor
Can't imagine anyone using this during live-game.
* CVars
Apparently? You need to dispose of the sequencer BEFORE the synth or a funny segfault will occur... T-Thanks libfluidsynth.
Also unregisters the sequencer clients before disposing, just for cleanliness.
* MapGridSystem for grid initialization
Doesn't seem to be a clean way to hook into grids being initialized (can't duplicate directed bus events and a few systems need to EnsureComponent) hence the event.
* Address reviews
This is because the parent was attached first, and then the Entity Coordinates are set, but position doesn't change because the parent is the same and the entity is anchored.
NOTE: I only fixed the EntityCoordinates overload. Unsure if this is even a problem with MapCoordinates.
It would do .EndsWidth(), so DropDownDebugConsole and DebugConsole would get confused.
It now properly checks for path separators and also will report an error if there are two candidate XAML files.
Also, fixed the AXN0003 diagnostic having the wrong name.
* Added unit tests for the new anchor system design.
* Amend ME!
* SnapGridComponent now anchors the entity when added or removed.
TransformComponent.Anchored properly replicates it's state to clients.
* Converted all SnapGridPositionChangedEvent subscriptions to AnchorStateChangedEvent.
Removed SnapGridPositionChangedEvent.
Obsoleted SnapGridComponent.
* Allows setting Transform.Anchored in prototypes.
* Changing tile to empty under anchored ents unanchors them.
* More unit testing.
* Migrated transform gamestate tests to RobustServerSimulation.
* Fixed nasty off-by-one error when sending a full server state.
* Adds lifetime stages to Component.
* More test fixing.
* Review changes.
* Implement subscription ordering into EventBus.
* Topological helpers, rest of code uses shared topological sort, fix bugs.
* Fix tests.
Didn't realize that multi-subscriptions are allowed on input handlers like that??
* Improve and use topological sort helpers more.
No weird-ass bug this time. There was also an issue where occasionally the AABB on the client would disappear if you had a bunch of objects and used showbb but I think it's fixed now.
1. Allow loading audio directly from a sample buffer
2. SetVolumeDirect that takes a 0 -> 1 scale similar to OpenAL's AL_GAIN.
3. Fix OpenAL threading bugs with logging by caching the sawmill.
* IComponentManager holds a reference to IComponentFactory.
* Directed events for a same <TComp, TEvent> can be duplicated, component references of a component are added to the entity's event tables.
* Fix tests.
* Improvements, duplicated subscriptions are no more
* Cache component factory for faster access
* when the
* Automatically unsubscribe event bus registrations in entity system shutdown.
* Fix incorrect unsubscription of local events, obsolete unsubscribe methods.
That's what we got tests for.
* = null instead of .Clear()
- Recipients is now of type `IEnumerable<ICommonSession>`.
- This way, people need to use the Filter API to modify the recipients, instead of being allowed to modify the underlying collection directly.
- Underlying collection is now a HashSet.
- We want no duplicates at all. This will ensure that while being quite performant.
- Removes `IFilter`.
- Let's face it, everyone is gonna end up using `Filter` instead as it has a much more convenient API, and nothing else will EVER implement `IFilter`. For this reason, I've just gone ahead and removed it. Every method used `Filter` already, anyway.
- Adds EntitySystem `RaiseNetworkEvent` overload that takes in a `Filter`.
- This deduplicates a lot of code that enumerated the recipients and raised a network event per each one.
- Made AddPlayersByPvs aware of `net.pvs` and `net.maxupdaterange`, has a range multiplier parameter.
- Now it will simply add all players to the filter if PVS is disabled, and add all players in range if it's enabled.
- The range multiplier parameter allows us to make the PVS filter a bit more permissive, and generally better. The range is doubled by default, as it was already before.
- Adds `AddInRange` method to filters.
- This is useful for the AudioSystem, and the PVS methods use it, too!
- Adds `RemoveByVisibility` method to filters.
- This will remove all recipients that don't have a visibility flag in their entity's EyeComponent from the filter.
- (This will be VERY useful for Ghost Pointing, for example)
- Adds `Clone` method to filters.
- This is useful in cases where methods take in a filter and want to modify it without modifying the original instance. (See AudioSystem)
* Add serialization write benchmark
* Add baseline test and rename AddNode to Add in mapping extensions
* Optimize serialization writing
* Make reader delegate private
* Unhardcode baseline test
* Removed SnapGridOffset, there is only center now.
* SnapGridComponent methods are now static.
* Removed SnapGridComponent.OnPositionChanged.
* Refactored static functions off SnapGridComponent to MapGrid.
Refactored away usages of SnapGridComponent.Position.
* Added Transform.Anchored for checking if an entity is a tile entity.
More refactoring for static MapGrid functions.
* Static snapgrid methods on MapGrid are no longer static.
* Removed IMapGrid.SnapSize, it is now always equal to the IMapGrid.TileSize.
* Add setter to ITransformComponent.Anchored.
Removed direct references to SnapGridComponent from content.
* Grid functions now deal with EntityUids instead of SnapGridComponents.
Began renaming public API functions from SnapGrid to Anchor.
* Add some unit tests.
* SnapGridComponent now anchors itself in startup, instead of Initialize (sending directed events in init is an error).
* Make serialization work with backing fields automatically
* Fix not taking priorities into account, make the test fail when that is the case
* Turn fieldDefs back into a list
* Format it better
* Remove GetInheritanceBehaviour, expose immutable array of base field definitions
* Refactors EntityManager to not do any networking.
ServerEntityManager and ClientEntityManager now do the networking instead.
* Rename property for "backwards compat."
* Remove comented out code in robust server simulation
* Refactors MapManager to not do any networking.
Now, ServerMapManager and ClientMapManager handle any networking.
* it's christmas in april!
* Remove comented line
* Remove useless seal
* Fix incorrect semicolon
* Event is no longer overriden, has a protected Invoke method instead
* Split entity lookups from entitymanager
* Helps if you subscribe dingus
* Handle map changes
* Stacks instead
* Make mapchanges use a queue because it's probably better
Moves likely only care about the latest position
* IoC what you did there
* IoC refactor
* Minor optimisations
* Apply feedback
* My IQ dropped 3 sizes that day
* Rest of acruid's feedback
* final_no_actual commit
* enlightenment?
* Liftoff
* final_commit_v2_actual
Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
* Add Robust.Benchmarks and read string benchmark
* Separate serialization manager methods, use compiled lambdas to call manager read
4 us > 200 ns
* Add int and data definition with string benchmarks
* Make serialization population use expressions to create definitions
* Make benchmark classes internal and create seed data definition
* Add complex data definition read benchmark
* Create primitive serializers, remove primitive special case
| Method | Mean | Error | StdDev |
|----------------------- |------------:|----------:|----------:|
| ReadString | 227.1 ns | 4.47 ns | 5.65 ns |
| ReadInteger | 245.4 ns | 4.82 ns | 6.26 ns |
| ReadDataDefWithString | 804.7 ns | 15.27 ns | 16.34 ns |
| ReadSeedDataDefinition | 15,846.8 ns | 312.89 ns | 773.39 ns |
* Remove testing code
* Setup delegates during initialize
* Revert "Setup delegates during initialize"
This reverts commit 7ff4d4eaaa.
* Store delegates in a concurrent dictionary because I really cannot be arsed to generate them on initialize at this point
* Wrapped the parallel GetMail function in a try/catch.
Added a hack to the ViewCulling leave message that skips ents that don't exist.
Always send ALL map and grid entities to the client.
More info logging about adding/removing maps/grids.
* Will now still send required map critical entities even if client is not attached to an entity.
PvsEnabled and PvsRange are now writeable.
* Adds barbones culling.
* Visibility culling and recursive parent ent additions.
DebugEntityNetView improvements.
Visibility moved from session to eyecomponent.
* Multiple viewport support.
* Perf improvements.
* Removed old netbubble system from ServerEntityManager.
Supports old NaN system for entities leaving view.
Supports old SendFullMap optimization for anchored, non-updating Entities.
* Fixes size of netView box.
* Remove empty EntityManager.Update method.
Switching ViewCulling back to PLINQ.
Removes NetId methods from IEntity, content does not need to be messing with them.
Fixes bug in DeleteComponent where the ComponentDeleted event was not being raised if a component did not have a NetId.
* Added an entity lifetime levels property.
Added exception when recursively deleting an entity.
* Add a directed event 'EntityTerminatingEvent' for right before an entity is deleted.
* Added MapInit lifestage to entities.
retires DataFieldWithConstantAttribute & DataFieldWithFlagAttribute in favor of new customtypeserializers
adds prototypeidvalidation, just needs to be added to the corresponding fields
fixes some behaviour in yamllinter
* Added new ComponentEventBus, combined it with IEventBus.
* Removed all traces of IEntity from ComponentDependencies.
Removed IEntityManager dependency from ComponentManager.
* Added entity create/delete events to IEntityManager.
* ComponentEvents now use EntitySystemMessages instead of their custom ComponentEvent class.
* Component events are now just overloads of entity events.
* Removed obsolete EntitySystemMessage, now everything uses the base EntityEventArgs.
* Add a bool argument for if the message should be broadcast as well as directed.
Fix ordering and init issues of events in EntityManager.
* Changed names from Component/Entity events to Directed/Broadcast.
* Fix bugs and unit tests.
The idea was that these are Task.Run'd so don't influence performance. That was before we started threading the hell out of startup.
We're getting more stuff like YAML linting now which should hopefully be able to catch 99% of this. And louder because it was always just a warning before.
* AAAAAAAAAAAAA
* Organization
* Still doesnt work
* Formatting
* It works!!
* More changes to everything
* Beginning of changes to overlays
* Makes the overlay manager GUID based (also it was very messy, still messy but i fixed some of it)
* Stencils are easy
* Questionable changes to overlays
* Minor change to HLR
* Fixed duplicate overlays when calling some commands (Like showbb)
* Fixes misleading message
* Adds a variety of worldspaces for overlays to choose from
* Caching
* Address reviews
* Merging pains
* ah.
* ahhhhh
* minor overlaymanager changes
* Work
* fix
* Merge??
* Fixes null errors
* Force update
* Delete whatever the fuck this is?
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
1. Stop using NJsonSchema, it didn't do anything useful.
2. Use System.Text.Json instead of Newtonsoft.Json.
3. General cleanup of the code, using arrays instead of lists, etc...
* Physics worlds
* Paul's a good boy
* Build working
* Ingame and not lagging to hell
* Why didn't you commit ahhhhh
* Hard collisions working
* Solver parity
* Decent broadphase work done
* BroadPhase outline done
* BroadPhase working
* waiting for pvs
* Fix static PVS AABB
* Stop static bodies from awakening
* Optimise a bunch of stuff
* Even more broadphase stuff
* I'm fucking stupid
* Optimise fixture updates
* Collision solver start
* Building
* A is for Argumentative
* Fix contact caching island flags
* Circle shapes actually workeded
* Damping
* DS2 consumables only
* Slightly more stable
* Even slightlier more stablier
* VV your heart out
* Initial joint support
* 90% of joints I just wanted to push as I'd scream if I lost progress
* JOINT PURGATORY
* Joints barely functional lmao
* Okay these joints slightly more functional
* Remove station FrictionJoint
* Also that
* Some Box2D ports
* Cleanup mass
* Edge shape
* Active contacts
* Fix active contacts
* Optimise active contacts even more
* Boxes be stacking
* I would die for smug oh my fucking god
* In which everything is fixed
* Distance joints working LETS GO
* Remove frequency on distancejoint
* Fix some stuff and break joints
* Crashing fixed mehbeh
* ICollideSpecial and more resilience
* auto-clear
* showbb vera
* Slap that TODO in there
* Fix restartround crash
* Random fixes
* Fix fixture networking
* Add intersection method for broadphase
* Fix contacts
* Licenses done
* Optimisations
* Fix wall clips
* Config caching for island
* allocations optimisations
* Optimise casts
* Optimise events queue for physics
* Contact manager optimisations
* Optimise controllers
* Sloth joint or something idk
* Controller graph
* Remove content cvar
* Random cleanup
* Finally remove VirtualController
* Manifold structs again
* Optimise this absolute retardation
* Optimise
* fix license
* Cleanup physics interface
* AHHHHHHHHHHHHH
* Fix collisions again
* snivybus
* Fix potential nasty manifold bug
* Tests go snivy
* Disable prediction for now
* Spans
* Fix ShapeTypes
* fixes
* ch ch changeesss
* Kinematic idea
* Prevent static bodies from waking
* Pass WorldAABB to MoveEvent
* Fix collisions
* manifold structs fucking WOOORRKKKINNGGG
* Better pushing
* Fix merge ickies
* Optimise MoveEvents
* Use event for collisions performance
* Fix content tests
* Do not research tests
* Fix most conflicts
* Paul's trying to kill me
* Maybe collisions work idk
* Make us whole again
* Smug is also trying to kill me
* nani
* shitty collisions
* Settling
* Do not research collisions
* SHIP IT
* Fix joints
* PVS moment
* Fix other assert
* Fix locker collisions
* serializable sleeptime
* Aether2D contacts
* Physics is no longer crashing (and burning)
* Add to the TODO list
Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
* oops
* fixes serialization il
* copytest
* typo & misc fixes
* 139 moment
* boxing
* mesa dum
* stuff
* goodbye bad friend
* last commit before the big (4) rewrite
* adds datanodes
* kills yamlobjserializer in favor of the new system
* adds more serializers, actually implements them & removes most of the last of the old system
* changed yamlfieldattribute namespace
* adds back iselfserialize
* refactors consts&flags
* renames everything to data(field/definition)
* adds afterserialization
* help
* dataclassgen
* fuggen help me mannen
* Fix most errors on content
* Fix engine errors except map loader
* maploader & misc fix
* misc fixes
* thing
* help
* refactors datanodes
* help me mannen
* Separate ITypeSerializer into reader and writer
* Convert all type serializers
* priority
* adds alot
* il fixes
* adds robustgen
* argh
* adds array & enum serialization
* fixes dataclasses
* adds vec2i / misc fixes
* fixes inheritance
* a very notcursed todo
* fixes some custom dataclasses
* push dis
* Remove data classes
* boutta box
* yes
* Add angle and regex serializer tests
* Make TypeSerializerTest abstract
* sets up ioc etc
* remove pushinheritance
* fixes
* Merge fixes, fix yaml hot reloading
* General fixes2
* Make enum serialization ignore case
* Fix the tag not being copied in data nodes
* Fix not properly serializing flag enums
* Fix component serialization on startup
* Implement ValueDataNode ToString
* Serialization IL fixes, fix return and string equality
* Remove async from prototype manager
* Make serializing unsupported node as enum exception more descriptive
* Fix serv3 tryread casting to serializer instead of reader
* Add constructor for invalid node type exception
* Temporary fix for SERV3: Turn populate delegate into regular code
* Fix not copying the data of non primitive types
* Fix not using the data definition found in copying
* Make ISerializationHooks require explicit implementations
* Add test for serialization inheritance
* Improve IsOverridenIn method
* Fix error message when a data definition is null
* Add method to cast a read value in Serv3Manager
* Rename IServ3Manager to ISerializationManager
* Rename usages of serv3manager, add generic copy method
* Fix IL copy method lookup
* Rename old usages of serv3manager
* Add ITypeCopier
* resistance is futile
* we will conquer this codebase
* Add copy method to all serializers
* Make primitive mismatch error message more descriptive
* bing bong im going to freacking heck
* oopsie moment
* hello are you interested in my wares
* does generic serializers under new architecture
* Convert every non generic serializer to the new format, general fixes
* Update usgaes of generic serializers, cleanup
* does some pushinheritance logic
* finishes pushinheritance FRAMEWORK
* shed
* Add box2, color and component registry serializer tests
* Create more deserialized types and store prototypes with their deserialized results
* Fixes and serializer updates
* Add serialization manager extensions
* adds pushinheritance
* Update all prototypes to have a parent and have consistent id/parent properties
* Fix grammar component serialization
* Add generic serializer tests
* thonk
* Add array serializer test
* Replace logger warning calls with exceptions
* fixes
* Move redundant methods to serialization manager extensions, cleanup
* Add array serialization
* fixes context
* more fixes
* argh
* inheritance
* this should do it
* fixes
* adds copiers & fixes some stuff
* copiers use context v1
* finishing copy context
* more context fixes
* Test fixes
* funky maps
* Fix server user interface component serialization
* Fix value tuple serialization
* Add copying for value types and arrays. Fix copy internal for primitives, enums and strings
* fixes
* fixes more stuff
* yes
* Make abstract/interface skips debugs instead of warnings
* Fix typo
* Make some dictionaries readonly
* Add checks for the serialization manager initializing and already being initialized
* Add base type required and usage for MeansDataDefinition and ImplicitDataDefinitionForInheritorsAttribute
* copy by ref
* Fix exception wording
* Update data field required summary with the new forbidden docs
* Use extension in map loader
* wanna erp
* Change serializing to not use il temporarily
* Make writing work with nullable types
* pushing
* check
* cuddling slaps HARD
* Add serialization priority test
* important fix
* a serialization thing
* serializer moment
* Add validation for some type serializers
* adds context
* moar context
* fixes
* Do the thing for appearance
* yoo lmao
* push haha pp
* Temporarily make copy delegate regular c# code
* Create deserialized component registry to handle not inheriting conflicting references
* YAML LINTER BABY
* ayes
* Fix sprite component norot not being default true like in latest master
* Remove redundant todos
* Add summary doc to every ISerializationManager method
* icon fixes
* Add skip hook argument to readers and copiers
* Merge fixes
* Fix ordering of arguments in read and copy reflection call
* Fix user interface components deserialization
* pew pew
* i am going to HECK
* Add MustUseReturnValue to copy-over methods
* Make serialization log calls use the same sawmill
* gamin
* Fix doc errors in ISerializationManager.cs
* goodbye brave soldier
* fixes
* WIP merge fixes and entity serialization
* aaaaaaaaaaaaaaa
* aaaaaaaaaaaaaaa
* adds inheritancebehaviour
* test/datafield fixes
* forgot that one
* adds more verbose validation
* This fixes the YAML hot reloading
* Replace yield break with Enumerable.Empty
* adds copiers
* aaaaaaaaaaaaa
* array fix
priority fix
misc fixes
* fix(?)
* fix.
* funny map serialization (wip)
* funny map serialization (wip)
* Add TODO
* adds proper info the validation
* Make yaml linter 5 times faster (~80% less execution time)
* Improves the error message for missing fields in the linter
* Include component name in unknown component type error node
* adds alwaysrelevant usa
* fixes mapsaving
* moved surpressor to analyzers proj
* warning cleanup & moves surpressor
* removes old msbuild targets
* Revert "Make yaml linter 5 times faster (~80% less execution time)"
This reverts commit 2ee4cc2c26.
* Add serialization to RobustServerSimulation and mock reflection methods
Fixes container tests
* Fix nullability warnings
* Improve yaml linter message feedback
* oops moment
* Add IEquatable, IComparable, ToString and operators to DataPosition
Rename it to NodeMark
Make it a readonly struct
* Remove try catch from enum parsing
* Make dependency management in serialization less bad
* Make dependencies an argument instead of a property on the serialization manager
* Clean up type serializers
* Improve validation messages and resourc epath checking
* Fix sprite error message
* reached perfection
Co-authored-by: Paul <ritter.paul1+git@googlemail.com>
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
Co-authored-by: Vera Aguilera Puerto <zddm@outlook.es>
* Adds the SoundSystem static proxy class for the AudioSystem.
Added a shared IAudioSystem interface for the future.
* Moved ConnectedClient property from IPlayerSession down to ICommonSession.
* Connected up the SoundSystem to the client/server AudioSystems.
* Converted client calls over to the new system.
* Marked the old serverside functions to play sound obsolete, use the new ones from the IAudioSystem.
* Added ISharedPlayerManager to the IoC registration.
* Added a basic server simulation framework for help with tests.
* Moved as much as possible to Robust.Shared/Containers.
Moved ContainerSlot from content to engine.
* Moved ClientContainer to shared.
* Merged client/server ContainerManagerComponents into a single shared version.
* ContainerManagerComponent is now implicitly registered with the attributes.
* Migrated to 2021 serialization technology.
* Existing Unit Tests work.
* More tests coverage.
Fixed bug with transferring items between containers.
* Container Type info is now sent over the network.
* Merge client/server container systems.
* Code cleanup.
* Attempted to fix dictionary serialization.
Logs warning when trying to check if an unknown GridId is paused.
* Remove OldCode.
* Physics worlds
* Paul's a good boy
* Build working
* Ingame and not lagging to hell
* Why didn't you commit ahhhhh
* Hard collisions working
* Solver parity
* Decent broadphase work done
* BroadPhase outline done
* BroadPhase working
* waiting for pvs
* Fix static PVS AABB
* Stop static bodies from awakening
* Optimise a bunch of stuff
* Even more broadphase stuff
* I'm fucking stupid
* Optimise fixture updates
* Collision solver start
* Building
* A is for Argumentative
* Fix contact caching island flags
* Circle shapes actually workeded
* Damping
* DS2 consumables only
* Slightly more stable
* Even slightlier more stablier
* VV your heart out
* Initial joint support
* 90% of joints I just wanted to push as I'd scream if I lost progress
* JOINT PURGATORY
* Joints barely functional lmao
* Okay these joints slightly more functional
* Remove station FrictionJoint
* Also that
* Some Box2D ports
* Cleanup mass
* Edge shape
* Active contacts
* Fix active contacts
* Optimise active contacts even more
* Boxes be stacking
* I would die for smug oh my fucking god
* In which everything is fixed
* Distance joints working LETS GO
* Remove frequency on distancejoint
* Fix some stuff and break joints
* Crashing fixed mehbeh
* ICollideSpecial and more resilience
* auto-clear
* showbb vera
* Slap that TODO in there
* Fix restartround crash
* Random fixes
* Fix fixture networking
* Add intersection method for broadphase
* Fix contacts
* Licenses done
* Optimisations
* Fix wall clips
* Config caching for island
* allocations optimisations
* Optimise casts
* Optimise events queue for physics
* Contact manager optimisations
* Optimise controllers
* Sloth joint or something idk
* Controller graph
* Remove content cvar
* Random cleanup
* Finally remove VirtualController
* Manifold structs again
* Optimise this absolute retardation
* Optimise
* fix license
* Cleanup physics interface
* AHHHHHHHHHHHHH
* Fix collisions again
* snivybus
* Fix potential nasty manifold bug
* Tests go snivy
Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
* Removed IBaseSession, pushed all members down to ICommonSession.
* Pulled all members of client IPlayerSession into ICommonSession.
Marked client IPlayerSession as obsolete, use the base ICommonSession.
* Restricted setter access for properties in ICommonSession, only engine should be setting them.
* Fixed ping implementation on server.
* Moved AttachedEntityUid to ICommonSession.
* Added a shared IPlayerManager and pulled some common properties down to it.
* Added a shared player Filter class that holds a set of recipients in a networked call. Very useful for selecting recipients in a shared context.
* Added support for erasing rectangular areas
* Apply suggestions from code review
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
* Switched sending start coordinate + end coordinate to sending start coordinate + rect selection size for preventing different parented positions, general code improvements
* Rewritten certain code part so the checks pass
* Added unshaded shader to rect erasing
* Tweaked alpha of erasing rectangle for better visualizing
Co-authored-by: Manel Navola <ManelNavola@users.noreply.github.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
*Allow content to define localization functions.
* Add rldloc command to reload localizations.
* Doc comments
* Error handling
* Parallelize loading of localization files, since I can only assume we'll have a lot eventually.
* Type system stuff to allow content to pass custom data types into fluent.
* Code cleanup.
This makes Direction no longer follow a cartesian trig circle but oh well. Also helper methods to work with this.
Math tests currently fail, pushing this so Acruid can see about fixing SpriteComponent.
* Added documentation to Clyde on the sprite rendering calls.
* Added a rotation debug entity.
* Non-directional RSIs and raw textures are now rotated properly.
* Directional RSIs and Sprite Smoothing work.
* Remove the Directional flag usages.
* Supports layers with different numbers of directions.
* Fixes window rendering.
* Implement hot reloading for entity prototypes
* Implement automatic prototype hot-reloading
* Merge fixes
* Add yaml hot reloading and a message to notify the client
* Add reloading only changed files, remove cooldown, add retries and remove IPrototype
* Remove reload command
* Make the client listen for reloads instead and only when focused
* Fix errors
* Only queue a reload when the queue has items in it
* Make fails after 10 retries log instead of throw if reloading
Co-authored-by: Jackson Lewis <inquisitivepenguin@protonmail.com>
* Moved IPauseManager from server to shared.
* Moved ITimerManager from Timers to Timing.
* Added missing IConsoleHost to server/client RegisterIoC. Tests work again.
1. Add XAML namespaces https://spacestation14.io with Avalonia hacks.
2. Make markup extensions work with Avalonia hacks.
3. Add LocExtension for localized strings.
4. Add Vector2 parsing type converter to XAML compilation.
5. Make SS14Window better thanks to these improvements.
* #272 no arrow, actually change id on channel changer
* #272 ability to apply style class to child
* #272 try methods for selecting items in OptionButton.cs
* #272 allow escaping right angle bracket in formatted message
* #272 ability to detect when local player is set / unset
* #272 make RemoveModal public since PushModal is as well, so modals can be removed on-demand if needed rather than relying on a click elsewhere
* #272 revert
* Add SerializedType attribute to serialize types without the !type tag
* Fix nulls in tests
* Fix null in tests maybe
* Return to type tags
* Fix imports
* Removed the Interfaces folder.
* All objects inside the GameObjects subfolders are now in the GameObjects namespace.
* Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces.
* Simplified Robust.client.Graphics namespace.
* Automated remove redundant using statements.
Lidgren NetTime.Now is now synchronized to IGameTiming.RealTime.
NetChannel is now a nested class of NetManager.
Add IGameTiming.ServerTime, INetChannel.RemoteTimeOffset, INetChannel.RemoteTime
* Renamed shared ICommand to IConsoleCommand.
* Lots of refactoring into a shared context.
* Removed ICommonSession from server concmd Execute.
* Added argStr parameter to concmd execute.
* The execute function of client concmds now returns void, use the new shell.RemoteExecuteCommand function to forward commands.
# Conflicts:
# Robust.Client/Console/Commands/Debug.cs
* Finally move shells and commands into shared.
* Console commands can now be registered directly without a class in a shared context.
* Pulled up ConsoleHost and Console shell into a shared context.
* Pulled up half the functions of ConsoleHost into a shared context.
* Repair rebase damage.
* Make LoadConsoleCommands function not remove any previously registered commands.
* Remove the main viewport.
* Re-add main viewport in a different place
* Move screen/map translation into ViewportContainer
* Support for viewport resolution
* Fix postfx, add WorldToScreen to Viewport
* Remove useless cast
* Some cleanup.
* Fix incorrect worldBounds when rendering viewports
* nullability
Co-authored-by: 20kdc <asdd2808@gmail.com>
* Add TryCastValue to CollectionExtensions.cs
* Change TryCastValue to be more generic
* Add notnull constraing for TKey to TryCastValue
Co-authored-by: Julian Giebel <j.giebel@netrocks.info>
Someone please performance-test this, but I think the fragment shader code simplifications speak for themselves.
Radrark found the "line in polar coordinates" equation I needed and a diagram that explained the variables.
That equation was essentially the missing piece to the whole thing.
1. Set timeBeginPeriod(3) on the server to reduce scheduler latency in the lidgren thread.
2. Add 16ms of guaranteed lag bias to client prediction calculations to account for scheduler latency.
Both of these changes are to account for how the windows scheduler seems to handle time periods in related to socket polls. See this Discord conversation for why, details down below as well: https://discord.com/channels/310555209753690112/770682801607278632/798309250291204107
Basically Windows has this thing called time periods which determines the precision of sleep operations and such. By default it's like 16ms so a sleep will only be accurate to within 16ms.
Problem: Lidgren polls the socket with a timeout of 1ms.
The way Windows seems to handle this is that:
1. if a message comes into the socket, the poll immediately ends and Lidgren can handle it.
2. If nothing comes in, it takes the whole 16ms time period to actually process stuff.
Oh yeah, and Lidgren's thread needs to keep pumping at a steady rate or else it *won't flush its send queue*. On Windows it seems to normally pump at 65/125 Hz. On Linux it goes like 950 Hz as intended.
Now, the worst part is that (1) causes Lidgren's latency calculation to always read 0 (over localhost) instead of the 30~ms it SHOULD BE (assuming client and server localhost).
That 30ms of unaccounted delay worst caseis enough to cause prediction undershoot and have messages arrive too late. Yikes.
So, to fix this...
On the server we just decrease the tick period and call it a day. Screw your battery life players don't have local servers running anyways.
On the client we bias the prediction calculations to account for this "unmeasurable" lag.
Of course, all this can be configured via CVars.
* Fixes sprite scale not being taken into account.
- Only apply scale if length of scale vector not close or equal to 1.
* I blame Remie
* Fix vector maths
I should spend more time studying maths instead of contributing, to be fair.
* Remie no please nO
Who would win?
Thirty developers
-OR-
One sneaky ` ` boi?
On windows default path to dotnet are `C:\Program Files`. Without quoting the
the command if it contains a space, it's going to break Windows builds that
install in `C:\Program Files`.
Note: Thanks to the nature of YAML properties in RobustToolbox, this commit is only an API blocker if the Softness property is directly manipulated from code, which is unlikely.
* Defer MoveEvent out of TransformComponent.HandleComponentState
* Imports
* Make the update loop more readable and call ToArray
* Fix tests
* Fix tests HALLELUJAH
It's now parallelized which cuts off ~200ms on its own for me.
Config is now shared between multiple loads which saves a lot as well.
All in all, pretty good.
Fixes#1434
This means that adding support for new architectures (e.g. ARM) is MUCH easier.
It removes download_natives.py which simplifies the build process.
It's also way less painful to maintain.
Makes it not a "temporary todo remove" API since it has merits in e.g. assembly loading performance (.NET can mmap the assembly if it has a disk path which is better).
Removed duplicated IResourceManagerInternal APIs in IResourceCache.
Microsoft isn't supporting NuGet-components ASP.NET Core ever since 3.x so using Kestrel is out.
New implementation is 100% thread pool compared to the old one which was a single specific thread.
This uses .NET 5's new Unsafe.SkipInit() function and a lot of FieldOffset.
The result of this is that you can now take a `ref` to the primary corners of the boxes, as well as better codegen in some cases.
* Numerics helpers
* Comments
* Reuse naive methods for remainders.
* Do naive operation if array length is under 4.
* NumericsHelpers takes in Span, can store elsewhere
* Make some spans read-only
* Enabled static property to disable/enable hardware accelerated paths.
* AVX support.
* welp
* .
* environment variable to disable simd
* Adds ARM support (AdvSimd)
* Fix AVX horizontal sum
* Add unit tests
* NET 5.0 moment
* RemoteExecutor moment
* Add nuget.config to the UnitTesting project only
* Add "ROBUST" prefix to env vars
* Better naming for array length utils
* Revert "Add nuget.config to the UnitTesting project only"
This reverts commit 1d474ff33d.
* Ignore ARM tests, remove #if NET5_0
* #272 avoid mouse overlapping tooltip when near edges,
change tooltip colors to match mockups
* #272 WIP customizable tooltips, old approach currently working still
* #272 WIP customizable tooltips, old approach currently working still
* #272 ensure tooltips go away when disposing control
* #272 implement row-oriented GridContainer
* #272 generalize GridContainer to support
rows or cols
* #272 improve readability in new GridContainer
logic
* #272 GridContainer can expand in opposite
direction
* #272 GridContainer can expand in opposite
direction
* #272 GridContainer can expand in opposite
direction, fix test
* #272 add GridContainer capability to
limit by size rather than count
* #272 add some clarifications about ui scale and vp / rp
* #272 don't spam showtooltip
event, calculate tooltip
positioning using combined
minimum size
* AlignWithClosestGridTile extension for EntityCoordinates
- Fixes component exception when adding a timer component to a deleted entity.
* Address review
* actually...
* Fix map deserialized entities not being included in OccluderSystem
* Revert "Fix map deserialized entities not being included in OccluderSystem"
This reverts commit 0af8b50231.
* Make it do it in occluder startup instead
* Refactor pausing
* Sprite as well woops
* Bring PauseManagerExt back with [Obsolete] so that content compiles.
Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
* Add HashSet YAML serialization
* consider this
* Revert "consider this"
This reverts commit f542f2c0bf.
* you think you are so funny c#
* Remove reflection call, fix equals and add tests
* Make this code slightly less bad
* Fix hashset equality and add test
* Some stuff for auth
* Holy crap auth works
* Enable encryption even if no auth token is provided.
It's still possible that the public key was retrieved over HTTPS via the status API, in which case it will be secure.
* Fix integration test compile.
* Secure CVar API.
* Literally rewrite the auth protocol to be minecraft's.
* Better exception tolerance in server handshake.
* Auth works from launcher.
* Fix some usages of UserID instead of UserName
* Fix auth.server CVar
* Kick existing connection if same account connects twice.
* Username assignment, guest session distinguishing.
* Necessary work to make bans work.
* Expose LoginType to OnConnecting.
* Fixing tests and warnings.
* Add support for 'Rounded' mode to Range (and thus Slider)
* Make lighting resolution more configurable
* Use a lighting presets dropper because RemieRichards said so
* Make ConfigLightingQuality not a property and instead two separate methods
* More configurable lighting: cleanup to use a switch rather than an if-chain
* Added struct skeleton for EntityCoordinates.
* Polish EntityCoordinates, add tests, add EntityCoordinates to Transforms
* Doc cleanup
* Remove useless code
* Return offset 0 when you don't have a parent
* Test for making sure EntityCoordinates for entities without parents have offset 0
* Use parent transform's GridId for GetGridId.
* Adds various methods, checks and tests
* Replace GridCoordinates with EntityCoordinates
* EyeManager.WorldToScreen fix
* Address reviews
* Fix za buildo
* Fix one transform test
* Fix the remaining tests
* Remove duplicate
* Remove another merge duplicate
* Fix property
* Rename most usages of GridCoordinates to EntityCoordinates.
* Add WithEntityId method to EntityCoordinates.
* Fix EntityCoordinates usage in GetEntitiesInRange
* Remove cursed IMapGrid method, change naming.
* Makes GridTileLookupSystem use EntityCoordinates
Co-authored-by: Acruid <shatter66@gmail.com>
Co-authored-by: Víctor Aguilera Puerto <zddm@outlook.es>
* Added struct skeleton for EntityCoordinates.
* Polish EntityCoordinates, add tests, add EntityCoordinates to Transforms
* Doc cleanup
* Remove useless code
* Return offset 0 when you don't have a parent
* Test for making sure EntityCoordinates for entities without parents have offset 0
* Use parent transform's GridId for GetGridId.
* Adds various methods, checks and tests
* Adds new constructor to EntityCoordinates and add WithPosition method
Co-authored-by: Acruid <shatter66@gmail.com>
Correctly use KHR and OES suffixed functions for debug output and VAOs, if necessary.
Allow overriding the detected GL version for feature detection (nvidia gives me an ES 3.2 context even when ES 2.0 is requested, so...)
1. Fixes screenshots on ES by providing a fallback path for when encessary features (PBO, fence sync, mapbuffer) are not available.
2. Correctly detect fence sync as not always being available for 3.1
3. Remove the "bad OpenGL version" box. We have MessageBoxW now.
4. Separated feature detection for ES and Desktop, added more feature detections on various sides.
5. Moved GL feature detection to its own file.
Net message functions are now cached when the message is registered or the string table updates (client side). This removes the cache call from DispatchNetMessage.
Receiving net messages that we don't have reception callbacks for, or that are blocked with the new NetMessageAccept enum, will instantly cause the net manager to drop the offending connection to avoid malicious use.
This means trying to send string tables to the server will just result in an instant kick without even hitting ReadFromBuffer().
This allows us to move some if() checks to asserts.
* Add component message for an entity moving
* Bring EntityMovementMessage out of the container check
* Make entity movement messages use one instance and mark PublicAPI
Added Open() method that takes in FileMode, FileAccess AND FileShare.
Added extra extension method helpers and made use of better FileAccess/FileShare modes.
BodyType is now serializable, fixes bug with VV.
Moved both velocity properties from ICollidableComponent to IPhysBody, added default methods to IPhysBody to get the word transform.
Added DebugTools.Break() method, calling it breaks execution in the attacked debugger.
Added VV attributes to various CollidableComponent properties.
Bodies without velocity are considered for collision, lockers are fixed.
Added force/torque integration to physics bodies.
Friction is now tickrate agnostic.
First open will be top left, centered, or left vertically centered. The subsequent calls to open will open the window at the position the window was closed at.
Removed Overlay.Shader property, you need to manage the field yourself and apply the shader before you draw.
Made all overlays compatible with the new changes.
Mark some classes as sealed where possible to remove type tags.
Re-order GameStateMapData.GridCreationDatum to reduce memory usage.
Use MemoryStream.TryGetBuffer instead of .ToArray() all over the place to cut out allocations.
Use VariableInt32s for serialized buffer sizes.
Use IRobustSerializer.SerializeDirect<T> where possible.
* Replace single controller with a dictionary
* Actually initialize the controller dictionary
* Fix not upgrading old physics controllers
* Return controller when adding it in CollidableComponent
* Make GetOrCreate name consistent
* Add updating linear velocity depending on controllers
* Address reviews
* Update Robust.Shared/Physics/VirtualController.cs
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
* Add missing physics component methods
* Make method names consistent with the rest of the project
* Add documentation to controller manipulation methods
* Add another method for controller manipulation
* Add SetController method
* Add stop method
* Add stop method to controllers
* Add bool return type to controller stopping and GetControllers method
* Fix physics stop return type not being bool
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
Allow content to push modal windows in the UI framework.
The MenuBar now closes it's MenuButton frame when you select one of the buttons.
Modal controls on the stack now actually block input from the rest of the UI.
Adds the `scene` concommand for instantly switching between game states (scenes).
I took the liberty to refactor it a bit internally so we can keep up-to-date copies of the NetPeer connection and channels lists per-peer. This allows us to avoid expensive copying allocations (Lidgren does not expose NetPeer.Connections without allocating due to thread safety)
This caused https://github.com/space-wizards/space-station-14/issues/1302.
The ChatBox focuses the LineEdit in KeyDown. This then causes the next key down, UIClick, to go to the LineEdit (it's keyboard focused now). The key up however is fired on the chatbox because keyups did prioritize mouse focus. So the LineEdit gets stuck thinking you have the mouse held down.
Now keeps a list of actively lerping transforms instead of iterating every transform every tick.
Yeah it doesn't even show up in profiles anymore instead of taking like 8% of CPU time.
Actually respects terminal encoding.
Doesn't do ANSI characters if unsupported (Windows) or redirected.
Uses 4-bit color codes instead of RGB codes.
More optimal outputting of ANSI escape codes. It's const all the way down.
* Fix client-side input system not sending sequence numbers for input messages.
This caused message ordering issues and keys getting stuck down.
* Make sure EyeUpdateSystem runs after physics.
* IGameTiming.TickFraction helper.
* Subtick data for input commands.
* Literally a unit test to verify that I wasn't going insane while debugging input message ordering issues.
* More prediction logs behind net.predict.
* Move physics to shared and run it on the client.
* Synchronize grid gravity.
* Fix ResetPredictedEntities crash when entities get deleted server-side.
* Fix CollidableComponent setters not calling Dirty()
* Fix going into space while predicting.
* Watch window uses history line edit.
* Fix unpredicted objects stuck-jittering.
* VV tags for interp vars on transform.
* Fix 0 mass objects on client.
* Fix friction calculations being TPS dependent.
* Reset predict flag on handelComponentState
* rework ComponentManager
create indexing solution, UniqueIndex
split out ComponentEventArgs, add sealed variants
fix up documentation
fix terrible crap
make benchmark work
* woops, ordered enumerables are already a copy
* naming
* clean up comments
* nullable enable
* add some doc comments to unique index
* perf tweaks
add UniqueIndexHkm for high key mutability
extract internal interface mostly for documentation
add nullability support and constraints
* fix doc comment for UniqueIndexHkm
* make PVS threaded
* remove redundant member declarations in interface
* fix grid loss crap on client shutdown
* fix nullability warning when retrieving from always constructed threadlocal
* add comment explaining chan == null check
remove inParallel parameter
* make lidgren use spans everywhere where it can
convert custom pooling to shared array pool impl
add unit tests for read/write
add native socket extensions to socket so we can legit pass spans for SendTo/ReceiveFrom
bump version in lidgren csproj
replace some random "% 8" w/ "& 7"
more minor nullability hacks to fix static analysis complaints
made receiving packets use span
minor native sockets refactor to use pinvoke
add read/write constrained/prealloc'd bit stream impl to lidgren and update usages
fixed missing stream cleanup
remove outstanding stream cleanup since it refs buffer thru the class, can't read some other buf
apply suggestions from code review
remove unsafe cruft
* add tests to gh actions
* make stats use interpolation in tostring and remove m_bytesAllocated since it's all in the shared pool now
* this pr still open so fuck it
stats, human readability, faster BitsToHold methods
* add api compatible version of ReadBytes
* rename ReadOnlyStreamWrapper -> ReadOnlyWrapperStream
rename WriteOnlyStreamWrapper -> WriteOnlyWrapperStream
add AppendViaStream, AppenderStream impl
add and update documentation on read/write bytes methods
also fix some goofs
update a bunch of packages and use JetBrains.Annotations as private asset as needed
mark some hot math methods agg inline to benefit from loop opts
use FMA for interp
use canny min/max/clamp
make Quaternion NormalizeAngle fixed time and faster
clean up YamlDotNet references
* implements shared string dictionary and handshake from net-code-2
* fix unit test
switch to szr sawmill
* try to silence some warnings around ZipEntry
* rebase and use system zip instead of icsharplib
fix rebase artifacts
* Update Robust.Shared/Interfaces/GameObjects/IComponentFactory.cs
* Update Robust.Shared/Serialization/RobustSerializer.MappedStringSerializer.cs
* Update Robust.Shared/Serialization/RobustSerializer.MappedStringSerializer.cs
* Apply suggestions from code review
* Apply suggestions from code review
* Update Robust.Shared/Serialization/RobustSerializer.cs
* since no longer gathering from paths, make string splitting more robust
* make string gathering ignore strings under 4 chars long
make string gathering yet more robust
* add limit to size of mapped strings
* add more string data to feed into shared string dictionary from YAML files
add JSON importer but don't parse RSI metadata yet
fix typo that breaks nulls in MappedStringSerializer
minor refactoring
make string splitting more robust
add WriteUnsignedInt / ReadUnsignedInt for validating WriteCompressedUnsignedInt / ReadCompressedUnsignedInt aren't bogus
* comment out some log statements
* minor refactor, reorder logging
add null check due to smart typing NRT checks
* Add doc comments, readability improvements to MappedStringSerializer
The protocol, handshake, and internal logic are now more documented.
The main area that could still be improved is the documentation of how
the cache system works, but the code is readable enough for now that it
isn't immediately necessary.
* add documentation, organization
* update some more doc comments
* add flows to doc comment for NetworkInitialize
* more documentation and organization
* more docs
* instead of retrieving INetManager by IoC, assign when NetworkInitialize is invoked
* "document" the regex
* Update Robust.Shared/Network/NetManager.cs
* add missing check for LockMappedStrings
* Update Robust.Shared/Serialization/RobustSerializer.MappedStringSerializer.cs
Co-authored-by: ComicIronic <comicironic@gmail.com>
* change to warning instead of throw for unlocked string mapping
Co-authored-by: ComicIronic <comicironic@gmail.com>
Tick clearing is now done in all entity constructors on the server, and components added during ExposeData like ContainerManager don't blow up on it anymore.
This fixes the issue where CurTime on the client would sometimes jump by
massive values. It was caused by an underflow when the current tick
would be before the most recently cached tick, due to time going in
reverse.
This reverts commit d81834c913.
I realized while writing the netcode document that `EntityEvent` is a different message group and am now quite ashamed of myself. This should stay as unreliable, probably.
If you sent multiple state updates on the same frame these could easily arrive in different orders on the client, which is definitely not intended. This fixes that by sending them per frame.
As a result, this also means earlier updates on the same frame are discarded, saving bandwidth.
1. Fixed handling of repeats so that they don't fire stuff incorrectly anymore.
2. Add Priority system to keybinds because apparently C# Sort isn't stable like I thought.
CanFocus is now evaluated separately by the input and UI manager so that it is possible to handle handling/UI blocking issues cleaner. This thus makes it possible to re-introduce keybind blocking which is quite useful.
NetSerializer does not handle these well and sends the entire backing array instead of a more compact representation. This can then cause it to start sending lists of length 1 with a *capacity* of 4096 resulting in 250 KiB/s down to send updates for a single entity. As it just did on the public server...
Made it so keybinds don't block other keybinds from firing.
Why is this necessary? This allows us to have "same keybind, different functionality" binds sanely, like shift click being both TextCursorSelect and (in content) ExamineEntity. Before this change the latter was temporarily broken in UI controls because of TextCursorSelect taking priority and instantly treating the event as handled because it's CanFocus.
The offshoot of this is that all the "args.CanFocus == mouse left" UI code had to be fixed, since multiple things were now firing for that and breaking everything. For example TextCursorSelect actually BROKE because now ExamineEntity was firing inside UI again and that was seen as a left click.
EngineKeyFunctions.UIClick has been introduced as "mouse left for the UI" for this purpose.
* Special check for decimal in serialization code. Changed method in IoCManager for a little QoL
* ISelfSerialize stuff
ISelfSerialize interface for stuff that want to implement their own (de)serialization.
Forgot that desialize could exist for decimals earlier.
Added ViewVariablesPropertyEditorISelfSerialzable thing for viewvariables.
* fix TestStylesheetOverride
* Fix improper UT logic
* Somewhat neater VV lineEdit event hanlding
* remove whitespace and unused using
* uninherit ViewVariablesPropertyEditorISelfSerialzable
* Fix improper use or ToString
* seal VV classes
* Adds a derived class from Nunit's Is test constraint class.
The game camera can now be rotated.
* Added the new `bind` command to the console, used to bind a key to a keybind.
Added two new keybinds for rotating the View camera left and right.
Added more info to the ""Component does not exist for state" exception.
Added Reduced() and FlipPositive() public functions to Angle.
* Fix a copy/paste bug.
* Adds missing code to bind/unbind CameraRotateLeft.
Camera snapping now actually uses the CameraSnapTolerance constant.
* Refactor Controls to default to MouseFilterMode.Ignore
* Clean up MouseFilterMode.Ignore from Controls
* Fix BoxContainer eating UI clicks
* Fix ScrollContainer using the wrong variable
* Refactor ContainerButtons to use a StyleClass for formatting instead of typeof
* Refactor BaseButton to work when child has MouseFilter.Pass
* Rework friction to work as a sum instead of indiviually
* Removed comments
* Changed how friction works from reducing movement to increased the effect of mass.
* Changed how collision checks work
* Undid asym collision
* Push to switch machines
* Added UnitTest to clarify the logic in CollidesOnMask
* moved test into testcase
* merged in shader automatic reloading, remove internal shader reloading
add support for includes to shader reloading, modified includes reload shaders that depends upon them
* add some fault tolerance to allow playing with the file a bit
* prevent multiple watch attempts
* fix spacing
* revert project change
* add cancellation to Reload with a default of 30s
fix case sensitivity comparison
assume windows & mac are case insensitive
Removed the component message queue inside of EntityManager. There should be no time where messages are coming in before the EntityManager is initialized.
Removed the ability to send EntityEvents, you need to send either component or system messages.
* remove setter for MapPosition
change DetachParent to set WorldPosition after re-parenting to correct Map entity or MapGrid entity
* workaround until default grid not needed due to items can't be picked up if map ent parent
* Use separate define constants for exception tolerance stuff.
* Improve handling of exceptions during entity creation.
The entity in question now gets marked as deleted immediately.
* Glorious.
* Testing components, tests, wrapper exception type.
* Work on shadow casting.
* Shadowcasting depth works, code cleanup
* Adds #include support to SWSL parser.
* Move lighting shader to swsl.
Also more shader parser fixes.
* Move PI constant to correct file.
* Got functional FOV, working on wall bleed.
* Hey, it kinda works.
* Occluder component now lives in shared.
* Optimizations.
* Fix light map color format.
I set it to something else while testing perf.
* Front face cull final FOV pass.
* Fix holes in occlusion geometry due to disabled occluders.
* Starting work on better wall handling.
* Some comments.
* Improve font-face-culled FOV pass.
* Improve various light biasing things.
* VSM, smooth shadows.
Also unused VSM blurring because it didn't work but committing it like this will forever keep it in Git somewhere.
* FOV smoothing, looks kinda awful.
* Base wall bleed blur strength on camera size.
* The part where I give up.
* Comments. Many comments.
* Allow eyes to disable FOV.
* Improve OccluderComponent on the client.
* Update for occluder component changes.
* Maybe do this properly...
* bubble implementation
include contained entities
fix line edit crash when clipboard contents are null somehow
use CVar for update bubble range
remove seenMovers that get NaN'd out of MaxUpdateRange - huge reduction in network traffic from bullets
cut default of MaxUpdateRange down to 12.5 for now
maybe handle teleported things
handle removing player state on disconnect
fixed positional audio errors
make UpdateEntityTree also update player's last seen ents
make net.maxupdaterange cvar tunable at runtime w/o impacting performance
back to position nan as means to hide from client
revert work pooling as the wrong player was getting the wrong game state
ffs needed to think less about *if* something is *seen* and more about *when* it must be *unseen*
clean up usings
handle parenting and sequencing issues that arise on the client
gather needed ents to update recursively
applied suggestions from code review
fix missing recursively contained ents
make assumption that client last saw things on first tick instead of tick zero, as zero would be the "from tick" and first would be he "to tick"
add First tick as constant to GameTick due to relevance above
renamed includedEnts to checkedEnts to make usage more clear
added comments
inverted some conditions to flatten parts of the pvs logic
fixed sending states when already seen (lastChange < lastSeen to lastChange <= lastSeen)
fix sending states when no actual changes (other bugs?)
local caching of currentTick, remove priorTick
* make TransformComponent's Parent setter call Dirty() to handle replicating network state if AttachParent isn't invoked
* fixed parent changed by setting Parent on Transform not updating parent's Children collection and other stuff
rotating parent entities now are visible with their orbiting children if one of their children moves into view
* break out duplicated code as GetLastSeen
* remove unused net.parallelstates
introduce net.pvs to configure enabling/disabling PVS
* Removed the EntitySystem event implementation, it now uses the more advanced EventBus.
Removed EntitySystem.RegisterMessageTypes() function.
Removed EntitySystem.SubscribeEvents() function.
Added EntitySystemMessage.NetChannel field. This holds the remote net channel the event originated from.
* Removed the Sender object from events. If you needed this field, add it to the event class.
* Removed unused event proxy methods from Entity.
SubscribeEvent() has been split into SubscribeNetworkEvent() and SubscribeLocalEvent() methods on EntitySystem.
Most methods on EntityEventBus now require callers to specify the source (Local or Network) of the events.
* Implement HistoryLineEdit
* Refactor DebugConsole to use HistoryLineEdit
* Clean up LineEdit
Add args.Handle() for each BoundKeyFunction
Clean up if statements
* Rearrange LineEdit variables
* Reimplement DebugConsole saving and loading
* Add style to TextureRect
* Implement ContainerButton
ContainerButton is a button that resizes to fit the Controls it contains.
* Refactor OptionButton to use ContainerButton
This allows OptionButton to have an inverted triangle icon on the right to make it more obvious that the button is an OptionButton.
* Fix Popup not updating size when opened
* Fix DrawMode not getting updated when _pressed is changed
* Refactor Button to inherit from ContainerButton
* Refactor CheckBox to inherit from ContainerButton
* Fix Control.StyleClasses.GetEnumerator
It was calling GetEnumerator in an infinite loop instead of getting _styleClasses.GetEnumerator like it was supposed to do.
* Update Button references
* Fix Styling
Removed use of ConcurrentDictionary. It was slow.
Other minor optimizations around the codebase.
Added option for parallel game state generation. Seems slower than doing it single-threaded so off by default for now.
* Fix server sending ALL game states reliably.
Now only large enough game states get sent reliably. This means that when a single client stops ACKing the server isn't spamming a bunch of massive game states into Lidgren to reliably deliver.
* Do not send prototype-duplicated data in game states.
This cuts out component states and ComponentChanged data if this can already be inferred by deserialization of the prototype on the client.
* More comments.
* Remove debugging code.
* Use GetNetComponents instead of GetAllComponents.
Nice little optimization.
* implement StatusHost as a minimal Kestler based HTTP Rest service
break up and organize StatusHost
* handle weird disposal mechanics exposed by testing facility
Adds a check to the `PlayAudioPositionalMessage` case of client `AudioSystem` to make sure the grid it's playing on actually exists. If it doesn't, an error is logged and the message is ignored instead of crashing the client.
* have PhysicsManager use DynamicTree
* remove BroadPhaseNative
add BroadPhase wrapping DynamicTree
replace IBroadPhase with regards to DynamicTree
* add collision enumeration capability for proper BroadPhase
* fix slow app exit due to MapId being unavailable at various stages of shutdown
reduce code footprint of alternate query in AnyEntitiesIntersecting by using existing query (only used rarely)
* separates Rays from CollisionRays, removing collision masking from Ray
* Entity, ClientEntityManager and EntityManager classes occasionally need to UpdateEntityTree
Entity intersection queries now use a DynamicTree
DynamicTree now correctly reports Count and separately NodeCount
DynamicTree now has optionally precise queries
DynamicTree no longer incorrectly Adds on AddOrUpdate if Update is not necessary
Entity startup now starts Transform, then Collidable, then remaining components
EntityManger's Entity dictionary is now a ConcurrentDictionary to support iteration under modification
DynamicTree freeing root leaf no longer results in invalid tree
SnapGridComponent has been extended to support additional area and directional queries
* added lots of calls to UpdateEntityTree, will need to scale back during review
fixed moved/changed AABB updates to DynamicTree, missed a ref
converted other methods in EntityManager to use the tree for spatial queries
* add unit tests for DynamicTree
make Capacity and EnsureCapacity public, setting Capacity will call EnsureCapacity
* fix brace style
* Box2 Grow -> Enlarged, Combine -> Union
Clients would treat any message coming in as being from the server they're connected to, instead of ignoring them if they're not correct.
This made the client crash inside integration tests because messages came in while disconnected.
This fixes that.
This is necessary because content now loads the preferences database from the thread pool. This causes the assembly loads for that (they're lazy by the runtime) to run in that thread, which means that the resolver callback we set up in ModLoader did not work (it has to do an IoC resolve).
This change creates a new AssemblyLoadContext for every ModLoader and as such we can tie the loading in said context to a specific ModLoader, thus cutting out the need for a static IoC resolve.
This also paves the way to assembly unloadability a bit.
This allows us to make Content.Client and Content.Server Exe projects so that they can be executed directly via your IDE. This'll help wtih not forgetting to do a full rebuild and such.
* Add delete key behavior to LineEdit
Pressing delete will now delete the character in front of your cursor like usual.
* Update Robust.Client/UserInterface/Controls/LineEdit.cs
Co-Authored-By: Pieter-Jan Briers <pieterjan.briers@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
Returns early if the window or framebuffer width or height = 0 to avoid dividing by zero. Checked the vector components individually instead of using `Vector2i.Equals()` because you can end up in a situation where width is non-zero and height is zero if you manually resize the window instead of using the minimize button.
Use PLINQ for prototype loading. Most of the time is spent reading YAML so this should help a lot.
Don't regenerate collision for every tile placed by the map loader.
Grid collision rectangles are now drawn as a blue overlay in the CollisionOverlay debug view.
GridChunkPartition now also returns the bounding rectangle, which is a union of all the collision rectangles.
Each IPhysShape now handles it's own debug drawing with a new method, DebugDraw.
Added MapManager.Restart().
Added MapManager.CreateNewMapEntity() and MapManager.SetMapEntity() for manipulating the map root entity.
You can now spawn entities directly into Nullspace, after setting up the Nullspace map entity.
This is not a proper fix. A proper fix would be a better physics engine.
But as it stands I really wanna get a progress report out and having to refactor physics to do it would just suck.
This fixes batching not working for sprite layers. They'd set & reset the active shader constantly which broke batching.
Active shader is now part of batch meta data and broken like other data like textures.
This halves the memory necessary for the lighting framebuffer, so probably helps with bandwidth usage (especially on integrated GPUs) too.
I couldn't notice a decline in visual quality on my (admittedly) bad laptop screen.
* Fold animation delays into a single set for all directions.
* Update systems to use new RSI animations API.
* Fetching layer directions now done in sprite render.
* Allow overriding direction in SpriteView.
* Adds Map components to the ECS system.
* Grid entities are now created along with map grids.
Grid components are now properly reused from map deserialization when a grid is created through the MapManager.
* Make MapGridComponent shared.
Don't send Nullspace default grid to client, they have their own.
Properly link the new grid with the entity sent from the server.
* Fixes nullRefException when ToString() is called on an Entity with no Prototype.
* Adds logging debug info about binding a map/grid to an entity.
Nightly Commit.
* Client map networking now properly pivots a grid from the client entity to the shared entity.
Added IMapGridComponent.ClearGridId() to properly dissociate the component from a grid before deleting it.
WorldPosition of a default grid is always 0,0 regardless of the entity transform (if any).
Nullspace map and default grid are not bound to an entity.
Nullspace map and default grid cannot be deleted.
* Map Entities are now created along with new maps.
* Client & Server load with new scene hierarchy.
* Fix rebase damage.
* Added ContainerHelpers helper class.
* Fix Container checks.
* Fixed clothes.
* Fixing unit tests.
* Removed disabled code.
* Actually initialize and startup the Map and Grid entities.
* Use GLFW instead of OpenTK windows
* Seems to work pretty well now.
* Fix stackalloc issue on Framework.
* Add GLFW project to sln.
* Fix package downgrade.
* Fix SLN more.
* Please work.
* Fix C# version error.
1. NetManager.IsConnected no longer uses LINQ.
2. creating net messages for sending/receiving now uses cached DynamicMethods to improve speed (bypasses Activator.CreateInstance and params allocations)
3. Entity.GetComponentStates uses GetNetComponents now.
4. PhysicsManager allocates significantly less now.
* UI layout v2.
All controls now act like containers.
Moved anchor/margin layout model to LayoutContainer
Implement basic WPF-like attached properties for the above LayoutContainer.
* Fix VV.
Give BoxContainer a preset capacity to reduce allocations in layout.
Removed Control.GetChild(string) and similar. This was no longer used (and was a pretty bad idea in general), and the implementation had a lot of wasted book keeping to do.
Use UpdateLayout() instead of DoUpdateLayout() in Control minsize changed to avoid doing redundant layout, and by extension style & minsize, updates.
Used RemoveAllChildren instead of DisposeAllChildren in EntitySpawnWindow because it's faster (way less stuff to clear, just let the GC handle it).
Optimized ResourcePath with a better GetHashCode(), better Equals, replacement for List<T>.ToArray()
Fixed enumerator allocations in stylesheet SelectorElement matching to speed up style updates.
ResourceCache now caches fallbacks to avoid constructing Resource instance when fetching fallback explicitly.
ResourceCache now has nested dictionaries for Type -> ResourcePath -> BaseResource storage of resources.
Use calculated property instead of auto property for TextureResource.Fallback
* Moved IMap from Shared/Interfaces/Map to Shared/Map namespace.
* Extracted Map class out of the MapManager class.
* Removed the Map class and interface.
* Fully removed the Map and IMap class.
* add basis for debug drawing raycasts
* rays
* this was too much work
* i assumed you could do string object stuff. you cant.
* fixed a crash
* Greatly improved DebugDrawingManager code with a struct and list as opposed to dictionary
* change default ray debug color from green to magenta
* reviewed changes
* reviewed changes and adds network message to physicsmanager so it works without much user config
* raw PCM audio for clyde
* Remove soundfont.cs
* Midi stuff
* Some more work
* This actually works now!
* update
* Add nfluidsynth submodule.
* fuck
* Midi audio works!
* Lots of stuff, and cool interfaces for items
* Update
* Note limit
* Moving out of range of UI raises OnClosed now as well
* It just works
* Update nfluidsynth submodule
* Remove managed-midi, remove unused methods I added to clyde
* Remove remnants of older NFluidsynth
* Update nfluidsynth submodule.
* Fix some of MidiManager
* Add changes PJB made to soundfont loading
* Delete OpenAL source/buffers when disposed
* Remove remnants of "Rendering"
* Use ReadOnlySpan, make interface/implementation arguments consistent
* Improve EmptyBuffers performance
* Make renderers use an enum for their status
* MidiRenderer events are now invoked on the main thread
* MidiManager now has a method to dispose renderers
* Lock player
* Fun stuff
* Update nfluidsynth submodule.
* Fix midi audio rendering
* Address a few reviews
* Revert changes made to Clyde
* Create sfloader per midi renderer
* Midi file size check
* Now OpenMidi/OpenInput and their respective close methods return bools.
* Update nfluidsynth submodule.
* Move number to constant.
* Use BufferedAudioSource
* Remove unused using statements
* Use new API
* Lock player and synth correctly
* Use midi sawmill
* Adds "Disposed" property to MidiRenderer
* Remove DisposeRenderer, let midi render thread handle it instead
* Renderer position is updated from main loop
* Use nfluidsynth from nuget
* Fix appveyor, lazy fluidsynth init
* Only join MidiThread if it actually exists...
Added IClientConGroupController and implemented it as ClientConGroupController. Lets client-side code check what commands the client can use based on their console group. Serves the same purpose as the server-side IConGroupController except it doesn't load a list of permissions from groups.yml. Instead, the server ConGroupController sends updated permissions to clients whenever they change.
By making these public they can now be used by content to check if players are in the right group (admin, mod, etc) before doing certain things. Required for PR 380 on content (https://github.com/space-wizards/space-station-14/pull/380)
* WiP property animations system
* Use better lerp for Angle property animations.
* Fix handling of offset in sprite component.
* Allow animating some sprite layer properties.
* Allow animating some Transform properties.
Obviously not advisable for server entities, but great for client side entities!
* Improve animation property interpolation handling.
Added a "previous" mode.
Made values that cannot be sanely interpolated fall back to this mode.
* Improve some animation docs.
Reverts b40413dfd6.
Decorates EntityPrototype.Name with CanBeNull.
The entity spawn window now properly handles prototypes with null names. Previously, a null name would throw a NullException. Entities with null names will never show up in the spawn window search results.
* Use DynamicMethod for dependency injection.
Should be way faster to initialize types and also have no allocation overhead
* Cleanup, don't make injectors for types without dependencies
* Fix Framework, maybe?
* Test the new system explicitly.
* Adds a new IPhysicsShape object where you can define what collisions shape a PhysBody has.
AABB is now accessed through the PhysicsShape, so the BoundingBoxComponent is not required.
* Default PhysShape now copies the AABB of the BoundingBoxComponent.
* Fixed issue with serialization of PhysShapeAabbComp.
* Spatial queries now use ICollidableComponent instead of BoundingBoxComponent.
showbb now draws entities using the obsolete BoundingBoxComponent in Aqua.
* Renamed PhysShapeAabbComp to PhysShapeAabb.
Removed BoundingBoxComponent.
* Default CollidableComponent does not collide with anything now.
* Renamed ICollidable to IPhysBody.
Moved ICollidable to the Robust.Shared/Physics namespace.
* PhysShapes are now a collection of primitive shapes that contribute to the whole PhysBody.
ObjectSerializer.DataField can now deal with abstract types using YAML tags.
* Added LocalBounds property to ClickableComponent.
Added state to ClickableComponent.
* Added a Rectangle physics shape.
* ClickableComponent now actually checks that a click is inside its bounds.
* Reverted the addition of a try/catch around map loading. Any errors can propagate to the code trying to load the map again.
Prototypes will now use existing components, like transform, when loading an entity. Previously they blindly created new ones on the entity.
AddComponent now cannot overwrite a protected component, ie TransformComponent and MetaDataComponent. Entity caches these components, they cannot be changed.
Regular RemoveComponent functions are now not able to remove protected components.
* Add a check in OnContextChanged to fix some crashes
Fixes crashes due to double input like the Quit button in the Esc menu
* Changed BaseButton to only trigger on KeyBindDown and KeyBindUp on the same control
* Fixes right click menu stopping input
Removed a flag change when the modal stack was showing, which preventing the click from getting passed to the next function.
* Added parsing for mod2 and mod3 from Keybind YAML
* Fixes a crash on context change when a keybind is not defined in keybinds.yml
* Implemented ShowDebugConsole Hotkey
* Refactored input system
Refactored input system to run Key and Mouse input through the InputManager before doing stuff.
* Upgraded LineEdit and classes that use it. Fixed input while KeyboardFocused.
Upgraded LineEdit to use Keybinds.
Upgraded DebugConsole to use Keybinds.
Replaced all references to MouseDown, MouseUp, KeyDown, and KeyUp with KeyBindUp and KeyBindDown.
Moved UserInterfaceManager call from GameController.Input to InputManager event.
Stopped input going to simulation while a control has focus in UserInterfaceManager.
* Some fixes for input system
Fixed keybinds getting stuck when selecting a LineEdit.
Changed MenuBar to not error.
Fixed a few cases where LineEdit would eat input if you hovered over it and where mouse input got eaten when clicking in the world while a LineEdit was selected.
* Removed extra dependencies
* Added GUIBoundKeyEventArgs to ButtonEventArgs
* Fixes for input with LineEdit selected
Fixed multiple keybinds mapped to the same key not triggering.
Fixed keybind input not getting to LineEdit when hovering over a control.
* Implemented Key Repeat for LineEdit
* Fix for input on Robust.Lite Launcher
* Renames NonFocusKeybinds to EnableAllKeybinds
Renamed NonFocusKeybinds to EnableAllKeybinds and added comment to clarify usage
* Adds repeating keybinds
Used for TextBackspace, TextCursorLeft, and TextCursorRight
Reverts a change to LineEdit that implemented repeating keys
Adds some documentation comments
* Quick fix to flashlight radius
* SomethingAbout CSS Class
* Shitty update
* fuck
* Creativ!
* Last But not least
* Quick Change
* Fixed version
* Tiny fix
* Next Fix
* Another fix
* Refactor UI system.
Deferred updating is used for styling & layout. This fixes the awful time complexity of containers.
Removed SetDefaults and Initialize. They were a bad idea alright.
* Fix build on .NET Framework.
* Attempted Clyde cleanup, didn't get far.
* Add negation operator to Vector2i.
* Add RenderOrder to ISpriteComponent.
* Post process shaders.
Adds "post process" shaders to sprite component.
These are executed on the WHOLE sprite component (every layer)
in one draw.
This is necessary to implement functional outlines.
They no longer load system-wide config or user data.
User data is emulated through a VFS.
Also added more hooks to improve the customizability of the test,
for example allowing content to hijack their IoC registrations.
This is necessary to avoid tons of papercuts with entity systems.
Without this it is not possible to create entities inside the update loop of an entity system, which is too common for me to disallow.
As for performance, I offset it by removing the LINQ usage.
It's marginally faster than before even.
This clears the collection of style classes and adds the new one. This allows controls to easily switch between several style classes without needing to keep track of the active one in their own code.
* Project file refactor
Move all the .csproj files to the new .NET Core style.
This doesn't make any difference for compiling for Framework,
but it does reduce a ton of useless boilerplate.
As an extension of this, killed a bunch of uncompiled & unmaintained .cs files.
Compiling for release (to profile) works now.
Removed AnyCPU targets from the solution file.
* Fix compiler warnings.
* Add StyleBox overrides to ProgressBar
The overrides are StyleBoxFlat instead of StyleBox as StyleBox does not expose or possess a color property. _getBackground and _getForeground were also changed to return StyleBoxFlat instead of StyleBox to keep things simple.
* Change ProgressBar _getBackground and _getForeground back to StyleBox
* Change ProgressBar style box overrides from StyleBoxFlat to StyleBox
* Retrofitted ComponentManager_Test to use DependencyCollection.
* Renamed ComponentManager_Test to ComponentManager_Tests to follow naming conventions.
* Added component add/remove/delete events to IComponentManager.
Removed IEntity dependency from ComponentManager.
* Entities can now be spawned without a prototype.
* Removed unused function.
* CreateEntity now actually works with a null prototype ID. The other spawn functions should work as well.
Updated doc comments for IEntityManager.SpawnEntity().
* Remove unused options menu tscn
* Move SS14Window to pure C#
* Move SpriteView to pure C#
* Move EntitySpawnWindow and EntitySpawnItem to pure C#
* Removes using statements accidentally added by resharper
* Set EntitySpawnWindow default size to normal value
Note that in construction menu and storage menu this had to be done in the object initializer and didn't work if it was set in the Initialize function for the respective menus. For whatever reason setting it in the EntitySpawnWindow.Initialize works fine.
Not quite perfect, but quite usable.
Adds the ability to scale the UI. Scaling is controlled via a cvar,
and can be changed at runtime.
Fractional scaling is supported.
Some controls could be better (SpriteView, TextureRect),
but for now it's a good start.
* Tile Placement box actually uses the mouse snapgrid, not the players.
* Placement box only snaps to grids if cursor is over grid.
First tile of new grid is centered on cursor, instead of bottom left on cursor.
* Place square now sticks to the edge of a grid.
Cannot place tiles that would touch two grid Bounds.
Make containers actually handle automatic removal of entities,
like say on unpartenting.
This was because a lot of content code was doing this manually,
and it broke, really badly.
They also emit events now that said content code can use instead.
* Server works if not connected to a tty.
* Rich presence does not run IoC resolution at runtime anymore.
* Work towards integration tests.
Mostly work related to making it so the server and client can run in
parallel, and allowing more control over main loop for testing.
* Lots of code relating to integration tests.
* Split GameState processing logic out of ClientGameStateManager into the new GameStateProcessor class.
* Adds a test fixture for GameStateProcessor with a basic use test.
* More unit tests and added Extrapolated property to GameStateProcessor.
* MapInit v1, so people can criticize my code.
* Map init v1.
* Improve LocalPlayer to fix aghosting.
* Fix map saving.
* Map command improvements:
Implement loadbp
Made certain commands aware of uninitialized maps.
* Adds IMapManager.GetAllGrids()
* Add lsgrid and lsmap commands.
* MetaData component serialization fixes.
Serialize name and description default as null.
Don't serialize prototype.
* Explicit UID indices in map files.
* Update map format doc again.
* Added centered unit box static field to Box2.
* MapGrid is more testable.
* Added some unit tests for MapGrid.
Fixed bug in MapChunk.GridTileToLocal().
MapGrid.UpdateAABB() actually expands properly now.
* Moved IMapChunk to Robust.Shared.Map.
Moved Chunk class out of MapManager class.
* Added unit tests for MapChunk.
* Bounds reduce by 1, so almost working.
* Now bound shrinking works :D
* Moved MapGrid out of MapManager.
Moved IMapGrid into the Shared/Map folder.
Replaced all calls to IMapGrid.ParentMap.Index with IMapGrid.ParentMapId.
* Added more MapGrid unit tests.
Fixed a bug in TryGetTileRef.
* Added a new special MetaDataComponent to store entity data that isn't specific to a component.
* Adds ExposeData to MetaDataComponent.
Name of the entity now defaults to the prototype name.
* EntityStates changed so that the list of networked components is not sent every tick for a modified entity.
* Code cleanup & doc comments.
* MetaDataComponent Name and Description are taken from the prototype before storing them in the component.
* Adds the EntityState serializer benchmark. This isn't a test, but is really useful.
* Redesigned the logic in ServerGameStateManager.
* Adds MetaDataComponent registration to the UnitTesting project.
* You can scroll ItemLists now.
* ScrollBar actually appears!
* Remove System.Drawing
* Move total content height away from the drawing loop, recalculate it...
...when needed.
* Take ActualBackground minimum vertical size into account
* Fix cases where lists didn't scroll to the very bottom.
* Fix CalculateMinimumSize for real I hope
* Removed unused method TileRef.GetStep().
Removed unused property TileRef.TileSize.
Removed unused property TileRef.Tile, made the field public with the same name.
Made the TileRef struct readonly.
Removed property TileRef.TileDef.
Removed property TileRef.LocalPos.
Renamed GridTile to GridIndices.
Implemented IEquatable on TileRef.
Implemented Equality operators on TileRef.
Added PublicAPI attribute to TileRef.
Added doc comments to TileRef.
* Modified Tile:
Added the PublicApi annotation.
Made struct readonly.
Filled out doc comments.
Changed auto properties to readonly fields.
Renamed TileId to TypeId.
Added a static Empty tile to the struct.
Implemented IEquatable.
* Modified MapCoordinates:
Added PublicApi attribute.
Implemented IEquatable.
Filled out doc comments.
Removed Map property.
* Modified ScreenCoordinates:
Filled out doc comments.
Added the PublicApi attribute.
Implemented IEquatable.
* Modified GridCoordinates:
Removed method IsValidLocation.
* Removed property GridCoordinates.Grid.
* Removed GridCoordinates.Map.
* Removed GridCoordinates.MapId.
* Removed property GridCoordinates.IsWorld.
Removed constructors taking a MapId.
* Removed static IoCManager calls from GridCoordinates.
* Modified GridCoordinates:
Added attribute PublicApi.
Filled out doc comments.
* Filled out doc comments for MapGrid.
Filled out doc comments for MapIndices.
Misc refactors for both.
* added command to teleport grids.
* Added method Box2.Intersect.
Added method Box2.Union.
Placement manager now spawns new grids to place tiles not connected to an existing grid.
Code was changed so that time starts at tick zero, and all entities are initialized in the space between tick 0 to 1. This was a solution to the fact fromSequence was including entities with lastStateUpdate tick one less than the actual sequence number. This is purely an issue about when exactly the game does its logic relative to the tick signals, ie positive or negative edge of the tick. Right now the game is set up to run the game logic on the positive edge of a Tick (enforced by GameLoop).
The second big part is that an empty collection takes 5ish bytes more than a null collection in the NetSerializer, even though they are conceptually the same thing in a game state. This PR puts null checks around everything and allows GameStates to have whole sections of itself null. This reduced the payload size of an empty game state from 49B to 15B.
This PR also fixes the bug where the physics system marks every movable entity as dirty every tick.
RobustToolbox projects should be named Robust.*
This PR changes the RobustToolbox projects from SS14.* to Robust.*
Updates SS14.* prefixes/namespaces to Robust.*
Updates SpaceStation14.sln to RobustToolbox.sln
Updates MSBUILD/SS14.* to MSBUILD/Robust.*
Updates CSProject and MSBuild references for the above
Updates git_helper.py
Removes Runserver and Runclient as they are unusable
I guess I accidentally removed some comment strings and didn't realize until I pushed. Related to issue #180 on the content repo. I'll put in a separate PR on that repo to fix the prototype for walls too.
* add a new GameTick struct.
* Everything now uses the new GameTick struct.
* TickRate was changed to a byte, no way it is going over 255.
Fixed bug with changing TickRate after the loop has started.
Client now properly sets the TickRate when connecting to a server.
* Removed the old CurTime fields from game states.
Getting to the Connected runlevel on the client does not require a gamestate.
GameState processing now only starts after the client runlevel >= Connected.
Added some preprocessor conditions to not catch exceptions in Debug builds.
Nightly work on the GameStateManager, it is still pretty broken.
* NetMessages now have a Size property.
Player states were fixed, you can now join the game again!
* Frame interpolation kinda works.
* Frame Interpolation pretty much works!
* simulation can now catch up if a lag spike causes it to fall behind.
* Added concommand to debug draw the interpolation targets.
* Fixed a bug with applying just the NextState to an entity.
* Skip/replay a tick to slow down if the client is running ahead of the server.
* Solved a null ref exception when an extrapolated packet is applied.
* The TickRate is now officially 10.
* ClientGameStateManager stops running when the client leaves the server.
* Replaced poorly implemented FastForward with new TickTimingAdjustment.
* Update System.Runtime.CompilerServices.Unsafe to get rid of version conflict.
* Added 'net.interp' cvar.
* Disabled frame interpolation by default. The entire feature will be disabled until clientside input prediction is working.
* Removed or disabled log spam.
Fixed Transform unit test.
* Fix compile.
* Removed Static IoC calls from MapLoader.
Misc Code cleanup in MapLoader.
* Removed static IoC calls from ViewVariablesPropertyControl.
* StateManager now uses the DynamicTypeFactory to create States.
Removed static IoC calls from States.
* EntitySystemManager now uses the DynamicTypeFactory to create States.
Removed static IoC calls from EntitySystems.
Minor code cleanup.
* Removed static IoC calls from DebugDrawing.
* ComponentFactory now instantiates Components with IDynamicTypeFactory.
Removed static IoC calls from all engine components.
Misc code cleanup.
* Removed static IoC calls from all DebugMonitors.
Misc code cleanup.
* Removed static IoC calls from spawn windows.
* Removed static IoC calls from UserInterface/CustomControls.
* Fixed unit tests.
* Removed static IoC calls from AppearanceComponent.
Added a bool to ICollidable to indicate friction with the floor, for thrown items down the line.
Added a bool to PhysicsComponent to indicate if movement is possible.
Added list of PhysicsComponent that are slowing "this" down.
PhysicsComponent handles BumpEntMsg by adding the bumping entity to that list.
Implemented ICollideSpecial to prevent collision with items in that list.
Reworked movement code:
- Separated calculating movement from doing movement;
- Calculating movement now involves several recalculations to see who is on "that" list;
- Friction of a tile now slows movement down depending on an object's mass;
Optimized collision code by building a Dictionary with a snapped grid location for key, reducing the amount of bodies that need to be checked significantly.
* Changed EntityQueries for 3x perf increase for the EntitySystemManager.Update() method.
Removed the useless giant list EntityQuery.
Allowed the DependencyCollection to be able to inject itself as a dependency. Hopefully it won't be abused too bad.
Added the new IDynamicTypeFactory to IoC for instantiating arbitrary types. This removes the need for Activator.CreateInstance() and IoCManager.InjectDependencies() anywhere in code.
Utilized IDynamicTypeFactory in IComponentManager as an example of its use.
* Added IDynamicTypeFactory to SS14UnitTest.
* Rework entity initialization.
Map loading now correctly processes entity load stages:
1. First all entities are allocated. This allocates the entity and gives
it a UID, nothing more. No user code is executed.
2. Then all entities are loaded. This runs ExposeData on components.
3. Then all entities are initialized. This runs Initialize.
4. Then all entities are started. This runs Startup.
Entity spawning methods on IEntityManager now actually set position
before Initialize.
Also cleaned up a lot of spaghetti.
* Add some comments.
* Refactor tile IDs.
Tile IDs are now automatically assigned at runtime.
A mapping is also stored in map files to avoid compatibility issues.
Also removed tile prototypes. Content is now responsible for it.
This is so content can define its own data for tiles.
* Update map format specification.
* Fix tile placement.
* Reworked the net manager connection sequence.
* Correctly handle IPv4/IPv6 prioritization and fallback.
* Making a proper handshake for an auth system further down the line should be much easier now too.
* Added feedback to connection sequence in the main menu.
This PR establishes the format "Runtime-yyyy-MM-dd-THH-mm-dd.txt" for runtime logs from the server, preventing locale from messing with string escape characters and causing directory runtimes at next line. ~I've replaced the dash with an underscore as they can cause problems in some shells such as windows CLI.~ Dashes are staying because whoever has a shell that complains needs to get a new one.
~~**_I have most importantly made sure that SS14 can live on until the year of our Lord God Emperor and veritable saviour 99,999 Anno Domini of the Gregorian Calendar by extending the runtime-log-naming year range to 5 digits._**~~
~~_Let the meme PRs begin if they haven't already_~~
4 digits so logs will display until 9999, godspeed future maintainers.
I was unable to reach 60 FPS steady on my Intel UHD 630,
so I'd say this is probably warranted.
It doesn't reduce visual quality in any way I can tell.
Load up OpenTK.dll.config again. PackageReference doesn't copy it due to
incorrect packaging.
I had to make packages be downloaded locally to the solution again via
nuget.config to do this, because otherwise I couldn't get a reference to the OpenTK.dll.config in the NuGet package.
Adds a Python script to auto download freetype6.dll and openal32.dll on
Windows.
Clyde does custom shaders. Woo!
Still some things need implementing like custom uniforms and vertex shaders,
but this commit is big enough as is.
Also gets rid of texture array based batching because it was a pain.
It now assumes that a state has the same total animation length for each
direction, this solves problems like rotating resetting animations.
Also paves the way for manual animation control.
I'm channeling the power of spaghetti through individual spaghett-
Wait what do you call an individual thing of spaghetti.
A noodle?
A strand?
Should I use this word every time I write bad code?
// Noodle incoming.
So many questions.
Adds a call to viewport on opengl init in order to properly initialize the viewport size when the OS imposes a window size on window creation. Fixes Windows OS tablet mode-imposed window sizes.
That System diff is a bug.
It's never going to be re-implemented on Clyde,
so I'm making it internal so content doesn't try to touch it.
Also fixed ScrollFollowing not being set.
So uh... Godot. Mind explaining why call()ing a nonexistant function
is completely silent?
Godot's RichTextLabel is extremely complicated to re-implement.
OutputPanel is a stripped down version that's significantly simpler.
It does what it needs to for the purposes we use RichTextLabel.
This is a really crappy OpenGL 4.5 rendering backend. Doesn't draw a lot of things but it's a hell of a lot better than Godot in the stability department. Mostly.
It's far from production ready but I already wrote all this. There's some minor API improvements in here too.
Maps are now synchronized as part of game states.
This instantly fixed all race conditions and the client can now live through a round restart with 0 problems (outside of Godot crashing yay).
I took the functionality of `IoCManager` and moved it into a non-static class. This new class is called `DependencyCollection`. The static `IoCManager` is now just a proxy to a `DependencyCollection` singleton. I also added the ability to directly register instances into the collection. The Smocks library was added to `SS14.UnitTesting`.
This is super useful for unit testing, because now you can register mock instances directly into the collection and then other services can resolve them. You can also apply a shim to static `IoCManager` calls and handle them properly. Because the collection is instanced, we can now run tests in parallel (with a shim) that modify `IoCManager`. The Smocks library gives us the ability to shim static method calls.
The entity manager is supposed to delay entity messages of which the entity doesn't exist (presumably because it *might* due to networking).
Problem is that somebody put a .Clear() at the end right after re-filling the queue.
Wasn't me.
You can now "pause" a map. Ideally this would result in the map not doing significant processing until unpaused.
This can be used later to code proper map editor modes that won't have any side effects while being edited.
1. IPv6 support. Woo!
2. NetManager can now explicitly bind to adresses and work with multiple peers. ~~I thought I needed this for IPv6 because I forgot about IPv4-mapped adresses, but the code's written so let's keep it.~~ OpenBSD doesn't support IPv4-mapped IPv6 addresses so effort not wasted.
* Transforms now unparent themselves before being removed.
Fixed crash with removing deleted entities from containers.
* Removed ClickedOnEntityMessage, use the Input System.
* Removed unused types from Physics system.
* Made CollisionEnabled actually work.
Added Collision group system.
CollidableComponent now registers the collidable in Startup instead of OnAdd.
Fixed BoundingBoxComponent namespace.
* Fixes a bug with adding components remotely.
Adds setters to the new ICollidable properties.
* Fixed unit tests.
* Converted everything (I think) to ICollidable.
* Renamed CollisionManager to PhysicsManager.
Removed the bucket system out of the PhysicsManager.
RayCastResults.Distance was changed from PositiveInfinity to 0f when no entity is hit.
* Soft collidables (bullets) work again.
Previously the GameController was in control of starting the EntityManager, and GameScreen responsible for shutting it and MapManager down.
There was no way to restart the Entity Manager.
This commit makes the start/stopping be handled in the connection procedure of BaseClient.
@Acruid please review.
1. Updates all the NuGet packages (except CommandLineParser because they ruined their API)
2. Makes all projects use C# 7.2 explicitly. (not latest)
3. Use some C# 7.2 features like readonly structs and default literals.
* VV Refactor.
Yes I just wrote it and it's already inadequate and filled with legacy code.
Instances and sessions were a terrible idea, they're getting replaced with "traits".
It's not even more modular.
Practical difference: it now supports private members, fields and displaying things implementing IEnumerable.
* Clean up code, fix some bugs. Document everything.
* Fix broken unit tests.
Adds member field to BaseClient to hold onto override name string. Figured that was the closest place to the usage, so why not stick it there.
On connecting to the server, the client will prefer to use that name, if it's set, over the name from the configuration.
Adds client console command to set that field.
Fixes#660
Added unit tests for all MathHelper methods. Very open to test data values, I tried to specifically seek out edge cases, but I'm sure there're some things I've missed. Added tests for ensuring parameter preconditions throw exceptions.
Made some minor chanes to MathHelper.NextPowerOfTwo:
- Made the long, int and float overloads defer to the double overload since the original implementation was using the same thing as the double implementation anyway.
- Modified the precondition checking for negative numbers to check for non-positive numbers since the implementation for 0 shouldn't work since log(0) is undefined.
- Added precondition checks for float and double implementations to check for NaN and +/-Infinity
- Added special case handling for float and double implementations when the input is greater than zero but less than one where the previous implementation would return negative powers of 2 (ie, non-integer results), which I assumed are not intended. Depending on what people think, that same case could be extended to all inputs less than 1, or contrarily all inputs less than 1 could be considered out of range.
I've noticed that Acruid has PR #666 open to move MathHelper, among others, to a different place, so once that's in, I can merge it into this.
Lemme know if I've missed some procedure in the PR process.
Moved SS14.Shared.Math namespace into its own assembly. This allows projects to reference the math library without needing to include the entire Shared assembly.
* Engine culling.
Sandbox is gone.
Anything resembling "content" such as prototypes and textures is gone.
The engine can no longer load up directly
(short of the client's main menu, of course).
* Make tile prototype definitions workable.
Still not great though.
You can now manually specify their insertion order,
so technically tile ID.
* Move more Player things into content.
Spawning of players is now 100% up to content.
IPlayerData is now purely for content.
* Stupid sandbox.
* Sandbox pls go.
* Aaaaaah.
PlayerIndex is dead, it's been replaced by NetSessionId.
NetSessionId is basically just the client username.
Conflicts between usernames are auto resolved by the server,
due to lack of auth server & need for local testing.
dupeip config option is gone, it doesn't understand NAT.
* Migrated click handling from old `ClickParser` to new `InputSystem`. Resolves#631.
* Input Context system added. Resolves#630.
* `PlacementManager` now uses its own input context.
* Added addon `Entrypoint.PostInit` function.
* Moved EntitySystemManager initialization from after the first state update, to right after the EntitySystem init.
* Made the EntitySystems only run Update/FrameUpdate/events after the map has been initialized.
* MapIndices implements IEquatable.
* Add sane Modulo method to MathHelper.
* SnapGrid improvements.
Has an OnMoved-like event now.
GetInDir helper, basically like BYOND get_step.
* Make MapChunk use new standard mod method.
* entfo command improvements.
Can print diagnostic info from components now.
Doesn't list components multiple times.
* Transform implements IComponentDebug
* Move code to Godot 3.0.6.
It changed collections to use its own collection types.
* Helper to turn Directions.
* I forgot to commit csproj for IComponentDebug.
* Improve SpriteComponent.
Add direction offsets for layers.
Handling of directions is better now.
* Added a shared interface for player sessions.
* Mouse Keys are now additionally handled like Keyboard keys.
Added Keybind for inspect.
* Added KeyFunctionId type.
* Keys now get passed through Gamescreen and into InputSystem.
* Remove useless KeyBindDown and KeyBindUp.
* Tried to get serverside input handling working (Spoiler: It does not).
* Stopped trying to make it over complicated, serverside input handling works!
* More cleanup, made InputSystem more symmetrical between client/server.
* Made it *actually* work with the examine system.
A new component, SnapGrid, now tracks the entity position on the actual tile grid.
This can be used to provide (relatively) quick indexing for say smoothwalling, atmos room calculations, etc...
Added a new DebugTools.Assert function to replace the System Assert. The System assert does not work well on mono, and was not gracefully handled by Visual Studio. This version now throws a unique exception when it fails, instead of the popup window. You can setup Visual Studio to break whenever the exception is thrown. The call sites to the new Assert are still removed in release builds, similar to the System version.
This resolves#569 without needing to add a trace listener.
* Remove `LoadParameters`
* Significantly refactor `EntitySerializer` to be better, no longer specific to entities.
* `IExposeData` so sub objects can be deserialized.
* Map format is now standardized & good.
* Entity and grid references inside map files now cross referenced and resolved correctly. Fixes#524
* Prototype data caching to speed up prototype instantiation.
* Switch from storing the components on each entity to a central database inside of ComponentManager.
* Better deferred component remove.
* Turn the IEntity component functions into proxies of the ComponentManager functions.
* Remove Update() base function from Components. If components need to update, an EntitySystem needs to do it.
Resolves#618.
### Purpose
* Merge ServerConsole and ClientConsoleHost shells into one system named ConsoleShell.
* Migrate all server side commands to the new ConsoleShell system.
* Add a PermissionGroup system, for 'ranks' like user/mod/admin/owner.
* Track per-client permission group, allow clients to elevate permission with global 'sudo' password.
* Changed `IWritableDirProvider.Open()` to return a `Stream` instead of a `FileStream` to help test-ability.
Resolves#612.
### Open Questions and Pre-Merge TODOs
- [x] This fix is tested on the same branch it is PR'ed to.
- [x] I correctly commented my code.
- [x] This PR does not include any unnecessary .meta, .prefab or .unity (scene) changes.
- [x] This PR does not bring up any new compile errors.
- [x] This PR has been tested in editor.
- [x] This PR has been tested in multiplayer.
* Added the new writable VFS API. Resolves#566.
* Moved resource interfaces into the new Interfaces.Resource namespace.
* Adds the property `ResourcePath.Directory`.
Removes the obsolete property `IResourceManager.ConfigDirectory`.
* Marked string version of content functions as obsolete.
* Removed unused `System.IO` using statements.
* Removed the System.IO namespace from a bunch of files.
Made the string version of IResourceCache obsolete, and converted everything to use the ResourcePath versions.
This should Resolve#567.
* Fixing some bugs.
* Un-Obsolete the string functions in IResourceCache and IResourceManager.
2018-07-02 20:33:14 +02:00
2504 changed files with 206628 additions and 74278 deletions
<preclass="cl"> <spanclass="cb1">// Create a response and write some example data to it</span></pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<styletype="text/css">
body
{
font-family:Verdana,Geneva,Arial,sans-serif;
font-size:small;
margin-left:20px;
background-color:#dddddd;
}
td
{
font-family:Verdana,Geneva,Arial,sans-serif;
font-size:small;
}
.cf
{
font-family:CourierNew;
font-size:10pt;
color:black;
background:white;
padding:16px;
border:1pxsolidblack;
}
.cl
{
margin:0px;
}
.cb1
{
color:green;
}
.cb2
{
color:#2b91af;
}
.cb3
{
color:blue;
}
.cb4
{
color:#a31515;
}
</style>
<title>Lidgren tutorial</title>
</head>
<body>
<table>
<tr>
<tdwidth="700">
<h1>Simulating bad network conditions</h1>
<p>
On the internet, your packets are likely to run in to all kinds of trouble. They will be delayed and lost and they might even arrive multiple times at the destination. Lidgren has a few option to simulate how your application or game will react when this happens.<br/>
They are all configured using the NetPeerConfiguration class - these properties exists:</p>
<p>
<divclass="cf">
<table>
<tr>
<tdvalign="top">
<b>SimulatedLoss</b>
</td>
<td>
</td>
<tdvalign="top">
This is a float which simulates lost packets. A value of 0 will disable this feature, a value of 0.5f will make half of your sent packets disappear, chosen randomly. Note that packets may contain several messages - this is the amount of packets lost.
</td>
</tr>
<tr>
<tdcolspan="3">
</td>
</tr>
<tr>
<tdvalign="top">
<b>SimulatedDuplicatesChance</b>
</td>
<td>
</td>
<tdvalign="top">
This is a float which determines the chance that a packet will be duplicated at the destination. 0 means no packets will be duplicated, 0.5f means that on average, every other packet will be duplicated.
</td>
</tr>
<tr>
<tdcolspan="3">
</td>
</tr>
<tr>
<tdvalign="top">
<b>SimulatedMinimumLatency</b><br/>
<b>SimulatedRandomLatency</b>
</td>
<td>
</td>
<tdvalign="top">
These two properties control simulating delay of packets in seconds (not milliseconds, use 0.05 for 50 ms of lag). They work on top of the actual network delay and the total delay will be:<br/>
Actual one way latency + SimulatedMinimumLatency + [Randomly per packet 0 to SimulatedRandomLatency seconds]
</td>
</tr>
</table>
</div>
<p>It's recommended to assume symmetric condtions and configure server and client with the same simulation settings.</p>
<p>Simulating bad network conditions only works in DEBUG builds.</p>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<styletype="text/css">
body
{
font-family:Verdana,Geneva,Arial,sans-serif;
font-size:small;
margin-left:20px;
background-color:#dddddd;
}
td
{
font-family:Verdana,Geneva,Arial,sans-serif;
font-size:small;
}
.cf
{
font-family:CourierNew;
font-size:10pt;
color:black;
background:white;
padding:16px;
border:1pxsolidblack;
}
.cl
{
margin:0px;
}
.cb1
{
color:green;
}
.cb2
{
color:#2b91af;
}
.cb3
{
color:blue;
}
.cb4
{
color:#a31515;
}
</style>
<title>Lidgren basics tutorial</title>
</head>
<body>
<table>
<tr>
<tdwidth="700">
<h1>
Lidgren basics</h1>
<p>
Lidgren network library is all about messages. There are two types of messages:</p>
<li>Library messages telling you things like a peer has connected or diagnostics messages (warnings, errors) when unexpected things happen.</li>
<li>Data messages which is data sent from a remote (connected or unconnected) peer.</li>
<p>
The base class for establishing connections, receiving and sending message are the NetPeer class. Using it you can make a peer-to-peer network, but if you are creating a server/client topology there are special classes called NetServer and NetClient. They inherit NetPeer but sets some defaults and includes some helper methods/properties.</p>
<preclass="cl"><spanclass="cb2">NetServer</span> server = <spanclass="cb3">new</span><spanclass="cb2">NetServer</span>(config);</pre>
<preclass="cl">server.Start();</pre>
</div>
<p>
The code above first creates a configuration. It has lots of properties you can change, but the default values should be pretty good for most applications. The string you provide in the constructor (MyExampleName) is an identifier to distinquish it from other applications using the lidgren library. Just make sure you use the same string in both server and client - or you will be unable to communicate between them.</p>
<p>
Secondly we've set the local port the server should listen to. This is the port number we tell the client(s) what port number to connect to. The local port can be set for a client too, but it's not needed and not recommended.</p>
<p>
Thirdly we create our server object and fourth we Start() it. Starting the server will create a new network thread and bind to a socket and start listening for connections.</p>
<p>
Early on we spoke about messages; now is the time to start receiving and sending some. Here's a code snippet for receiving messages:</p>
So, lets dissect the above code. First we declare a NetIncomingMessage, which is the type of incoming messages. Then we read a message and handles it, looping back as long as there are messages to fetch. For each message we find, we switch on sometime called MessageType - it's a description what the message contains. In this code example we only catch messages of type VerboseDebugMessage, DebugMessage, WarningMessage and ErrorMessage. All those four types are emitted by the library to inform about various events. They all contains a single string, so we use the method ReadString() to extract a copy of that string and print it in the console.</p>
<p>
Reading data will increment the internal message pointer so you can read subsequent data using the Read*() methods.</p>
<p>
For all other message type we just print that it's currently unhandled.</p>
<p>
Finally, we recycle the message after we're done with it - this will enable the library to reuse the object and create less garbage.</p>
The above code first creates a new message, or uses a recycled message, which is why it's not possible to just create a message using new(). It then writes a string ("Hello") and an integer (System.Int32, 4 bytes in size) to the message.</p>
<p>
Then the message is sent using the SendMessage() method. The first argument is the message to send, the second argument is the recipient connection - which we'll not go into detail about just yet - and the third argument are HOW to deliver the message, or rather how to behave if network conditions are bad and a packet gets lost, duplicated or reordered.</p>
<p>
There are five delivery methods available:</p>
<divclass="cf">
<table>
<tr>
<tdvalign="top">
<b>Unreliable</b>
</td>
<td>
</td>
<tdvalign="top">
This is just UDP. Messages can be lost, received more than once and messages sent after other messages may be received before them.
</td>
</tr>
<tr>
<tdcolspan="3">
</td>
</tr>
<tr>
<tdvalign="top">
<b>UnreliableSequenced</b>
</td>
<td>
</td>
<tdvalign="top">
Using this delivery method messages can still be lost; but you're protected against duplicated messages and if a message arrives late; that is, if a message sent after this one has already been received - it will be dropped. This means you will never receive "older" data than what you already have received.
</td>
</tr>
<tr>
<tdcolspan="3">
</td>
</tr>
<tr>
<tdvalign="top">
<b>ReliableUnordered</b>
</td>
<td>
</td>
<tdvalign="top">
This delivery method ensures that every message sent will be received eventually. It does not however guarantee what order they will be received; late messages may be delivered before older ones.
</td>
</tr>
<tr>
<tdcolspan="3">
</td>
</tr>
<tr>
<tdvalign="top">
<b>ReliableSequenced</b>
</td>
<td>
</td>
<tdvalign="top">
This delivery method is similar to UnreliableSequenced; except that is guarantees that SOME messages will be received - if you only send one message - it will be received. If you sent two messages quickly, and they get reordered in transit, only the newest message will be received - but at least ONE of them will be received guaranteed.
</td>
</tr>
<tr>
<tdcolspan="3">
</td>
</tr>
<tr>
<tdvalign="top"><b>ReliableOrdered</b></td>
<td> </td>
<tdvalign="top">
This delivery method guarantees that messages will always be received in the exact order they were sent.
</td>
</tr>
</table>
</div>
<p>
Here's how to read and decode the message above:</p>
/// Gets or sets the length of the used portion of the buffer in bytes
/// </summary>
publicintLengthBytes
{
get{return((m_bitLength+7)>>3);}
set
{
m_bitLength=value*8;
InternalEnsureBufferSize(m_bitLength);
}
}
/// <summary>
/// Gets or sets the length of the used portion of the buffer in bits
/// </summary>
publicintLengthBits
{
get{returnm_bitLength;}
set
{
m_bitLength=value;
InternalEnsureBufferSize(m_bitLength);
}
}
/// <summary>
/// Gets or sets the read position in the buffer, in bits (not bytes)
/// </summary>
publiclongPosition
{
get{return(long)m_readPosition;}
set{m_readPosition=(int)value;}
}
/// <summary>
/// Gets the position in the buffer in bytes; note that the bits of the first returned byte may already have been read - check the Position property to make sure.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
usingSystem;
usingSystem.Net;
namespaceLidgren.Network
{
/// <summary>
/// Specialized version of NetPeer used for a "client" connection. It does not accept any incoming connections and maintains a ServerConnection property
/// </summary>
publicclassNetClient:NetPeer
{
/// <summary>
/// Gets the connection to the server, if any
/// </summary>
publicNetConnectionServerConnection
{
get
{
NetConnectionretval=null;
if(m_connections.Count>0)
{
try
{
retval=m_connections[0];
}
catch
{
// preempted!
returnnull;
}
}
returnretval;
}
}
/// <summary>
/// Gets the connection status of the server connection (or NetConnectionStatus.Disconnected if no connection)
/// </summary>
publicNetConnectionStatusConnectionStatus
{
get
{
varconn=ServerConnection;
if(conn==null)
returnNetConnectionStatus.Disconnected;
returnconn.Status;
}
}
/// <summary>
/// NetClient constructor
/// </summary>
/// <param name="config"></param>
publicNetClient(NetPeerConfigurationconfig)
:base(config)
{
config.AcceptIncomingConnections=false;
}
/// <summary>
/// Connect to a remote server
/// </summary>
/// <param name="remoteEndPoint">The remote endpoint to connect to</param>
/// <param name="hailMessage">The hail message to pass</param>
/// <returns>server connection, or null if already connected</returns>
m_peer.LogVerbose("Updated average roundtrip time to "+NetTime.ToReadable(m_averageRoundtripTime)+", remote time to "+(now+m_remoteTimeOffset)+" (ie. diff "+m_remoteTimeOffset+")");
}
// update resend delay for all channels
floatresendDelay=GetResendDelay();
foreach(varchaninm_sendChannels)
{
varrchan=chanasNetReliableSenderChannel;
if(rchan!=null)
rchan.m_resendDelay=resendDelay;
}
// notify the application that average rtt changed
/// Gets or sets the read position in the buffer, in bits (not bytes)
/// </summary>
publiclongPosition
{
get{return(long)m_readPosition;}
set{m_readPosition=(int)value;}
}
/// <summary>
/// Gets the position in the buffer in bytes; note that the bits of the first returned byte may already have been read - check the Position property to make sure.
thrownewNetException("Unconnected messages too long! Must be shorter than NetConfiguration.MaximumTransmissionUnit (currently "+m_configuration.MaximumTransmissionUnit+")");
thrownewNetException("Unconnected messages too long! Must be shorter than NetConfiguration.MaximumTransmissionUnit (currently "+m_configuration.MaximumTransmissionUnit+")");
thrownewNetException("Unconnected messages too long! Must be shorter than NetConfiguration.MaximumTransmissionUnit (currently "+m_configuration.MaximumTransmissionUnit+")");
/// Gets or sets the name of the library network thread. Cannot be changed once NetPeer is initialized.
/// </summary>
publicstringNetworkThreadName
{
get{returnm_networkThreadName;}
set
{
if(m_isLocked)
thrownewNetException("NetworkThreadName may not be set after the NetPeer which uses the configuration has been started");
m_networkThreadName=value;
}
}
/// <summary>
/// Gets or sets the maximum amount of connections this peer can hold. Cannot be changed once NetPeer is initialized.
/// </summary>
publicintMaximumConnections
{
get{returnm_maximumConnections;}
set
{
if(m_isLocked)
thrownewNetException(c_isLockedMessage);
m_maximumConnections=value;
}
}
/// <summary>
/// Gets or sets the maximum amount of bytes to send in a single packet, excluding ip, udp and lidgren headers. Cannot be changed once NetPeer is initialized.
/// </summary>
publicintMaximumTransmissionUnit
{
get{returnm_maximumTransmissionUnit;}
set
{
if(m_isLocked)
thrownewNetException(c_isLockedMessage);
if(value<1||value>=((ushort.MaxValue+1)/8))
thrownewNetException("MaximumTransmissionUnit must be between 1 and "+(((ushort.MaxValue+1)/8)-1)+" bytes");
m_maximumTransmissionUnit=value;
}
}
/// <summary>
/// Gets or sets the default capacity in bytes when NetPeer.CreateMessage() is called without argument
/// </summary>
publicintDefaultOutgoingMessageCapacity
{
get{returnm_defaultOutgoingMessageCapacity;}
set{m_defaultOutgoingMessageCapacity=value;}
}
/// <summary>
/// Gets or sets the time between latency calculating pings
/// </summary>
publicfloatPingInterval
{
get{returnm_pingInterval;}
set{m_pingInterval=value;}
}
/// <summary>
/// Gets or sets if the library should recycling messages to avoid excessive garbage collection. Cannot be changed once NetPeer is initialized.
/// </summary>
publicboolUseMessageRecycling
{
get{returnm_useMessageRecycling;}
set
{
if(m_isLocked)
thrownewNetException(c_isLockedMessage);
m_useMessageRecycling=value;
}
}
/// <summary>
/// Gets or sets the number of seconds timeout will be postponed on a successful ping/pong
/// </summary>
publicfloatConnectionTimeout
{
get{returnm_connectionTimeout;}
set
{
if(value<m_pingInterval)
thrownewNetException("Connection timeout cannot be lower than ping interval!");
m_connectionTimeout=value;
}
}
/// <summary>
/// Enables UPnP support; enabling port forwarding and getting external ip
/// </summary>
publicboolEnableUPnP
{
get{returnm_enableUPnP;}
set
{
if(m_isLocked)
thrownewNetException(c_isLockedMessage);
m_enableUPnP=value;
}
}
/// <summary>
/// Enables or disables automatic flushing of the send queue. If disabled, you must manully call NetPeer.FlushSendQueue() to flush sent messages to network.
/// </summary>
publicboolAutoFlushSendQueue
{
get{returnm_autoFlushSendQueue;}
set{m_autoFlushSendQueue=value;}
}
/// <summary>
/// Gets or sets the local ip address to bind to. Defaults to IPAddress.Any. Cannot be changed once NetPeer is initialized.
/// </summary>
publicIPAddressLocalAddress
{
get{returnm_localAddress;}
set
{
if(m_isLocked)
thrownewNetException(c_isLockedMessage);
m_localAddress=value;
}
}
/// <summary>
/// Gets or sets the local broadcast address to use when broadcasting
/// </summary>
publicIPAddressBroadcastAddress
{
get{returnm_broadcastAddress;}
set
{
if(m_isLocked)
thrownewNetException(c_isLockedMessage);
m_broadcastAddress=value;
}
}
/// <summary>
/// Gets or sets the local port to bind to. Defaults to 0. Cannot be changed once NetPeer is initialized.
/// </summary>
publicintPort
{
get{returnm_port;}
set
{
if(m_isLocked)
thrownewNetException(c_isLockedMessage);
m_port=value;
}
}
/// <summary>
/// Gets or sets the size in bytes of the receiving buffer. Defaults to 131071 bytes. Cannot be changed once NetPeer is initialized.
/// </summary>
publicintReceiveBufferSize
{
get{returnm_receiveBufferSize;}
set
{
if(m_isLocked)
thrownewNetException(c_isLockedMessage);
m_receiveBufferSize=value;
}
}
/// <summary>
/// Gets or sets the size in bytes of the sending buffer. Defaults to 131071 bytes. Cannot be changed once NetPeer is initialized.
/// </summary>
publicintSendBufferSize
{
get{returnm_sendBufferSize;}
set
{
if(m_isLocked)
thrownewNetException(c_isLockedMessage);
m_sendBufferSize=value;
}
}
/// <summary>
/// Gets or sets if the NetPeer should accept incoming connections. This is automatically set to true in NetServer and false in NetClient.
/// </summary>
publicboolAcceptIncomingConnections
{
get{returnm_acceptIncomingConnections;}
set{m_acceptIncomingConnections=value;}
}
/// <summary>
/// Gets or sets the number of seconds between handshake attempts
/// </summary>
publicfloatResendHandshakeInterval
{
get{returnm_resendHandshakeInterval;}
set{m_resendHandshakeInterval=value;}
}
/// <summary>
/// Gets or sets the maximum number of handshake attempts before failing to connect
/// </summary>
publicintMaximumHandshakeAttempts
{
get{returnm_maximumHandshakeAttempts;}
set
{
if(value<1)
thrownewNetException("MaximumHandshakeAttempts must be at least 1");
m_maximumHandshakeAttempts=value;
}
}
/// <summary>
/// Gets or sets if the NetPeer should send large messages to try to expand the maximum transmission unit size
/// </summary>
publicboolAutoExpandMTU
{
get{returnm_autoExpandMTU;}
set
{
if(m_isLocked)
thrownewNetException(c_isLockedMessage);
m_autoExpandMTU=value;
}
}
/// <summary>
/// Gets or sets how often to send large messages to expand MTU if AutoExpandMTU is enabled
/// </summary>
publicfloatExpandMTUFrequency
{
get{returnm_expandMTUFrequency;}
set{m_expandMTUFrequency=value;}
}
/// <summary>
/// Gets or sets the number of failed expand mtu attempts to perform before setting final MTU
/// </summary>
publicintExpandMTUFailAttempts
{
get{returnm_expandMTUFailAttempts;}
set{m_expandMTUFailAttempts=value;}
}
#ifDEBUG
/// <summary>
/// Gets or sets the simulated amount of sent packets lost from 0.0f to 1.0f
/// </summary>
publicfloatSimulatedLoss
{
get{returnm_loss;}
set{m_loss=value;}
}
/// <summary>
/// Gets or sets the minimum simulated amount of one way latency for sent packets in seconds
/// </summary>
publicfloatSimulatedMinimumLatency
{
get{returnm_minimumOneWayLatency;}
set{m_minimumOneWayLatency=value;}
}
/// <summary>
/// Gets or sets the simulated added random amount of one way latency for sent packets in seconds
/// </summary>
publicfloatSimulatedRandomLatency
{
get{returnm_randomOneWayLatency;}
set{m_randomOneWayLatency=value;}
}
/// <summary>
/// Gets the average simulated one way latency in seconds
thrownewNetException("m_storedMessages["+storeIndex+"].Message is null; sent "+m_storedMessages[storeIndex].NumSent+" times, last time "+(NetTime.Now-m_storedMessages[storeIndex].LastSent)+" seconds ago");
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.