Browse Source

Updated to latest kNet.
Editor script fixes.
Fixed loading resources from script.
Fixed crashes when handling events from objects that subsequently get destroyed.
Fixed not being able to load elements of type UIElement from xml layouts.

Lasse Öörni 14 years ago
parent
commit
f1bb8bd2ba
90 changed files with 204 additions and 177 deletions
  1. 10 10
      Bin/Data/Scripts/Editor/EditorCamera.as
  2. 2 3
      Bin/Data/Scripts/Editor/EditorNodeWindow.as
  3. 8 5
      Bin/Data/Scripts/Editor/EditorScene.as
  4. 4 4
      Bin/Data/Scripts/Editor/EditorSceneWindow.as
  5. 7 7
      Bin/Data/Scripts/Editor/EditorUI.as
  6. 2 2
      Bin/Data/Scripts/TestScene.as
  7. 2 2
      Bin/Data/UI/EditorSettingsDialog.xml
  8. 3 3
      Bin/Data/UI/SceneWindow.xml
  9. 1 1
      Docs/Reference.dox
  10. 21 19
      Engine/Core/Object.cpp
  11. 2 2
      Engine/Engine/ResourceAPI.cpp
  12. 1 0
      Engine/Resource/ResourceCache.cpp
  13. 16 16
      Engine/Scene/Node.cpp
  14. 2 2
      Engine/Scene/Node.h
  15. 4 2
      Engine/UI/ListView.cpp
  16. 6 0
      Engine/UI/UI.cpp
  17. 1 1
      Engine/UI/UIElement.h
  18. 5 5
      ThirdParty/kNet/CMakeLists.txt
  19. 28 1
      ThirdParty/kNet/README.txt
  20. 2 3
      ThirdParty/kNet/include/kNet.h
  21. 1 1
      ThirdParty/kNet/include/kNet/Alignment.h
  22. 1 1
      ThirdParty/kNet/include/kNet/Allocator.h
  23. 1 1
      ThirdParty/kNet/include/kNet/Array.h
  24. 1 1
      ThirdParty/kNet/include/kNet/Atomics.h
  25. 1 1
      ThirdParty/kNet/include/kNet/BasicSerializedDataTypes.h
  26. 1 1
      ThirdParty/kNet/include/kNet/BitOps.h
  27. 1 1
      ThirdParty/kNet/include/kNet/Clock.h
  28. 1 1
      ThirdParty/kNet/include/kNet/DataDeserializer.h
  29. 1 1
      ThirdParty/kNet/include/kNet/DataSerializer.h
  30. 1 1
      ThirdParty/kNet/include/kNet/Datagram.h
  31. 1 1
      ThirdParty/kNet/include/kNet/DebugMemoryLeakCheck.h
  32. 1 1
      ThirdParty/kNet/include/kNet/EndPoint.h
  33. 1 1
      ThirdParty/kNet/include/kNet/Event.h
  34. 1 1
      ThirdParty/kNet/include/kNet/EventArray.h
  35. 1 1
      ThirdParty/kNet/include/kNet/FragmentedTransferManager.h
  36. 1 1
      ThirdParty/kNet/include/kNet/IMessageHandler.h
  37. 1 1
      ThirdParty/kNet/include/kNet/INetworkServerListener.h
  38. 1 1
      ThirdParty/kNet/include/kNet/LockFreePoolAllocator.h
  39. 1 1
      ThirdParty/kNet/include/kNet/Lockable.h
  40. 1 1
      ThirdParty/kNet/include/kNet/MaxHeap.h
  41. 1 1
      ThirdParty/kNet/include/kNet/MessageConnection.h
  42. 1 1
      ThirdParty/kNet/include/kNet/MessageListParser.h
  43. 1 1
      ThirdParty/kNet/include/kNet/NetException.h
  44. 1 1
      ThirdParty/kNet/include/kNet/Network.h
  45. 1 1
      ThirdParty/kNet/include/kNet/NetworkLogging.h
  46. 1 1
      ThirdParty/kNet/include/kNet/NetworkMessage.h
  47. 1 1
      ThirdParty/kNet/include/kNet/NetworkServer.h
  48. 1 1
      ThirdParty/kNet/include/kNet/NetworkWorkerThread.h
  49. 1 1
      ThirdParty/kNet/include/kNet/OrderedHashTable.h
  50. 1 1
      ThirdParty/kNet/include/kNet/PolledTimer.h
  51. 1 1
      ThirdParty/kNet/include/kNet/RingBuffer.h
  52. 1 1
      ThirdParty/kNet/include/kNet/SequentialIntegerSet.h
  53. 1 1
      ThirdParty/kNet/include/kNet/SerializationStructCompiler.h
  54. 1 1
      ThirdParty/kNet/include/kNet/SerializedDataIterator.h
  55. 1 1
      ThirdParty/kNet/include/kNet/SharedPtr.h
  56. 1 1
      ThirdParty/kNet/include/kNet/SharedPtr.inl
  57. 1 1
      ThirdParty/kNet/include/kNet/Socket.h
  58. 1 1
      ThirdParty/kNet/include/kNet/Sort.h
  59. 1 1
      ThirdParty/kNet/include/kNet/Sort.inl
  60. 1 1
      ThirdParty/kNet/include/kNet/SortCmp.h
  61. 1 1
      ThirdParty/kNet/include/kNet/StatsEventHierarchy.h
  62. 1 1
      ThirdParty/kNet/include/kNet/StdCMallocHeap.h
  63. 1 1
      ThirdParty/kNet/include/kNet/TCPMessageConnection.h
  64. 1 1
      ThirdParty/kNet/include/kNet/Thread.h
  65. 1 1
      ThirdParty/kNet/include/kNet/Types.h
  66. 1 3
      ThirdParty/kNet/include/kNet/UDPMessageConnection.h
  67. 1 1
      ThirdParty/kNet/include/kNet/VLEPacker.h
  68. 1 1
      ThirdParty/kNet/include/kNet/WaitFreeQueue.h
  69. 1 1
      ThirdParty/kNet/include/kNet/win32/WS2Include.h
  70. 2 3
      ThirdParty/kNet/include/kNetFwd.h
  71. 1 1
      ThirdParty/kNet/src/DataDeserializer.cpp
  72. 1 1
      ThirdParty/kNet/src/DataSerializer.cpp
  73. 1 1
      ThirdParty/kNet/src/FragmentedTransferManager.cpp
  74. 1 1
      ThirdParty/kNet/src/MessageConnection.cpp
  75. 1 1
      ThirdParty/kNet/src/MessageListParser.cpp
  76. 1 1
      ThirdParty/kNet/src/Network.cpp
  77. 1 1
      ThirdParty/kNet/src/NetworkLogging.cpp
  78. 1 1
      ThirdParty/kNet/src/NetworkMessage.cpp
  79. 1 1
      ThirdParty/kNet/src/NetworkServer.cpp
  80. 1 1
      ThirdParty/kNet/src/NetworkWorkerThread.cpp
  81. 1 1
      ThirdParty/kNet/src/SerializationStructCompiler.cpp
  82. 1 1
      ThirdParty/kNet/src/SerializedDataIterator.cpp
  83. 1 1
      ThirdParty/kNet/src/Socket.cpp
  84. 1 1
      ThirdParty/kNet/src/TCPMessageConnection.cpp
  85. 1 1
      ThirdParty/kNet/src/Thread.cpp
  86. 7 16
      ThirdParty/kNet/src/UDPMessageConnection.cpp
  87. 1 1
      ThirdParty/kNet/src/win32/W32Clock.cpp
  88. 1 1
      ThirdParty/kNet/src/win32/W32Event.cpp
  89. 1 1
      ThirdParty/kNet/src/win32/W32EventArray.cpp
  90. 1 1
      ThirdParty/kNet/src/win32/W32Thread.cpp

