Commit Graph

17 Commits

Author SHA1 Message Date
Regalis
d0b52d92fe Event ID wraparound fixes 2017-05-02 22:18:36 +03:00
Regalis
06db2fed86 Fixed clients incrementing their lastReceivedID every time they receive an empty entity event (even if the event has already been received) 2017-05-02 22:15:18 +03:00
Regalis
9330bd08de Clients don't switch from init events to normal until they receive the first normal event update (instead of switching when they receive the last init event they know about). Otherwise the client may switch to normal events too early, if the server has created new unique events the client doesn't know about yet. 2017-04-06 21:52:24 +03:00
juanjp600
4ad373294c Update client.UnreceivedEntityEventCount on every event write
I noticed that if the main event IDs went over 10000 and there were more than 450 unique events, the server would sometimes skip the next event the client needed. Sometimes the client would also not realize that the last event it received was the final init event, so it would reject all further events because of a huge ID discrepancy. The init events will likely need to be reworked, but updating UnreceivedEntityEventCount seems to help somewhat.
2017-04-06 12:37:38 -03:00
Regalis
3306a1ab96 EntitySpawner only writes a limited number of entities per packet 2017-03-26 17:19:29 +03:00
Regalis
dfd24045f8 EntityEventManagers send an empty event if the entity doesn't exist anymore when writing the message (may happen, for example, when a client is still waiting for some message about the item when it's destroyed in a deconstructor).
Not sending the events at all would be a better solution, but then we'd need to shift the IDs of all the consecutive events and make sure it doesn't mess anything up with any of the clients. Not necessarily worth the effort, considering how rare these "empty events" are.
2017-03-24 19:12:09 +02:00
juanjp600
ecb7500df9 Converted UInt32 ID's to UInt16
TODO: test everything, make sure nothing broke
2017-03-06 16:25:12 -03:00
Regalis
6c8f5b8999 The server maintains a list of unique EntityEvents created during the round and sends them to clients who join mid-round 2017-02-18 15:09:13 +02:00
Regalis
52bf73722f ServerEntityEventManager doesn't process received events until the character inputs of the client for the corresponding frame have been processed (fixes character movement lagging behind EntityEvents at the servers side)
+ split character networking logic into a separate file, characters drop items at the position of their collider instead of hands
2017-02-09 23:09:42 +02:00
Regalis
ff96f152ce Resetting EntityEvent & EntitySpawner IDs when starting a new round, LOS effect is enabled when a client takes control of a character 2017-01-09 18:22:37 +02:00
Regalis
1eea373117 NetEntityEvent fixes:
- comparing event data equality with Object.Equals instead of == because == returns false for boxed value types
- fixed old unacked messages not being resent if there are newer unacked messages that have been resent less than 1.5 * RTT ago
2017-01-03 20:10:03 +02:00
Regalis
1f454d593e Inventory syncing, objHeader is passed to the ClientRead/ServerRead methods so they can determine how to read the msg (is it an inventory update, position, input, etc) 2016-12-10 16:39:58 +02:00
Regalis
9192dad6ea EntityEventManagers wait for 1.5*roundtriptime before resending messages (less unnecessary resends), skipping to the next event in a packet if an exception is thrown while reading an event 2016-12-09 20:00:41 +02:00
Regalis
e4744e8385 Resetting EventManager IDs when ending the round, NaN/INF check when setting camera position 2016-11-24 20:48:20 +02:00
Regalis
3d234aef73 Sending NetEntityEvents from client to server, ItemComponent class doesn't implement the INetSerializable interfaces (only the derived classes do), reactor syncing 2016-11-13 19:34:23 +02:00
Regalis
498c72c64a Server sends ServerEntityEvents to clients, NetEntityEvents can contain an object array which will be passed to the serializable entity (now only used for ItemComponent indices) 2016-11-13 13:56:48 +02:00
Regalis
c314b37029 Some classes for syncing entity state changes. Similar to the NetworkEvents in the old netcode, but the logic is split into separate classes which prevent the server from reading updates for entities that aren't IClientSerializable.
todo: add NetEntityEventManagers to server & client, some logic to prevent sending events that don't need to be sent (e.g. duplicate event state updates)
2016-11-12 20:56:06 +02:00