diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-01-31 01:38:18 +0100 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-01-31 01:38:18 +0100 |
commit | c142424571a3744e8b68ec9746eaa05505c03af5 (patch) | |
tree | 9a8950e671cafbe4eddc096cdc648d7876c1b1de /source | |
parent | Replaced most FILE operations with a cFile object (diff) | |
download | cuberite-c142424571a3744e8b68ec9746eaa05505c03af5.tar cuberite-c142424571a3744e8b68ec9746eaa05505c03af5.tar.gz cuberite-c142424571a3744e8b68ec9746eaa05505c03af5.tar.bz2 cuberite-c142424571a3744e8b68ec9746eaa05505c03af5.tar.lz cuberite-c142424571a3744e8b68ec9746eaa05505c03af5.tar.xz cuberite-c142424571a3744e8b68ec9746eaa05505c03af5.tar.zst cuberite-c142424571a3744e8b68ec9746eaa05505c03af5.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Bindings.cpp | 33 | ||||
-rw-r--r-- | source/Bindings.h | 2 | ||||
-rw-r--r-- | source/cPlayer.cpp | 3 | ||||
-rw-r--r-- | source/cWebAdmin.cpp | 2 | ||||
-rw-r--r-- | source/cWebAdmin.h | 1 | ||||
-rw-r--r-- | source/cWebPlugin_Lua.cpp | 8 |
6 files changed, 41 insertions, 8 deletions
diff --git a/source/Bindings.cpp b/source/Bindings.cpp index 8d484fa1f..6462036be 100644 --- a/source/Bindings.cpp +++ b/source/Bindings.cpp @@ -1,6 +1,6 @@ /*
** Lua binding: AllToLua
-** Generated automatically by tolua++-1.0.92 on 01/30/12 17:26:14.
+** Generated automatically by tolua++-1.0.92 on 01/31/12 01:23:11.
*/
#ifndef __cplusplus
@@ -10453,6 +10453,36 @@ static int tolua_set_HTTPRequest_Params_ptr(lua_State* tolua_S) }
#endif //#ifndef TOLUA_DISABLE
+/* get function: PostParams of class HTTPRequest */
+#ifndef TOLUA_DISABLE_tolua_get_HTTPRequest_PostParams_ptr
+static int tolua_get_HTTPRequest_PostParams_ptr(lua_State* tolua_S)
+{
+ HTTPRequest* self = (HTTPRequest*) tolua_tousertype(tolua_S,1,0);
+#ifndef TOLUA_RELEASE
+ if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'PostParams'",NULL);
+#endif
+ tolua_pushusertype(tolua_S,(void*)self->PostParams,"cStringMap");
+ return 1;
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* set function: PostParams of class HTTPRequest */
+#ifndef TOLUA_DISABLE_tolua_set_HTTPRequest_PostParams_ptr
+static int tolua_set_HTTPRequest_PostParams_ptr(lua_State* tolua_S)
+{
+ HTTPRequest* self = (HTTPRequest*) tolua_tousertype(tolua_S,1,0);
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'PostParams'",NULL);
+ if (!tolua_isusertype(tolua_S,2,"cStringMap",0,&tolua_err))
+ tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);
+#endif
+ self->PostParams = ((cStringMap*) tolua_tousertype(tolua_S,2,0))
+;
+ return 0;
+}
+#endif //#ifndef TOLUA_DISABLE
+
/* get function: Username of class HTTPRequest */
#ifndef TOLUA_DISABLE_tolua_get_HTTPRequest_Username
static int tolua_get_HTTPRequest_Username(lua_State* tolua_S)
@@ -17001,6 +17031,7 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_variable(tolua_S,"Method",tolua_get_HTTPRequest_Method,tolua_set_HTTPRequest_Method);
tolua_variable(tolua_S,"Path",tolua_get_HTTPRequest_Path,tolua_set_HTTPRequest_Path);
tolua_variable(tolua_S,"Params",tolua_get_HTTPRequest_Params_ptr,tolua_set_HTTPRequest_Params_ptr);
+ tolua_variable(tolua_S,"PostParams",tolua_get_HTTPRequest_PostParams_ptr,tolua_set_HTTPRequest_PostParams_ptr);
tolua_variable(tolua_S,"Username",tolua_get_HTTPRequest_Username,tolua_set_HTTPRequest_Username);
tolua_endmodule(tolua_S);
#ifdef __cplusplus
diff --git a/source/Bindings.h b/source/Bindings.h index b2ff3c1c8..6e1a7b46c 100644 --- a/source/Bindings.h +++ b/source/Bindings.h @@ -1,6 +1,6 @@ /*
** Lua binding: AllToLua
-** Generated automatically by tolua++-1.0.92 on 01/30/12 17:26:15.
+** Generated automatically by tolua++-1.0.92 on 01/31/12 01:23:11.
*/
/* Exported function */
diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp index 8e161900c..23c43ae25 100644 --- a/source/cPlayer.cpp +++ b/source/cPlayer.cpp @@ -767,8 +767,7 @@ void cPlayer::LoadPermissionsFromDisk() -
-bool cPlayer::LoadFromDisk() // TODO - This should also get/set/whatever the correct world for this player
+bool cPlayer::LoadFromDisk()
{
LoadPermissionsFromDisk();
diff --git a/source/cWebAdmin.cpp b/source/cWebAdmin.cpp index 70f89528c..005a85424 100644 --- a/source/cWebAdmin.cpp +++ b/source/cWebAdmin.cpp @@ -136,6 +136,7 @@ void cWebAdmin::Request_Handler(webserver::http_request* r) Request.Username = r->username_;
Request.Method = r->method_;
Request.Params = new cStringMap(r->params_);
+ Request.PostParams = new cStringMap(r->params_post_);
Request.Path = r->path_;
if( Split.size() > 1 )
@@ -158,6 +159,7 @@ void cWebAdmin::Request_Handler(webserver::http_request* r) }
delete Request.Params;
+ delete Request.PostParams;
if( FoundPlugin.empty() ) // Default page
{
diff --git a/source/cWebAdmin.h b/source/cWebAdmin.h index 5a43b4877..da60a5492 100644 --- a/source/cWebAdmin.h +++ b/source/cWebAdmin.h @@ -10,6 +10,7 @@ struct HTTPRequest std::string Method;
std::string Path;
cStringMap* Params;
+ cStringMap* PostParams;
std::string Username;
};
//tolua_end
diff --git a/source/cWebPlugin_Lua.cpp b/source/cWebPlugin_Lua.cpp index 40e8fcb76..d1446ba24 100644 --- a/source/cWebPlugin_Lua.cpp +++ b/source/cWebPlugin_Lua.cpp @@ -76,13 +76,13 @@ std::string cWebPlugin_Lua::HandleRequest( HTTPRequest* a_Request ) if( Tab )
{
- LOGINFO("1. Stack size: %i", lua_gettop(LuaState) );
+ //LOGINFO("1. Stack size: %i", lua_gettop(LuaState) );
lua_rawgeti( LuaState, LUA_REGISTRYINDEX, Tab->Reference); // same as lua_getref()
- LOGINFO("2. Stack size: %i", lua_gettop(LuaState) );
+ //LOGINFO("2. Stack size: %i", lua_gettop(LuaState) );
// Push HTTPRequest
tolua_pushusertype( LuaState, a_Request, "HTTPRequest" );
- LOGINFO("Calling bound function! :D");
+ //LOGINFO("Calling bound function! :D");
int s = lua_pcall( LuaState, 1, 1, 0);
if ( s != 0 )
@@ -103,7 +103,7 @@ std::string cWebPlugin_Lua::HandleRequest( HTTPRequest* a_Request ) RetVal += tolua_tostring(LuaState, -1, 0);
lua_pop(LuaState, 1); // Pop return value
- LOGINFO("ok. Stack size: %i", lua_gettop(LuaState) );
+ //LOGINFO("ok. Stack size: %i", lua_gettop(LuaState) );
}
return RetVal;
|