+ 10 - 10
Bin/Data/Scripts/Editor/EditorCamera.as

@@ -198,7 +198,7 @@ void EditRotateStep(StringHash eventType, VariantMap& eventData)
         edit.text = String(rotateStep);
         edit.text = String(rotateStep);
 }
 }
 
 
-void editScaleStep(StringHash eventType, VariantMap& eventData)
+void EditScaleStep(StringHash eventType, VariantMap& eventData)
 {
 {
     LineEdit@ edit = eventData["Element"].GetUIElement();
     LineEdit@ edit = eventData["Element"].GetUIElement();
     scaleStep = Max(edit.text.ToFloat(), 0.0);
     scaleStep = Max(edit.text.ToFloat(), 0.0);
@@ -212,19 +212,19 @@ void EditMoveSnap(StringHash eventType, VariantMap& eventData)
     moveSnap = edit.checked;
     moveSnap = edit.checked;
 }
 }
 
 
-void editRotateSnap(StringHash eventType, VariantMap& eventData)
+void EditRotateSnap(StringHash eventType, VariantMap& eventData)
 {
 {
     CheckBox@ edit = eventData["Element"].GetUIElement();
     CheckBox@ edit = eventData["Element"].GetUIElement();
     rotateSnap = edit.checked;
     rotateSnap = edit.checked;
 }
 }
 
 
-void editScaleSnap(StringHash eventType, VariantMap& eventData)
+void EditScaleSnap(StringHash eventType, VariantMap& eventData)
 {
 {
     CheckBox@ edit = eventData["Element"].GetUIElement();
     CheckBox@ edit = eventData["Element"].GetUIElement();
     scaleSnap = edit.checked;
     scaleSnap = edit.checked;
 }
 }
 
 
-void editUseLocalIDs(StringHash eventType, VariantMap& eventData)
+void EditUseLocalIDs(StringHash eventType, VariantMap& eventData)
 {
 {
     CheckBox@ edit = eventData["Element"].GetUIElement();
     CheckBox@ edit = eventData["Element"].GetUIElement();
     useLocalIDs = edit.checked;
     useLocalIDs = edit.checked;
@@ -232,11 +232,11 @@ void editUseLocalIDs(StringHash eventType, VariantMap& eventData)
 
 
 void CreateStatsBar()
 void CreateStatsBar()
 {
 {
-    Font@ font = cache.GetResource("Font", "cour.ttf");
-    
+    Font@ font = cache.GetResource("Font", "Fonts/Anonymous Pro.ttf");
+
     renderStatsText = Text();
     renderStatsText = Text();
     cameraPosText = Text();
     cameraPosText = Text();
-    
+
     if (ui.root.width >= 1024)
     if (ui.root.width >= 1024)
     {
     {
         SetupStatsBarText(renderStatsText, font, 0, 20, HA_LEFT);
         SetupStatsBarText(renderStatsText, font, 0, 20, HA_LEFT);
@@ -253,7 +253,7 @@ void SetupStatsBarText(Text@ text, Font@ font, int x, int y, HorizontalAlignment
 {
 {
     text.position = IntVector2(x, y);
     text.position = IntVector2(x, y);
     text.horizontalAlignment = align;
     text.horizontalAlignment = align;
-    text.SetFont(font, 9);
+    text.SetFont(font, 11);
     text.color = Color(1, 1, 0);
     text.color = Color(1, 1, 0);
     text.priority = -100;
     text.priority = -100;
     ui.root.AddChild(text);
     ui.root.AddChild(text);
@@ -266,8 +266,8 @@ void UpdateStats(float timeStep)
         " Batches: " + renderer.numBatches +
         " Batches: " + renderer.numBatches +
         " Lights: " + renderer.numLights[true] +
         " Lights: " + renderer.numLights[true] +
         " Shadowmaps: " + renderer.numShadowMaps[true] +
         " Shadowmaps: " + renderer.numShadowMaps[true] +
-        " Occluders: " + renderer.numOccluders[true] + renderer.numShadowOccluders[true]);
-    
+        " Occluders: " + renderer.numOccluders[true] + " / " + renderer.numShadowOccluders[true]);
+
     Vector3 cameraPos = cameraNode.position;
     Vector3 cameraPos = cameraNode.position;
     String xText(cameraPos.x);
     String xText(cameraPos.x);
     String yText(cameraPos.y);
     String yText(cameraPos.y);

+ 2 - 3
Bin/Data/Scripts/Editor/EditorNodeWindow.as

@@ -83,9 +83,8 @@ void CreateNodeWindow()
     resourceEditors.push(ResourceEditorData("ScriptInstance", "script", "name", "ScriptFile", ".as"));
     resourceEditors.push(ResourceEditorData("ScriptInstance", "script", "name", "ScriptFile", ".as"));
     resourceEditors.push(ResourceEditorData("ParticleEmitter", "emitter", "name", "XMLFile", ".xml"));
     resourceEditors.push(ResourceEditorData("ParticleEmitter", "emitter", "name", "XMLFile", ".xml"));
 
 
-    subscribeToEvent(nodeWindow.getChild("CloseButton", true), "Released", "hideNodeWindow");
-    subscribeToEvent(nodeWindow.getChild("EntityNameEdit", true), "TextFinished", "editEntityName");
-    subscribeToEvent(nodeWindow.getChild("ComponentNameEdit", true), "TextFinished", "editComponentName");
+    subscribeToEvent(nodeWindow.getChild("CloseButton", true), "Released", "HideNodeWindow");
+    subscribeToEvent(nodeWindow.getChild("NodeNameEdit", true), "TextFinished", "EditNodeName");
     */
     */
 }
 }
 
 

+ 8 - 5
Bin/Data/Scripts/Editor/EditorScene.as

@@ -140,7 +140,7 @@ void ReloadResources()
         cache.ReloadResource(sceneResources[i]);
         cache.ReloadResource(sceneResources[i]);
 }
 }
 
 
-void LoadScene(String fileName)
+void LoadScene(const String&in fileName)
 {
 {
     // Always load the scene from the filesystem, not from resource paths
     // Always load the scene from the filesystem, not from resource paths
     if (!fileSystem.FileExists(fileName))
     if (!fileSystem.FileExists(fileName))
@@ -149,6 +149,10 @@ void LoadScene(String fileName)
         return;
         return;
     }
     }
 
 
+    File file(fileName, FILE_READ);
+    if (!file.open)
+        return;
+
     // Clear the old scene
     // Clear the old scene
     selectedComponent = null;
     selectedComponent = null;
     selectedNode = null;
     selectedNode = null;
@@ -157,13 +161,12 @@ void LoadScene(String fileName)
     // Add the new resource path
     // Add the new resource path
     SetResourcePath(cache.GetPreferredResourceDir(GetPath(fileName)));
     SetResourcePath(cache.GetPreferredResourceDir(GetPath(fileName)));
 
 
-    File file(fileName, FILE_READ);
     String extension = GetExtension(fileName);
     String extension = GetExtension(fileName);
     if (extension != ".xml")
     if (extension != ".xml")
         editorScene.Load(file);
         editorScene.Load(file);
     else
     else
         editorScene.LoadXML(file);
         editorScene.LoadXML(file);
-    
+
     sceneFileName = fileName;
     sceneFileName = fileName;
     sceneModified = false;
     sceneModified = false;
     runPhysics = false;
     runPhysics = false;
@@ -173,7 +176,7 @@ void LoadScene(String fileName)
     ResetCamera();
     ResetCamera();
 }
 }
 
 
-void SaveScene(String fileName)
+void SaveScene(const String&in fileName)
 {
 {
     if (fileName.empty || GetFileName(fileName).empty)
     if (fileName.empty || GetFileName(fileName).empty)
         return;
         return;
@@ -267,7 +270,7 @@ void ScenePostRenderUpdate()
     SceneRaycast(false);
     SceneRaycast(false);
 }
 }
 
 
-void sceneMouseClick()
+void SceneMouseClick()
 {
 {
     SceneRaycast(true);
     SceneRaycast(true);
 }
 }

+ 4 - 4
Bin/Data/Scripts/Editor/EditorSceneWindow.as

@@ -42,9 +42,9 @@ void CreateSceneWindow()
         newComponentList.AddItem(choice);
         newComponentList.AddItem(choice);
     }
     }
 
 
