Commit Graph

1183 Commits

Author SHA1 Message Date
Marcel Märtens
03af9937cf 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
ea8ab1ce7a 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
9884019963 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
5aa1940ef8 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
1b77b6dc41 Initial switch to tokio for network, minimum working example. 2021-02-17 12:37:59 +01:00
Caelan
dda4931f46 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
f10f88081d Small chat message formatting changes and fixed missing player alias during admin entity possession 2021-02-17 02:15:45 +00:00
Joshua Barretto
4d19308612 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
8b4230db61 Limit character name length 2021-02-16 21:29:45 +00:00
Avi Weinstock
c984035976 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
232ddb0860 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
f6db8bb7c4 Implement actual inventory-manipulation part of trading server side. 2021-02-12 18:43:10 -05:00
Avi Weinstock
abb5684883 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
e2b55e0706 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
aeb2398fc6 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
ae528124fc Trade implementation progress.
- State machine for modifying trades.
- ServerGeneral/ClientGeneral messages.
2021-02-12 18:43:09 -05:00
Avi Weinstock
e9b811b62b 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
63952875d9 Rebase !1447 Chat input color and icon reflect channel message is sent to. 2021-02-10 19:42:59 +00:00
Sam
e033fe6bee 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
1d8496ea21 Move agent system to server 2021-02-06 06:15:25 +00:00
Ludvig Böklin
a1ff9ab83f Redefine Ori as a quaternion 2021-02-05 09:33:14 +01:00
Imbris
b9f404c6f5 fix test server 2021-02-04 00:18:46 -05:00
Sam
d13302f256 Fixed bombs panicing the server. 2021-02-03 00:41:19 -05:00
Sam
be8df9aef6 Addressed comments. 2021-02-02 16:08:09 -05:00
Sam
80954f3ba4 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
17d1432be0 Outcomes now correctly read if an attack had any healing components. 2021-02-02 13:07:06 -05:00
Sam
5eec915c2e Added support for damage falloff with explosions. 2021-02-02 13:07:06 -05:00
Sam
5c16b0b532 Explosions now use attacks. 2021-02-02 13:07:06 -05:00
Sam
2b11ae6569 Attacks can now heal. 2021-02-02 13:07:04 -05:00
Sam
fdef168e82 Beams now use Attack, with limited functionality in some cases. 2021-02-02 13:07:03 -05:00
Sam
c3408c084c Critical hits are now functional. 2021-02-02 13:06:32 -05:00
James Melkonian
23b1df3cdd Add basic NPC interaction and fix NPC chat spamming 2021-01-31 20:29:50 +00:00
jiminycrick
a02444825d 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
46c8c744fa Add migration for starter gear 2021-01-28 17:22:39 -08:00
jiminycrick
152156d065 Fix rebase and scrub poise from UI 2021-01-28 17:22:39 -08:00
jiminycrick
661764f4aa Some preliminary balancing
Fix rebase
2021-01-28 17:22:39 -08:00
jshipsey
29732bb763 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
0f244bf84b Made stunned state invulnerable to poise damage
Fixing silly error for comp creation
2021-01-28 17:22:35 -08:00
jiminycrick
dd69b5f2bc Poise stats 2021-01-28 17:22:35 -08:00
jiminycrick
af076aa87f Add knockback to poise 2021-01-28 17:22:35 -08:00
jiminycrick
e3965ae0ab Very basic functioning stun 2021-01-28 17:22:35 -08:00
jiminycrick
c83296a4ec Initial broken implementation of poise
Character movement no longer broken.
2021-01-28 17:22:33 -08:00
jiminycrick
8b97199245 Update rand dependency 2021-01-26 20:35:08 -08:00
Scott Williams
e50bd4dc6f Changed some recipes to use other gems. Removed DELETE statements from migration. 2021-01-24 19:45:44 +00:00
Scott Williams
157e56d8ca 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
77312ccdd4 Move outcome vec from being defined in frontend and server to common. 2021-01-23 15:17:36 -05:00
Sam
4014b28d19 Removed body from stats component as there is already a body component. 2021-01-22 16:50:22 -05:00
Monty Marz
1eb7f78189 Revert "Added TR translations for deaths by debuffs."
This reverts commit 0817e45e13.
2021-01-20 11:20:06 +00:00
Sam
221dfc0ffa Players should no longer reward exp on being killed. 2021-01-19 15:27:56 -05:00
Sarra Kitty
e7d852835c Sarrakitty/rotsys item sprites 2021-01-19 18:23:44 +00:00