Ver Fonte

15 more script bind files. heh.

Charlie Patterson há 12 anos atrás
pai
commit
157403de35
39 ficheiros alterados com 141 adições e 942 exclusões
  1. 15 0
      engine/compilers/VisualStudio 2012/Torque 2D.vcxproj
  2. 45 0
      engine/compilers/VisualStudio 2012/Torque 2D.vcxproj.filters
  3. BIN
      engine/source/2d/sceneobject/ShapeVector_ScriptBinding.h
  4. 2 19
      engine/source/component/dynamicConsoleMethodComponent.cpp
  5. BIN
      engine/source/component/dynamicConsoleMethodComponent_ScriptBinding.h
  6. 2 33
      engine/source/console/consoleNamespace.cc
  7. BIN
      engine/source/console/consoleNamespace_ScriptBinding.h
  8. 2 40
      engine/source/debug/profiler.cc
  9. BIN
      engine/source/debug/profiler_ScriptBinding.h
  10. 1 26
      engine/source/debug/telnetDebugger.cc
  11. BIN
      engine/source/debug/telnetDebugger_ScriptBinding.h
  12. 2 63
      engine/source/graphics/PNGImage.cpp
  13. BIN
      engine/source/graphics/PNGImage_ScriptBinding.h
  14. 2 310
      engine/source/graphics/gFont.cc
  15. BIN
      engine/source/graphics/gFont_ScriptBinding.h
  16. 1 50
      engine/source/io/fileStreamObject.cc
  17. BIN
      engine/source/io/fileStreamObject_ScriptBinding.h
  18. 2 24
      engine/source/messaging/message.cc
  19. BIN
      engine/source/messaging/message_ScriptBinding.h
  20. 2 11
      engine/source/network/httpObject.cc
  21. BIN
      engine/source/network/httpObject_ScriptBinding.h
  22. BIN
      engine/source/network/netConnection_ScriptBinding.h
  23. 0 6
      engine/source/network/netGhost.cc
  24. 2 42
      engine/source/network/netObject.cc
  25. BIN
      engine/source/network/netObject_ScriptBinding.h
  26. 9 5
      engine/source/network/netTest.cc
  27. 4 171
      engine/source/network/serverQuery.cc
  28. 3 0
      engine/source/network/serverQuery.h
  29. BIN
      engine/source/network/serverQuery_ScriptBinding.h
  30. 2 60
      engine/source/network/tcpObject.cc
  31. BIN
      engine/source/network/tcpObject_ScriptBinding.h
  32. 0 5
      engine/source/platform/platform.cc
  33. 2 9
      engine/source/platform/platformAssert.cc
  34. 39 0
      engine/source/platform/platformAssert_ScriptBinding.h
  35. 2 25
      engine/source/platform/platformFileIO.cc
  36. BIN
      engine/source/platform/platformFileIO_ScriptBinding.h
  37. BIN
      engine/source/platform/platform_ScriptBinding.h
  38. 2 43
      engine/source/sim/simSerialize.cpp
  39. BIN
      engine/source/sim/simSerialize_ScriptBinding.h

+ 15 - 0
engine/compilers/VisualStudio 2012/Torque 2D.vcxproj

@@ -793,6 +793,7 @@
     <ClInclude Include="..\..\source\component\behaviors\behaviorComponent_ScriptBinding.h" />
     <ClInclude Include="..\..\source\component\behaviors\behaviorInstance_ScriptBinding.h" />
     <ClInclude Include="..\..\source\component\behaviors\behaviorTemplate_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\component\dynamicConsoleMethodComponent_ScriptBinding.h" />
     <ClInclude Include="..\..\source\component\simComponent_ScriptBinding.h" />
     <ClInclude Include="..\..\source\console\consoleBaseType.h" />
     <ClInclude Include="..\..\source\console\consoleDictionary.h" />
@@ -801,10 +802,12 @@
     <ClInclude Include="..\..\source\console\consoleInternal.h" />
     <ClInclude Include="..\..\source\console\consoleLogger_ScriptBinding.h" />
     <ClInclude Include="..\..\source\console\consoleNamespace.h" />
+    <ClInclude Include="..\..\source\console\consoleNamespace_ScriptBinding.h" />
     <ClInclude Include="..\..\source\console\ConsoleTypeValidators.h" />
     <ClInclude Include="..\..\source\console\expando_ScriptBinding.h" />
     <ClInclude Include="..\..\source\console\output_ScriptBinding.h" />
     <ClInclude Include="..\..\source\debug\profiler.h" />
+    <ClInclude Include="..\..\source\debug\profiler_ScriptBinding.h" />
     <ClInclude Include="..\..\source\debug\remote\RemoteDebugger1.h" />
     <ClInclude Include="..\..\source\debug\remote\RemoteDebugger1_ScriptBinding.h" />
     <ClInclude Include="..\..\source\debug\remote\RemoteDebuggerBase.h" />
@@ -812,6 +815,7 @@
     <ClInclude Include="..\..\source\debug\remote\RemoteDebuggerBridge.h" />
     <ClInclude Include="..\..\source\debug\remote\RemoteDebuggerBridge_ScriptBinding.h" />
     <ClInclude Include="..\..\source\debug\telnetDebugger.h" />
+    <ClInclude Include="..\..\source\debug\telnetDebugger_ScriptBinding.h" />
     <ClInclude Include="..\..\source\delegates\delegate.h" />
     <ClInclude Include="..\..\source\delegates\delegateSignal.h" />
     <ClInclude Include="..\..\source\delegates\FastDelegate.h" />
@@ -826,8 +830,10 @@
     <ClInclude Include="..\..\source\graphics\DynamicTexture.h" />
     <ClInclude Include="..\..\source\graphics\gBitmap.h" />
     <ClInclude Include="..\..\source\graphics\gFont.h" />
+    <ClInclude Include="..\..\source\graphics\gFont_ScriptBinding.h" />
     <ClInclude Include="..\..\source\graphics\gPalette.h" />
     <ClInclude Include="..\..\source\graphics\PNGImage.h" />
+    <ClInclude Include="..\..\source\graphics\PNGImage_ScriptBinding.h" />
     <ClInclude Include="..\..\source\graphics\splineUtil.h" />
     <ClInclude Include="..\..\source\graphics\TextureDictionary.h" />
     <ClInclude Include="..\..\source\graphics\TextureHandle.h" />
@@ -876,6 +882,7 @@
     <ClInclude Include="..\..\source\io\fileObject_ScriptBinding.h" />
     <ClInclude Include="..\..\source\io\fileStream.h" />
     <ClInclude Include="..\..\source\io\fileStreamObject.h" />
+    <ClInclude Include="..\..\source\io\fileStreamObject_ScriptBinding.h" />
     <ClInclude Include="..\..\source\io\filterStream.h" />
     <ClInclude Include="..\..\source\io\memstream.h" />
     <ClInclude Include="..\..\source\io\resizeStream.h" />
@@ -908,6 +915,7 @@
     <ClInclude Include="..\..\source\messaging\eventManager_ScriptBinding.h" />
     <ClInclude Include="..\..\source\messaging\message.h" />
     <ClInclude Include="..\..\source\messaging\messageForwarder.h" />
+    <ClInclude Include="..\..\source\messaging\message_ScriptBinding.h" />
     <ClInclude Include="..\..\source\messaging\scriptMsgListener.h" />
     <ClInclude Include="..\..\source\module\moduleCallbacks.h" />
     <ClInclude Include="..\..\source\module\moduleDefinition.h" />
@@ -919,14 +927,18 @@
     <ClInclude Include="..\..\source\network\connectionProtocol.h" />
     <ClInclude Include="..\..\source\network\connectionStringTable.h" />
     <ClInclude Include="..\..\source\network\httpObject.h" />
+    <ClInclude Include="..\..\source\network\httpObject_ScriptBinding.h" />
     <ClInclude Include="..\..\source\network\netConnection.h" />
     <ClInclude Include="..\..\source\network\netConnection_ScriptBinding.h" />
     <ClInclude Include="..\..\source\network\netInterface.h" />
     <ClInclude Include="..\..\source\network\netObject.h" />
+    <ClInclude Include="..\..\source\network\netObject_ScriptBinding.h" />
     <ClInclude Include="..\..\source\network\netStringTable.h" />
     <ClInclude Include="..\..\source\network\networkProcessList.h" />
     <ClInclude Include="..\..\source\network\serverQuery.h" />