-    SubscribeToEvent(sceneWindow.GetChild("CloseButton", true), "Released", "hideSceneWindow");
-    SubscribeToEvent(sceneWindow.GetChild("ExpandAllButton", true), "Released", "expandSceneHierarchy");
-    SubscribeToEvent(sceneWindow.GetChild("CollapseAllButton", true), "Released", "collapseSceneHierarchy");
+    SubscribeToEvent(sceneWindow.GetChild("CloseButton", true), "Released", "HideSceneWindow");
+    SubscribeToEvent(sceneWindow.GetChild("ExpandAllButton", true), "Released", "ExpandSceneHierarchy");
+    SubscribeToEvent(sceneWindow.GetChild("CollapseAllButton", true), "Released", "CollapseSceneHierarchy");
     SubscribeToEvent(sceneWindow.GetChild("NodeList", true), "ItemSelected", "HandleNodeListSelectionChange");
     SubscribeToEvent(sceneWindow.GetChild("NodeList", true), "ItemSelected", "HandleNodeListSelectionChange");
     SubscribeToEvent(sceneWindow.GetChild("NodeList", true), "ItemDeselected", "HandleNodeListSelectionChange");
     SubscribeToEvent(sceneWindow.GetChild("NodeList", true), "ItemDeselected", "HandleNodeListSelectionChange");
     SubscribeToEvent(sceneWindow.GetChild("NodeList", true), "UnHandledKey", "HandleNodeListKey");
     SubscribeToEvent(sceneWindow.GetChild("NodeList", true), "UnHandledKey", "HandleNodeListKey");
@@ -71,7 +71,7 @@ void ExpandSceneHierarchy()
     list.SetChildItemsVisible(true);
     list.SetChildItemsVisible(true);
 }
 }
 
 
-void collapseSceneHierarchy()
+void CollapseSceneHierarchy()
 {
 {
     ListView@ list = sceneWindow.GetChild("NodeList", true);
     ListView@ list = sceneWindow.GetChild("NodeList", true);
     list.SetChildItemsVisible(false);
     list.SetChildItemsVisible(false);

+ 7 - 7
Bin/Data/Scripts/Editor/EditorUI.as

@@ -22,9 +22,9 @@ void CreateUI()
     CreateStatsBar();
     CreateStatsBar();
     CreateConsole();
     CreateConsole();
     
     
-    SubscribeToEvent("ScreenMode", "resizeUI");
-    SubscribeToEvent("MenuSelected", "handleMenuSelected");
-    SubscribeToEvent("KeyDown", "handleKeyDown");
+    SubscribeToEvent("ScreenMode", "ResizeUI");
+    SubscribeToEvent("MenuSelected", "HandleMenuSelected");
+    SubscribeToEvent("KeyDown", "HandleKeyDown");
 }
 }
 
 
 void ResizeUI()
 void ResizeUI()
