Commit Graph

785 Commits

Author SHA1 Message Date
Ben Wallis
a9be045cb8 Fixed suppressed clippy warnings for #587 - useless_conversion 2020-07-13 20:57:13 +01:00
Marcel Märtens
6db9c6f91b fix a followup bug, after a protocol fail now Participant is closed, including all streams, so we get the stream errors.
We MUST handle them and we are not allowed to act on a stream after it failed, as i am to lazy to change the structure to ensure the client to be imeadiatly dropped i added a AtomicBool to it.
2020-07-13 13:03:35 +02:00
Marcel Märtens
df45d35c0e tcp protocol hardening
- make it harder for the server to crash and also kill invalid sessions properly (instead of waiting for them to close)
 - introduce macros to reduce code duplication
 - added tests to check for valid handshake as well as garbage tcp
2020-07-13 13:03:25 +02:00
Marcel Märtens
9d32e3f884 proper voxygen connect and code cleanups:
- voxygen abort when the server has a invalid veloren_network handshake, e.g. by outdated version instead of try again
- rename Network `Address` to `ProtocolAddr` as sugested by zest as it's a combination of Protocol and std::io::Addr
- remove the manual byte arrays in `protocols.rs` with something more nice
2020-07-13 13:03:20 +02:00
Marcel Märtens
041349be48 Switch API to return Participant rather than Arc<Participant>
- API behavior switched!
 - the `Network` no longer holds a copy of participant, thus if the return of `connect` (before `Arc<Participant>, now `Participant`) got dropped, the `Participant::Drop` is triggered!
 - you can close a Participant async via `Particiant::disconnect()`, no more need to know the network at this point
 - the `Network::Drop` will check and drop not yet disconnected Participants.
 - you can compare Participants via PartialEq, if they are true they point to the same endpoint (it checks remote_pid)
   - Note: multiple Participants are only supported in theory, wont work yet

Additionally:
 - fix some `debug!`
 - veloren-client will now drop the participant gracefully on shutdown
 - rename `error` to `debug` when 2 times Bparticipant shutdown is called, as it is to be expected in a async runtime
2020-07-13 13:03:14 +02:00
Marcel Märtens
9ae1d8474f dropping participant on client disconnect clients 2020-07-13 13:03:07 +02:00
Ben Wallis
7f6c892cf0 Added migration to fix characters unable to login due to DashMelee ability change 2020-07-11 15:42:19 +01:00
Songtronix
5b57072064 fix: use correct specs(-idvs) versions
related to torvus
2020-07-09 19:46:30 +02:00
Joshua Barretto
23c774c8da Fixed missed VD update bug 2020-07-09 16:54:10 +01:00
Samuel Keiffer
25c28f26d6 Different body types now have different health values and gain different amounts of healths on leveling. 2020-07-09 00:04:25 +00:00
Ben Wallis
ddb66ec73b Added CharacterDataError when character list fails to load due to Loadout de-serialization error 2020-07-08 09:34:20 +01:00
Ben Wallis
e83d0abd33 Added migration to create a default inventory and loadout for characters without one 2020-07-08 09:09:48 +01:00
Ben Wallis
3ac18f73ea Removed de-serialization failure tolerance to prevent player inventory/loadout wipes 2020-07-08 09:09:47 +01:00
Marcel Märtens
85a3f8637d fix specs 2020-07-07 14:28:00 +02:00
Marcel Märtens
c212de00c2 updated dependencies and fixed stuff
- replace serde_derive by feature of serde
   incl. source code modifications to compile
 - reduce futures-timer to "2.0" to be same as async_std
 - update notify
 - removed mio, bincode and lz4 compress in common as networking is now in own crate
   btw there is a better lz4 compress crate, which is newer than 2017
 - update prometheus to 0.9
 - can't update uvth yet due to usues
 - hashbrown to 7.2 to only need a single version
 - libsqlite3 update
 - image didn't change as there is a problem with `image 0.23`
 - switch old directories with newer directories-next
 - no num upgrade as we still depend on num 0.2 anyways
 - rodio and cpal upgrade
 - const-tewaker update
 - dispatch (untested) update
 - git2 update
 - iterations update
2020-07-07 09:43:49 +02:00
Joshua Barretto
3cfd8bdd3c Fixed animal loadouts and /spawn 2020-07-07 02:21:14 +01:00
Joshua Barretto
d1cdb6ea55 Updated changelog 2020-07-07 01:11:37 +01:00
Joshua Barretto
e626f6255f Prevented pet damage 2020-07-07 01:01:39 +01:00
Joshua Barretto
bdab3972c2 Fixed view distance bug 2020-07-06 16:36:13 +01:00
Marcel
e19d170b61 Merge branch 'imbris/smaller-fixes' into 'master'
Stop spamming loadout, Update specs

See merge request veloren/veloren!1165
2020-07-06 09:50:46 +00:00
Songtronix
200496d1bc fix: allow maximum view distance in singleplayer 2020-07-06 10:37:44 +02:00
Imbris
8d39f27458 Upgrade hashbrown 2020-07-06 03:15:06 -04:00
Imbris
afff8a43b9 Add some code to count how many updates will be sent for each component type (commented out) 2020-07-06 02:25:29 -04:00
Imbris
c2d6d00b00 point to github specs to access PairedStorage type, fix Loadout sync spam 2020-07-06 01:56:02 -04:00
Joshua Barretto
a9f862ee95 Fixed multiple char select bug 2020-07-05 18:05:00 +01:00
Joshua Barretto
43f75f2f54 Removed bomb timeout 2020-07-05 16:15:51 +01:00
Joshua Barretto
fd39ee97bc Added training dummies 2020-07-05 16:15:51 +01:00
Joshua Barretto
92c9db5291 Made fluids block explosions 2020-07-05 16:15:51 +01:00
Joshua Barretto
38c422bef7 Added bombs to loot table 2020-07-05 16:15:51 +01:00
Joshua Barretto
2f6a618d5a Added bombs, throwable items, more block kinds, weaker explosions 2020-07-05 16:15:48 +01:00
Marcel
2a7a8b05e6 Merge branch 'network-lockless' into 'master'
Network lockless

See merge request veloren/veloren!1153
2020-07-05 09:17:29 +00:00
Forest Anderson
7ac5876743 Merge branch 'xvar/skills' into 'master'
Initial implementation of skills and skill groups

See merge request veloren/veloren!1135
2020-07-05 00:33:11 +00:00
Forest Anderson
3e830aa0ca Merge branch 'angel/add-spawn-training-dummy' into 'master'
Added spawning test dummy

See merge request veloren/veloren!1142
2020-07-04 19:24:02 +00:00
Piotr Korgól
27440e16c4 Correctly load the loot table 2020-07-04 18:40:23 +02:00
Ben Wallis
538598eb08 Refactored Skills/SkillGroups structure and implemented JSON persistence 2020-07-04 15:25:21 +01:00
Piotr Korgól
aefa7e2f11 Make chests and enemies use the basic loot table 2020-07-04 14:07:10 +02:00
Marcel Märtens
cbfd398035 remove Mutex in server as Stream is now 'Sync' 2020-07-04 12:31:59 +02:00
Forest Anderson
954a4857c4 Added proper training dummy model 2020-07-03 16:53:04 -04:00
Forest Anderson
c525358637 Prevent xp gain from training dummy kill 2020-07-03 16:53:04 -04:00
Forest Anderson
6140555e43 Fixed clippy issues 2020-07-03 16:53:04 -04:00
Forest Anderson
e73ec7a4d2 Added spawning test dummy 2020-07-03 16:53:04 -04:00
Marcel Märtens
15ff58cd6a simple fmt in order to make the replacement commit as simple as possible 2020-07-03 13:11:44 +02:00
Marcel Märtens
4e92c0160e network layer switch, doing the stuff that might confict.
- mostly its the message handling put now in a async wrapper
 - add some fixes to pass without warnings and make clippy happy
 - some network error handling is ignored, this can be improved but is no blocker
2020-07-03 13:11:38 +02:00
Marcel Märtens
77c90b2c7c doing a simple 1:1 swap out network coding
this is the part which prob has less Merge conflics and is easy to rebase
the next commit will have prob alot of merge conflics
followed by a fmt commit
2020-07-03 13:11:31 +02:00
Monty Marz
89400264dc Loot ChatType, Update german translation, map zooming 2020-07-01 19:05:44 +00:00
Marcel Märtens
6535fa5744 fix various clippy issues 2020-07-01 00:37:06 +02:00
Samuel Keiffer
44203ab817 Adds a command that allows a username to be added or removed from the whitelist 2020-06-30 12:21:36 +00:00
Ben Wallis
48a23e5f4c Fixed inventory full message when pressing the pickup item key in quick succession (#651) 2020-06-29 07:48:44 +01:00
Forest Anderson
201f513737 Fixed meta chattype error on master 2020-06-28 17:10:01 +00:00
Forest Anderson
9246e34c1b Merge branch 'CapsizeGlimmer/chat_modes' into 'master'
Capsize glimmer/chat modes

Closes #217

See merge request veloren/veloren!1043
2020-06-28 14:35:39 +00:00
Monty Marz
f3a84e07a7 changed message type for motd 2020-06-28 16:04:55 +02:00
Forest Anderson
48f70bd088 Fixed double login message 2020-06-28 09:47:48 -04:00
Monty Marz
670d9e8736 remove unnecessary conversions to make clippy happy 2020-06-28 15:15:00 +02:00
Ben Wallis
a9d3f984f0 Implemented loot pickup chat messages and the option for playing different sounds for picked up items
* Added chat message when an item is picked up
* Changed InventoryUpdateEvent::Collected to InventoryUpdateEvent::Collected(Item) to facilitate the client being aware of what was picked up
* Added SfxInventoryEvent enum to allow different sounds to be used based on the item type. The RON mapping/de-serialization doesn't support matching on structs so we have to give it fixed enum values which are determined in TryFrom<&InventoryUpdateEvent> for SfxEvent
* Refactored InventoryManip::Pickup arm of match in inventory_manip::handle_inventory for clarity/better warning messages
* Fixed a bug that prevented the CollectFailed event from being raised when a player's inventory is full
* Added a panic for the situation where an item is pushed into the players inventory and then the deletion of the entity fails as this would indicate an item dupe bug - this could potentially be reworked to pull the item back from the player's inventory but this seems like there's be a more correct transactional way to do this.
* Added two temporary sounds to prove the per-item sound functionality (pickup sounds for Swords and Staffs)
2020-06-28 13:05:28 +01:00
Forest Anderson
2665159790 Fixing errors after rebase 2020-06-27 19:12:12 -04:00
CapsizeGlimmer
883d9acf30 cargo fmt 2020-06-27 17:43:46 -04:00
CapsizeGlimmer
3d29c3254a Add setting for displaying character names in chat. Placate cargo clippy. 2020-06-27 17:43:46 -04:00
CapsizeGlimmer
59db2fcd3b Admin status added when registering; cargo fmt 2020-06-27 17:43:45 -04:00
CapsizeGlimmer
2d2aba3a5d Chat bubble text shadows. Fix panic when re-joining a group or faction 2020-06-27 17:40:03 -04:00
CapsizeGlimmer
b04810cae5 misc chat mode changes 2020-06-27 17:40:03 -04:00
CapsizeGlimmer
5ad212b7ed Add chat types for offline, online. Implement Pfau's fixes 2020-06-27 17:40:03 -04:00
CapsizeGlimmer
b7d7696d89 Implement MR!1043 changes suggested by Imbris 2020-06-27 17:20:26 -04:00
CapsizeGlimmer
34acc4ddf3 Players are removed from social menu when logged out. 2020-06-27 17:20:26 -04:00
CapsizeGlimmer
4117f2f2a8 cargo fmt; changelog 2020-06-27 17:03:55 -04:00
CapsizeGlimmer
35ed03aa18 Implement chat mode icons in chat window 2020-06-27 17:03:30 -04:00
CapsizeGlimmer
22315a6e1d Added shortcut for chat commands /g=>/group, /s=>/say, /w=>/world, etc. 2020-06-27 17:03:30 -04:00
CapsizeGlimmer
c984bdcdf1 Implement chat filtering for /say /region /group etc. 2020-06-27 17:03:30 -04:00
CapsizeGlimmer
5cbecb29e6 Implement /join_group and /join_faction commands 2020-06-27 16:42:26 -04:00
CapsizeGlimmer
289ef5d6b2 Move message processing and chat bubbles to the client 2020-06-27 16:42:26 -04:00
CapsizeGlimmer
0b2a3ebe8b Re-implement names in chat. It is done client-side now and /alias changes are retroactive. 2020-06-27 16:42:25 -04:00
CapsizeGlimmer
b08d717eac Rework chat processing 2020-06-27 16:29:03 -04:00
CapsizeGlimmer
702a21302c Base implementation of /group /faction /say /region 2020-06-27 16:26:02 -04:00
Joshua Barretto
1cca7bf4a8 Fmt, fixed chat-cli problem 2020-06-25 19:50:04 +01:00
Joshua Barretto
d9cd37056d Added settings editing, set_motd command 2020-06-25 18:57:29 +01:00
Joshua Barretto
83a96c24ec Added MOTD on login, MOTD editing 2020-06-25 18:57:26 +01:00
Joshua Barretto
b46e080ade Added server-side maximum view distance setting 2020-06-25 18:46:04 +01:00
Imbris
6501611372 Merge branch 'shandley/character-loading' into 'master'
Move character DB ops off the main thread

See merge request veloren/veloren!1075
2020-06-25 16:16:15 +00:00
Songtronix
f44df23935 feat: add server whitelist 2020-06-24 17:36:19 +02:00
Shane Handley
255ad97289 - Move the remaining character data loading to the message/thread formatharacter list actions
- Handle/notify the client of errors during character load by returning to character select with the error, clean up client and server states
- Add player_uuid check when loading character data.
2020-06-24 11:47:41 +10:00
Shane Handley
38b146d840 Add channel setup for persistence to move character operations off the
main thread.
2020-06-23 21:07:43 +10:00
Shane Handley
304e06cbce Fix clippy warnings after toolchain update 2020-06-23 16:52:04 +10:00
Marcel Märtens
9485b45e70 switch to tracing stlye and enhance logs with usefull information
- Updated CHANGELOG
- reduce dependencies
- found out that we have alot of duplicate coding... alot...
2020-06-22 09:53:15 +02:00
Kevin Glasson
589254e4ab Convert all other veloren crates to use tracing
- Completely removed both `log` and `pretty_env_logger` and replaced
with `tracing` and `tracing_subscriber` where necessary.

- Converted all `log::info!(...)` et al. statements to just use the
shorthand macro i.e. `info!`. This was mostly to make renaming easier.
2020-06-21 23:19:41 +08:00
Ben Wallis
6da7a11d33 Fixed suppressed clippy warnings for #587 - clone_on_copy 2020-06-18 22:25:48 +01:00
Imbris
26e53409d8 Merge branch 'xvar/clippy-globally-suppress-option_map_unit_fn' into 'master'
Globally suppressed clippy lint option_map_unit_fn for #587

See merge request veloren/veloren!1071
2020-06-14 16:48:07 +00:00
Ben Wallis
c1c968f479 Globally suppressed clippy lint option_map_unit_fn for #587 2020-06-14 16:48:07 +00:00
Imbris
fb47115695 Merge branch 'xvar/clippy-fixes-redundant_closure_found' into 'master'
Fixed suppressed clippy warnings for #587 - redundant_closure

See merge request veloren/veloren!1065
2020-06-14 16:33:04 +00:00
Ben Wallis
4d6c553b1b Fixed suppressed clippy warnings for #587 - redundant_closure 2020-06-12 20:47:22 +01:00
Ben Wallis
8ed2109bcf Fixed suppressed clippy warnings for #587 - collapsible_if 2020-06-12 20:34:54 +01:00
Marcel Märtens
0e59ee901e dependency reduction:
- authc no longer uses reqwest
 - image only supports PNG
 - replace routille with tiny_http
 - several other dependencies
 - cargo upgrade
 - following improvement was measured on R7 1700X:
   before:
    - cargo build: 3076.73s user / 4:45 total / 589 dependencies
    - cargo test: 6118.38s user / 7:30 total / 959 dependencies
   after:
    - cargo build: 2680.54s user / 4:05 total / 480 dependencies
    - cargo test: 5351.81s user / 7:04 total / 791 dependencies
 - added xMAC94x to CODEOWNERS for Cargo.toml, he will protect them from now on and hit people with evil looks ;)
2020-06-11 20:55:34 +02:00
Ben Wallis
950c62efc6 Suppressed all existing clippy warnings in preparation for fixes as part of #587 2020-06-10 22:01:42 +01:00
Marcel Märtens
3324c08640 Fixing the DEADLOCK in handshake -> channel creation
- this bug was initially called imbris bug, as it happened on his runners and i couldn't reproduce it locally at fist :)
- When in a Handshake a seperate mpsc::Channel was created for (Cid, Frame) transport
  however the protocol could already catch non handshake data any more and push in into this
  mpsc::Channel.
  Then this channel got dropped and a fresh one was created for the network::Channel.
  These droped Frames are ofc a BUG!
  I tried multiple things to solve this:
   - dont create a new mpsc::Channel, but instead bind it to the Protocol itself and always use 1.
     This would work theoretically, but in bParticipant side we are using 1 mpsc::Channel<(Cid, Frame)>
     to handle ALL the network::channel.
     If now ever Protocol would have it's own, and with that every network::Channel had it's own it would no longer work out
     Bad Idea...
   - using the first method but creating the mpsc::Channel inside the scheduler instead protocol neither works, as the
     scheduler doesnt know the remote_pid yet
   - i dont want a hack to say the protocol only listen to 2 messages and then stop no matter what
  So i switched over to the simply method now:
   - Do everything like before with 2 mpsc::Channels
   - after the handshake. close the receiver and listen for all remaining (cid, frame) combinations
   - when starting the channel, reapply them to the new sender/listener combination
   - added tracing
- switched Protocol RwLock to Mutex, as it's only ever 1
- Additionally changed the layout and introduces the c2w_frame_s and w2s_cid_frame_s name schema
- Fixed a bug in scheduler which WOULD cause a DEADLOCK if handshake would fail
- fixd a but in api_send_send_main, i need to store the stream_p otherwise it's immeadiatly closed and a stream_a.send() isn't guaranteed
- add extra test to verify that a send message is received even if the Stream is already closed
- changed OutGoing to Outgoing
- fixed a bug that `metrics.tick()` was never called
- removed 2 unused nightly features and added `deny_code`
2020-06-09 01:24:21 +02:00
Marcel Märtens
8f65168506 fix workspaces and Cargo dependencies 2020-06-09 01:23:21 +02:00
Marcel Märtens
88f6b36a4e Differ Metrics to make it easier to implement your own metric coding!
Implement my own metric coding in networking
2020-06-09 01:22:48 +02:00
Shane Handley
24cdea0a4c Enable WAL and busy_timeout for each sqlite connection to mitigate db locks, 2020-06-07 22:33:48 +10:00
S Handley
e0633a238e Update CHANGELOG and a TODO, fix safer deserialisation for inventory
data.
2020-06-04 11:44:33 +00:00
Monty Marz
b34da9b07b More item drops 2020-06-03 17:59:09 +00:00
S Handley
b1d191301a Make the persistence system code more generic so that it handles all
data associated with a character, rather than individually as we were
planning to do with stats/inv/etc... This removes potential for DB locking when we deal with each individually, and we
should have plenty of room for additional writes within the transaction.
2020-06-01 21:34:52 +00:00
scott-c
2d3f81b4c1 Add character info to /players command 2020-06-01 22:04:44 +08:00
scott-c
fe20da3923 send level change event for set_level command 2020-06-01 22:04:44 +08:00