+    <ClInclude Include="..\..\source\network\serverQuery_ScriptBinding.h" />
     <ClInclude Include="..\..\source\network\tcpObject.h" />
+    <ClInclude Include="..\..\source\network\tcpObject_ScriptBinding.h" />
     <ClInclude Include="..\..\source\network\telnetConsole.h" />
     <ClInclude Include="..\..\source\persistence\rapidjson\include\rapidjson\allocators.h" />
     <ClInclude Include="..\..\source\persistence\rapidjson\include\rapidjson\document.h" />
@@ -1015,10 +1027,12 @@
     <ClInclude Include="..\..\source\platform\platform.h" />
     <ClInclude Include="..\..\source\platform\platformAL.h" />
     <ClInclude Include="..\..\source\platform\platformAssert.h" />
+    <ClInclude Include="..\..\source\platform\platformAssert_ScriptBinding.h" />
     <ClInclude Include="..\..\source\platform\platformAudio.h" />
     <ClInclude Include="..\..\source\platform\platformCPU.h" />
     <ClInclude Include="..\..\source\platform\platformEndian.h" />
     <ClInclude Include="..\..\source\platform\platformFileIO.h" />
+    <ClInclude Include="..\..\source\platform\platformFileIO_ScriptBinding.h" />
     <ClInclude Include="..\..\source\platform\platformFont.h" />
     <ClInclude Include="..\..\source\platform\platformGL.h" />
     <ClInclude Include="..\..\source\platform\platformInput.h" />
@@ -1086,6 +1100,7 @@
     <ClInclude Include="..\..\source\sim\simObjectPtr.h" />
     <ClInclude Include="..\..\source\sim\simObjectTimerEvent.h" />
     <ClInclude Include="..\..\source\sim\simObject_ScriptBinding.h" />
+    <ClInclude Include="..\..\source\sim\simSerialize_ScriptBinding.h" />
     <ClInclude Include="..\..\source\sim\simSet.h" />
     <ClInclude Include="..\..\source\sim\simSet_ScriptBinding.h" />
     <ClInclude Include="..\..\source\string\findMatch.h" />

+ 45 - 0
engine/compilers/VisualStudio 2012/Torque 2D.vcxproj.filters

@@ -2847,6 +2847,51 @@
     <ClInclude Include="..\..\source\component\simComponent_ScriptBinding.h">
       <Filter>component</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\source\component\dynamicConsoleMethodComponent_ScriptBinding.h">
+      <Filter>component</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\io\fileStreamObject_ScriptBinding.h">
+      <Filter>io</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\network\httpObject_ScriptBinding.h">
+      <Filter>network</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\messaging\message_ScriptBinding.h">
+      <Filter>messaging</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\network\tcpObject_ScriptBinding.h">
+      <Filter>network</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\network\netObject_ScriptBinding.h">
+      <Filter>network</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\sim\simSerialize_ScriptBinding.h">
+      <Filter>sim</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\graphics\PNGImage_ScriptBinding.h">
+      <Filter>graphics</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\console\consoleNamespace_ScriptBinding.h">
+      <Filter>console</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\graphics\gFont_ScriptBinding.h">
+      <Filter>graphics</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\network\serverQuery_ScriptBinding.h">
+      <Filter>network</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\platform\platformAssert_ScriptBinding.h">
+      <Filter>platform</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\platform\platformFileIO_ScriptBinding.h">
+      <Filter>platform</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\debug\profiler_ScriptBinding.h">
+      <Filter>debug</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\debug\telnetDebugger_ScriptBinding.h">
+      <Filter>debug</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="..\..\source\math\mMath_ASM.asm">

BIN
engine/source/2d/sceneobject/ShapeVector_ScriptBinding.h


+ 2 - 19
engine/source/component/dynamicConsoleMethodComponent.cpp

@@ -22,6 +22,8 @@
 
 #include "component/dynamicConsoleMethodComponent.h"
 
+#include "dynamicConsoleMethodComponent_ScriptBinding.h"
+
 IMPLEMENT_CONOBJECT(DynamicConsoleMethodComponent);
 
 //-----------------------------------------------------------
@@ -161,22 +163,3 @@ const char *DynamicConsoleMethodComponent::callOnBehaviors( U32 argc, const char
 
    return result;
 }
-
-ConsoleMethod( DynamicConsoleMethodComponent, callOnBehaviors, const char*, 3, 64 , 
-   "(methodName, argi) Calls script defined method on first behavior that defines it.\n"
-   "Example: %obj.callOnBehaviors( %methodName, %arg1, %arg2, ... );\n"
-   "@param methodName The method's name as a string\n"
-   "@param argi Any arguments to pass to the method\n"
-   "@return Any returned value from the behavior that handles the method, or the string 'ERR_CALL_NOT_HANDLED' if "
-   "no behavior can handle the method.\n" )
-
-{
-   // Put this in the correct form of: [method, caller, args...]
-   // We do this by just copying the third argument (the method we want to call)
-   // over the second (originally the caller ID).
-   argv[1] = argv[2];
-   return object->callOnBehaviors( argc - 1, argv + 1 );
-}
-
-//////////////////////////////////////////////////////////////////////////
-

BIN
engine/source/component/dynamicConsoleMethodComponent_ScriptBinding.h


+ 2 - 33
engine/source/console/consoleNamespace.cc

@@ -34,6 +34,8 @@
 #include "io/fileStream.h"
 #include "console/compiler.h"
 
+#include "consoleNamespace_ScriptBinding.h"
+
 U32 Namespace::mCacheSequence = 0;
 DataChunker Namespace::mCacheAllocator;
 DataChunker Namespace::mAllocator;
@@ -619,36 +621,3 @@ void Namespace::relinkPackages()
    for(U32 i = 0; i < mOldNumActivePackages; i++)
       activatePackage(mActivePackages[i]);
 }
-
-ConsoleFunctionGroupBegin( Packages, "Functions relating to the control of packages.");
-
-ConsoleFunction(isPackage,bool,2,2,"( packageName ) Use the isPackage function to check if the name or ID specified in packageName is a valid package.\n"
-                                                                "@param packagename The name or ID of an existing package.\n"
-                                                                "@return Returns true if packageName is a valid package, false otherwise.\n"
-                                                                "@sa activatePackage, deactivatePackage")
-{
-   StringTableEntry packageName = StringTable->insert(argv[1]);
-   return Namespace::isPackage(packageName);
-}
-
-ConsoleFunction(activatePackage, void,2,2,"( packageName ) Use the activatePackage function to activate a package definition and to re-define all functions named within this package with the definitions provided in the package body.\n"
-                                                                "This pushes the newly activated package onto the top of the package stack.\n"
-                                                                "@param packagename The name or ID of an existing package.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa deactivatePackage, isPackage")
-{
-   StringTableEntry packageName = StringTable->insert(argv[1]);
-   Namespace::activatePackage(packageName);
-}
-
-ConsoleFunction(deactivatePackage, void,2,2,"( packageName ) Use the deactivatePackage function to deactivate a package definition and to pop any definitions from this package off the package stack.\n"
-                                                                "This also causes any subsequently stacked packages to be popped. i.e. If any packages were activated after the one specified in packageName, they too will be deactivated and popped.\n"
-                                                                "@param packagename The name or ID of an existing package.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa activatePackage, isPackage")
-{
-   StringTableEntry packageName = StringTable->insert(argv[1]);
-   Namespace::deactivatePackage(packageName);
-}
-
-ConsoleFunctionGroupEnd( Packages );

BIN
engine/source/console/consoleNamespace_ScriptBinding.h


+ 2 - 40
engine/source/debug/profiler.cc

@@ -30,6 +30,8 @@
 #include "io/fileStream.h"
 #include "platform/threads/thread.h"
 
+#include "profiler_ScriptBinding.h"
+
 #ifdef TORQUE_ENABLE_PROFILER
 ProfilerRootData *ProfilerRootData::sRootList = NULL;
 Profiler *gProfiler = NULL;
@@ -609,44 +611,4 @@ void Profiler::enableMarker(const char *marker, bool enable)
    }
 }
 