@@ -341,7 +341,7 @@ void HandleKeyDown(StringHash eventType, VariantMap& eventData)
 {
 {
     int key = eventData["Key"].GetInt();
     int key = eventData["Key"].GetInt();
     
     
-    if (key == 220)
+    if (key == KEY_F1)
     {
     {
         console.Toggle();
         console.Toggle();
         input.SuppressNextChar();
         input.SuppressNextChar();
@@ -355,11 +355,11 @@ void HandleKeyDown(StringHash eventType, VariantMap& eventData)
             front.visible = false;
             front.visible = false;
     }
     }
 
 
-    if (key == KEY_F1)
-        ToggleRenderingDebug();
     if (key == KEY_F2)
     if (key == KEY_F2)
-        TogglePhysicsDebug();
+        ToggleRenderingDebug();
     if (key == KEY_F3)
     if (key == KEY_F3)
+        TogglePhysicsDebug();
+    if (key == KEY_F4)
         ToggleOctreeDebug();
         ToggleOctreeDebug();
         
         
     if (eventData["Qualifiers"].GetInt() == QUAL_CTRL)
     if (eventData["Qualifiers"].GetInt() == QUAL_CTRL)

+ 2 - 2
Bin/Data/Scripts/TestScene.as

@@ -318,13 +318,13 @@ void HandleUpdate(StringHash eventType, VariantMap& eventData)
 
 
         if (input.keyPress[KEY_F5])
         if (input.keyPress[KEY_F5])
         {
         {
-            File@ xmlFile = File("scene.xml", FILE_WRITE);
+            File@ xmlFile = File("Data/Scene.xml", FILE_WRITE);
             testScene.SaveXML(xmlFile);
             testScene.SaveXML(xmlFile);
         }
         }
 
 
         if (input.keyPress[KEY_F7])
         if (input.keyPress[KEY_F7])
         {
         {
-            File@ xmlFile = File("scene.xml", FILE_READ);
+            File@ xmlFile = File("Data/Scene.xml", FILE_READ);
             if (xmlFile.open)
             if (xmlFile.open)
                 testScene.LoadXML(xmlFile);
                 testScene.LoadXML(xmlFile);
         }
         }

+ 2 - 2
Bin/Data/UI/EditorSettingsDialog.xml

@@ -1,11 +1,11 @@
-<element type="Window" name="CameraDialog">
+<element type="Window" name="EditorSettingsDialog">
     <movable enable="true" />
     <movable enable="true" />
     <layout mode="vertical" spacing="4" border="6 6 6 6" />
     <layout mode="vertical" spacing="4" border="6 6 6 6" />
     <element>
     <element>
         <fixedheight value="16" />
         <fixedheight value="16" />
         <layout mode="horizontal" />
         <layout mode="horizontal" />
         <element type="Text">
         <element type="Text">
-            <text value="Editor camera settings" />
+            <text value="Editor settings" />
         </element>
         </element>
         <element type="Button" style="CloseButton" name="CloseButton" />
         <element type="Button" style="CloseButton" name="CloseButton" />
     </element>
     </element>

+ 3 - 3
Bin/Data/UI/SceneWindow.xml

@@ -20,7 +20,7 @@
         <element type="Button" name="ExpandAllButton">
         <element type="Button" name="ExpandAllButton">
             <fixedwidth value="70" />
             <fixedwidth value="70" />
             <element type="Text">
             <element type="Text">
-                <font name="cour.ttf" size="9" />
+                <font name="Anonymous Pro.ttf" size="9" />
                 <text value="Expand" />
                 <text value="Expand" />
                 <alignment horizontal="center" vertical="center" />
                 <alignment horizontal="center" vertical="center" />
             </element>
             </element>
@@ -28,7 +28,7 @@
         <element type="Button" name="CollapseAllButton">
         <element type="Button" name="CollapseAllButton">
             <fixedwidth value="70" />
             <fixedwidth value="70" />
             <element type="Text">
             <element type="Text">
-                <font name="cour.ttf" size="9" />
+                <font name="Anonymous Pro.ttf" size="9" />
                 <text value="Collapse" />
                 <text value="Collapse" />
                 <alignment horizontal="center" vertical="center" />
                 <alignment horizontal="center" vertical="center" />
             </element>
             </element>
@@ -42,7 +42,7 @@
     <element>
     <element>
         <fixedheight value="22" />
         <fixedheight value="22" />
         <layout mode="horizontal" spacing="4" />
         <layout mode="horizontal" spacing="4" />
-        <element type="Element" />
+        <element />
         <element type="DropDownList" name="NewNodeList">
         <element type="DropDownList" name="NewNodeList">
             <fixedsize value="90 22" />
             <fixedsize value="90 22" />
             <layout border="4 4 4 4" />
             <layout border="4 4 4 4" />

+ 1 - 1
Docs/Reference.dox

@@ -768,7 +768,7 @@ The XML data for each UI element follows. Everything is optional and defaults wi
 \subsection UI_UIElement UIElement
 \subsection UI_UIElement UIElement
 
 
 \code
 \code
-<element name="ElementName" type="Element" >
+<element name="ElementName" type="UIElement" >
     <position value="x y" />
     <position value="x y" />
     <size value="x y" />
     <size value="x y" />
     <width value="x" />
     <width value="x" />

+ 21 - 19
Engine/Core/Object.cpp

@@ -40,18 +40,17 @@ Object::~Object()
 
 
 void Object::OnEvent(Object* sender, bool broadcast, StringHash eventType, VariantMap& eventData)
 void Object::OnEvent(Object* sender, bool broadcast, StringHash eventType, VariantMap& eventData)
 {
 {
-    // Make a weak pointer to self to check for destruction during event handling
-    WeakPtr<Object> self(this);
+    // Make a copy of the context pointer in case the object is destroyed during event handler invocation
+    Context* context = context_;
     
     
     // Check first the specific event handlers, which have priority
     // Check first the specific event handlers, which have priority
     Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::ConstIterator i = eventHandlers_.Find(
     Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::ConstIterator i = eventHandlers_.Find(
         MakePair(sender, eventType));
         MakePair(sender, eventType));
     if (i != eventHandlers_.End())
     if (i != eventHandlers_.End())
     {
     {
-        context_->SetEventHandler(i->second_);
+        context->SetEventHandler(i->second_);
         i->second_->Invoke(eventType, eventData);
         i->second_->Invoke(eventType, eventData);
-        if (!self.Expired())
-            context_->SetEventHandler(0);
+        context->SetEventHandler(0);
         return;
         return;
     }
     }
     
     
@@ -59,10 +58,9 @@ void Object::OnEvent(Object* sender, bool broadcast, StringHash eventType, Varia
     i = eventHandlers_.Find(MakePair((Object*)0, eventType));
     i = eventHandlers_.Find(MakePair((Object*)0, eventType));
     if (i != eventHandlers_.End())
     if (i != eventHandlers_.End())
     {
     {
-        context_->SetEventHandler(i->second_);
+        context->SetEventHandler(i->second_);
         i->second_->Invoke(eventType, eventData);
         i->second_->Invoke(eventType, eventData);
-        if (!self.Expired())
-            context_->SetEventHandler(0);
+        context->SetEventHandler(0);
     }
     }
 }
 }
 
 
@@ -178,12 +176,13 @@ void Object::SendEvent(StringHash eventType, VariantMap& eventData)
 {
 {
     // Make a weak pointer to self to check for destruction during event handling
     // Make a weak pointer to self to check for destruction during event handling
     WeakPtr<Object> self(this);
     WeakPtr<Object> self(this);
+    Context* context = context_;
     HashSet<Object*> processed;
     HashSet<Object*> processed;
     
     
-    context_->BeginSendEvent(this);
+    context->BeginSendEvent(this);
     
     
     // Check first the specific event receivers
     // Check first the specific event receivers
-    const PODVector<Object*>* group = context_->GetReceivers(this, eventType);
+    const PODVector<Object*>* group = context->GetReceivers(this, eventType);
     if (group)
     if (group)
     {
     {
         unsigned numReceivers = group->Size();
         unsigned numReceivers = group->Size();
@@ -197,7 +196,7 @@ void Object::SendEvent(StringHash eventType, VariantMap& eventData)
                 receiver->OnEvent(this, true, eventType, eventData);
                 receiver->OnEvent(this, true, eventType, eventData);
                 if (self.Expired())
                 if (self.Expired())
                 {
                 {
-                    context_->EndSendEvent();
+                    context->EndSendEvent();
                     return;
                     return;
                 }
                 }
             }
             }
@@ -205,7 +204,7 @@ void Object::SendEvent(StringHash eventType, VariantMap& eventData)
     }
     }
     
     
     // Then the non-specific receivers
     // Then the non-specific receivers
-    group = context_->GetReceivers(eventType);
+    group = context->GetReceivers(eventType);
     if (group)
     if (group)
     {
     {
         unsigned numReceivers = group->Size();
         unsigned numReceivers = group->Size();
@@ -219,7 +218,7 @@ void Object::SendEvent(StringHash eventType, VariantMap& eventData)
                     receiver->OnEvent(this, true, eventType, eventData);
                     receiver->OnEvent(this, true, eventType, eventData);
                     if (self.Expired())
                     if (self.Expired())
                     {
                     {
-                        context_->EndSendEvent();
+                        context->EndSendEvent();
                         return;
                         return;
                     }
                     }
                 }
                 }
@@ -236,7 +235,7 @@ void Object::SendEvent(StringHash eventType, VariantMap& eventData)
                     receiver->OnEvent(this, true, eventType, eventData);
                     receiver->OnEvent(this, true, eventType, eventData);
                     if (self.Expired())
                     if (self.Expired())
                     {
                     {
-                        context_->EndSendEvent();
+                        context->EndSendEvent();
                         return;
                         return;
                     }
                     }
                 }
                 }
@@ -244,7 +243,7 @@ void Object::SendEvent(StringHash eventType, VariantMap& eventData)
         }
         }
     }
     }
     
     
