6586 Commits

Author SHA1 Message Date
Marcel Märtens
d3ef72e2b7 share tokio Runtime between Client and Server, name rayon Threadpool 2021-02-22 17:35:06 +01:00
Marcel Märtens
def5db54de Update Network Protocol
- now last digit version is compatible 0.6.0 will connect to 0.6.1
 - the TCP DATA Frames no longer contain START field, as it's not needed
 - the TCP OPENSTREAM Frames will now contain the BANDWIDTH field
 - MID is not Protocol internal

Update network
 - update API with Bandwidth

Update veloren
 - introduce better runtime and `async` things that are IO bound.
 - Remove `uvth` and instead use `tokio::runtime::Runtime::spawn_blocking`
 - remove futures_execute from client and server use tokio::runtime::Runtime instead
 - give threads a Name
2021-02-22 17:34:55 +01:00
Marcel
a34c9d2906 Merge branch 'Dumbeldor/opti_phys_entities' into 'master'
Physics improvements

See merge request veloren/veloren!1809
2021-02-22 14:17:23 +00:00
Vincent Glize
8e6d7cee71 Optimize Entity <> Entity collision check by calculating a entity via sphere. 2021-02-22 12:36:42 +01:00
Imbris
da6d050188 Merge branch 'slipped/savetheuniverse' into 'master'
fix glider crash

See merge request veloren/veloren!1808
2021-02-22 06:31:12 +00:00
Justin Shipsey
f4576de079 fix glider crash 2021-02-22 06:31:12 +00:00
Joshua Barretto
56bf0f6af0 Merge branch 'humanoid_ai_glide_when_falling' into 'master'
FIX #956: Humanoid ai glide when falling