-ConsoleFunctionGroupBegin( Profiler, "Profiler functionality.");
-
-ConsoleFunction(profilerMarkerEnable, void, 3, 3, "(string markerName, bool enable) Enables (or disables) a marker for the profiler\n"
-                "@param markerName The name of the marker to (un)set\n"
-                "@param enable Boolean value. Set if true, unset if false\n"
-                "@return No Return Value")
-{
-   if(gProfiler)
-      gProfiler->enableMarker(argv[1], dAtob(argv[2]));
-}
-
-ConsoleFunction(profilerEnable, void, 2, 2, "( enable ) Use the profileEnable function to enable (or disable) engine profiling.\n"
-                                                                "@param enable A boolean value. If set to true and the engine was compiled with DEBUG specified, engine profiling is enabled, otherwise it is disabled.\n"
-                                                                "@return No return value.")
-{
-   if(gProfiler)
-      gProfiler->enable(dAtob(argv[1]));
-}
-
-ConsoleFunction(profilerDump, void, 1, 1, "() Use the profilerDump function to dump engine profile statistics to the console.\n"
-                                                                "@return No return value")
-{
-   if(gProfiler)
-      gProfiler->dumpToConsole();
-}
-
-ConsoleFunction(profilerDumpToFile, void, 2, 2, "(string filename) Dump profiling stats to a file.")
-{
-   if(gProfiler)
-      gProfiler->dumpToFile(argv[1]);
-}
-
-ConsoleFunction(profilerReset, void, 1, 1, "Resets the profiler, clearing all of its data.")
-{
-   if(gProfiler)
-      gProfiler->reset();
-}
-
-ConsoleFunctionGroupEnd( Profiler );
-
 #endif

BIN
engine/source/debug/profiler_ScriptBinding.h


+ 1 - 26
engine/source/debug/telnetDebugger.cc

@@ -31,6 +31,7 @@
 #include "console/compiler.h"
 #include "game/gameInterface.h"
 
+#include "telnetDebugger_ScriptBinding.h"
 
 //
 // Enhanced TelnetDebugger for Torsion
@@ -97,32 +98,6 @@
 // BRKCLR file line - sent when a breakpoint cannot be moved to a breakable line on the client.
 //
 