-    context_->EndSendEvent();
+    context->EndSendEvent();
 }
 }
 
 
 void Object::SendEvent(Object* receiver, StringHash eventType)
 void Object::SendEvent(Object* receiver, StringHash eventType)
@@ -252,10 +251,11 @@ void Object::SendEvent(Object* receiver, StringHash eventType)
     if (receiver)
     if (receiver)
     {
     {
         VariantMap noEventData;
         VariantMap noEventData;
+        Context* context = context_;
         
         
-        context_->BeginSendEvent(this);
+        context->BeginSendEvent(this);
         receiver->OnEvent(this, false, eventType, noEventData);
         receiver->OnEvent(this, false, eventType, noEventData);
-        context_->EndSendEvent();
+        context->EndSendEvent();
     }
     }
 }
 }
 
 
@@ -263,9 +263,11 @@ void Object::SendEvent(Object* receiver, StringHash eventType, VariantMap& event
 {
 {
     if (receiver)
     if (receiver)
     {
     {
-        context_->BeginSendEvent(this);
+        Context* context = context_;
+        
+        context->BeginSendEvent(this);
         receiver->OnEvent(this, false, eventType, eventData);
         receiver->OnEvent(this, false, eventType, eventData);
-        context_->EndSendEvent();
+        context->EndSendEvent();
     }
     }
 }
 }
 
 

+ 2 - 2
Engine/Engine/ResourceAPI.cpp

@@ -110,8 +110,8 @@ static void RegisterResourceCache(asIScriptEngine* engine)
     engine->RegisterObjectMethod("ResourceCache", "bool Exists(const String&in) const", asMETHODPR(ResourceCache, Exists, (const String&) const, bool), asCALL_THISCALL);
     engine->RegisterObjectMethod("ResourceCache", "bool Exists(const String&in) const", asMETHODPR(ResourceCache, Exists, (const String&) const, bool), asCALL_THISCALL);
     engine->RegisterObjectMethod("ResourceCache", "File@ GetFile(const String&in)", asFUNCTION(ResourceCacheGetFile), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod("ResourceCache", "File@ GetFile(const String&in)", asFUNCTION(ResourceCacheGetFile), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod("ResourceCache", "String GetPreferredResourceDir(const String&in)", asMETHOD(ResourceCache, GetPreferredResourceDir), asCALL_THISCALL);
     engine->RegisterObjectMethod("ResourceCache", "String GetPreferredResourceDir(const String&in)", asMETHOD(ResourceCache, GetPreferredResourceDir), asCALL_THISCALL);
-    engine->RegisterObjectMethod("ResourceCache", "Resource@+ GetResource(ShortStringHash, StringHash)", asFUNCTION(ResourceCacheGetResource), asCALL_CDECL_OBJLAST);
-    engine->RegisterObjectMethod("ResourceCache", "Resource@+ GetResource(const String&in, const String&in)", asMETHODPR(ResourceCache, GetResource, (ShortStringHash, StringHash), Resource*), asCALL_THISCALL);
+    engine->RegisterObjectMethod("ResourceCache", "Resource@+ GetResource(const String&in, const String&in)", asFUNCTION(ResourceCacheGetResource), asCALL_CDECL_OBJLAST);
+    engine->RegisterObjectMethod("ResourceCache", "Resource@+ GetResource(ShortStringHash, StringHash)", asMETHODPR(ResourceCache, GetResource, (ShortStringHash, StringHash), Resource*), asCALL_THISCALL);
     engine->RegisterObjectMethod("ResourceCache", "void set_memoryBudget(const String&in, uint)", asFUNCTION(ResourceCacheSetMemoryBudget), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod("ResourceCache", "void set_memoryBudget(const String&in, uint)", asFUNCTION(ResourceCacheSetMemoryBudget), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod("ResourceCache", "uint get_memoryBudget(const String&in) const", asFUNCTION(ResourceCacheGetMemoryBudget), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod("ResourceCache", "uint get_memoryBudget(const String&in) const", asFUNCTION(ResourceCacheGetMemoryBudget), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod("ResourceCache", "uint get_memoryUse(const String&in) const", asFUNCTION(ResourceCacheGetMemoryUse), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod("ResourceCache", "uint get_memoryUse(const String&in) const", asFUNCTION(ResourceCacheGetMemoryUse), asCALL_CDECL_OBJLAST);

+ 1 - 0
Engine/Resource/ResourceCache.cpp

@@ -42,6 +42,7 @@ static const String checkDirs[] = {
     "Scripts",
     "Scripts",
     "Sounds",
     "Sounds",
     "Shaders",
     "Shaders",
+    "Techniques",
     "Textures",
     "Textures",
     "UI",
     "UI",
     ""
     ""

+ 16 - 16
Engine/Scene/Node.cpp

@@ -49,7 +49,7 @@ Node::Node(Context* context) :
     targetPosition_(Vector3::ZERO),
     targetPosition_(Vector3::ZERO),
     targetRotation_(Quaternion::IDENTITY),
     targetRotation_(Quaternion::IDENTITY),
     rotateCount_(0),
     rotateCount_(0),
-    smoothingFlags_(SMOOTH_NONE),
+    smoothingMask_(SMOOTH_NONE),
     dirty_(false),
     dirty_(false),
     smoothed_(false)
     smoothed_(false)
 {
 {
@@ -193,7 +193,7 @@ void Node::SetPosition(const Vector3& position)
     else
     else
     {
     {
         targetPosition_ = position;
         targetPosition_ = position;
-        smoothingFlags_ |= SMOOTH_POSITION;
+        smoothingMask_ |= SMOOTH_POSITION;
     }
     }
 }
 }
 
 
@@ -208,7 +208,7 @@ void Node::SetRotation(const Quaternion& rotation)
     else
     else
     {
     {
         targetRotation_ = rotation;
         targetRotation_ = rotation;
-        smoothingFlags_ |= SMOOTH_ROTATION;
+        smoothingMask_ |= SMOOTH_ROTATION;
     }
     }
     rotateCount_ = 0;
     rotateCount_ = 0;
 }
 }
@@ -245,7 +245,7 @@ void Node::SetTransform(const Vector3& position, const Quaternion& rotation)
     {
     {
         targetPosition_ = position;
         targetPosition_ = position;
         targetRotation_ = rotation;
         targetRotation_ = rotation;
-        smoothingFlags_ |= SMOOTH_POSITION | SMOOTH_ROTATION;
+        smoothingMask_ |= SMOOTH_POSITION | SMOOTH_ROTATION;
     }
     }
     rotateCount_ = 0;
     rotateCount_ = 0;
 }
 }
@@ -261,7 +261,7 @@ void Node::SetTransform(const Vector3& position, const Quaternion& rotation, flo
     {
     {
         targetPosition_ = position;
         targetPosition_ = position;
         targetRotation_ = rotation;
         targetRotation_ = rotation;
-        smoothingFlags_ |= SMOOTH_POSITION | SMOOTH_ROTATION;
+        smoothingMask_ |= SMOOTH_POSITION | SMOOTH_ROTATION;
     }
     }
     rotateCount_ = 0;
     rotateCount_ = 0;
     scale_ = Vector3(scale, scale, scale);
     scale_ = Vector3(scale, scale, scale);
@@ -280,7 +280,7 @@ void Node::SetTransform(const Vector3& position, const Quaternion& rotation, con
     {
     {
         targetPosition_ = position;
         targetPosition_ = position;
         targetRotation_ = rotation;
         targetRotation_ = rotation;
-        smoothingFlags_ |= SMOOTH_POSITION | SMOOTH_ROTATION;
+        smoothingMask_ |= SMOOTH_POSITION | SMOOTH_ROTATION;
     }
     }
     rotateCount_ = 0;
     rotateCount_ = 0;
     scale_ = scale;
     scale_ = scale;
@@ -292,7 +292,7 @@ void Node::SnapPosition(const Vector3& position)
 {
 {
     position_ = position;
     position_ = position;
     targetPosition_ = position;
     targetPosition_ = position;
-    smoothingFlags_ &= ~SMOOTH_POSITION;
+    smoothingMask_ &= ~SMOOTH_POSITION;
     if (!dirty_)
     if (!dirty_)
         MarkDirty();
         MarkDirty();
 }
 }
@@ -301,7 +301,7 @@ void Node::SnapRotation(const Quaternion& rotation)
 {
 {
     rotation_ = rotation;
     rotation_ = rotation;
     targetRotation_ = rotation;
     targetRotation_ = rotation;
-    smoothingFlags_ &= ~SMOOTH_ROTATION;
+    smoothingMask_ &= ~SMOOTH_ROTATION;
     rotateCount_ = 0;
     rotateCount_ = 0;
     if (!dirty_)
     if (!dirty_)
         MarkDirty();
         MarkDirty();
@@ -318,7 +318,7 @@ void Node::Translate(const Vector3& delta)
     else
     else
     {
     {
         targetPosition_ += delta;
         targetPosition_ += delta;
-        smoothingFlags_ |= SMOOTH_POSITION;
+        smoothingMask_ |= SMOOTH_POSITION;
     }
     }
 }
 }
 
 
@@ -333,7 +333,7 @@ void Node::TranslateRelative(const Vector3& delta)
     else
     else
     {
     {
         targetPosition_ += targetRotation_ * delta;
         targetPosition_ += targetRotation_ * delta;
-        smoothingFlags_ |= SMOOTH_POSITION;
+        smoothingMask_ |= SMOOTH_POSITION;
     }
     }
 }
 }
 
 
@@ -352,7 +352,7 @@ void Node::Rotate(const Quaternion& delta, bool fixedAxis)
             targetRotation_ = targetRotation_ * delta;
             targetRotation_ = targetRotation_ * delta;
         else
         else
             targetRotation_ = delta * targetRotation_;
             targetRotation_ = delta * targetRotation_;
-        smoothingFlags_ |= SMOOTH_ROTATION;
+        smoothingMask_ |= SMOOTH_ROTATION;
     }
     }
     
     
     ++rotateCount_;
     ++rotateCount_;
@@ -801,10 +801,10 @@ const PODVector<unsigned char>& Node::GetNetParentAttr() const
 
 
 void Node::UpdateSmoothing(float constant, float squaredSnapThreshold)
 void Node::UpdateSmoothing(float constant, float squaredSnapThreshold)
 {
 {
-    if (!smoothed_ || !smoothingFlags_)
+    if (!smoothed_ || !smoothingMask_)
         return;
         return;
     
     
-    if (smoothingFlags_ & SMOOTH_POSITION)
+    if (smoothingMask_ & SMOOTH_POSITION)
     {
     {
         // If position snaps, snap everything to the end
         // If position snaps, snap everything to the end
         float delta = (position_ - targetPosition_).LengthSquared();
         float delta = (position_ - targetPosition_).LengthSquared();
@@ -814,18 +814,18 @@ void Node::UpdateSmoothing(float constant, float squaredSnapThreshold)
         if (delta < M_EPSILON || constant >= 1.0f)
         if (delta < M_EPSILON || constant >= 1.0f)
         {
         {
             position_ = targetPosition_;
             position_ = targetPosition_;
-            smoothingFlags_ &= ~SMOOTH_POSITION;
+            smoothingMask_ &= ~SMOOTH_POSITION;
         }
         }
         else
         else
             position_ = position_.Lerp(targetPosition_, constant);
             position_ = position_.Lerp(targetPosition_, constant);
     }
     }
-    if (smoothingFlags_ & SMOOTH_ROTATION)
+    if (smoothingMask_ & SMOOTH_ROTATION)
     {
     {
         float delta = (rotation_ - targetRotation_).LengthSquared();
         float delta = (rotation_ - targetRotation_).LengthSquared();
         if (delta < M_EPSILON || constant >= 1.0f)
         if (delta < M_EPSILON || constant >= 1.0f)
         {
         {
             rotation_ = targetRotation_;
             rotation_ = targetRotation_;
-            smoothingFlags_ &= ~SMOOTH_ROTATION;
+            smoothingMask_ &= ~SMOOTH_ROTATION;
         }
         }
         else
         else
             rotation_ = rotation_.Slerp(targetRotation_, constant);
             rotation_ = rotation_.Slerp(targetRotation_, constant);

+ 2 - 2
Engine/Scene/Node.h

@@ -346,8 +346,8 @@ private:
     mutable VectorBuffer attrBuffer_;
     mutable VectorBuffer attrBuffer_;
     /// Consecutive rotation count for rotation renormalization.
     /// Consecutive rotation count for rotation renormalization.
     unsigned char rotateCount_;
     unsigned char rotateCount_;
-    /// Active smoothing flags.
-    unsigned char smoothingFlags_;
+    /// Active smoothing operations bitmask.
+    unsigned char smoothingMask_;
     /// World transform needs update flag.
     /// World transform needs update flag.
     mutable bool dirty_;
     mutable bool dirty_;
     /// Smoothed motion flag.
     /// Smoothed motion flag.

+ 4 - 2
Engine/UI/ListView.cpp

@@ -119,6 +119,9 @@ void ListView::SetStyle(const XMLElement& element)
         AddSelection(selectionElem.GetInt("value"));
         AddSelection(selectionElem.GetInt("value"));
         selectionElem = selectionElem.GetNext("selection");
         selectionElem = selectionElem.GetNext("selection");
     }
     }
+    
+    // Set the container's layout border to match scroll panel clipping, so that elements are not left partially hidden
+    contentElement_->SetLayoutBorder(scrollPanel_->GetClipBorder());
 }
 }
 
 
 void ListView::Update(float timeStep)
 void ListView::Update(float timeStep)
@@ -250,8 +253,7 @@ void ListView::OnResize()
     ScrollView::OnResize();
     ScrollView::OnResize();
     
     
     // Set the content element width to match the scrollpanel
     // Set the content element width to match the scrollpanel
-    const IntRect& clipBorder = scrollPanel_->GetClipBorder();
-    contentElement_->SetWidth(scrollPanel_->GetWidth() - clipBorder.left_ - clipBorder.right_);
+    contentElement_->SetWidth(scrollPanel_->GetWidth());
 }
 }
 
 
 void ListView::OnFocus()
 void ListView::OnFocus()

+ 6 - 0
Engine/UI/UI.cpp

@@ -322,6 +322,9 @@ SharedPtr<UIElement> UI::LoadLayout(XMLFile* file, XMLFile* styleFile)
     }
     }
     
     
     String type = rootElem.GetString("type");
     String type = rootElem.GetString("type");
