SceneReplication.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. //
  2. // Copyright (c) 2008-2014 the Urho3D project.
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. #include <Urho3D/Urho3D.h>
  23. #include <Urho3D/UI/Button.h>
  24. #include <Urho3D/Graphics/Camera.h>
  25. #include <Urho3D/Physics/CollisionShape.h>
  26. #include <Urho3D/Network/Connection.h>
  27. #include <Urho3D/Network/Controls.h>
  28. #include <Urho3D/Core/CoreEvents.h>
  29. #include <Urho3D/UI/Cursor.h>
  30. #include <Urho3D/Engine/Engine.h>
  31. #include <Urho3D/UI/Font.h>
  32. #include <Urho3D/Graphics/Graphics.h>
  33. #include <Urho3D/Input/Input.h>
  34. #include <Urho3D/Graphics/Light.h>
  35. #include <Urho3D/UI/LineEdit.h>
  36. #include <Urho3D/IO/Log.h>
  37. #include <Urho3D/Graphics/Material.h>
  38. #include <Urho3D/Graphics/Model.h>
  39. #include <Urho3D/Network/Network.h>
  40. #include <Urho3D/Network/NetworkEvents.h>
  41. #include <Urho3D/Graphics/Octree.h>
  42. #include <Urho3D/Physics/PhysicsEvents.h>
  43. #include <Urho3D/Physics/PhysicsWorld.h>
  44. #include <Urho3D/Graphics/Renderer.h>
  45. #include <Urho3D/Physics/RigidBody.h>
  46. #include <Urho3D/Resource/ResourceCache.h>
  47. #include <Urho3D/Scene/Scene.h>
  48. #include <Urho3D/Graphics/StaticModel.h>
  49. #include <Urho3D/UI/Text.h>
  50. #include <Urho3D/UI/UI.h>
  51. #include <Urho3D/UI/UIEvents.h>
  52. #include <Urho3D/Resource/XMLFile.h>
  53. #include <Urho3D/Graphics/Zone.h>
  54. #include "SceneReplication.h"
  55. #include <Urho3D/DebugNew.h>
  56. // UDP port we will use
  57. static const unsigned short SERVER_PORT = 2345;
  58. // Identifier for our custom remote event we use to tell the client which object they control
  59. static const StringHash E_CLIENTOBJECTID("ClientObjectID");
  60. // Identifier for the node ID parameter in the event data
  61. static const StringHash P_ID("ID");
  62. // Control bits we define
  63. static const unsigned CTRL_FORWARD = 1;
  64. static const unsigned CTRL_BACK = 2;
  65. static const unsigned CTRL_LEFT = 4;
  66. static const unsigned CTRL_RIGHT = 8;
  67. DEFINE_APPLICATION_MAIN(SceneReplication)
  68. SceneReplication::SceneReplication(Context* context) :
  69. Sample(context)
  70. {
  71. }
  72. void SceneReplication::Start()
  73. {
  74. // Execute base class startup
  75. Sample::Start();
  76. // Create the scene content
  77. CreateScene();
  78. // Create the UI content
  79. CreateUI();
  80. // Setup the viewport for displaying the scene
  81. SetupViewport();
  82. // Hook up to necessary events
  83. SubscribeToEvents();
  84. }
  85. void SceneReplication::CreateScene()
  86. {
  87. scene_ = new Scene(context_);
  88. // Create scene content on the server only
  89. ResourceCache* cache = GetSubsystem<ResourceCache>();
  90. // Create octree and physics world with default settings. Create them as local so that they are not needlessly replicated
  91. // when a client connects
  92. scene_->CreateComponent<Octree>(LOCAL);
  93. scene_->CreateComponent<PhysicsWorld>(LOCAL);
  94. // All static scene content and the camera are also created as local, so that they are unaffected by scene replication and are
  95. // not removed from the client upon connection. Create a Zone component first for ambient lighting & fog control.
  96. Node* zoneNode = scene_->CreateChild("Zone", LOCAL);
  97. Zone* zone = zoneNode->CreateComponent<Zone>();
  98. zone->SetBoundingBox(BoundingBox(-1000.0f, 1000.0f));
  99. zone->SetAmbientColor(Color(0.1f, 0.1f, 0.1f));
  100. zone->SetFogStart(100.0f);
  101. zone->SetFogEnd(300.0f);
  102. // Create a directional light without shadows
  103. Node* lightNode = scene_->CreateChild("DirectionalLight", LOCAL);
  104. lightNode->SetDirection(Vector3(0.5f, -1.0f, 0.5f));
  105. Light* light = lightNode->CreateComponent<Light>();
  106. light->SetLightType(LIGHT_DIRECTIONAL);
  107. light->SetColor(Color(0.2f, 0.2f, 0.2f));
  108. light->SetSpecularIntensity(1.0f);
  109. // Create a "floor" consisting of several tiles. Make the tiles physical but leave small cracks between them
  110. for (int y = -20; y <= 20; ++y)
  111. {
  112. for (int x = -20; x <= 20; ++x)
  113. {
  114. Node* floorNode = scene_->CreateChild("FloorTile", LOCAL);
  115. floorNode->SetPosition(Vector3(x * 20.2f, -0.5f, y * 20.2f));
  116. floorNode->SetScale(Vector3(20.0f, 1.0f, 20.0f));
  117. StaticModel* floorObject = floorNode->CreateComponent<StaticModel>();
  118. floorObject->SetModel(cache->GetResource<Model>("Models/Box.mdl"));
  119. floorObject->SetMaterial(cache->GetResource<Material>("Materials/Stone.xml"));
  120. RigidBody* body = floorNode->CreateComponent<RigidBody>();
  121. body->SetFriction(1.0f);
  122. CollisionShape* shape = floorNode->CreateComponent<CollisionShape>();
  123. shape->SetBox(Vector3::ONE);
  124. }
  125. }
  126. // Create the camera. Limit far clip distance to match the fog
  127. // The camera needs to be created into a local node so that each client can retain its own camera, that is unaffected by
  128. // network messages. Furthermore, because the client removes all replicated scene nodes when connecting to a server scene,
  129. // the screen would become blank if the camera node was replicated (as only the locally created camera is assigned to a
  130. // viewport in SetupViewports() below)
  131. cameraNode_ = scene_->CreateChild("Camera", LOCAL);
  132. Camera* camera = cameraNode_->CreateComponent<Camera>();
  133. camera->SetFarClip(300.0f);
  134. // Set an initial position for the camera scene node above the plane
  135. cameraNode_->SetPosition(Vector3(0.0f, 5.0f, 0.0f));
  136. }
  137. void SceneReplication::CreateUI()
  138. {
  139. ResourceCache* cache = GetSubsystem<ResourceCache>();
  140. UI* ui = GetSubsystem<UI>();
  141. UIElement* root = ui->GetRoot();
  142. XMLFile* uiStyle = cache->GetResource<XMLFile>("UI/DefaultStyle.xml");
  143. // Set style to the UI root so that elements will inherit it
  144. root->SetDefaultStyle(uiStyle);
  145. // Create a Cursor UI element because we want to be able to hide and show it at will. When hidden, the mouse cursor will
  146. // control the camera, and when visible, it can interact with the login UI
  147. SharedPtr<Cursor> cursor(new Cursor(context_));
  148. cursor->SetStyleAuto(uiStyle);
  149. ui->SetCursor(cursor);
  150. // Set starting position of the cursor at the rendering window center
  151. Graphics* graphics = GetSubsystem<Graphics>();
  152. cursor->SetPosition(graphics->GetWidth() / 2, graphics->GetHeight() / 2);
  153. // Construct the instructions text element
  154. instructionsText_ = ui->GetRoot()->CreateChild<Text>();
  155. instructionsText_->SetText(
  156. "Use WASD keys to move and RMB to rotate view"
  157. );
  158. instructionsText_->SetFont(cache->GetResource<Font>("Fonts/Anonymous Pro.ttf"), 15);
  159. // Position the text relative to the screen center
  160. instructionsText_->SetHorizontalAlignment(HA_CENTER);
  161. instructionsText_->SetVerticalAlignment(VA_CENTER);
  162. instructionsText_->SetPosition(0, graphics->GetHeight() / 4);
  163. // Hide until connected
  164. instructionsText_->SetVisible(false);
  165. buttonContainer_ = root->CreateChild<UIElement>();
  166. buttonContainer_->SetFixedSize(500, 20);
  167. buttonContainer_->SetPosition(20, 20);
  168. buttonContainer_->SetLayoutMode(LM_HORIZONTAL);
  169. textEdit_ = buttonContainer_->CreateChild<LineEdit>();
  170. textEdit_->SetStyleAuto();
  171. connectButton_ = CreateButton("Connect", 90);
  172. disconnectButton_ = CreateButton("Disconnect", 100);
  173. startServerButton_ = CreateButton("Start Server", 110);
  174. UpdateButtons();
  175. }
  176. void SceneReplication::SetupViewport()
  177. {
  178. Renderer* renderer = GetSubsystem<Renderer>();
  179. // Set up a viewport to the Renderer subsystem so that the 3D scene can be seen
  180. SharedPtr<Viewport> viewport(new Viewport(context_, scene_, cameraNode_->GetComponent<Camera>()));
  181. renderer->SetViewport(0, viewport);
  182. }
  183. void SceneReplication::SubscribeToEvents()
  184. {
  185. // Subscribe to fixed timestep physics updates for setting or applying controls
  186. SubscribeToEvent(E_PHYSICSPRESTEP, HANDLER(SceneReplication, HandlePhysicsPreStep));
  187. // Subscribe HandlePostUpdate() method for processing update events. Subscribe to PostUpdate instead
  188. // of the usual Update so that physics simulation has already proceeded for the frame, and can
  189. // accurately follow the object with the camera
  190. SubscribeToEvent(E_POSTUPDATE, HANDLER(SceneReplication, HandlePostUpdate));
  191. // Subscribe to button actions
  192. SubscribeToEvent(connectButton_, E_RELEASED, HANDLER(SceneReplication, HandleConnect));
  193. SubscribeToEvent(disconnectButton_, E_RELEASED, HANDLER(SceneReplication, HandleDisconnect));
  194. SubscribeToEvent(startServerButton_, E_RELEASED, HANDLER(SceneReplication, HandleStartServer));
  195. // Subscribe to network events
  196. SubscribeToEvent(E_SERVERCONNECTED, HANDLER(SceneReplication, HandleConnectionStatus));
  197. SubscribeToEvent(E_SERVERDISCONNECTED, HANDLER(SceneReplication, HandleConnectionStatus));
  198. SubscribeToEvent(E_CONNECTFAILED, HANDLER(SceneReplication, HandleConnectionStatus));
  199. SubscribeToEvent(E_CLIENTCONNECTED, HANDLER(SceneReplication, HandleClientConnected));
  200. SubscribeToEvent(E_CLIENTDISCONNECTED, HANDLER(SceneReplication, HandleClientDisconnected));
  201. // This is a custom event, sent from the server to the client. It tells the node ID of the object the client should control
  202. SubscribeToEvent(E_CLIENTOBJECTID, HANDLER(SceneReplication, HandleClientObjectID));
  203. // Events sent between client & server (remote events) must be explicitly registered or else they are not allowed to be received
  204. GetSubsystem<Network>()->RegisterRemoteEvent(E_CLIENTOBJECTID);
  205. }
  206. Button* SceneReplication::CreateButton(const String& text, int width)
  207. {
  208. ResourceCache* cache = GetSubsystem<ResourceCache>();
  209. Font* font = cache->GetResource<Font>("Fonts/Anonymous Pro.ttf");
  210. Button* button = buttonContainer_->CreateChild<Button>();
  211. button->SetStyleAuto();
  212. button->SetFixedWidth(width);
  213. Text* buttonText = button->CreateChild<Text>();
  214. buttonText->SetFont(font, 12);
  215. buttonText->SetAlignment(HA_CENTER, VA_CENTER);
  216. buttonText->SetText(text);
  217. return button;
  218. }
  219. void SceneReplication::UpdateButtons()
  220. {
  221. Network* network = GetSubsystem<Network>();
  222. Connection* serverConnection = network->GetServerConnection();
  223. bool serverRunning = network->IsServerRunning();
  224. // Show and hide buttons so that eg. Connect and Disconnect are never shown at the same time
  225. connectButton_->SetVisible(!serverConnection && !serverRunning);
  226. disconnectButton_->SetVisible(serverConnection || serverRunning);
  227. startServerButton_->SetVisible(!serverConnection && !serverRunning);
  228. textEdit_->SetVisible(!serverConnection && !serverRunning);
  229. }
  230. Node* SceneReplication::CreateControllableObject()
  231. {
  232. ResourceCache* cache = GetSubsystem<ResourceCache>();
  233. // Create the scene node & visual representation. This will be a replicated object
  234. Node* ballNode = scene_->CreateChild("Ball");
  235. ballNode->SetPosition(Vector3(Random(40.0f) - 20.0f, 5.0f, Random(40.0f) - 20.0f));
  236. ballNode->SetScale(0.5f);
  237. StaticModel* ballObject = ballNode->CreateComponent<StaticModel>();
  238. ballObject->SetModel(cache->GetResource<Model>("Models/Sphere.mdl"));
  239. ballObject->SetMaterial(cache->GetResource<Material>("Materials/StoneSmall.xml"));
  240. // Create the physics components
  241. RigidBody* body = ballNode->CreateComponent<RigidBody>();
  242. body->SetMass(1.0f);
  243. body->SetFriction(1.0f);
  244. // In addition to friction, use motion damping so that the ball can not accelerate limitlessly
  245. body->SetLinearDamping(0.5f);
  246. body->SetAngularDamping(0.5f);
  247. CollisionShape* shape = ballNode->CreateComponent<CollisionShape>();
  248. shape->SetSphere(1.0f);
  249. // Create a random colored point light at the ball so that can see better where is going
  250. Light* light = ballNode->CreateComponent<Light>();
  251. light->SetRange(3.0f);
  252. light->SetColor(Color(0.5f + (Rand() & 1) * 0.5f, 0.5f + (Rand() & 1) * 0.5f, 0.5f + (Rand() & 1) * 0.5f));
  253. return ballNode;
  254. }
  255. void SceneReplication::MoveCamera()
  256. {
  257. // Right mouse button controls mouse cursor visibility: hide when pressed
  258. UI* ui = GetSubsystem<UI>();
  259. Input* input = GetSubsystem<Input>();
  260. ui->GetCursor()->SetVisible(!input->GetMouseButtonDown(MOUSEB_RIGHT));
  261. // Mouse sensitivity as degrees per pixel
  262. const float MOUSE_SENSITIVITY = 0.1f;
  263. // Use this frame's mouse motion to adjust camera node yaw and pitch. Clamp the pitch and only move the camera
  264. // when the cursor is hidden
  265. if (!ui->GetCursor()->IsVisible())
  266. {
  267. IntVector2 mouseMove = input->GetMouseMove();
  268. yaw_ += MOUSE_SENSITIVITY * mouseMove.x_;
  269. pitch_ += MOUSE_SENSITIVITY * mouseMove.y_;
  270. pitch_ = Clamp(pitch_, 1.0f, 90.0f);
  271. }
  272. // Construct new orientation for the camera scene node from yaw and pitch. Roll is fixed to zero
  273. cameraNode_->SetRotation(Quaternion(pitch_, yaw_, 0.0f));
  274. // Only move the camera / show instructions if we have a controllable object
  275. bool showInstructions = false;
  276. if (clientObjectID_)
  277. {
  278. Node* ballNode = scene_->GetNode(clientObjectID_);
  279. if (ballNode)
  280. {
  281. const float CAMERA_DISTANCE = 5.0f;
  282. // Move camera some distance away from the ball
  283. cameraNode_->SetPosition(ballNode->GetPosition() + cameraNode_->GetRotation() * Vector3::BACK * CAMERA_DISTANCE);
  284. showInstructions = true;
  285. }
  286. }
  287. instructionsText_->SetVisible(showInstructions);
  288. }
  289. void SceneReplication::HandlePostUpdate(StringHash eventType, VariantMap& eventData)
  290. {
  291. // We only rotate the camera according to mouse movement since last frame, so do not need the time step
  292. MoveCamera();
  293. }
  294. void SceneReplication::HandlePhysicsPreStep(StringHash eventType, VariantMap& eventData)
  295. {
  296. // This function is different on the client and server. The client collects controls (WASD controls + yaw angle)
  297. // and sets them to its server connection object, so that they will be sent to the server automatically at a
  298. // fixed rate, by default 30 FPS. The server will actually apply the controls (authoritative simulation.)
  299. Network* network = GetSubsystem<Network>();
  300. Connection* serverConnection = network->GetServerConnection();
  301. // Client: collect controls
  302. if (serverConnection)
  303. {
  304. UI* ui = GetSubsystem<UI>();
  305. Input* input = GetSubsystem<Input>();
  306. Controls controls;
  307. // Copy mouse yaw
  308. controls.yaw_ = yaw_;
  309. // Only apply WASD controls if there is no focused UI element
  310. if (!ui->GetFocusElement())
  311. {
  312. controls.Set(CTRL_FORWARD, input->GetKeyDown('W'));
  313. controls.Set(CTRL_BACK, input->GetKeyDown('S'));
  314. controls.Set(CTRL_LEFT, input->GetKeyDown('A'));
  315. controls.Set(CTRL_RIGHT, input->GetKeyDown('D'));
  316. }
  317. serverConnection->SetControls(controls);
  318. // In case the server wants to do position-based interest management using the NetworkPriority components, we should also
  319. // tell it our observer (camera) position. In this sample it is not in use, but eg. the NinjaSnowWar game uses it
  320. serverConnection->SetPosition(cameraNode_->GetPosition());
  321. }
  322. // Server: apply controls to client objects
  323. else if (network->IsServerRunning())
  324. {
  325. const Vector<SharedPtr<Connection> >& connections = network->GetClientConnections();
  326. for (unsigned i = 0; i < connections.Size(); ++i)
  327. {
  328. Connection* connection = connections[i];
  329. // Get the object this connection is controlling
  330. Node* ballNode = serverObjects_[connection];
  331. if (!ballNode)
  332. continue;
  333. RigidBody* body = ballNode->GetComponent<RigidBody>();
  334. // Get the last controls sent by the client
  335. const Controls& controls = connection->GetControls();
  336. // Torque is relative to the forward vector
  337. Quaternion rotation(0.0f, controls.yaw_, 0.0f);
  338. const float MOVE_TORQUE = 3.0f;
  339. // Movement torque is applied before each simulation step, which happen at 60 FPS. This makes the simulation
  340. // independent from rendering framerate. We could also apply forces (which would enable in-air control),
  341. // but want to emphasize that it's a ball which should only control its motion by rolling along the ground
  342. if (controls.buttons_ & CTRL_FORWARD)
  343. body->ApplyTorque(rotation * Vector3::RIGHT * MOVE_TORQUE);
  344. if (controls.buttons_ & CTRL_BACK)
  345. body->ApplyTorque(rotation * Vector3::LEFT * MOVE_TORQUE);
  346. if (controls.buttons_ & CTRL_LEFT)
  347. body->ApplyTorque(rotation * Vector3::FORWARD * MOVE_TORQUE);
  348. if (controls.buttons_ & CTRL_RIGHT)
  349. body->ApplyTorque(rotation * Vector3::BACK * MOVE_TORQUE);
  350. }
  351. }
  352. }
  353. void SceneReplication::HandleConnect(StringHash eventType, VariantMap& eventData)
  354. {
  355. Network* network = GetSubsystem<Network>();
  356. String address = textEdit_->GetText().Trimmed();
  357. if (address.Empty())
  358. address = "localhost"; // Use localhost to connect if nothing else specified
  359. // Connect to server, specify scene to use as a client for replication
  360. clientObjectID_ = 0; // Reset own object ID from possible previous connection
  361. network->Connect(address, SERVER_PORT, scene_);
  362. UpdateButtons();
  363. }
  364. void SceneReplication::HandleDisconnect(StringHash eventType, VariantMap& eventData)
  365. {
  366. Network* network = GetSubsystem<Network>();
  367. Connection* serverConnection = network->GetServerConnection();
  368. // If we were connected to server, disconnect. Or if we were running a server, stop it. In both cases clear the
  369. // scene of all replicated content, but let the local nodes & components (the static world + camera) stay
  370. if (serverConnection)
  371. {
  372. serverConnection->Disconnect();
  373. scene_->Clear(true, false);
  374. clientObjectID_ = 0;
  375. }
  376. // Or if we were running a server, stop it
  377. else if (network->IsServerRunning())
  378. {
  379. network->StopServer();
  380. scene_->Clear(true, false);
  381. }
  382. UpdateButtons();
  383. }
  384. void SceneReplication::HandleStartServer(StringHash eventType, VariantMap& eventData)
  385. {
  386. Network* network = GetSubsystem<Network>();
  387. network->StartServer(SERVER_PORT);
  388. UpdateButtons();
  389. }
  390. void SceneReplication::HandleConnectionStatus(StringHash eventType, VariantMap& eventData)
  391. {
  392. UpdateButtons();
  393. }
  394. void SceneReplication::HandleClientConnected(StringHash eventType, VariantMap& eventData)
  395. {
  396. using namespace ClientConnected;
  397. // When a client connects, assign to scene to begin scene replication
  398. Connection* newConnection = static_cast<Connection*>(eventData[P_CONNECTION].GetPtr());
  399. newConnection->SetScene(scene_);
  400. // Then create a controllable object for that client
  401. Node* newObject = CreateControllableObject();
  402. serverObjects_[newConnection] = newObject;
  403. // Finally send the object's node ID using a remote event
  404. VariantMap remoteEventData;
  405. remoteEventData[P_ID] = newObject->GetID();
  406. newConnection->SendRemoteEvent(E_CLIENTOBJECTID, true, remoteEventData);
  407. }
  408. void SceneReplication::HandleClientDisconnected(StringHash eventType, VariantMap& eventData)
  409. {
  410. using namespace ClientConnected;
  411. // When a client disconnects, remove the controlled object
  412. Connection* connection = static_cast<Connection*>(eventData[P_CONNECTION].GetPtr());
  413. Node* object = serverObjects_[connection];
  414. if (object)
  415. object->Remove();
  416. serverObjects_.Erase(connection);
  417. }
  418. void SceneReplication::HandleClientObjectID(StringHash eventType, VariantMap& eventData)
  419. {
  420. clientObjectID_ = eventData[P_ID].GetUInt();
  421. }