-
-ConsoleFunction( dbgSetParameters, void, 3, 4, "(int port, string password, bool waitForClient)"
-                "Open a debug server port on the specified port, requiring the specified password, "
-                "and optionally waiting for the debug client to connect."
-            "@param port The IP port to set the password on.\n"
-        "@param password The password for this port. Set this to a NULL string to clear the password for the port.\n"
-        "@return No return value")
-{
-   if (TelDebugger)
-       TelDebugger->setDebugParameters(dAtoi(argv[1]), argv[2], argc > 3 ? dAtob(argv[3]) : false );
-}
-
-ConsoleFunction( dbgIsConnected, bool, 1, 1, "()\n"
-                "@return Returns true if a script debugging client is connected else return false.")
-{
-   return TelDebugger && TelDebugger->isConnected();
-}
-
-ConsoleFunction( dbgDisconnect, void, 1, 1, "()"
-                "Forcibly disconnects any attached script debugging client.\n"
-                "@return No Return Value")
-{
-   if (TelDebugger)
-       TelDebugger->disconnect();
-}
-
 static void debuggerConsumer(ConsoleLogEntry::Level level, const char *line)
 {
    if (TelDebugger)

BIN
engine/source/debug/telnetDebugger_ScriptBinding.h


+ 2 - 63
engine/source/graphics/PNGImage.cpp

@@ -25,6 +25,8 @@
 #include "platform/platformGL.h"
 #include "platform/platform.h"
 
+#include "PNGImage_ScriptBinding.h"
+
 #define min(a,b) (a <= b ? a : b)
 
 IMPLEMENT_CONOBJECT(PNGImage);
@@ -519,66 +521,3 @@ ConsoleFunction(CaptureScreenArea, bool, 7, 7, "(posX, posY, width, height, file
 
     return true;
 }
-
-ConsoleMethod(PNGImage, CreateBaseImage, bool, 5, 5, "(width, height, imageType) Create the base image to merge onto ")
-{
-    U32 width = dAtoi(argv[2]);
-    U32 height = dAtoi(argv[3]);
-
-    return object->Create(width, height, (PNGImageType)dAtoi(argv[4]));
-}
-
-ConsoleMethod(PNGImage, MergeOn, bool, 5, 5, "(x, y, imageFile) Add an image to the spritesheet")
-{
-    U32 width = dAtoi(argv[2]);
-    U32 height = dAtoi(argv[3]);
-
-    // File name is argv[4]
-    FileStream fStream;
-
-    if(!fStream.open(argv[4], FileStream::Read))
-    { 
-        Con::printf("Failed to open file '%s'.", argv[4]);
-        return false;
-    }
-
-    PNGImage* newImage = new PNGImage();
-
-    bool didReadImage = newImage->Read(argv[4]);
-
-    if(!didReadImage)
-    {
-        newImage->CleanMemoryUsage();
-
-        delete newImage;
-        return false;
-    }
-
-    fStream.close();
-
-    bool didMergeOn = object->MergeOn(width, height, newImage);
-
-    newImage->CleanMemoryUsage();
-    delete newImage;
-
-    return didMergeOn;
-}
-
-ConsoleMethod(PNGImage, SaveImage, bool, 3, 3, "(fileName) Save the new spritesheet to a file")
-{
-    FileStream fStream;
-
-    if(!fStream.open(argv[2], FileStream::Write))
-    { 
-        Con::printf("Failed to open file '%s'.", argv[2]);
-        return false;
-    }
-
-    fStream.close();
-
-    object->Write(argv[2]);
-
-    object->CleanMemoryUsage();
-
-    return true;
-}

BIN
engine/source/graphics/PNGImage_ScriptBinding.h


+ 2 - 310
engine/source/graphics/gFont.cc

@@ -37,319 +37,11 @@
 #include "zlib.h"
 #include "ctype.h"  // Needed for isupper and tolower
 
+#include "gFont_ScriptBinding.h"
+
 S32 GFont::smSheetIdCount = 0;
 const U32 GFont::csm_fileVersion = 3;
 
-ConsoleFunction(populateFontCacheString, void, 4, 4, "(faceName, size, string) "
-                "Populate the font cache for the specified font with characters from the specified string."
-                "@param faceName The font's name\n"
-                "@param size The size of the font.\n"
-                "@param string The string to use to fill font cache\n"
-                "@return No return value.")
-{
-   Resource<GFont> f = GFont::create(argv[1], dAtoi(argv[2]), Con::getVariable("$GUI::fontCacheDirectory"));
-
-   if(f.isNull())
-   {
-      Con::errorf("populateFontCacheString - could not load font '%s %d'!", argv[1], dAtoi(argv[2]));
-      return;
-   }
-
-   if(!f->hasPlatformFont())
-   {
-      Con::errorf("populateFontCacheString - font '%s %d' has no platform font! Cannot generate more characters.", argv[1], dAtoi(argv[2]));
-      return;
-   }
-
-   // This has the side effect of generating character info, including the bitmaps.
-   f->getStrWidthPrecise(argv[3]);
-}
-
-ConsoleFunction(populateFontCacheRange, void, 5, 5, "(faceName, size, rangeStart, rangeEnd) - "
-                "Populate the font cache for the specified font with Unicode code points in the specified range. "
-                "Note we only support BMP-0, so code points range from 0 to 65535."
-                "@param faceName The name of the font\n"
-                "@param size The size of the font.\n"
-                "@param rangeStart The initial Unicode point\n"
-                "@param rangeEnd The final Unicode point in range\n"
-                "@return No return value")
-{
-   Resource<GFont> f = GFont::create(argv[1], dAtoi(argv[2]), Con::getVariable("$GUI::fontCacheDirectory"));
-
-   if(f.isNull())
-   {
-      Con::errorf("populateFontCacheRange - could not load font '%s %d'!", argv[1], dAtoi(argv[2]));
-      return;
-   }
-
-   U32 rangeStart = dAtoi(argv[3]);
-   U32 rangeEnd   = dAtoi(argv[4]);
-
-   if(rangeStart > rangeEnd)
-   {
-      Con::errorf("populateFontCacheRange - range start is after end!");
-      return;
-   }
-
-   if(!f->hasPlatformFont())
-   {
-      Con::errorf("populateFontCacheRange - font '%s %d' has no platform font! Cannot generate more characters.", argv[1], dAtoi(argv[2]));
-      return;
-   }
-
-   // This has the side effect of generating character info, including the bitmaps.
-   for(U32 i=rangeStart; i<rangeEnd; i++)
-   {
-      if(f->isValidChar(i))
-         f->getCharWidth(i);
-      else
-         Con::warnf("populateFontCacheRange - skipping invalid char 0x%x",  i);
-   }
-
-   // All done!
-}
-
-ConsoleFunction(dumpFontCacheStatus, void, 1, 1, "() Dump a full description "
-                "of all cached fonts, along with info on the codepoints each contains.\n"
-                "@return No return value")
-{
-   FindMatch match("*.uft", 4096);
-   ResourceManager->findMatches(&match);
-
-   Con::printf("--------------------------------------------------------------------------");
-   Con::printf("   Font Cache Usage Report (%d fonts found)", match.numMatches());
-
-   for (U32 i = 0; i < (U32)match.numMatches(); i++)
-   {
-      char *curMatch = match.matchList[i];
-      Resource<GFont> font = ResourceManager->load(curMatch);
-
-      // Deal with inexplicably missing or failed to load fonts.
-      if (font.isNull())
-      {
-         Con::errorf(" o Couldn't load font : %s", curMatch);
-         continue;
-      }
-
-      // Ok, dump info!
-      font->dumpInfo();
-   }
-}
-
-ConsoleFunction(writeFontCache, void, 1, 1, "() force all cached fonts to"
-                "serialize themselves to the cache."
-                "@return No return value")
-{
-   FindMatch match("*.uft", 4096);
-   ResourceManager->findMatches(&match);
-
-   Con::printf("--------------------------------------------------------------------------");
-   Con::printf("   Writing font cache to disk (%d fonts found)", match.numMatches());
-
-   for (U32 i = 0; i < (U32)match.numMatches(); i++)
-   {
-      char *curMatch = match.matchList[i];
-      Resource<GFont> font = ResourceManager->load(curMatch);
-
-      // Deal with inexplicably missing or failed to load fonts.
-      if (font.isNull())
-      {
-         Con::errorf(" o Couldn't find font : %s", curMatch);
-         continue;
-      }
-
-      // Ok, dump info!
-      FileStream stream;
-      if(ResourceManager->openFileForWrite(stream, curMatch)) 
-      {
-         Con::printf("      o Writing '%s' to disk...", curMatch);
-         font->write(stream);
-         stream.close();
-      }
-      else
-      {
-         Con::errorf("      o Could not open '%s' for write!", curMatch);
-      }
-   }
-}
-
-ConsoleFunction(populateAllFontCacheString, void, 2, 2, "(string inString) "
-                "Populate the font cache for all fonts with characters from the specified string.\n"
-                "@param inString The string to use to set the font caches\n"
-                "@return No return value.")
-{
-   FindMatch match("*.uft", 4096);
-   ResourceManager->findMatches(&match);
-
-   Con::printf("Populating font cache with string '%s' (%d fonts found)", argv[1], match.numMatches());
-
-   for (U32 i = 0; i < (U32)match.numMatches(); i++)
-   {
-      char *curMatch = match.matchList[i];
-      Resource<GFont> font = ResourceManager->load(curMatch);
-
-      // Deal with inexplicably missing or failed to load fonts.
-      if (font.isNull())
-      {
-         Con::errorf(" o Couldn't load font : %s", curMatch);
-         continue;
-      }
-
-      if(!font->hasPlatformFont())
-      {
-         Con::errorf("populateAllFontCacheString - font '%s' has no platform font! Cannot generate more characters.", curMatch);
-         continue;
-      }
-
-      // This has the side effect of generating character info, including the bitmaps.
-      font->getStrWidthPrecise(argv[1]);
-   }
-}
-
-ConsoleFunction(populateAllFontCacheRange, void, 3, 3, "(rangeStart, rangeEnd) "
-                "Populate the font cache for all fonts with Unicode code points in the specified range. "
-                "Note we only support BMP-0, so code points range from 0 to 65535.\n"
-                "@param rangeStart, rangeEnd The range of the unicode points to populate caches with\n"
-                "@return No return value")
-{
-   U32 rangeStart = dAtoi(argv[1]);
-   U32 rangeEnd   = dAtoi(argv[2]);
-
-   if(rangeStart > rangeEnd)
-   {
-      Con::errorf("populateAllFontCacheRange - range start is after end!");
-      return;
-   }
-
-   FindMatch match("*.uft", 4096);
-   ResourceManager->findMatches(&match);
-
-   Con::printf("Populating font cache with range 0x%x to 0x%x (%d fonts found)", rangeStart, rangeEnd, match.numMatches());
-
-   for (U32 i = 0; i < (U32)match.numMatches(); i++)
-   {
-      char *curMatch = match.matchList[i];
-      Resource<GFont> font = ResourceManager->load(curMatch);
-
-      // Deal with inexplicably missing or failed to load fonts.
-      if (font.isNull())
-      {
-         Con::errorf(" o Couldn't load font : %s", curMatch);
-         continue;
-      }
-
-      if(!font->hasPlatformFont())
-      {
-         Con::errorf("populateAllFontCacheRange - font '%s' has no platform font! Cannot generate more characters.", curMatch);
-         continue;
-      }
-
-      // This has the side effect of generating character info, including the bitmaps.
-      Con::printf("   o Populating font '%s'", curMatch);
-      for(U32 i=rangeStart; i<rangeEnd; i++)
-      {
-         if(font->isValidChar(i))
-            font->getCharWidth(i);
-         else
-            Con::warnf("populateAllFontCacheRange - skipping invalid char 0x%x",  i);
-      }
-   }
-   // All done!
-}
-
-ConsoleFunction(exportCachedFont, void, 6, 6, "(fontName, size, fileName, padding, kerning) - "
-                "Export specified font to the specified filename as a PNG. The "
-                "image can then be processed in Photoshop or another tool and "
-                "reimported using importCachedFont. Characters in the font are"
-                "exported as one long strip.\n"
-                "@param fontName The name of the font to export.\n"
-                "@param size The size of the font\n"
-                "@param fileName The export file name.\n"
-                "@param padding Desired padding settings.\n"
-                "@param kerning Kerning settings (space between elements)\n"
-                "@return No return value.")
-{
-   // Read in some params.
-   const char *fileName = argv[3];
-   S32 padding    = dAtoi(argv[4]);
-   S32 kerning    = dAtoi(argv[5]);
-
-   // Tell the font to export itself.
-   Resource<GFont> f = GFont::create(argv[1], dAtoi(argv[2]), Con::getVariable("$GUI::fontCacheDirectory"));
-
-   if(f.isNull())
-   {
-      Con::errorf("populateFontCacheString - could not load font '%s %d'!", argv[1], dAtoi(argv[2]));
-      return;
-   }
-
-   f->exportStrip(fileName, padding, kerning);
-}
-
-ConsoleFunction(importCachedFont, void, 6, 6, "(fontName, size, fileName, padding, kerning) "
-                "Import an image strip from exportCachedFont. Call with the "
-                "same parameters you called exportCachedFont."
-                "@param fontName The name of the font to import.\n"
-                "@param size The size of the font\n"
-                "@param fileName The imported file name.\n"
-                "@param padding Desired padding settings.\n"
-                "@param kerning Kerning settings (space between elements)\n"
-                "@return No return value.")
-{
-   // Read in some params.
-   const char *fileName = argv[3];
-   S32 padding    = dAtoi(argv[4]);
-   S32 kerning    = dAtoi(argv[5]);
-
-   // Tell the font to import itself.
-   Resource<GFont> f = GFont::create(argv[1], dAtoi(argv[2]), Con::getVariable("$GUI::fontCacheDirectory"));
-
-   if(f.isNull())
-   {
-      Con::errorf("populateFontCacheString - could not load font '%s %d'!", argv[1], dAtoi(argv[2]));
-      return;
-   }
-
-   f->importStrip(fileName, padding, kerning);
-}
-
-ConsoleFunction(duplicateCachedFont, void, 4, 4, "(oldFontName, oldFontSize, newFontName) "
-                "Copy the specified old font to a new name. The new copy will not have a "
-                "platform font backing it, and so will never have characters added to it. "
-                "But this is useful for making copies of fonts to add postprocessing effects "
-                "to via exportCachedFont.\n"
-                "@param oldFontName The original font.\n"
-                "@param oldFontSize The original font's size property.\n"
-                "@param newFontName The name to set the copy to.\n"
-                "@return No return value.")
-{
-   char newFontFile[256];
-   GFont::getFontCacheFilename(argv[3], dAtoi(argv[2]), 256, newFontFile);
-
-   // Load the original font.
-   Resource<GFont> font = GFont::create(argv[1], dAtoi(argv[2]), Con::getVariable("$GUI::fontCacheDirectory"));
-
-   // Deal with inexplicably missing or failed to load fonts.
-   if (font.isNull())
-   {
-      Con::errorf(" o Couldn't find font : %s", newFontFile);
-      return;
-   }
-
-   // Ok, dump info!
-   FileStream stream;
-   if(ResourceManager->openFileForWrite(stream, newFontFile)) 
-   {
-      Con::printf("      o Writing duplicate font '%s' to disk...", newFontFile);
-      font->write(stream);
-      stream.close();
-   }
-   else
-   {
-      Con::errorf("      o Could not open '%s' for write!", newFontFile);
-   }
-}
-
 static PlatformFont* createSafePlatformFont(const char *name, U32 size, U32 charset = TGE_ANSI_CHARSET)
 {
    PlatformFont *platFont = createPlatformFont(name, size, charset);

BIN
engine/source/graphics/gFont_ScriptBinding.h


+ 1 - 50
engine/source/io/fileStreamObject.cc

@@ -23,22 +23,7 @@
 #include "console/console.h"
 #include "fileStreamObject.h"
 
-//////////////////////////////////////////////////////////////////////////
-// Local Globals
-//////////////////////////////////////////////////////////////////////////
-
-static const struct
-{
-   const char *strMode;
-   FileStream::AccessMode mode;
-} gModeMap[]=
-{
-   { "read", FileStream::Read },
-   { "write", FileStream::Write },
-   { "readwrite", FileStream::ReadWrite },
-   { "writeappend", FileStream::WriteAppend },
-   { NULL, (FileStream::AccessMode)0 }
-};
+#include "fileStreamObject_ScriptBinding.h"
 
 //////////////////////////////////////////////////////////////////////////
 // Constructor/Destructor
@@ -84,37 +69,3 @@ void FileStreamObject::close()
    mFileStream.close();
    mStream = NULL;
 }
-
-//////////////////////////////////////////////////////////////////////////
-// Console Methods
-//////////////////////////////////////////////////////////////////////////
-
-ConsoleMethod(FileStreamObject, open, bool, 4, 4, "(filename, mode) Open a file. Mode can be one of Read, Write, ReadWrite or WriteAppend.")
-{
-   FileStream::AccessMode mode;
-   bool found = false;
-   for(S32 i = 0;gModeMap[i].strMode;++i)
-   {
-      if(dStricmp(gModeMap[i].strMode, argv[3]) == 0)
-      {
-         mode = gModeMap[i].mode;
-         found = true;
-         break;
-      }
-   }
-
-   if(! found)
-   {
-      Con::errorf("FileStreamObject::open - Mode must be one of Read, Write, ReadWrite or WriteAppend.");
-      return false;
-   }
-
-   char buffer[1024];
-   Con::expandPath(buffer, sizeof(buffer), argv[2]);
-   return object->open(buffer, mode);
-}
-
-ConsoleMethod(FileStreamObject, close, void, 2, 2, "() Close the file.")
-{
-   object->close();
-}

BIN
engine/source/io/fileStreamObject_ScriptBinding.h


+ 2 - 24
engine/source/messaging/message.cc

@@ -39,6 +39,8 @@
 #include "memory/safeDelete.h"
 #include "io/bitStream.h"
 
+#include "message_ScriptBinding.h"
+
 //////////////////////////////////////////////////////////////////////////
 
 namespace Sim
@@ -112,27 +114,3 @@ void Message::freeReference()
       return;
    }
 }
