Sirse / MineFantasyII-Cont

Unofficial MineFantasy II repository
GNU General Public License v3.0
16 stars 17 forks source link

Constant TileEntity synchronization #5

Closed Sirse closed 7 years ago

Sirse commented 7 years ago

Constant Server>Client synchronization: every second most TE sends own custom update packet. Custom packets are better solution than using getDescriptionPacket and onDataPacket methods (reduced packet size), but in MF they are used for dirty things. That causes REALLY huge traffic/bandwidth usage (about 1.8TB outgoing traffic per mouth and 4mb/sec of bandwidth).

Sync should be runned only on TE's condition change (e.g: when player adds fuel to firepit). All time calculations should be double-sided (on client for tooltips and GUIs and on server for data validation).

Referenced issue: https://github.com/AnonymousProductions/MineFantasyII-Cont/issues/9

Sorry me my bad english, i'm russian.

Sirse commented 7 years ago

0d34211b8464fbed 1e61415fd1ed989e_censored

Yesterday17 commented 7 years ago

Another report here~ Great improvement compared with the former version, hope to optimize further. A serious problem is that its packets are almost empty(with about 20% of space used), so it's here you can also do efforts to make it better.

Sirse commented 7 years ago

@yesterday17, "empty" packets, if i correctly understand you, are size optimization. MF uses custom TEUpdate packets to reduce their size, it sends only changed values, but sends messages every second.

Yesterday17 commented 7 years ago

Sure, just like this: tra The dots are 0 in packets and you can see there're too many space not used but sent in packet, which used great amount of network resource.

Sirse commented 7 years ago

Should be fixed via https://github.com/Sirse/MineFantasyII-Cont/pull/8 pull request. Thx to @yesterday17, i know about PlayerManager's methods getPlayersWatchingChunk and sendToAllWatching, but don't know about Railcraft workaround.

Yesterday17 commented 7 years ago

@Sirse Sadly, #8 only reduced the packet sending, but didn't do anything about the packet itself. The structure of the packet still has some problems, and i don't know much about this...