See merge request veloren/veloren!1772
2021-02-22 00:57:25 +00:00
Overblob
4024f2d7e1 CI - Fix clippy errors
Fix trailing whitspace
2021-02-22 00:57:25 +00:00
Samuel Keiffer
b8283e6243 Merge branch 'aweinstock/speed-floor-quickfix' into 'master'
Change the speed floor to `0.1` (avoiding a division by zero in modular...

See merge request veloren/veloren!1804
2021-02-21 02:49:57 +00:00
Samuel Keiffer
d57a69ab4d Merge branch 'sam/food-queue' into 'master'
Food buff queues

See merge request veloren/veloren!1803
2021-02-21 01:06:50 +00:00
Avi Weinstock
14166acb46 Change the speed floor to 0.1 (avoiding a division by zero in modular weapons accidentally buffed the Twitching Root). 2021-02-20 19:19:26 -05:00
Sam
b0c26317b5 Added functionality for buffs queueing. Saturation now queues. 2021-02-20 17:13:17 -05:00
Sam
6deabe9e47 Removed duplicate possess stick 2021-02-20 17:12:27 -05:00
Ben Wallis
1e17a5d71d Merge branch 'aweinstock/modular-weapons' into 'master'
Aweinstock/modular weapons

See merge request veloren/veloren!1795
2021-02-20 22:06:11 +00:00
Avi Weinstock
44db4199b0 Implement persistence for modular weapons.
This stores the components as children of the item that contains them via the DB's `parent_container_item_id` feature, and ensures that things are loaded in a good order with breadth-first search.

Squahed fixes:

- Fix some constraint violations that occurred when swapping inventory items.
- Comment out recipes for modular weapons.
- Make update_item_at_slot_using_persistence_key and is_modular more idiomatic.
- Add changelog entry.
- Document `defer_foreign_keys` usage.
2021-02-20 14:31:46 -05:00
Avi Weinstock
2e1ee28949 Implement modular weapons.
- Add ItemKind::ModularComponent, Item::components.
- Add tool::StatKind::{Direct,Modular} for the modular weapons themselves.
- Move ItemConfig from ItemDesc to Item, so components' stats can be taken into account.
- Crafting stores into the components field.
- Components/recipes/placeholders are created dynamically.
- Show which components a modular weapon contains in the tooltip in voxygen.

Squashed fixes:
- `Item::duplicate` components in `Item::new_from_item_def`.
- Speed of 1.0 for now.
2021-02-20 14:30:39 -05:00
Snowram
7b3af67507 Merge branch 'snowram/buffs-immunity' into 'master'
Allows some species to be immune to specific buffs

See merge request veloren/veloren!1800
2021-02-20 14:03:16 +00:00
Snowram
9a02777d22 Allows some species to be immune to specific buffs 2021-02-20 14:03:15 +00:00
Marcel
a85ba52406 Merge branch 'clangdo/fix_macos_build' into 'master'
Backdate coreaudio-sys for OSX cross toolchain compatibility

See merge request veloren/veloren!1799
2021-02-20 09:58:59 +00:00
Samuel Keiffer
f64d4e555c Merge branch 'sam/dual-wielding' into 'master'
Dual wielding backend

See merge request veloren/veloren!1787
2021-02-20 05:12:17 +00:00
Sam
77a8612e87 Addressed comments
Fixed audio test
2021-02-19 19:55:23 -05:00
Sam
2d9887f9f9 Added 1h swords. 2021-02-19 19:33:26 -05:00
Caelan
cae0c1adef Backdate coreaudio-sys for OSX cross toolchain compatibility
See https://github.com/RustAudio/coreaudio-sys/issues/48
2021-02-19 15:46:36 -08:00
Sam
517abc79ab Factored out duplicate code into closures, consolidated ability handling logic to a single function. 2021-02-19 18:45:48 -05:00
Joshua Barretto
6108653b9a Merge branch 'aweinstock/trade-client-improvements' into 'master'
Client-side trade improvements.

See merge request veloren/veloren!1798
2021-02-19 23:38:30 +00:00
Sam
7be14eef30 Re-deleted duplicate weapons that somehow reappeared. 2021-02-19 17:30:24 -05:00
Sam
b934023169 Added 1h hammers.
Fixed audio tests.
2021-02-19 17:30:24 -05:00
Sam
f50c2479e3 Added AbilityInfo struct to attack states 2021-02-19 17:30:24 -05:00
Sam
35f106c184 Added one-handed axes. 2021-02-19 17:30:23 -05:00
Sam
1b7d4b95b8 Added handedness to weapon tooltips. 2021-02-19 17:30:23 -05:00
Sam
c2cf3b890e Dual wielding now uses skillbar abilities from multiple weapons. 2021-02-19 17:30:22 -05:00
Sam
dbc759b043 Wielding a 1 handed weapon now correctly uses abilities when the second weapon is not also a 1 handed weapon. 2021-02-19 17:30:22 -05:00
Sam
3c47f5ab5b ItemConfig now stores AbilitySet directly instead of each individual ability. 2021-02-19 17:30:21 -05:00
Sam
d94595423c Handedness of weapons affects power and speed. 2021-02-19 17:30:21 -05:00
Sam
a32c14a78b Check for prerequisite skill in using an ability is no longer hardcoded. 2021-02-19 17:30:21 -05:00
Sam
16dcea0ecf Added hands field to all ron files of weapons.
Removed weapons that were duplicated in weapons and npc_weapons from npc_weapons.
Added migration to convert npc_weapons that ended up in anyone's inventory to weapon version.
Consolidated debug boost and possess sticks into one debug_stick, and renamed the admin sword (with name cultist_purp_2h_boss-0) to admin_sword
2021-02-19 17:30:20 -05:00
Sam
0f4b4e4271 Added hands field onto weapons. 2021-02-19 17:30:20 -05:00
Avi Weinstock
d44565d6cc Client-side trade improvements.
- Add item tooltips in trade.
- More localization support.
- Fix bindings (R for trade, B for bag).
2021-02-19 15:20:27 -05:00
Forest Anderson
eef372a850 Merge branch 'angel/fix-mirror-actions' into 'master'
Remove git filter repo

See merge request veloren/veloren!1797
2021-02-19 18:01:42 +00:00
Forest Anderson
7bb038e474 Remove git filter repo 2021-02-19 08:55:10 -05:00
Marcel
e6517db945 Merge branch 'xMAC94x/quick_net_fix' into 'master'
fix main thread blocking which was a bad combination of

See merge request veloren/veloren!1793
2021-02-18 19:26:43 +00:00
Marcel Märtens
6d24c4e1a0 fix main thread blocking which was a bad combination of
- a channel was stale and wasn't shut down propertly AS WELL AS
 - the msg ingoing pipe was bounded, so it could fill up

To mitigate this we
 a) unbounded the pipe
 b) stoped spam the log in no channel case
 c) instead of ever reaching "no channel" state we actually shutdown participant
 d) when send_mgr is closed it will no longer be able to SEND on streams
