Update sync plus vite.
This commit is contained in:
parent
5ef6ab5006
commit
a6b6ac870a
@ -91,8 +91,8 @@ void Connection::sendPacks(SOCKET sock, std::unordered_map<uint64_t, Connection*
|
|||||||
|
|
||||||
outs += out.timestamp + last;
|
outs += out.timestamp + last;
|
||||||
|
|
||||||
if (outs >= 1000) {
|
if (outs >= 200) {
|
||||||
outs -= 1000;
|
outs -= 200;
|
||||||
Sync sync;
|
Sync sync;
|
||||||
sync.hp = player->GetHP();
|
sync.hp = player->GetHP();
|
||||||
sync.timestamp = out.timestamp;
|
sync.timestamp = out.timestamp;
|
||||||
|
@ -1453,8 +1453,8 @@ void Engine::Render(float elapsedTime) {
|
|||||||
cmod_acc += tstamp - last;
|
cmod_acc += tstamp - last;
|
||||||
last = tstamp;
|
last = tstamp;
|
||||||
|
|
||||||
if (sync_acc >= 1000) {
|
if (sync_acc >= 200) {
|
||||||
sync_acc -= 1000;
|
sync_acc -= 200;
|
||||||
sync.sid = id;
|
sync.sid = id;
|
||||||
sync.timestamp = tstamp;
|
sync.timestamp = tstamp;
|
||||||
sync.position = m_player.GetPositionAbs();
|
sync.position = m_player.GetPositionAbs();
|
||||||
@ -1466,9 +1466,9 @@ void Engine::Render(float elapsedTime) {
|
|||||||
m_syncs[sync.timestamp] = sync;
|
m_syncs[sync.timestamp] = sync;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmod_acc >= 3000) {
|
if (cmod_acc >= 2000) {
|
||||||
while (cmod_acc >= 3000)
|
while (cmod_acc >= 2000)
|
||||||
cmod_acc -= 3000;
|
cmod_acc -= 2000;
|
||||||
if (!m_chunkmod_manifest.empty()) {
|
if (!m_chunkmod_manifest.empty()) {
|
||||||
ChunkMod* cmod = m_chunkmod_manifest.front();
|
ChunkMod* cmod = m_chunkmod_manifest.front();
|
||||||
m_chunkmod_manifest.pop_front();
|
m_chunkmod_manifest.pop_front();
|
||||||
@ -1511,7 +1511,7 @@ void Engine::Render(float elapsedTime) {
|
|||||||
Sync comp = m_syncs[sync.timestamp];
|
Sync comp = m_syncs[sync.timestamp];
|
||||||
|
|
||||||
std::cout << sync.hp << std::endl;
|
std::cout << sync.hp << std::endl;
|
||||||
|
m_otherplayerpos = sync.position;
|
||||||
m_player.InflictDamage(sync.hp - comp.hp);
|
m_player.InflictDamage(sync.hp - comp.hp);
|
||||||
|
|
||||||
Vector3f diff = sync.position - comp.position;
|
Vector3f diff = sync.position - comp.position;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user