-
-//////////////////////////////////////////////////////////////////////////
-// Console Methods
-//////////////////////////////////////////////////////////////////////////
-
-ConsoleMethod(Message, getType, const char *, 2, 2, "() Get message type (script class name or C++ class name if no script defined class)"
-			  "@return The type as a string")
-{
-   return object->getType();
-}
-
-//////////////////////////////////////////////////////////////////////////
-
-ConsoleMethod(Message, addReference, void, 2, 2, "() Increment the reference count for this message\n"
-			  "@return No Return Value.")
-{
-   object->addReference();
-}
-
-ConsoleMethod(Message, freeReference, void, 2, 2, "() Decrement the reference count for this message\n"
-			  "@return No Return Value.")
-{
-   object->freeReference();
-}

BIN
engine/source/messaging/message_ScriptBinding.h


+ 2 - 11
engine/source/network/httpObject.cc

@@ -28,6 +28,8 @@
 #include "sim/simBase.h"
 #include "console/consoleInternal.h"
 
+#include "httpObject_ScriptBinding.h"
+
 IMPLEMENT_CONOBJECT(HTTPObject);
 
 //--------------------------------------
@@ -313,14 +315,3 @@ U32 HTTPObject::onReceive(U8 *buffer, U32 bufferLen)
    }
    return bufferLen;
 }
-
-//--------------------------------------
-ConsoleMethod( HTTPObject, get, void, 4, 5, "(TransportAddress addr, string requirstURI, string query=NULL)")
-{
-   object->get(argv[2], argv[3], argc == 4 ? NULL : argv[4]);
-}
-
-ConsoleMethod( HTTPObject, post, void, 6, 6, "(TransportAddress addr, string requestURI, string query, string post)")
-{
-   object->post(argv[2], argv[3], argv[4], argv[5]);
-}

BIN
engine/source/network/httpObject_ScriptBinding.h


BIN
engine/source/network/netConnection_ScriptBinding.h


+ 0 - 6
engine/source/network/netGhost.cc

@@ -116,12 +116,6 @@ public:
 
 IMPLEMENT_CO_NETEVENT_V1(GhostAlwaysObjectEvent);
 
