# HG changeset patch # User kazz # Date 1275740605 -32400 # Node ID 8c78d15ea9993e00ac0e21613634ce825238832a # Parent dbcfa04ee4db059003d366ccacdd74a630a947e9 replace rd() to wait_rd(). and if reply of wait_rd() is NULL, client request one more rd(). for wait_rd() cannot get last changed tuple. diff -r dbcfa04ee4db -r 8c78d15ea999 Renderer/Engine/SceneGraph.h --- a/Renderer/Engine/SceneGraph.h Fri Jun 04 09:01:00 2010 +0900 +++ b/Renderer/Engine/SceneGraph.h Sat Jun 05 21:23:25 2010 +0900 @@ -32,7 +32,7 @@ int id; // Objectのシーケンス番号(Linda) // とりあえず動かしたいので追加 - int seq, resend_flag; + int seq, seq_rd, resend_flag; int property_size; void *propertyptr; diff -r dbcfa04ee4db -r 8c78d15ea999 Renderer/Test/dynamic_create.cc --- a/Renderer/Test/dynamic_create.cc Fri Jun 04 09:01:00 2010 +0900 +++ b/Renderer/Test/dynamic_create.cc Sat Jun 05 21:23:25 2010 +0900 @@ -94,12 +94,24 @@ { SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; // LindaServerから座標データを取得してオブジェクトに反映させる。 + + if (!node->resend_flag || node->seq_rd != node->seq) { + unsigned char *reply_rd = psx_reply(node->seq_rd); + if (reply_rd != NULL) { + set_position(node, reply_rd); + free(reply_rd); + return; + } + } unsigned char *reply = psx_reply(node->seq); if (reply != NULL) { set_position(node, reply); free(reply); -// node->seq = psx_wait_rd(sgroot->tid, node->id * 10 + 1); - node->seq = psx_rd(sgroot->tid, node->id * 10 + 1); + node->seq = psx_wait_rd(sgroot->tid, node->id * 10 + 1); + node->resend_flag = true; + } else if (node->resend_flag) { + node->seq_rd = psx_rd(sgroot->tid, node->id * 10 + 1); + node->resend_flag = false; } } @@ -119,9 +131,9 @@ sgroot->createFromXMLmemory(sgroot->tmanager, child, (char *)data, len); child->set_move_collision(moon_move, moon_collision); child->id = serial_id; -// child->seq = psx_wait_rd(sgroot->tid, serial_id * 10 + 1); - child->seq = psx_rd(sgroot->tid, serial_id * 10 + 1); - + child->seq = psx_wait_rd(sgroot->tid, serial_id * 10 + 1); + child->seq_rd = psx_rd(sgroot->tid, serial_id * 10 + 1); + child->resend_flag = false; return child; }