+    if (type.Empty())
+        type = "UIElement";
+    
     root = DynamicCast<UIElement>(context_->CreateObject(ShortStringHash(type)));
     root = DynamicCast<UIElement>(context_->CreateObject(ShortStringHash(type)));
     if (!root)
     if (!root)
     {
     {
@@ -546,6 +549,9 @@ void UI::LoadLayout(UIElement* current, const XMLElement& elem, XMLFile* styleFi
     {
     {
         // Create element
         // Create element
         String type = childElem.GetString("type");
         String type = childElem.GetString("type");
+        if (type.Empty())
+            type = "UIElement";
+        
         SharedPtr<UIElement> child = DynamicCast<UIElement>(context_->CreateObject(ShortStringHash(type)));
         SharedPtr<UIElement> child = DynamicCast<UIElement>(context_->CreateObject(ShortStringHash(type)));
         if (!child)
         if (!child)
         {
         {

+ 1 - 1
Engine/UI/UIElement.h

@@ -101,7 +101,7 @@ class asIScriptEngine;
 /// Base class for %UI elements.
 /// Base class for %UI elements.
 class UIElement : public Object
 class UIElement : public Object
 {
 {
-    OBJECT(Element);
+    OBJECT(UIElement);
     
     
 public:
 public:
     /// Construct.
     /// Construct.

+ 5 - 5
ThirdParty/kNet/CMakeLists.txt

@@ -146,14 +146,14 @@ elseif (UNIX)
    file(GLOB kNetUnixSourceFiles ./src/unix/*.cpp)
    file(GLOB kNetUnixSourceFiles ./src/unix/*.cpp)
    file(GLOB kNetUnixHeaderFiles ./include/*.h ./include/kNet/*.h ./include/kNet/unix/*.h)
    file(GLOB kNetUnixHeaderFiles ./include/*.h ./include/kNet/*.h ./include/kNet/unix/*.h)
 
 
-   if (USE_BOOST)
-      list(REMOVE_ITEM kNetUnixSourceFiles ${PROJECT_SOURCE_DIR}/./src/unix/UnixThread.cpp)
-   endif()
-
    set(kNetSourceFiles ${kNetSourceFiles} ${kNetUnixSourceFiles})
    set(kNetSourceFiles ${kNetSourceFiles} ${kNetUnixSourceFiles})
    set(kNetHeaderFiles ${kNetHeaderFiles} ${kNetUnixHeaderFiles})
    set(kNetHeaderFiles ${kNetHeaderFiles} ${kNetUnixHeaderFiles})
 
 
-   set(kNetLinkLibraries ${kNetLinkLibraries} pthread)
+   if (USE_BOOST)
+      list(REMOVE_ITEM kNetUnixSourceFiles ${PROJECT_SOURCE_DIR}/./src/unix/UnixThread.cpp)
+   else()
+      set(kNetLinkLibraries ${kNetLinkLibraries} pthread)
+   endif()
 endif()
 endif()
 
 
 #AddCompilationUnitNameDefines(kNetSourceFiles)
 #AddCompilationUnitNameDefines(kNetSourceFiles)

+ 28 - 1
ThirdParty/kNet/README.txt

@@ -2,6 +2,8 @@
 
 
 kNet is a low-level networking protocol library designed for bit-efficient realtime streaming of custom application-specified messages on top of TCP or UDP. kNet is written in C++.
 kNet is a low-level networking protocol library designed for bit-efficient realtime streaming of custom application-specified messages on top of TCP or UDP. kNet is written in C++.
 
 
+
+
    Supported Platforms.
    Supported Platforms.
 
 
 kNet has been tested to build on the following platforms:
 kNet has been tested to build on the following platforms:
@@ -9,9 +11,11 @@ kNet has been tested to build on the following platforms:
  - Windows 7 & Visual Studio 2008 Standard
  - Windows 7 & Visual Studio 2008 Standard
  - Ubuntu 9.04 & GCC 4.4.1
  - Ubuntu 9.04 & GCC 4.4.1
 
 
+
+
    Building kNet.
    Building kNet.
 
 
-kNet uses cmake (2.6 or newer) as its build system. On Linux it depends on boost v1.38.0 or newer for threading support. On Windows a CMake flag USE_BOOST can be used to specify whether to depend on boost or not. By default USE_BOOST is on.
+kNet uses cmake (2.6 or newer) as its build system. On Linux it can use pthreads or boost v1.38.0 or newer for threading support. On Windows a CMake flag USE_BOOST can be used to specify whether to depend on boost or not. By default USE_BOOST is on.
 
 
 Windows:
 Windows:
  - Install cmake. 
  - Install cmake. 
@@ -32,3 +36,26 @@ Linux:
  - run 'make'.
  - run 'make'.
 
 
 The project output files are placed in the directory kNet/lib.
 The project output files are placed in the directory kNet/lib.
+
+
+
+   Contributors.
+
+The following people have contributed to the project:
+
+   Toni Alatalo
+   Jukka Jylänki
+   Erno Kuusela
+   Ali Kämäräinen
+   Jonne Nauha
+   Ville Saarinen
+   Cvetan Stefanovski
+   Kari Vatjus-Anttila
+   Lasse Öörni
+
+
+
+   Links.
+
+There exists a Wireshark dissector plugin for kNet: http://chiru.cie.fi/chiru-sharedfolder/knet-tundra-v.0.0.8.tar.gz .
+A SCTP -enabled branch of kNet is being developed at https://bitbucket.org/karivatj/knet-sctp/ .

+ 2 - 3
ThirdParty/kNet/include/kNet.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.
@@ -18,8 +18,6 @@
 	       client application. This file is ideal to be added to a PCH. If you are not using a PCH,
 	       client application. This file is ideal to be added to a PCH. If you are not using a PCH,
 	       #including the individual files when necessary is most likely faster. */
 	       #including the individual files when necessary is most likely faster. */
 
 
-// Modified by Lasse Öörni for Urho3D
-
 #include "kNetBuildConfig.h"
 #include "kNetBuildConfig.h"
 #include "kNetFwd.h"
 #include "kNetFwd.h"
 
 
@@ -45,6 +43,7 @@
 #include "kNet/NetworkMessage.h"
 #include "kNet/NetworkMessage.h"
 #include "kNet/NetworkServer.h"
 #include "kNet/NetworkServer.h"
 #include "kNet/PolledTimer.h"
 #include "kNet/PolledTimer.h"
+#include "kNet/SerializationStructCompiler.h"
 #include "kNet/SerializedDataIterator.h"
 #include "kNet/SerializedDataIterator.h"
 #include "kNet/SharedPtr.h"
 #include "kNet/SharedPtr.h"
 #include "kNet/Socket.h"
 #include "kNet/Socket.h"

+ 1 - 1
ThirdParty/kNet/include/kNet/Alignment.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/Allocator.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/Array.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/Atomics.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/BasicSerializedDataTypes.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/BitOps.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/Clock.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/DataDeserializer.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/DataSerializer.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/Datagram.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/DebugMemoryLeakCheck.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/EndPoint.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/Event.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/EventArray.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/FragmentedTransferManager.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/IMessageHandler.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/INetworkServerListener.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/LockFreePoolAllocator.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/Lockable.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/MaxHeap.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/MessageConnection.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/MessageListParser.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/NetException.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/Network.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/NetworkLogging.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/NetworkMessage.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/NetworkServer.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/NetworkWorkerThread.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/OrderedHashTable.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/PolledTimer.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/RingBuffer.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/SequentialIntegerSet.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/SerializationStructCompiler.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/SerializedDataIterator.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/SharedPtr.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/SharedPtr.inl

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/Socket.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/Sort.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/Sort.inl

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/SortCmp.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/StatsEventHierarchy.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/StdCMallocHeap.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/TCPMessageConnection.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/Thread.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/Types.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 3
ThirdParty/kNet/include/kNet/UDPMessageConnection.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.
@@ -256,8 +256,6 @@ private:
 	/// Returns the percentage of inbound packets that are being lost, [0, 1].
 	/// Returns the percentage of inbound packets that are being lost, [0, 1].
 	float GetPacketLossRate() const { return packetLossRate; }
 	float GetPacketLossRate() const { return packetLossRate; }
 
 
-	void Initialize();
-
 	void DumpConnectionStatus() const;
 	void DumpConnectionStatus() const;
 
 
 	friend class NetworkServer;
 	friend class NetworkServer;

+ 1 - 1
ThirdParty/kNet/include/kNet/VLEPacker.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/WaitFreeQueue.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/include/kNet/win32/WS2Include.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 2 - 3
ThirdParty/kNet/include/kNetFwd.h

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.
@@ -16,8 +16,6 @@
 /** @file kNetFwd.h
 /** @file kNetFwd.h
 	@brief Forward-declares all common symbols defined by kNet. */
 	@brief Forward-declares all common symbols defined by kNet. */
 
 
-// Modified by Lasse Öörni for Urho3D
-
 namespace kNet
 namespace kNet
 {
 {
 	class Clock;
 	class Clock;
@@ -36,6 +34,7 @@ namespace kNet
 	class NetworkMessage;
 	class NetworkMessage;
 	class NetworkServer;
 	class NetworkServer;
 	class PolledTimer;
 	class PolledTimer;
+	class SerializationStructCompiler;
 	class SerializedDataIterator;
 	class SerializedDataIterator;
 	class Socket;
 	class Socket;
 	class StatsEventHierarchyNode;
 	class StatsEventHierarchyNode;

+ 1 - 1
ThirdParty/kNet/src/DataDeserializer.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/DataSerializer.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/FragmentedTransferManager.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/MessageConnection.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/MessageListParser.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/Network.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/NetworkLogging.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/NetworkMessage.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/NetworkServer.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/NetworkWorkerThread.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/SerializationStructCompiler.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/SerializedDataIterator.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/Socket.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/TCPMessageConnection.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/Thread.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 7 - 16
ThirdParty/kNet/src/UDPMessageConnection.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.
@@ -58,15 +58,18 @@ static const float maxRTOTimeoutValue = 5000.f;
 
 
 UDPMessageConnection::UDPMessageConnection(Network *owner, NetworkServer *ownerServer, Socket *socket, ConnectionState startingState)
 UDPMessageConnection::UDPMessageConnection(Network *owner, NetworkServer *ownerServer, Socket *socket, ConnectionState startingState)
 :MessageConnection(owner, ownerServer, socket, startingState),
 :MessageConnection(owner, ownerServer, socket, startingState),
-numAcksLastFrame(0), numLossesLastFrame(0), rttVariation(0.f), rttCleared(true),
+retransmissionTimeout(1000.f), numAcksLastFrame(0), numLossesLastFrame(0), smoothedRTT(1000.f), rttVariation(0.f), rttCleared(true), // Set RTT initial values as per RFC 2988.
 lastReceivedInOrderPacketID(0), 
 lastReceivedInOrderPacketID(0), 
 lastSentInOrderPacketID(0), datagramPacketIDCounter(1),
 lastSentInOrderPacketID(0), datagramPacketIDCounter(1),
-packetLossRate(0.f), packetLossCount(0.f), slowModeDelay(0),
+packetLossRate(0.f), packetLossCount(0.f), 
+datagramSendRate(50.f), lowestDatagramSendRateOnPacketLoss(50.f), slowModeDelay(0),
 receivedPacketIDs(64 * 1024), outboundPacketAckTrack(1024),
 receivedPacketIDs(64 * 1024), outboundPacketAckTrack(1024),
 previousReceivedPacketID(0), queuedInboundDatagrams(128)
 previousReceivedPacketID(0), queuedInboundDatagrams(128)
 {
 {
 	LOG(LogObjectAlloc, "Allocated UDPMessageConnection %p.", this);
 	LOG(LogObjectAlloc, "Allocated UDPMessageConnection %p.", this);
-	Initialize();
+
+	lastFrameTime = Clock::Tick();
+	lastDatagramSendTime = Clock::Tick();
 }
 }
 
 
 UDPMessageConnection::~UDPMessageConnection()
 UDPMessageConnection::~UDPMessageConnection()
@@ -148,18 +151,6 @@ UDPMessageConnection::SocketReadResult UDPMessageConnection::ReadSocket(size_t &
 	return SocketReadOK;
 	return SocketReadOK;
 }
 }
 
 
-void UDPMessageConnection::Initialize()
-{
-	rttCleared = true;
-	retransmissionTimeout = 1000.f;
-	smoothedRTT = 1000.f;
-	rttVariation = 0.f;
-	datagramSendRate = lowestDatagramSendRateOnPacketLoss = 50.f;
-
-	lastFrameTime = Clock::Tick();
-	lastDatagramSendTime = Clock::Tick();
-}
-
 void UDPMessageConnection::PerformPacketAckSends()
 void UDPMessageConnection::PerformPacketAckSends()
 {
 {
 	AssertInWorkerThreadContext();
 	AssertInWorkerThreadContext();

+ 1 - 1
ThirdParty/kNet/src/win32/W32Clock.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/win32/W32Event.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/win32/W32EventArray.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.

+ 1 - 1
ThirdParty/kNet/src/win32/W32Thread.cpp

@@ -1,4 +1,4 @@
-/* Copyright 2010 Jukka Jylänki
+/* Copyright The kNet Project.
 
 
    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.