2021-02-18 20:00:07 +01:00
Marcel
0f633e7b7c Merge branch 'xMAC94x/network_tokio' into 'master'
xMAC94x/network_tokio switch from `async_std` to `tokio`

See merge request veloren/veloren!1789
2021-02-17 22:47:11 +00:00
Samuel Keiffer
92b7657c0f Merge branch 'cherry-pick-2ef5fb90' into 'master'
Fix missing controller actions

See merge request veloren/veloren!1786
2021-02-17 21:10:14 +00:00
Ada Lovegirls
540635ed99 Fixed missing controller actions
(cherry picked from commit 2ef5fb90e89bf3f8f0acc84e269f6948c696c196)
2021-02-17 21:10:14 +00:00
Marcel Märtens
048fcf88f8 Stabelize Network again:
- completly switch to Bytes, even in api. speed up TCP by fak 2
 - improve benchmarks
 - speed up mpsc metrics
 - gracefully handle shutdown by interpreting Ok(0) as tokio::tcpstream closed now.
 - fix hotloop in participants by adding `Some(n)` to fix endless handing.
 - fix closing bug by closing streams after `recv_mgr` is shutdown even if now shutdown is triggered locally.
 - fix prometheus
 - no longer throw when a `Stream` is dropped while participant still receives a msg for it.
 - fix the bandwith handling, TCP network send speed is up to 1.5GiB/s while recv is 150MiB/s
 - add documentation
 - tmp require rt-multi-threaded in client for tokio, to not fail cargo check

this is prob stable, i tested over 1 hour.
after that some optimisations in priomgr.
and impl. propper bandwith.
Speed is up to 2GB/s write and 150MB/s recv on a single core

sync add documentation
2021-02-17 19:37:48 +01:00
Marcel Märtens
00386b6955 Great improvements to the codebase:
- better logging in network
 - we now notify the send of what happened in recv in participant.
 - works with veloren master servers
 - works in singleplayer, using a actual mid.
 - add `mpsc` in whole stack incl tests
 - speed up internal read/write with `Bytes` crate
 - use `prometheus-hyper` for metrics
 - use a metrics cache
2021-02-17 16:15:00 +01:00
Marcel Märtens
33085f1645 COMPLETE REDESIGN of network crate
- Implementing a async non-io protocol crate
    a) no tokio / no channels
    b) I/O is based on abstraction Sink/Drain
    c) different Protocols can have a different Drain Type
       This allow MPSC to send its content without splitting up messages at all!
       It allows UDP to have internal extra frames to care for security
       It allows better abstraction for tests
       Allows benchmarks on the mpsc variant
       Custom Handshakes to allow sth like Quic protocol easily
 - reduce the participant managers to 4: channel creations, send, recv and shutdown.
   keeping the `mut data` in one manager removes the need for all RwLocks.
   reducing complexity and parallel access problems
 - more strategic participant shutdown. first send. then wait for remote side to notice recv stop, then remote side will stop send, then local side can stop recv.
 - metrics are internally abstracted to fit protocol and network layer
 - in this commit network/protocol tests work and network tests work someway, veloren compiles but does not work
 - handshake compatible to async_std
2021-02-17 12:39:47 +01:00
Marcel Märtens
13bf418794 fix most unittests (not all) by a) dropping network/participant BEFORE runtime and by transfering a expect into a warn! in the protocol 2021-02-17 12:38:58 +01:00
Marcel Märtens
13276a6d00 get rid of async_std::channel
switch to `tokio` and `async_channel` crate.
I wanted to do tokio first, but it doesnt feature Sender::close(), thus i included async_channel
Got rid of `futures` and only need `futures_core` and `futures_util`.

Tokio does not support `Stream` and `StreamExt` so for now i need to use `tokio-stream`, i think this will go in `std` in the future

Created `b2b_close_stream_opened_sender_r` as the shutdown procedure does not need a copy of a Sender, it just need to stop it.

Various adjustments, e.g. for `select!` which now requieres a `&mut` for oneshots.

Future things to do:
 - Use some better signalling than oneshot<()> in some cases.
 - Use a Watch for the Prio propergation (impl. it ofc)
 - Use Bounded Channels in order to improve performance
 - adjust tests coding

bring tests to work
2021-02-17 12:38:53 +01:00