-ConsoleMethod( NetConnection, getGhostsActive, S32, 2, 2, "() Use the getGhostsActive method to determine how many ghosts are active on a particular connection.\n"
-                                                                "@return Returns an integer value between 0 and inf, specifying how many objects are being ghosted to a client on the other side of a specific connection")
-{
-    return object->getGhostsActive();
-}
-
 void NetConnection::setGhostTo(bool ghostTo)
 {
    if(mLocalGhosts) // if ghosting to this is already enabled, silently return

+ 2 - 42
engine/source/network/netObject.cc

@@ -27,6 +27,8 @@
 #include "network/netObject.h"
 #include "console/consoleTypes.h"
 
+#include "netObject_ScriptBinding.h"
+
 IMPLEMENT_CONOBJECT(NetObject);
 
 //----------------------------------------------------------------------------
@@ -143,43 +145,6 @@ void NetObject::collapseDirtyList()
 
 //-----------------------------------------------------------------------------
 
-ConsoleMethod(NetObject,scopeToClient,void,3,3,"( client ) Use the scopeToClient method to force this object to be SCOPE_ALWAYS on client.\n"
-                                                                "When an object is SCOPE_ALWAYS it is always ghosted. Therefore, if you have an object that should always be ghosted to a client, use this method.\n"
-                                                                "@param client The ID of the client to force this object to be SCOPE_ALWAYS for.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa clearScopeToClient, setScopeAlways")
-{
-   NetConnection *conn;
-   if(!Sim::findObject(argv[2], conn))
-   {
-      Con::errorf(ConsoleLogEntry::General, "NetObject::scopeToClient: Couldn't find connection %s", argv[2]);
-      return;
-   }
-   conn->objectLocalScopeAlways(object);
-}
-
-ConsoleMethod(NetObject,clearScopeToClient,void,3,3,"( client ) Use the clearScopeToClient method to undo the effects of a previous call to scopeToClient.\n"
-                                                                "@param client The ID of the client to stop forcing scoping this object for.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa scopeToClient")
-{
-   NetConnection *conn;
-   if(!Sim::findObject(argv[2], conn))
-   {
-      Con::errorf(ConsoleLogEntry::General, "NetObject::clearScopeToClient: Couldn't find connection %s", argv[2]);
-      return;
-   }
-   conn->objectLocalClearAlways(object);
-}
-
-ConsoleMethod(NetObject,setScopeAlways,void,2,2,"() Use the setScopeAlways method to force an object to be SCOPE_ALWAYS for all clients.\n"
-                                                                "When an object is SCOPE_ALWAYS it is always ghosted. Therefore, if you have an object that should always be ghosted to all clients, use this method.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa scopeToClient")
-{
-   object->setScopeAlways();
-}
-
 void NetObject::setScopeAlways()
 {
    if(mNetFlags.test(Ghostable) && !mNetFlags.test(IsGhost))
@@ -280,8 +245,3 @@ void NetObject::initPersistFields()
 {
    Parent::initPersistFields();
 }
-
-ConsoleMethod( NetObject, getGhostID, S32, 2, 2, "()\n @return Returns the ghost ID of the object")
-{
-   return object->getNetIndex();
-}

BIN
engine/source/network/netObject_ScriptBinding.h


+ 9 - 5
engine/source/network/netTest.cc

@@ -87,15 +87,19 @@ public:
 
 IMPLEMENT_CO_NETOBJECT_V1(SimpleNetObject);
 
-ConsoleMethod( SimpleNetObject, setMessage, void, 3, 3, "(string msg) Sets the object message to the provide string\n"
-              "@param msg The string you wish as the message\n"
-              "@return No return value")
+/*! Sets the object message to the provide string
+	@param msg The string you wish as the message
+	@return No return value
+*/
+ConsoleMethodWithDocs( SimpleNetObject, setMessage, void, 3, 3, (string msg)) 
 {
    object->setMessage(argv[2]);
 }
 
-ConsoleFunction( msg, void, 3, 3, "(NetConnection id, string message)"
-                "Send a SimpleNetObject message to the specified connection.")
+/*! Send a SimpleNetObject message to the specified connection
+*/
+
+ConsoleFunctionWithDocs( msg, void, 3, 3, (NetConnection id, string message))
 {
    NetConnection *con = (NetConnection *) Sim::findObject(argv[1]);
    if(con)

+ 4 - 171
engine/source/network/serverQuery.cc

@@ -106,6 +106,8 @@
 #include "game/version.h"
 #include "game/gameConnection.h"
 
+#include "serverQuery_ScriptBinding.h"
+
 // This is basically the server query protocol version now:
 static const char* versionString = "VER1";
 
@@ -138,8 +140,6 @@ static U32 gServerPingCount = 0;
 static U32 gServerQueryCount = 0;
 static U32 gHeartbeatSeq = 0;
 
-ConsoleFunctionGroupBegin( ServerQuery, "Functions which allow you to query the LAN or a master server for online games.");
-
 //-----------------------------------------------------------------------------
 
 struct Ping
@@ -389,45 +389,6 @@ void queryLanServers(U32 port, U8 flags, const char* gameType, const char* missi
    processPingsAndQueries( gPingSession );
 }
 
-//-----------------------------------------------------------------------------
-ConsoleFunction( queryLanServers, void, 12, 12, "( port , flags , gametype , missiontype , minplayers , maxplayers , maxbots , regionmask , maxping , mincpu , filterflags ) Use the queryLANServers function to establish whether any game servers of the required specification(s) are available on the local area network (LAN).\n"
-                                                                "@param port Look for any game servers advertising at this port. Set to 0 if you don't care what port the game server is using.\n"
-                                                                "@param flags Look for any game servers with these special flags set. Set to 0 for no flags.\n"
-                                                                "@param gametype Look for any game servers playing a game type that matches this string. Set to the NULL string to look for any game type.\n"
-                                                                "@param missiontype Look for any game servers playing a mission type that matches this string. Set to the NULL string to look for any mission type.\n"
-                                                                "@param minplayers Look for any game servers with this number of players or more. Set to 0 for no lower limit.\n"
-                                                                "@param maxplayers Look for any game servers with this number of players or fewer. Set to 0 for no upper limit.\n"
-                                                                "@param maxbots Look for any game servers with this number of AI controlled players or fewer. Set to 0 for no limit.\n"
-                                                                "@param regionmask Look for any master servers, on our master server list, in this region. Set to 0 to examine all regions.\n"
-                                                                "@param maxping Look for any game servers with a PING rate equal to or lower than this. Set to 0 for no upper PING limit.\n"
-                                                                "@param mincpu Look for any game servers with a CPU (clock speed) equal or greater than this. Set to 0 for no CPU (clock speed) limit.\n"
-                                                                "@param filterflags Look for any game servers with this game version number or higher. Set to 0 to find all versions.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa getServerCount, queryMasterServer, setServerInfo, stopServerQuery")
-{
-   U32 lanPort = dAtoi(argv[1]);
-   U8 flags = dAtoi(argv[2]);
-
-   // It's not a good idea to hold onto args, recursive calls to
-   // console exec will trash them.
-   char* gameType = dStrdup(argv[3]);
-   char* missionType = dStrdup(argv[4]);
-
-   U8 minPlayers = dAtoi(argv[5]);
-   U8 maxPlayers = dAtoi(argv[6]);
-   U8 maxBots = dAtoi(argv[7]);
-   U32 regionMask = dAtoi(argv[8]);
-   U32 maxPing = dAtoi(argv[9]);
-   U16 minCPU = dAtoi(argv[10]);
-   U8 filterFlags = dAtoi(argv[11]);
-
-   queryLanServers(lanPort, flags, gameType, missionType, minPlayers, maxPlayers, maxBots,
-       regionMask, maxPing, minCPU, filterFlags);
-
-   dFree(gameType);
-   dFree(missionType);
-}
-
 //-----------------------------------------------------------------------------
 
 void queryMasterGameTypes()
@@ -513,63 +474,6 @@ void queryMasterServer(U8 flags, const char* gameType, const char* missionType,
       processMasterServerQuery( gPingSession );
 }
 
-ConsoleFunction( queryMasterServer, void, 11, 11, "( flags , gametype , missiontype , minplayers , maxplayers , maxbots , regionmask , maxping , mincpu , filterflags ) Use the queryMasterServer function to query all master servers in the master server list and to establish if they are aware of any game servers that meet the specified requirements, as established by the arguments passed to this function.\n"
-                                                                "In order for this function to do anything, a list of master servers must have been previously specified. This list may contain one or more server addresses. A call to this function will search all servers in the list. To specify a list, simply create a set of array entries like this:\n$pref::Master[0] = \"2:192.168.123.15:28002\";\n$pref::Master[1] = \"2:192.168.123.2:28002\";\nThe format of these values is ==> Region Number : IP Address : Port Number\nThese values should be specified in either the client's or the server's preferences file (prefs.cs). You may specifiy it elsewhere, however be sure that it is specified prior to this function being called and before any other functions that rely on it.\n"
-                                                                "@param flags Look for any game servers with these special flags set. Set to 0 for no flags.\n"
-                                                                "@param gametype Look for any game servers playing a game type that matches this string. Set to the NULL string to look for any game type.\n"
-                                                                "@param missiontype Look for any game servers playing a mission type that matches this string. Set to the NULL string to look for any mission type.\n"
-                                                                "@param minplayers Look for any game servers with this number of players or more. Set to 0 for no lower limit.\n"
-                                                                "@param maxplayers Look for any game servers with this number of players or fewer. Set to 0 for no upper limit.\n"
-                                                                "@param maxbots Look for any game servers with this number of AI controlled players or fewer. Set to 0 for no limit.\n"
-                                                                "@param regionmask Look for any master servers, on our master server list, in this region. Set to 0 to examine all regions.\n"
-                                                                "@param maxping Look for any game servers with a PING rate equal to or lower than this. Set to 0 for no upper PING limit.\n"
-                                                                "@param mincpu Look for any game servers with a CPU (clock speed) equal or greater than this. Set to 0 for no CPU (clock speed) limit.\n"
-                                                                "@param filterflags Look for any game servers with this game version number or higher. Set to 0 to find all versions.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa getServerCount, queryLANServers, setServerInfo, startHeartbeat, stopServerQuery")
-{
-   U8 flags = dAtoi(argv[1]);
-
-   // It's not a good idea to hold onto args, recursive calls to
-   // console exec will trash them.
-   char* gameType = dStrdup(argv[2]);
-   char* missionType = dStrdup(argv[3]);
-
-   U8 minPlayers = dAtoi(argv[4]);
-   U8 maxPlayers = dAtoi(argv[5]);
-   U8 maxBots = dAtoi(argv[6]);
-   U32 regionMask = dAtoi(argv[7]);
-   U32 maxPing = dAtoi(argv[8]);
-   U16 minCPU = dAtoi(argv[9]);
-   U8 filterFlags = dAtoi(argv[10]);
-   U32 buddyList = 0;
-
-   queryMasterServer(flags,gameType,missionType,minPlayers,maxPlayers,
-      maxBots,regionMask,maxPing,minCPU,filterFlags,0,&buddyList);
-
-   dFree(gameType);
-   dFree(missionType);
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( querySingleServer, void, 3, 3, "( address [ , flags ] ) Use the querySingleServer function to re-query a previously queried lan server, OR a game server found with queryLANServers or with queryMasterServer and selected with setServerInfo. This will refresh the information stored by TGE about this server. It will not however modify the values of the $ServerInfo::* global variables.\n"
-                                                                "@param address The IP address and Port to re-query, i.e. \"192.168.123.2:28000\".\n"
-                                                                "@param flags No longer used.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa getServerCount, queryLANServers, queryMasterServer, setServerInfo, stopServerQuery")
-{
-   NetAddress addr;
-   char* addrText;
-
-   addrText = dStrdup(argv[1]);
-   U8 flags = dAtoi(argv[2]);
-
-
-   Net::stringToAddress( addrText, &addr );
-   querySingleServer(&addr,flags);
-}
-
 //-----------------------------------------------------------------------------
 
 void queryFavoriteServers( U8 /*flags*/ )
@@ -647,13 +551,6 @@ void cancelServerQuery()
    }
 }
 
-ConsoleFunction( cancelServerQuery, void, 1, 1, "() Use the cancelServerQuery function to cancel a previous query*() call.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa queryLANServers, queryMasterServer, querySingleServer")
-{
-   cancelServerQuery();
-}
-
 //-----------------------------------------------------------------------------
 
 void stopServerQuery()
@@ -677,19 +574,7 @@ void stopServerQuery()
    }
 }
 
