1183 Commits

Author SHA1 Message Date
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
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
Marcel Märtens
88620c804a Initial switch to tokio for network, minimum working example. 2021-02-17 12:37:59 +01:00
Caelan
86d1b00735 Clean and update dependencies
* Remove tweak feature
 * Remove const-tweaker
 * Update tiny_http
 * Update bitvec to 0.21.0
 * Downgrade euc to avoid conflict with vek 0.12.0
 * Require exactly vek 0.12.0
 * Update all other dependencies automatically based on these changes
 * Update gilrs to latest at the request of Ada Lovegirls
 * Update meshing benchmarks to new criterion API
2021-02-17 01:27:06 -08:00
TheThirdSpartan
6b236cbc30 Small chat message formatting changes and fixed missing player alias during admin entity possession 2021-02-17 02:15:45 +00:00
Joshua Barretto
2706ccd675 Merge branch 'lboklin/quat-ori' into 'master'
Redefine Ori as a quaternion

See merge request veloren/veloren!1755
2021-02-16 22:39:11 +00:00
Quellus
ca66b2880b Limit character name length 2021-02-16 21:29:45 +00:00
Avi Weinstock
f86f22f0e8 MR 1775 review fixes.
- Separate `invite` machinery from `group_manip` into it's own thing (includes renaming `group_invite` to `invite` where applicable).
- Move some invite/trade machinery to `ControlEvent`.
- Make `TradePhase` a proper enum instead of a bunch of bools.
- Make `TradeId` a proper newtype.
- Remove trades from `Trades` on accept (previously was only on decline).
- Typo fixes/misc cleanup.
- Add bullet point for trading to the changelog.
2021-02-14 11:13:56 -05:00
Avi Weinstock
a1176284d2 Polish trading implementation and address review comments.
- Fix item swapping edge case
- Document more assumptions/edge cases
- fmt and clippy
- s/ServerGeneral::GroupInvite/ServerGeneral::Invite/
- Use `Client::current` in `Client::is_dead`
2021-02-14 11:11:35 -05:00
Avi Weinstock
7a37538f06 Implement actual inventory-manipulation part of trading server side. 2021-02-12 18:43:10 -05:00
Avi Weinstock
e0f4bb3dc6 Trade implementation progress.
- Accept/decline buttons that submit the proper messages
- A phase2 screen that renders the (item, quantity) pairs as text
- More checks in the trade state machine server-side.
2021-02-12 18:43:10 -05:00
Avi Weinstock
2b9129d290 Implement enough of a trade UI that dragging & dropping items into it round-trips between clients. 2021-02-12 18:43:09 -05:00
Avi Weinstock
231c104355 Trade implementation progress.
- Server messages now bring up the trade window.
- When a trade is declined, it closes the window on both clients.
2021-02-12 18:43:09 -05:00
Avi Weinstock
b259acaa59 Trade implementation progress.
- State machine for modifying trades.
- ServerGeneral/ClientGeneral messages.
2021-02-12 18:43:09 -05:00
Avi Weinstock
94ef4a6917 Plumb trade requests through the group invite UI, such that they can be accepted/declined without impacting the counterparty's movement. 2021-02-12 18:43:09 -05:00
Quellus
22501ccf64 Rebase !1447 Chat input color and icon reflect channel message is sent to. 2021-02-10 19:42:59 +00:00
Sam
7e3ec94207 Inventory manipulations are now only for input from the client, and are no longer directly sent as a server event. Slot manipulations do that instead. 2021-02-08 13:55:50 -05:00
James Melkonian
4d4c6d8b13 Move agent system to server 2021-02-06 06:15:25 +00:00
Ludvig Böklin
a888cd00d5 Redefine Ori as a quaternion 2021-02-05 09:33:14 +01:00
Imbris
36f7ac900e fix test server 2021-02-04 00:18:46 -05:00
Sam
14dfe5a30b Fixed bombs panicing the server. 2021-02-03 00:41:19 -05:00
Sam
64868ad7a3 Addressed comments. 2021-02-02 16:08:09 -05:00
Sam
30f33a03b7 Made attacker entity and uid optional to remove potential for attacks to not be applied and some unwraps. 2021-02-02 13:07:07 -05:00
Sam
e5bc0d7edf Outcomes now correctly read if an attack had any healing components. 2021-02-02 13:07:06 -05:00
Sam
1bc1b5f200 Added support for damage falloff with explosions. 2021-02-02 13:07:06 -05:00
Sam
486de732fc Explosions now use attacks. 2021-02-02 13:07:06 -05:00
Sam
c1db9025b8 Attacks can now heal. 2021-02-02 13:07:04 -05:00
Sam
52dbf3f1a8 Beams now use Attack, with limited functionality in some cases. 2021-02-02 13:07:03 -05:00
Sam
c6012f5b00 Critical hits are now functional. 2021-02-02 13:06:32 -05:00
James Melkonian
8951e427e4 Add basic NPC interaction and fix NPC chat spamming 2021-01-31 20:29:50 +00:00
jiminycrick
ae8722794b Address some comments
Eliminated extra stagger state

Responding to more comments

Move poise character state changes to character behavior system

Move poise out of JoinTuple/Data

Finish up comments (various fixes)
2021-01-28 17:31:05 -08:00
jiminycrick
b689226173 Add migration for starter gear 2021-01-28 17:22:39 -08:00
jiminycrick
53b43e9812 Fix rebase and scrub poise from UI 2021-01-28 17:22:39 -08:00
jiminycrick
1fadcf51ba Some preliminary balancing
Fix rebase
2021-01-28 17:22:39 -08:00
jshipsey
95c3af1123 starting stun anim
stagger anim, mirroring, bettern walk anim

wielding with stuns/stagger

Knockback fix

Added Poise documentation/comments
2021-01-28 17:22:37 -08:00
jiminycrick
27ad277051 Made stunned state invulnerable to poise damage
Fixing silly error for comp creation
2021-01-28 17:22:35 -08:00
jiminycrick
a2262c5c6b Poise stats 2021-01-28 17:22:35 -08:00
jiminycrick
221d4c8cdc Add knockback to poise 2021-01-28 17:22:35 -08:00
jiminycrick
df124a1eef Very basic functioning stun 2021-01-28 17:22:35 -08:00
jiminycrick
df4c9eff49 Initial broken implementation of poise
Character movement no longer broken.
2021-01-28 17:22:33 -08:00
jiminycrick
64a3c16999 Update rand dependency 2021-01-26 20:35:08 -08:00
Scott Williams
9d3982940b Changed some recipes to use other gems. Removed DELETE statements from migration. 2021-01-24 19:45:44 +00:00
Scott Williams
95c67cbfbd Removed Shiny Gem, Added migration to change shiny gems to diamonds. Changed shiny gem recipes to diamonds 2021-01-24 16:40:22 +00:00
Sam
1ee7cc4760 Move outcome vec from being defined in frontend and server to common. 2021-01-23 15:17:36 -05:00
Sam
020e4acba4 Removed body from stats component as there is already a body component. 2021-01-22 16:50:22 -05:00
Monty Marz
3b01a888da Revert "Added TR translations for deaths by debuffs."
This reverts commit 0817e45e131b70dbd7ef8bee768ccc377301b5d7.
2021-01-20 11:20:06 +00:00
Sam
1453e964a6 Players should no longer reward exp on being killed. 2021-01-19 15:27:56 -05:00
Sarra Kitty
f332bf4ceb Sarrakitty/rotsys item sprites 2021-01-19 18:23:44 +00:00