-ConsoleFunction( stopServerQuery, void, 1, 1, "() Use the stopServerQuery function to cancel any outstanding server queries.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa queryLANServers, queryMasterServer, querySingleServer")
-{
-   stopServerQuery();
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction(startHeartbeat, void, 1, 1, "() Use the startHeartbeat function to start advertising this game serer to any master servers on the master server list.\n"
-                                                                "In order for this function to do anything, a list of master servers must have been previously specified. This list may contain one or more server addresses. Once this function is called, the game server will re-advertise itself to all the master servers on its master server lits every two minutes. To specify a list, simply create a set of array entries like this:\n$pref::Master[0] = \"2:192.168.123.15:28002\";\n$pref::Master[1] = \"2:192.168.123.2:28002\";\nThe format of these values is ==> Region Number : IP Address : Port Number\nThese values should be specified in either the client's or the server's preferences file (prefs.cs). You may specifiy it elsewhere, however be sure that it is specified prior to this function being called and before any other functions that rely on it.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa queryMasterServer, stopHeartbeat")
+void startHeartbeat()
 {
    if (validateAuthenticatedServer())
    {
@@ -698,60 +583,11 @@ ConsoleFunction(startHeartbeat, void, 1, 1, "() Use the startHeartbeat function
    }
 }
 
-ConsoleFunction(stopHeartbeat, void, 1, 1, "() Use the startHeartbeat function to stop advertising this game serer to any master servers on the master server list.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa queryMasterServer, startHeartbeat")
+void stopHeartBeat()
 {
    gHeartbeatSeq++;
 }
 
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( getServerCount, int, 1, 1, "() Use the getServerCount function to determine the number of game servers found on the last queryLANServers() or queryMasterServer() call.\n"
-                                                                "This value is important because it allows us to properly index when calling setServerInfo().\n"
-                                                                "@return Returns a numeric value equal to the number of game servers found on the last queryLANServers() or queryMasterServer() call. Returns 0 if the function was not called, or none were found.\n"
-                                                                "@sa queryLANServers, queryMasterServer, setServerInfo")
-{
-   return gServerList.size();
-}
-
-ConsoleFunction( setServerInfo, bool, 2, 2, "( index ) Use the setServerInfo function to set the values of the $ServerInfo::* global variables with information for a server found with queryLANServers or with queryMasterServer.\n"
-                                                                "@param index The index of the server to get information about.\n"
-                                                                "@return Will return true if the information was successfully set, false otherwise.\n"
-                                                                "@sa getServerCount, queryLANServers, queryMasterServer, querySingleServer")
-{
-   S32 index = dAtoi(argv[1]);
-   
-   if (index >= 0 && index < gServerList.size())
-   {
-      ServerInfo& info = gServerList[index];
-
-      char addrString[256];
-      Net::addressToString( &info.address, addrString );
-
-      Con::setIntVariable("ServerInfo::Status",info.status);
-      Con::setVariable("ServerInfo::Address",addrString);
-      Con::setVariable("ServerInfo::Name",info.name);
-      Con::setVariable("ServerInfo::GameType",info.gameType);
-      Con::setVariable("ServerInfo::MissionName",info.missionName);
-      Con::setVariable("ServerInfo::MissionType",info.missionType);
-      Con::setVariable("ServerInfo::State",info.statusString);
-      Con::setVariable("ServerInfo::Info",info.infoString);
-      Con::setIntVariable("ServerInfo::PlayerCount",info.numPlayers);
-      Con::setIntVariable("ServerInfo::MaxPlayers",info.maxPlayers);
-      Con::setIntVariable("ServerInfo::BotCount",info.numBots);
-      Con::setIntVariable("ServerInfo::Version",info.version);
-      Con::setIntVariable("ServerInfo::Ping",info.ping);
-      Con::setIntVariable("ServerInfo::CPUSpeed",info.cpuSpeed);
-      Con::setBoolVariable("ServerInfo::Favorite",info.isFavorite);
-      Con::setBoolVariable("ServerInfo::Dedicated",info.isDedicated());
-      Con::setBoolVariable("ServerInfo::Password",info.isPassworded());
-      return true;
-   }
-   return false;
-}
-
-
 //-----------------------------------------------------------------------------
 // Internal
 //-----------------------------------------------------------------------------
@@ -2096,6 +1932,3 @@ void DemoNetInterface::handleInfoPacket( const NetAddress* address, U8 packetTyp
          break;
    }
 }
-
-
-ConsoleFunctionGroupEnd( ServerQuery );

+ 3 - 0
engine/source/network/serverQuery.h

@@ -133,7 +133,10 @@ extern void queryMasterServer(U8 flags, const char* gameType, const char* missio
       U8 filterFlags, U8 buddyCount, U32* buddyList );
 extern void queryFavoriteServers( U8 flags );
 extern void querySingleServer(const NetAddress* addr, U8 flags);
+extern void cancelServerQuery();
+extern void stopServerQuery();
 extern void startHeartbeat();
+extern void stopHeartBeat();
 extern void sendHeartbeat( U8 flags );
 
 #ifdef TORQUE_DEBUG

BIN
engine/source/network/serverQuery_ScriptBinding.h


+ 2 - 60
engine/source/network/tcpObject.cc

@@ -33,6 +33,8 @@
 #include "platformiOS/iOSUtil.h"
 #endif //TORQUE_OS_IOS
 
+#include "tcpObject_ScriptBinding.h"
+
 TCPObject *TCPObject::table[TCPObject::TableSize] = {0, };
 
 IMPLEMENT_CONOBJECT(TCPObject);
@@ -325,66 +327,6 @@ void TCPObject::send(const U8 *buffer, U32 len)
    Net::sendtoSocket(mTag, buffer, S32(len));
 }
 
-ConsoleMethod( TCPObject, send, void, 3, 0, "( ... ) Use the send method to send any number of parameters, as strings, one at a time to the agent at the other end of the connection.\n"
-                                                                "@param ... Any number of arguments, as strings. Each string is sent separately. i.e. The arguments are not concatenated.\n"
-                                                                "@return No return value")
-{
-   for(S32 i = 2; i < argc; i++)
-      object->send((const U8 *) argv[i], dStrlen(argv[i]));
-}
-
-ConsoleMethod( TCPObject, listen, void, 3, 3, "( port ) Use the listen method to allow this TCPObject to accept connections on the specified port.\n"
-                                                                "@param port A value between 1000 and 65536.\n"
-                                                                "@return No return value")
-{
-   object->listen(U32(dAtoi(argv[2])));
-}
-
-ConsoleMethod( TCPObject, connect, void, 3, 3, "( addr ) Use the connect method to request a connection to a remote agent at the address addr.\n"
-                                                                "@param addr A string containing an address of the form: ìA.B.C.D:Portî, where A .. B are standard IP numbers between 0 and 255 and Port can be between 1000 and 65536.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa disconnect")
-{
-   object->connect(argv[2]);
-}
-
-
-//Luma:	Used to force networking to be opened before connecting... written specifically to handle GPRS/EDGE/3G situation on iPhone, but can be expanded to other platforms too
-ConsoleMethod( TCPObject, openAndConnect, void, 3, 3, "(string addr)"
-              "Connect to the given address, making sure that the connection is open first.")
-{
-   object->openAndConnect(argv[2]);
-}
-
-ConsoleMethod( TCPObject, disconnect, void, 2, 2, "() Use the disconnect method to close a previously opened connection without destroying the requesting TCPOpbject.\n"
-                                                                "This will close any open connection, but not destroy this object. Thus, the object can be used to open a new connection.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa connect")
-{
-   object->disconnect();
-}
-
-
-//Luma:	Encode data before sending via TCP so that only valid URL characters are sent
-ConsoleMethod(TCPObject, URLEncodeString, const char*, 3, 3, "(string data) Performs URLEncoding on a single string.\n\n")
-{
-    U8	*pEncodedString;
-    U32	iNewBufferLen;
-
-
-    pEncodedString = object->URLEncodeData((U8 *)argv[2], dStrlen(argv[2]) + 1, &iNewBufferLen);
-
-    //copy string to return buffer
-    char	*pcReturnBuffer = Con::getReturnBuffer(iNewBufferLen);
-    dMemcpy(pcReturnBuffer, pEncodedString, iNewBufferLen);
-
-    //free encoded data pointer
-    dFree((void *)pEncodedString);
-   
-    return pcReturnBuffer;
-}
-
-
 void DefaultGame::processConnectedReceiveEvent(ConnectedReceiveEvent* event )
 {
    TCPObject *tcpo = TCPObject::find(event->tag);

BIN
engine/source/network/tcpObject_ScriptBinding.h


+ 0 - 5
engine/source/platform/platform.cc

@@ -68,8 +68,3 @@ bool Platform::hasExtension(const char* pFilename, const char* pExtension)
     // Check if extension exists.
     return dStricmp( pFilename + filenameLength - extensionLength, pExtension ) == 0;
 }
-
-ConsoleFunction( createUUID, const char*, 1, 1, "() - Creates a UUID string." )
-{
-    return Platform::createUUID();
-}

+ 2 - 9
engine/source/platform/platformAssert.cc

@@ -24,6 +24,8 @@
 #include "console/console.h"
 #include <stdarg.h>
 
+#include "platformAssert_ScriptBinding.h"
+
 //-------------------------------------- STATIC Declaration
 PlatformAssert *PlatformAssert::platformAssert = NULL;
 
@@ -168,12 +170,3 @@ const char* avar(const char *message, ...)
    dVsprintf(buffer, sizeof(buffer), message, args);
    return( buffer );
 }
-
-
-//-----------------------------------------------------------------------------
-
-ConsoleFunction( Assert, void, 3, 3, "(condition, message) - Fatal Script Assertion" )
-{
-    // Process Assertion.
-    AssertISV( dAtob(argv[1]), argv[2] );
-}

+ 39 - 0
engine/source/platform/platformAssert_ScriptBinding.h

@@ -0,0 +1,39 @@
+//-----------------------------------------------------------------------------
+// Copyright (c) 2013 GarageGames, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+
+/*! @defgroup AssertFunctions Assert
+	@ingroup TorqueScriptFunctions
+	@{
+*/
+
+/*!  Fatal Script Assertion
+	@param condition if false, exit the program
+	@param message message to print on assertion
+*/
+
+ConsoleFunctionWithDocs( Assert, void, 3, 3, (condition, message) )
+{
+    // Process Assertion.
+    AssertISV( dAtob(argv[1]), argv[2] );
+}
+
+/*! @} */ // AssertFunctions

+ 2 - 25
engine/source/platform/platformFileIO.cc

@@ -27,6 +27,8 @@
 #include "string/stringTable.h"
 #include "io/resource/resourceManager.h"
 
+#include "platformFileIO_ScriptBinding.h"
+
 //-----------------------------------------------------------------------------
 
 StringTableEntry Platform::getTemporaryDirectory()
@@ -39,12 +41,6 @@ StringTableEntry Platform::getTemporaryDirectory()
    return path;
 }
 
-ConsoleFunction(getTemporaryDirectory, const char *, 1, 1, "() Gets the path to the system's temporary directory\n"
-                "@return Returns the path to the temporary directory as a string")
-{
-   return Platform::getTemporaryDirectory();
-}
-
 StringTableEntry Platform::getTemporaryFileName()
 {
    char buf[512];
@@ -59,12 +55,6 @@ StringTableEntry Platform::getTemporaryFileName()
    return StringTable->insert(buf);
 }
 
-ConsoleFunction(getTemporaryFileName, const char *, 1, 1, "() Generates a temporary filename for use.\n"
-                "@return Returns the formatted temporary filename for use")
-{
-   return Platform::getTemporaryFileName();
-}
-
 //-----------------------------------------------------------------------------
 static char filePathBuffer[1024];
 static bool deleteDirectoryRecusrive( const char* pPath )
@@ -464,16 +454,3 @@ StringTableEntry Platform::getPrefsPath(const char *file /* = NULL */)
 }
 
 //-----------------------------------------------------------------------------
-
-ConsoleFunction(getUserDataDirectory, const char*, 1, 1, "()\n"
-                "@return Returns a string to the directory storing the user's data")
-{
-   return Platform::getUserDataDirectory();
-}
-
-ConsoleFunction(getUserHomeDirectory, const char*, 1, 1, "() \n"
-                "@return Returns the path to the user's home directory.")
-{
-   return Platform::getUserHomeDirectory();
-}
-

BIN
engine/source/platform/platformFileIO_ScriptBinding.h


BIN
engine/source/platform/platform_ScriptBinding.h


+ 2 - 43
engine/source/sim/simSerialize.cpp

@@ -26,6 +26,8 @@
 #include "io/fileStream.h"
 #include "io/resource/resourceManager.h"
 
+#include "simSerialize_ScriptBinding.h"
+
 //////////////////////////////////////////////////////////////////////////
 // SimObject Methods
 //////////////////////////////////////////////////////////////////////////
@@ -269,46 +271,3 @@ SimObject *loadObjectStream(Stream *stream)
 }
 
 } // end namespace Sim
-
-//////////////////////////////////////////////////////////////////////////
-// Console Methods
-//////////////////////////////////////////////////////////////////////////
-
-ConsoleMethod(SimObject, addFieldFilter, void, 3, 3, "(fieldName) Adds the given field filter to the list of table entries.\n"
-              "@param fieldName The name of the field filter to add.\n"
-              "@return No return value")
-{
-   object->addFieldFilter(argv[2]);
-}
-
-ConsoleMethod(SimObject, removeFieldFilter, void, 3, 3, "(fieldName) Removes the specified field filter from the table\n"
-              "@param fieldName The name of the field filter to remove.\n"
-              "@return No return value.")
-{
-   object->removeFieldFilter(argv[2]);
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-// Console Functions
-//////////////////////////////////////////////////////////////////////////
-
-ConsoleFunction(saveObject, bool, 3, 3, "(object, filename) Saves the given object to the given filename\n"
-                "@param object The SimObject to save\n"
-                "@param filename The name of the file in which to save the object\n"
-                "@return Returns true on success and flase on failure")
-{
-   SimObject *obj = dynamic_cast<SimObject *>(Sim::findObject(argv[1]));
-   if(obj == NULL)
-      return false;
-   
-   return Sim::saveObject(obj, argv[2]);
-}
-
-ConsoleFunction(loadObject, S32, 2, 2, "(filename) Loads an object from the specified filename\n"
-                "@param filename The name of the file to load the object from\n"
-                "@return Returns the ID of the object on success, or 0 on failure.")
-{
-   SimObject *obj = Sim::loadObjectStream(argv[1]);
-   return obj ? obj->getId() : 0;
-}

BIN
engine/source/sim/simSerialize_ScriptBinding.h