diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/Authenticator.cpp | 2 | ||||
-rw-r--r-- | source/Bindings.cpp | 738 | ||||
-rw-r--r-- | source/Bindings.h | 2 | ||||
-rw-r--r-- | source/BlockID.cpp | 12 | ||||
-rw-r--r-- | source/Entities/Player.cpp | 8 | ||||
-rw-r--r-- | source/Generating/ChunkGenerator.cpp | 2 | ||||
-rw-r--r-- | source/GroupManager.cpp | 4 | ||||
-rw-r--r-- | source/Mobs/Monster.h | 4 | ||||
-rw-r--r-- | source/MonsterConfig.cpp | 8 | ||||
-rw-r--r-- | source/PluginManager.cpp | 4 | ||||
-rw-r--r-- | source/Root.cpp | 6 | ||||
-rw-r--r-- | source/WebAdmin.cpp | 9 | ||||
-rw-r--r-- | source/World.cpp | 6 |
13 files changed, 198 insertions, 607 deletions
diff --git a/source/Authenticator.cpp b/source/Authenticator.cpp index 368431010..a32e9ce8f 100644 --- a/source/Authenticator.cpp +++ b/source/Authenticator.cpp @@ -67,7 +67,7 @@ void cAuthenticator::ReadINI(cIniFile & IniFile) if (bSave) { IniFile.SetValueB("Authentication", "Authenticate", m_ShouldAuthenticate); - IniFile.WriteFile(); + IniFile.WriteFile("settings.ini"); } } diff --git a/source/Bindings.cpp b/source/Bindings.cpp index 998fab632..5de3a3b38 100644 --- a/source/Bindings.cpp +++ b/source/Bindings.cpp @@ -1,6 +1,6 @@ /* ** Lua binding: AllToLua -** Generated automatically by tolua++-1.0.92 on 10/24/13 16:43:14. +** Generated automatically by tolua++-1.0.92 on 10/25/13 11:34:58. */ #ifndef __cplusplus @@ -230,7 +230,7 @@ static void tolua_reg_types (lua_State* tolua_S) tolua_usertype(tolua_S,"cRoot"); tolua_usertype(tolua_S,"std::vector<cIniFile::key>"); tolua_usertype(tolua_S,"cPickup"); - tolua_usertype(tolua_S,"cItems"); + tolua_usertype(tolua_S,"sWebAdminPage"); tolua_usertype(tolua_S,"cFireChargeEntity"); tolua_usertype(tolua_S,"cWorld"); tolua_usertype(tolua_S,"cChunkDesc"); @@ -253,39 +253,39 @@ static void tolua_reg_types (lua_State* tolua_S) tolua_usertype(tolua_S,"cLuaWindow"); tolua_usertype(tolua_S,"cInventory"); tolua_usertype(tolua_S,"cHopperEntity"); + tolua_usertype(tolua_S,"std::vector<AString>"); tolua_usertype(tolua_S,"cBlockEntityWithItems"); tolua_usertype(tolua_S,"cWindow"); - tolua_usertype(tolua_S,"cGroup"); tolua_usertype(tolua_S,"HTTPFormData"); - tolua_usertype(tolua_S,"cCraftingGrid"); + tolua_usertype(tolua_S,"cGroup"); tolua_usertype(tolua_S,"cArrowEntity"); tolua_usertype(tolua_S,"cDropSpenserEntity"); + tolua_usertype(tolua_S,"cCraftingGrid"); + tolua_usertype(tolua_S,"cPlayer"); tolua_usertype(tolua_S,"cBlockArea"); tolua_usertype(tolua_S,"cTracer"); tolua_usertype(tolua_S,"cStringMap"); - tolua_usertype(tolua_S,"cBoundingBox"); - tolua_usertype(tolua_S,"cServer"); tolua_usertype(tolua_S,"cBlockEntity"); tolua_usertype(tolua_S,"cCriticalSection"); tolua_usertype(tolua_S,"HTTPTemplateRequest"); + tolua_usertype(tolua_S,"cBoundingBox"); + tolua_usertype(tolua_S,"cServer"); tolua_usertype(tolua_S,"Vector3i"); tolua_usertype(tolua_S,"cFile"); - tolua_usertype(tolua_S,"std::vector<std::string>"); + tolua_usertype(tolua_S,"cItems"); tolua_usertype(tolua_S,"cClientHandle"); + tolua_usertype(tolua_S,"cIniFile"); tolua_usertype(tolua_S,"cChatColor"); tolua_usertype(tolua_S,"cWebPlugin"); - tolua_usertype(tolua_S,"cIniFile"); - tolua_usertype(tolua_S,"cWebAdmin"); - tolua_usertype(tolua_S,"sWebAdminPage"); tolua_usertype(tolua_S,"cPawn"); - tolua_usertype(tolua_S,"cPlayer"); + tolua_usertype(tolua_S,"cThrownEggEntity"); tolua_usertype(tolua_S,"cGroupManager"); + tolua_usertype(tolua_S,"cWebAdmin"); tolua_usertype(tolua_S,"cItem"); - tolua_usertype(tolua_S,"HTTPRequest"); tolua_usertype(tolua_S,"cProjectileEntity"); + tolua_usertype(tolua_S,"HTTPRequest"); tolua_usertype(tolua_S,"cItemGrid::cListener"); tolua_usertype(tolua_S,"cDropperEntity"); - tolua_usertype(tolua_S,"cThrownEggEntity"); } /* method: new of class cIniFile */ @@ -345,59 +345,6 @@ static int tolua_AllToLua_cIniFile_new00_local(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: new of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_new01 -static int tolua_AllToLua_cIniFile_new01(lua_State* tolua_S) -{ - tolua_Error tolua_err; - if ( - !tolua_isusertable(tolua_S,1,"cIniFile",0,&tolua_err) || - !tolua_iscppstring(tolua_S,2,0,&tolua_err) || - !tolua_isnoobj(tolua_S,3,&tolua_err) - ) - goto tolua_lerror; - else - { - const std::string a_Path = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - { - cIniFile* tolua_ret = (cIniFile*) Mtolua_new((cIniFile)(a_Path)); - tolua_pushusertype(tolua_S,(void*)tolua_ret,"cIniFile"); - tolua_pushcppstring(tolua_S,(const char*)a_Path); - } - } - return 2; -tolua_lerror: - return tolua_AllToLua_cIniFile_new00(tolua_S); -} -#endif //#ifndef TOLUA_DISABLE - -/* method: new_local of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_new01_local -static int tolua_AllToLua_cIniFile_new01_local(lua_State* tolua_S) -{ - tolua_Error tolua_err; - if ( - !tolua_isusertable(tolua_S,1,"cIniFile",0,&tolua_err) || - !tolua_iscppstring(tolua_S,2,0,&tolua_err) || - !tolua_isnoobj(tolua_S,3,&tolua_err) - ) - goto tolua_lerror; - else - { - const std::string a_Path = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - { - cIniFile* tolua_ret = (cIniFile*) Mtolua_new((cIniFile)(a_Path)); - tolua_pushusertype(tolua_S,(void*)tolua_ret,"cIniFile"); - tolua_register_gc(tolua_S,lua_gettop(tolua_S)); - tolua_pushcppstring(tolua_S,(const char*)a_Path); - } - } - return 2; -tolua_lerror: - return tolua_AllToLua_cIniFile_new00_local(tolua_S); -} -#endif //#ifndef TOLUA_DISABLE - /* method: CaseSensitive of class cIniFile */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_CaseSensitive00 static int tolua_AllToLua_cIniFile_CaseSensitive00(lua_State* tolua_S) @@ -460,101 +407,6 @@ static int tolua_AllToLua_cIniFile_CaseInsensitive00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: Path of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_Path00 -static int tolua_AllToLua_cIniFile_Path00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"cIniFile",0,&tolua_err) || - !tolua_iscppstring(tolua_S,2,0,&tolua_err) || - !tolua_isnoobj(tolua_S,3,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string newPath = ((const std::string) tolua_tocppstring(tolua_S,2,0)); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Path'", NULL); -#endif - { - self->Path(newPath); - tolua_pushcppstring(tolua_S,(const char*)newPath); - } - } - return 1; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'Path'.",&tolua_err); - return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - -/* method: Path of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_Path01 -static int tolua_AllToLua_cIniFile_Path01(lua_State* tolua_S) -{ - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"const cIniFile",0,&tolua_err) || - !tolua_isnoobj(tolua_S,2,&tolua_err) - ) - goto tolua_lerror; - else - { - const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Path'", NULL); -#endif - { - const std::string tolua_ret = (const std::string) self->Path(); - tolua_pushcppstring(tolua_S,(const char*)tolua_ret); - } - } - return 1; -tolua_lerror: - return tolua_AllToLua_cIniFile_Path00(tolua_S); -} -#endif //#ifndef TOLUA_DISABLE - -/* method: SetPath of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_SetPath00 -static int tolua_AllToLua_cIniFile_SetPath00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"cIniFile",0,&tolua_err) || - !tolua_iscppstring(tolua_S,2,0,&tolua_err) || - !tolua_isnoobj(tolua_S,3,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string newPath = ((const std::string) tolua_tocppstring(tolua_S,2,0)); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetPath'", NULL); -#endif - { - self->SetPath(newPath); - tolua_pushcppstring(tolua_S,(const char*)newPath); - } - } - return 1; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'SetPath'.",&tolua_err); - return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - /* method: ReadFile of class cIniFile */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_ReadFile00 static int tolua_AllToLua_cIniFile_ReadFile00(lua_State* tolua_S) @@ -563,24 +415,27 @@ static int tolua_AllToLua_cIniFile_ReadFile00(lua_State* tolua_S) tolua_Error tolua_err; if ( !tolua_isusertype(tolua_S,1,"cIniFile",0,&tolua_err) || - !tolua_isboolean(tolua_S,2,1,&tolua_err) || - !tolua_isnoobj(tolua_S,3,&tolua_err) + !tolua_iscppstring(tolua_S,2,0,&tolua_err) || + !tolua_isboolean(tolua_S,3,1,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) ) goto tolua_lerror; else #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - bool a_AllowExampleRedirect = ((bool) tolua_toboolean(tolua_S,2,true)); + const AString a_FileName = ((const AString) tolua_tocppstring(tolua_S,2,0)); + bool a_AllowExampleRedirect = ((bool) tolua_toboolean(tolua_S,3,true)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'ReadFile'", NULL); #endif { - bool tolua_ret = (bool) self->ReadFile(a_AllowExampleRedirect); + bool tolua_ret = (bool) self->ReadFile(a_FileName,a_AllowExampleRedirect); tolua_pushboolean(tolua_S,(bool)tolua_ret); + tolua_pushcppstring(tolua_S,(const char*)a_FileName); } } - return 1; + return 2; #ifndef TOLUA_RELEASE tolua_lerror: tolua_error(tolua_S,"#ferror in function 'ReadFile'.",&tolua_err); @@ -597,22 +452,25 @@ static int tolua_AllToLua_cIniFile_WriteFile00(lua_State* tolua_S) tolua_Error tolua_err; if ( !tolua_isusertype(tolua_S,1,"const cIniFile",0,&tolua_err) || - !tolua_isnoobj(tolua_S,2,&tolua_err) + !tolua_iscppstring(tolua_S,2,0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); + const AString a_FileName = ((const AString) tolua_tocppstring(tolua_S,2,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'WriteFile'", NULL); #endif { - bool tolua_ret = (bool) self->WriteFile(); + bool tolua_ret = (bool) self->WriteFile(a_FileName); tolua_pushboolean(tolua_S,(bool)tolua_ret); + tolua_pushcppstring(tolua_S,(const char*)a_FileName); } } - return 1; + return 2; #ifndef TOLUA_RELEASE tolua_lerror: tolua_error(tolua_S,"#ferror in function 'WriteFile'.",&tolua_err); @@ -652,68 +510,6 @@ static int tolua_AllToLua_cIniFile_Clear00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: Reset of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_Reset00 -static int tolua_AllToLua_cIniFile_Reset00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"cIniFile",0,&tolua_err) || - !tolua_isnoobj(tolua_S,2,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Reset'", NULL); -#endif - { - self->Reset(); - } - } - return 0; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'Reset'.",&tolua_err); - return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - -/* method: Erase of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_Erase00 -static int tolua_AllToLua_cIniFile_Erase00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"cIniFile",0,&tolua_err) || - !tolua_isnoobj(tolua_S,2,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Erase'", NULL); -#endif - { - self->Erase(); - } - } - return 0; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'Erase'.",&tolua_err); - return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - /* method: FindKey of class cIniFile */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_FindKey00 static int tolua_AllToLua_cIniFile_FindKey00(lua_State* tolua_S) @@ -730,12 +526,12 @@ static int tolua_AllToLua_cIniFile_FindKey00(lua_State* tolua_S) #endif { const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'FindKey'", NULL); #endif { - long tolua_ret = (long) self->FindKey(keyname); + int tolua_ret = (int) self->FindKey(keyname); tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); tolua_pushcppstring(tolua_S,(const char*)keyname); } @@ -766,13 +562,13 @@ static int tolua_AllToLua_cIniFile_FindValue00(lua_State* tolua_S) #endif { const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); - const std::string valuename = ((const std::string) tolua_tocppstring(tolua_S,3,0)); + const int keyID = ((const int) tolua_tonumber(tolua_S,2,0)); + const AString valuename = ((const AString) tolua_tocppstring(tolua_S,3,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'FindValue'", NULL); #endif { - long tolua_ret = (long) self->FindValue(keyID,valuename); + int tolua_ret = (int) self->FindValue(keyID,valuename); tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); tolua_pushcppstring(tolua_S,(const char*)valuename); } @@ -786,38 +582,6 @@ static int tolua_AllToLua_cIniFile_FindValue00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: NumKeys of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_NumKeys00 -static int tolua_AllToLua_cIniFile_NumKeys00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"const cIniFile",0,&tolua_err) || - !tolua_isnoobj(tolua_S,2,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'NumKeys'", NULL); -#endif - { - unsigned tolua_ret = (unsigned) self->NumKeys(); - tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); - } - } - return 1; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'NumKeys'.",&tolua_err); - return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - /* method: GetNumKeys of class cIniFile */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_GetNumKeys00 static int tolua_AllToLua_cIniFile_GetNumKeys00(lua_State* tolua_S) @@ -837,7 +601,7 @@ static int tolua_AllToLua_cIniFile_GetNumKeys00(lua_State* tolua_S) if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetNumKeys'", NULL); #endif { - unsigned tolua_ret = (unsigned) self->GetNumKeys(); + int tolua_ret = (int) self->GetNumKeys(); tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); } } @@ -866,12 +630,12 @@ static int tolua_AllToLua_cIniFile_AddKeyName00(lua_State* tolua_S) #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'AddKeyName'", NULL); #endif { - unsigned tolua_ret = (unsigned) self->AddKeyName(keyname); + int tolua_ret = (int) self->AddKeyName(keyname); tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); tolua_pushcppstring(tolua_S,(const char*)keyname); } @@ -885,40 +649,6 @@ static int tolua_AllToLua_cIniFile_AddKeyName00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: KeyName of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_KeyName00 -static int tolua_AllToLua_cIniFile_KeyName00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"const cIniFile",0,&tolua_err) || - !tolua_isnumber(tolua_S,2,0,&tolua_err) || - !tolua_isnoobj(tolua_S,3,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'KeyName'", NULL); -#endif - { - std::string tolua_ret = (std::string) self->KeyName(keyID); - tolua_pushcppstring(tolua_S,(const char*)tolua_ret); - } - } - return 1; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'KeyName'.",&tolua_err); - return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - /* method: GetKeyName of class cIniFile */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_GetKeyName00 static int tolua_AllToLua_cIniFile_GetKeyName00(lua_State* tolua_S) @@ -935,12 +665,12 @@ static int tolua_AllToLua_cIniFile_GetKeyName00(lua_State* tolua_S) #endif { const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); + const int keyID = ((const int) tolua_tonumber(tolua_S,2,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetKeyName'", NULL); #endif { - std::string tolua_ret = (std::string) self->GetKeyName(keyID); + AString tolua_ret = (AString) self->GetKeyName(keyID); tolua_pushcppstring(tolua_S,(const char*)tolua_ret); } } @@ -953,41 +683,6 @@ static int tolua_AllToLua_cIniFile_GetKeyName00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: NumValues of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_NumValues00 -static int tolua_AllToLua_cIniFile_NumValues00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"cIniFile",0,&tolua_err) || - !tolua_iscppstring(tolua_S,2,0,&tolua_err) || - !tolua_isnoobj(tolua_S,3,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'NumValues'", NULL); -#endif - { - unsigned tolua_ret = (unsigned) self->NumValues(keyname); - tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); - tolua_pushcppstring(tolua_S,(const char*)keyname); - } - } - return 2; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'NumValues'.",&tolua_err); - return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - /* method: GetNumValues of class cIniFile */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_GetNumValues00 static int tolua_AllToLua_cIniFile_GetNumValues00(lua_State* tolua_S) @@ -995,7 +690,7 @@ static int tolua_AllToLua_cIniFile_GetNumValues00(lua_State* tolua_S) #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"cIniFile",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cIniFile",0,&tolua_err) || !tolua_iscppstring(tolua_S,2,0,&tolua_err) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) @@ -1003,13 +698,13 @@ static int tolua_AllToLua_cIniFile_GetNumValues00(lua_State* tolua_S) else #endif { - cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); + const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetNumValues'", NULL); #endif { - unsigned tolua_ret = (unsigned) self->GetNumValues(keyname); + int tolua_ret = (int) self->GetNumValues(keyname); tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); tolua_pushcppstring(tolua_S,(const char*)keyname); } @@ -1023,55 +718,26 @@ static int tolua_AllToLua_cIniFile_GetNumValues00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: NumValues of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_NumValues01 -static int tolua_AllToLua_cIniFile_NumValues01(lua_State* tolua_S) -{ - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"cIniFile",0,&tolua_err) || - !tolua_isnumber(tolua_S,2,0,&tolua_err) || - !tolua_isnoobj(tolua_S,3,&tolua_err) - ) - goto tolua_lerror; - else - { - cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'NumValues'", NULL); -#endif - { - unsigned tolua_ret = (unsigned) self->NumValues(keyID); - tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); - } - } - return 1; -tolua_lerror: - return tolua_AllToLua_cIniFile_NumValues00(tolua_S); -} -#endif //#ifndef TOLUA_DISABLE - /* method: GetNumValues of class cIniFile */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_GetNumValues01 static int tolua_AllToLua_cIniFile_GetNumValues01(lua_State* tolua_S) { tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"cIniFile",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cIniFile",0,&tolua_err) || !tolua_isnumber(tolua_S,2,0,&tolua_err) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else { - cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); + const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); + const int keyID = ((const int) tolua_tonumber(tolua_S,2,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetNumValues'", NULL); #endif { - unsigned tolua_ret = (unsigned) self->GetNumValues(keyID); + int tolua_ret = (int) self->GetNumValues(keyID); tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); } } @@ -1081,43 +747,6 @@ tolua_lerror: } #endif //#ifndef TOLUA_DISABLE -/* method: ValueName of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_ValueName00 -static int tolua_AllToLua_cIniFile_ValueName00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"const cIniFile",0,&tolua_err) || - !tolua_iscppstring(tolua_S,2,0,&tolua_err) || - !tolua_isnumber(tolua_S,3,0,&tolua_err) || - !tolua_isnoobj(tolua_S,4,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - const unsigned valueID = ((const unsigned) tolua_tonumber(tolua_S,3,0)); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'ValueName'", NULL); -#endif - { - std::string tolua_ret = (std::string) self->ValueName(keyname,valueID); - tolua_pushcppstring(tolua_S,(const char*)tolua_ret); - tolua_pushcppstring(tolua_S,(const char*)keyname); - } - } - return 2; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'ValueName'.",&tolua_err); - return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - /* method: GetValueName of class cIniFile */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_GetValueName00 static int tolua_AllToLua_cIniFile_GetValueName00(lua_State* tolua_S) @@ -1135,13 +764,13 @@ static int tolua_AllToLua_cIniFile_GetValueName00(lua_State* tolua_S) #endif { const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - const unsigned valueID = ((const unsigned) tolua_tonumber(tolua_S,3,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); + const int valueID = ((const int) tolua_tonumber(tolua_S,3,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetValueName'", NULL); #endif { - std::string tolua_ret = (std::string) self->GetValueName(keyname,valueID); + AString tolua_ret = (AString) self->GetValueName(keyname,valueID); tolua_pushcppstring(tolua_S,(const char*)tolua_ret); tolua_pushcppstring(tolua_S,(const char*)keyname); } @@ -1155,37 +784,6 @@ static int tolua_AllToLua_cIniFile_GetValueName00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: ValueName of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_ValueName01 -static int tolua_AllToLua_cIniFile_ValueName01(lua_State* tolua_S) -{ - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"const cIniFile",0,&tolua_err) || - !tolua_isnumber(tolua_S,2,0,&tolua_err) || - !tolua_isnumber(tolua_S,3,0,&tolua_err) || - !tolua_isnoobj(tolua_S,4,&tolua_err) - ) - goto tolua_lerror; - else - { - const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); - const unsigned valueID = ((const unsigned) tolua_tonumber(tolua_S,3,0)); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'ValueName'", NULL); -#endif - { - std::string tolua_ret = (std::string) self->ValueName(keyID,valueID); - tolua_pushcppstring(tolua_S,(const char*)tolua_ret); - } - } - return 1; -tolua_lerror: - return tolua_AllToLua_cIniFile_ValueName00(tolua_S); -} -#endif //#ifndef TOLUA_DISABLE - /* method: GetValueName of class cIniFile */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_GetValueName01 static int tolua_AllToLua_cIniFile_GetValueName01(lua_State* tolua_S) @@ -1201,13 +799,13 @@ static int tolua_AllToLua_cIniFile_GetValueName01(lua_State* tolua_S) else { const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); - const unsigned valueID = ((const unsigned) tolua_tonumber(tolua_S,3,0)); + const int keyID = ((const int) tolua_tonumber(tolua_S,2,0)); + const int valueID = ((const int) tolua_tonumber(tolua_S,3,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetValueName'", NULL); #endif { - std::string tolua_ret = (std::string) self->GetValueName(keyID,valueID); + AString tolua_ret = (AString) self->GetValueName(keyID,valueID); tolua_pushcppstring(tolua_S,(const char*)tolua_ret); } } @@ -1306,8 +904,8 @@ static int tolua_AllToLua_cIniFile_GetValue02(lua_State* tolua_S) else { const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); - const unsigned valueID = ((const unsigned) tolua_tonumber(tolua_S,3,0)); + const int keyID = ((const int) tolua_tonumber(tolua_S,2,0)); + const int valueID = ((const int) tolua_tonumber(tolua_S,3,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetValue'", NULL); #endif @@ -1338,8 +936,8 @@ static int tolua_AllToLua_cIniFile_GetValue03(lua_State* tolua_S) else { const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); - const unsigned valueID = ((const unsigned) tolua_tonumber(tolua_S,3,0)); + const int keyID = ((const int) tolua_tonumber(tolua_S,2,0)); + const int valueID = ((const int) tolua_tonumber(tolua_S,3,0)); const AString defValue = ((const AString) tolua_tocppstring(tolua_S,4,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetValue'", NULL); @@ -1688,9 +1286,9 @@ static int tolua_AllToLua_cIniFile_SetValue00(lua_State* tolua_S) #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); - const unsigned valueID = ((const unsigned) tolua_tonumber(tolua_S,3,0)); - const std::string value = ((const std::string) tolua_tocppstring(tolua_S,4,0)); + const int keyID = ((const int) tolua_tonumber(tolua_S,2,0)); + const int valueID = ((const int) tolua_tonumber(tolua_S,3,0)); + const AString value = ((const AString) tolua_tocppstring(tolua_S,4,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetValue'", NULL); #endif @@ -1726,9 +1324,9 @@ static int tolua_AllToLua_cIniFile_SetValue01(lua_State* tolua_S) else { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - const std::string valuename = ((const std::string) tolua_tocppstring(tolua_S,3,0)); - const std::string value = ((const std::string) tolua_tocppstring(tolua_S,4,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); + const AString valuename = ((const AString) tolua_tocppstring(tolua_S,3,0)); + const AString value = ((const AString) tolua_tocppstring(tolua_S,4,0)); const bool create = ((const bool) tolua_toboolean(tolua_S,5,true)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetValue'", NULL); @@ -1766,8 +1364,8 @@ static int tolua_AllToLua_cIniFile_SetValueI00(lua_State* tolua_S) #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - const std::string valuename = ((const std::string) tolua_tocppstring(tolua_S,3,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); + const AString valuename = ((const AString) tolua_tocppstring(tolua_S,3,0)); const int value = ((const int) tolua_tonumber(tolua_S,4,0)); const bool create = ((const bool) tolua_toboolean(tolua_S,5,true)); #ifndef TOLUA_RELEASE @@ -1808,8 +1406,8 @@ static int tolua_AllToLua_cIniFile_SetValueB00(lua_State* tolua_S) #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - const std::string valuename = ((const std::string) tolua_tocppstring(tolua_S,3,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); + const AString valuename = ((const AString) tolua_tocppstring(tolua_S,3,0)); const bool value = ((const bool) tolua_toboolean(tolua_S,4,0)); const bool create = ((const bool) tolua_toboolean(tolua_S,5,true)); #ifndef TOLUA_RELEASE @@ -1850,8 +1448,8 @@ static int tolua_AllToLua_cIniFile_SetValueF00(lua_State* tolua_S) #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - const std::string valuename = ((const std::string) tolua_tocppstring(tolua_S,3,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); + const AString valuename = ((const AString) tolua_tocppstring(tolua_S,3,0)); const double value = ((const double) tolua_tonumber(tolua_S,4,0)); const bool create = ((const bool) tolua_toboolean(tolua_S,5,true)); #ifndef TOLUA_RELEASE @@ -1890,8 +1488,8 @@ static int tolua_AllToLua_cIniFile_DeleteValueByID00(lua_State* tolua_S) #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); - const unsigned valueID = ((const unsigned) tolua_tonumber(tolua_S,3,0)); + const int keyID = ((const int) tolua_tonumber(tolua_S,2,0)); + const int valueID = ((const int) tolua_tonumber(tolua_S,3,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'DeleteValueByID'", NULL); #endif @@ -1926,8 +1524,8 @@ static int tolua_AllToLua_cIniFile_DeleteValue00(lua_State* tolua_S) #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - const std::string valuename = ((const std::string) tolua_tocppstring(tolua_S,3,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); + const AString valuename = ((const AString) tolua_tocppstring(tolua_S,3,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'DeleteValue'", NULL); #endif @@ -1963,7 +1561,7 @@ static int tolua_AllToLua_cIniFile_DeleteKey00(lua_State* tolua_S) #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'DeleteKey'", NULL); #endif @@ -1982,9 +1580,9 @@ static int tolua_AllToLua_cIniFile_DeleteKey00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: NumHeaderComments of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_NumHeaderComments00 -static int tolua_AllToLua_cIniFile_NumHeaderComments00(lua_State* tolua_S) +/* method: GetNumHeaderComments of class cIniFile */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_GetNumHeaderComments00 +static int tolua_AllToLua_cIniFile_GetNumHeaderComments00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; @@ -1998,25 +1596,25 @@ static int tolua_AllToLua_cIniFile_NumHeaderComments00(lua_State* tolua_S) { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'NumHeaderComments'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetNumHeaderComments'", NULL); #endif { - unsigned tolua_ret = (unsigned) self->NumHeaderComments(); + int tolua_ret = (int) self->GetNumHeaderComments(); tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'NumHeaderComments'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'GetNumHeaderComments'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: HeaderComment of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_HeaderComment00 -static int tolua_AllToLua_cIniFile_HeaderComment00(lua_State* tolua_S) +/* method: AddHeaderComment of class cIniFile */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_AddHeaderComment00 +static int tolua_AllToLua_cIniFile_AddHeaderComment00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; @@ -2030,28 +1628,29 @@ static int tolua_AllToLua_cIniFile_HeaderComment00(lua_State* tolua_S) #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string comment = ((const std::string) tolua_tocppstring(tolua_S,2,0)); + const AString comment = ((const AString) tolua_tocppstring(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'HeaderComment'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'AddHeaderComment'", NULL); #endif { - self->HeaderComment(comment); + self->AddHeaderComment(comment); tolua_pushcppstring(tolua_S,(const char*)comment); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'HeaderComment'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'AddHeaderComment'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: HeaderComment of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_HeaderComment01 -static int tolua_AllToLua_cIniFile_HeaderComment01(lua_State* tolua_S) +/* method: GetHeaderComment of class cIniFile */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_GetHeaderComment00 +static int tolua_AllToLua_cIniFile_GetHeaderComment00(lua_State* tolua_S) { +#ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( !tolua_isusertype(tolua_S,1,"const cIniFile",0,&tolua_err) || @@ -2060,20 +1659,24 @@ static int tolua_AllToLua_cIniFile_HeaderComment01(lua_State* tolua_S) ) goto tolua_lerror; else +#endif { const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned commentID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); + const int commentID = ((const int) tolua_tonumber(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'HeaderComment'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetHeaderComment'", NULL); #endif { - std::string tolua_ret = (std::string) self->HeaderComment(commentID); + AString tolua_ret = (AString) self->GetHeaderComment(commentID); tolua_pushcppstring(tolua_S,(const char*)tolua_ret); } } return 1; -tolua_lerror: - return tolua_AllToLua_cIniFile_HeaderComment00(tolua_S); +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'GetHeaderComment'.",&tolua_err); + return 0; +#endif } #endif //#ifndef TOLUA_DISABLE @@ -2093,7 +1696,7 @@ static int tolua_AllToLua_cIniFile_DeleteHeaderComment00(lua_State* tolua_S) #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - unsigned commentID = ((unsigned) tolua_tonumber(tolua_S,2,0)); + int commentID = ((int) tolua_tonumber(tolua_S,2,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'DeleteHeaderComment'", NULL); #endif @@ -2142,9 +1745,9 @@ static int tolua_AllToLua_cIniFile_DeleteHeaderComments00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: NumKeyComments of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_NumKeyComments00 -static int tolua_AllToLua_cIniFile_NumKeyComments00(lua_State* tolua_S) +/* method: GetNumKeyComments of class cIniFile */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_GetNumKeyComments00 +static int tolua_AllToLua_cIniFile_GetNumKeyComments00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; @@ -2158,27 +1761,27 @@ static int tolua_AllToLua_cIniFile_NumKeyComments00(lua_State* tolua_S) #endif { const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); + const int keyID = ((const int) tolua_tonumber(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'NumKeyComments'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetNumKeyComments'", NULL); #endif { - unsigned tolua_ret = (unsigned) self->NumKeyComments(keyID); + int tolua_ret = (int) self->GetNumKeyComments(keyID); tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'NumKeyComments'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'GetNumKeyComments'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: NumKeyComments of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_NumKeyComments01 -static int tolua_AllToLua_cIniFile_NumKeyComments01(lua_State* tolua_S) +/* method: GetNumKeyComments of class cIniFile */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_GetNumKeyComments01 +static int tolua_AllToLua_cIniFile_GetNumKeyComments01(lua_State* tolua_S) { tolua_Error tolua_err; if ( @@ -2190,25 +1793,25 @@ static int tolua_AllToLua_cIniFile_NumKeyComments01(lua_State* tolua_S) else { const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'NumKeyComments'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetNumKeyComments'", NULL); #endif { - unsigned tolua_ret = (unsigned) self->NumKeyComments(keyname); + int tolua_ret = (int) self->GetNumKeyComments(keyname); tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); tolua_pushcppstring(tolua_S,(const char*)keyname); } } return 2; tolua_lerror: - return tolua_AllToLua_cIniFile_NumKeyComments00(tolua_S); + return tolua_AllToLua_cIniFile_GetNumKeyComments00(tolua_S); } #endif //#ifndef TOLUA_DISABLE -/* method: KeyComment of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_KeyComment00 -static int tolua_AllToLua_cIniFile_KeyComment00(lua_State* tolua_S) +/* method: AddKeyComment of class cIniFile */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_AddKeyComment00 +static int tolua_AllToLua_cIniFile_AddKeyComment00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; @@ -2223,13 +1826,13 @@ static int tolua_AllToLua_cIniFile_KeyComment00(lua_State* tolua_S) #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); - const std::string comment = ((const std::string) tolua_tocppstring(tolua_S,3,0)); + const int keyID = ((const int) tolua_tonumber(tolua_S,2,0)); + const AString comment = ((const AString) tolua_tocppstring(tolua_S,3,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'KeyComment'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'AddKeyComment'", NULL); #endif { - bool tolua_ret = (bool) self->KeyComment(keyID,comment); + bool tolua_ret = (bool) self->AddKeyComment(keyID,comment); tolua_pushboolean(tolua_S,(bool)tolua_ret); tolua_pushcppstring(tolua_S,(const char*)comment); } @@ -2237,15 +1840,15 @@ static int tolua_AllToLua_cIniFile_KeyComment00(lua_State* tolua_S) return 2; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'KeyComment'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'AddKeyComment'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: KeyComment of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_KeyComment01 -static int tolua_AllToLua_cIniFile_KeyComment01(lua_State* tolua_S) +/* method: AddKeyComment of class cIniFile */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_AddKeyComment01 +static int tolua_AllToLua_cIniFile_AddKeyComment01(lua_State* tolua_S) { tolua_Error tolua_err; if ( @@ -2258,13 +1861,13 @@ static int tolua_AllToLua_cIniFile_KeyComment01(lua_State* tolua_S) else { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - const std::string comment = ((const std::string) tolua_tocppstring(tolua_S,3,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); + const AString comment = ((const AString) tolua_tocppstring(tolua_S,3,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'KeyComment'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'AddKeyComment'", NULL); #endif { - bool tolua_ret = (bool) self->KeyComment(keyname,comment); + bool tolua_ret = (bool) self->AddKeyComment(keyname,comment); tolua_pushboolean(tolua_S,(bool)tolua_ret); tolua_pushcppstring(tolua_S,(const char*)keyname); tolua_pushcppstring(tolua_S,(const char*)comment); @@ -2272,14 +1875,15 @@ static int tolua_AllToLua_cIniFile_KeyComment01(lua_State* tolua_S) } return 3; tolua_lerror: - return tolua_AllToLua_cIniFile_KeyComment00(tolua_S); + return tolua_AllToLua_cIniFile_AddKeyComment00(tolua_S); } #endif //#ifndef TOLUA_DISABLE -/* method: KeyComment of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_KeyComment02 -static int tolua_AllToLua_cIniFile_KeyComment02(lua_State* tolua_S) +/* method: GetKeyComment of class cIniFile */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_GetKeyComment00 +static int tolua_AllToLua_cIniFile_GetKeyComment00(lua_State* tolua_S) { +#ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( !tolua_isusertype(tolua_S,1,"const cIniFile",0,&tolua_err) || @@ -2289,27 +1893,31 @@ static int tolua_AllToLua_cIniFile_KeyComment02(lua_State* tolua_S) ) goto tolua_lerror; else +#endif { const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); - const unsigned commentID = ((const unsigned) tolua_tonumber(tolua_S,3,0)); + const int keyID = ((const int) tolua_tonumber(tolua_S,2,0)); + const int commentID = ((const int) tolua_tonumber(tolua_S,3,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'KeyComment'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetKeyComment'", NULL); #endif { - std::string tolua_ret = (std::string) self->KeyComment(keyID,commentID); + AString tolua_ret = (AString) self->GetKeyComment(keyID,commentID); tolua_pushcppstring(tolua_S,(const char*)tolua_ret); } } return 1; -tolua_lerror: - return tolua_AllToLua_cIniFile_KeyComment01(tolua_S); +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'GetKeyComment'.",&tolua_err); + return 0; +#endif } #endif //#ifndef TOLUA_DISABLE -/* method: KeyComment of class cIniFile */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_KeyComment03 -static int tolua_AllToLua_cIniFile_KeyComment03(lua_State* tolua_S) +/* method: GetKeyComment of class cIniFile */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cIniFile_GetKeyComment01 +static int tolua_AllToLua_cIniFile_GetKeyComment01(lua_State* tolua_S) { tolua_Error tolua_err; if ( @@ -2322,20 +1930,20 @@ static int tolua_AllToLua_cIniFile_KeyComment03(lua_State* tolua_S) else { const cIniFile* self = (const cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - const unsigned commentID = ((const unsigned) tolua_tonumber(tolua_S,3,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); + const int commentID = ((const int) tolua_tonumber(tolua_S,3,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'KeyComment'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetKeyComment'", NULL); #endif { - std::string tolua_ret = (std::string) self->KeyComment(keyname,commentID); + AString tolua_ret = (AString) self->GetKeyComment(keyname,commentID); tolua_pushcppstring(tolua_S,(const char*)tolua_ret); tolua_pushcppstring(tolua_S,(const char*)keyname); } } return 2; tolua_lerror: - return tolua_AllToLua_cIniFile_KeyComment02(tolua_S); + return tolua_AllToLua_cIniFile_GetKeyComment00(tolua_S); } #endif //#ifndef TOLUA_DISABLE @@ -2356,8 +1964,8 @@ static int tolua_AllToLua_cIniFile_DeleteKeyComment00(lua_State* tolua_S) #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); - const unsigned commentID = ((const unsigned) tolua_tonumber(tolua_S,3,0)); + const int keyID = ((const int) tolua_tonumber(tolua_S,2,0)); + const int commentID = ((const int) tolua_tonumber(tolua_S,3,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'DeleteKeyComment'", NULL); #endif @@ -2390,8 +1998,8 @@ static int tolua_AllToLua_cIniFile_DeleteKeyComment01(lua_State* tolua_S) else { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); - const unsigned commentID = ((const unsigned) tolua_tonumber(tolua_S,3,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); + const int commentID = ((const int) tolua_tonumber(tolua_S,3,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'DeleteKeyComment'", NULL); #endif @@ -2423,7 +2031,7 @@ static int tolua_AllToLua_cIniFile_DeleteKeyComments00(lua_State* tolua_S) #endif { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const unsigned keyID = ((const unsigned) tolua_tonumber(tolua_S,2,0)); + const int keyID = ((const int) tolua_tonumber(tolua_S,2,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'DeleteKeyComments'", NULL); #endif @@ -2455,7 +2063,7 @@ static int tolua_AllToLua_cIniFile_DeleteKeyComments01(lua_State* tolua_S) else { cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); - const std::string keyname = ((const std::string) tolua_tocppstring(tolua_S,2,0)); + const AString keyname = ((const AString) tolua_tocppstring(tolua_S,2,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'DeleteKeyComments'", NULL); #endif @@ -29487,33 +29095,19 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_function(tolua_S,"new",tolua_AllToLua_cIniFile_new00); tolua_function(tolua_S,"new_local",tolua_AllToLua_cIniFile_new00_local); tolua_function(tolua_S,".call",tolua_AllToLua_cIniFile_new00_local); - tolua_function(tolua_S,"new",tolua_AllToLua_cIniFile_new01); - tolua_function(tolua_S,"new_local",tolua_AllToLua_cIniFile_new01_local); - tolua_function(tolua_S,".call",tolua_AllToLua_cIniFile_new01_local); tolua_function(tolua_S,"CaseSensitive",tolua_AllToLua_cIniFile_CaseSensitive00); tolua_function(tolua_S,"CaseInsensitive",tolua_AllToLua_cIniFile_CaseInsensitive00); - tolua_function(tolua_S,"Path",tolua_AllToLua_cIniFile_Path00); - tolua_function(tolua_S,"Path",tolua_AllToLua_cIniFile_Path01); - tolua_function(tolua_S,"SetPath",tolua_AllToLua_cIniFile_SetPath00); tolua_function(tolua_S,"ReadFile",tolua_AllToLua_cIniFile_ReadFile00); tolua_function(tolua_S,"WriteFile",tolua_AllToLua_cIniFile_WriteFile00); tolua_function(tolua_S,"Clear",tolua_AllToLua_cIniFile_Clear00); - tolua_function(tolua_S,"Reset",tolua_AllToLua_cIniFile_Reset00); - tolua_function(tolua_S,"Erase",tolua_AllToLua_cIniFile_Erase00); tolua_function(tolua_S,"FindKey",tolua_AllToLua_cIniFile_FindKey00); tolua_function(tolua_S,"FindValue",tolua_AllToLua_cIniFile_FindValue00); - tolua_function(tolua_S,"NumKeys",tolua_AllToLua_cIniFile_NumKeys00); tolua_function(tolua_S,"GetNumKeys",tolua_AllToLua_cIniFile_GetNumKeys00); tolua_function(tolua_S,"AddKeyName",tolua_AllToLua_cIniFile_AddKeyName00); - tolua_function(tolua_S,"KeyName",tolua_AllToLua_cIniFile_KeyName00); tolua_function(tolua_S,"GetKeyName",tolua_AllToLua_cIniFile_GetKeyName00); - tolua_function(tolua_S,"NumValues",tolua_AllToLua_cIniFile_NumValues00); tolua_function(tolua_S,"GetNumValues",tolua_AllToLua_cIniFile_GetNumValues00); - tolua_function(tolua_S,"NumValues",tolua_AllToLua_cIniFile_NumValues01); tolua_function(tolua_S,"GetNumValues",tolua_AllToLua_cIniFile_GetNumValues01); - tolua_function(tolua_S,"ValueName",tolua_AllToLua_cIniFile_ValueName00); tolua_function(tolua_S,"GetValueName",tolua_AllToLua_cIniFile_GetValueName00); - tolua_function(tolua_S,"ValueName",tolua_AllToLua_cIniFile_ValueName01); tolua_function(tolua_S,"GetValueName",tolua_AllToLua_cIniFile_GetValueName01); tolua_function(tolua_S,"GetValue",tolua_AllToLua_cIniFile_GetValue00); tolua_function(tolua_S,"GetValue",tolua_AllToLua_cIniFile_GetValue01); @@ -29535,17 +29129,17 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_function(tolua_S,"DeleteValueByID",tolua_AllToLua_cIniFile_DeleteValueByID00); tolua_function(tolua_S,"DeleteValue",tolua_AllToLua_cIniFile_DeleteValue00); tolua_function(tolua_S,"DeleteKey",tolua_AllToLua_cIniFile_DeleteKey00); - tolua_function(tolua_S,"NumHeaderComments",tolua_AllToLua_cIniFile_NumHeaderComments00); - tolua_function(tolua_S,"HeaderComment",tolua_AllToLua_cIniFile_HeaderComment00); - tolua_function(tolua_S,"HeaderComment",tolua_AllToLua_cIniFile_HeaderComment01); + tolua_function(tolua_S,"GetNumHeaderComments",tolua_AllToLua_cIniFile_GetNumHeaderComments00); + tolua_function(tolua_S,"AddHeaderComment",tolua_AllToLua_cIniFile_AddHeaderComment00); + tolua_function(tolua_S,"GetHeaderComment",tolua_AllToLua_cIniFile_GetHeaderComment00); tolua_function(tolua_S,"DeleteHeaderComment",tolua_AllToLua_cIniFile_DeleteHeaderComment00); tolua_function(tolua_S,"DeleteHeaderComments",tolua_AllToLua_cIniFile_DeleteHeaderComments00); - tolua_function(tolua_S,"NumKeyComments",tolua_AllToLua_cIniFile_NumKeyComments00); - tolua_function(tolua_S,"NumKeyComments",tolua_AllToLua_cIniFile_NumKeyComments01); - tolua_function(tolua_S,"KeyComment",tolua_AllToLua_cIniFile_KeyComment00); - tolua_function(tolua_S,"KeyComment",tolua_AllToLua_cIniFile_KeyComment01); - tolua_function(tolua_S,"KeyComment",tolua_AllToLua_cIniFile_KeyComment02); - tolua_function(tolua_S,"KeyComment",tolua_AllToLua_cIniFile_KeyComment03); + tolua_function(tolua_S,"GetNumKeyComments",tolua_AllToLua_cIniFile_GetNumKeyComments00); + tolua_function(tolua_S,"GetNumKeyComments",tolua_AllToLua_cIniFile_GetNumKeyComments01); + tolua_function(tolua_S,"AddKeyComment",tolua_AllToLua_cIniFile_AddKeyComment00); + tolua_function(tolua_S,"AddKeyComment",tolua_AllToLua_cIniFile_AddKeyComment01); + tolua_function(tolua_S,"GetKeyComment",tolua_AllToLua_cIniFile_GetKeyComment00); + tolua_function(tolua_S,"GetKeyComment",tolua_AllToLua_cIniFile_GetKeyComment01); tolua_function(tolua_S,"DeleteKeyComment",tolua_AllToLua_cIniFile_DeleteKeyComment00); tolua_function(tolua_S,"DeleteKeyComment",tolua_AllToLua_cIniFile_DeleteKeyComment01); tolua_function(tolua_S,"DeleteKeyComments",tolua_AllToLua_cIniFile_DeleteKeyComments00); diff --git a/source/Bindings.h b/source/Bindings.h index f123da881..edcdfd12f 100644 --- a/source/Bindings.h +++ b/source/Bindings.h @@ -1,6 +1,6 @@ /*
** Lua binding: AllToLua
-** Generated automatically by tolua++-1.0.92 on 10/24/13 16:43:15.
+** Generated automatically by tolua++-1.0.92 on 10/25/13 11:34:58.
*/
/* Exported function */
diff --git a/source/BlockID.cpp b/source/BlockID.cpp index 95e1a63bf..7193094d8 100644 --- a/source/BlockID.cpp +++ b/source/BlockID.cpp @@ -42,20 +42,20 @@ class cBlockIDMap public: cBlockIDMap(void) { - cIniFile Ini("items.ini"); - if (!Ini.ReadFile()) + cIniFile Ini; + if (!Ini.ReadFile("items.ini")) { return; } - long KeyID = Ini.FindKey("Items"); + int KeyID = Ini.FindKey("Items"); if (KeyID == cIniFile::noID) { return; } - unsigned NumValues = Ini.GetNumValues(KeyID); - for (unsigned i = 0; i < NumValues; i++) + int NumValues = Ini.GetNumValues(KeyID); + for (int i = 0; i < NumValues; i++) { - AString Name = Ini.ValueName(KeyID, i); + AString Name = Ini.GetValueName(KeyID, i); if (Name.empty()) { continue; diff --git a/source/Entities/Player.cpp b/source/Entities/Player.cpp index f92d42556..d94bc944c 100644 --- a/source/Entities/Player.cpp +++ b/source/Entities/Player.cpp @@ -1224,11 +1224,11 @@ void cPlayer::LoadPermissionsFromDisk() m_Groups.clear(); m_Permissions.clear(); - cIniFile IniFile("users.ini"); - if( IniFile.ReadFile() ) + cIniFile IniFile; + if (IniFile.ReadFile("users.ini")) { std::string Groups = IniFile.GetValue(m_PlayerName, "Groups", ""); - if( Groups.size() > 0 ) + if (!Groups.empty()) { AStringVector Split = StringSplit( Groups, "," ); for( unsigned int i = 0; i < Split.size(); i++ ) @@ -1245,7 +1245,7 @@ void cPlayer::LoadPermissionsFromDisk() } else { - LOGWARN("WARNING: Failed to read ini file users.ini"); + LOGWARN("Failed to read the users.ini file. The player will be added only to the Default group."); AddToGroup("Default"); } ResolvePermissions(); diff --git a/source/Generating/ChunkGenerator.cpp b/source/Generating/ChunkGenerator.cpp index d35b30460..59a00b540 100644 --- a/source/Generating/ChunkGenerator.cpp +++ b/source/Generating/ChunkGenerator.cpp @@ -75,8 +75,6 @@ bool cChunkGenerator::Start(cWorld * a_World, cIniFile & a_IniFile) m_Generator->Initialize(a_World, a_IniFile); - a_IniFile.WriteFile(); - return super::Start(); } diff --git a/source/GroupManager.cpp b/source/GroupManager.cpp index b79fde9dc..d7332fd0a 100644 --- a/source/GroupManager.cpp +++ b/source/GroupManager.cpp @@ -44,8 +44,8 @@ cGroupManager::cGroupManager() : m_pState( new sGroupManagerState ) { LOGD("-- Loading Groups --"); - cIniFile IniFile("groups.ini"); - if (!IniFile.ReadFile()) + cIniFile IniFile; + if (!IniFile.ReadFile("groups.ini")) { LOGWARNING("groups.ini inaccessible, no groups are defined"); return; diff --git a/source/Mobs/Monster.h b/source/Mobs/Monster.h index 39fa716ed..a0002bf4f 100644 --- a/source/Mobs/Monster.h +++ b/source/Mobs/Monster.h @@ -137,10 +137,10 @@ public: // tolua_begin - /// Translates MobType enum to a string + /// Translates MobType enum to a string, empty string if unknown static AString MobTypeToString(eType a_MobType); - /// Translates MobType string to the enum + /// Translates MobType string to the enum, mtInvalidType if not recognized static eType StringToMobType(const AString & a_MobTypeName); /// Returns the mob family based on the type diff --git a/source/MonsterConfig.cpp b/source/MonsterConfig.cpp index 37c7431b0..a5a1ebd49 100644 --- a/source/MonsterConfig.cpp +++ b/source/MonsterConfig.cpp @@ -55,18 +55,18 @@ cMonsterConfig::~cMonsterConfig() void cMonsterConfig::Initialize() { - cIniFile MonstersIniFile("monsters.ini"); + cIniFile MonstersIniFile; - if (!MonstersIniFile.ReadFile()) + if (!MonstersIniFile.ReadFile("monsters.ini")) { LOGWARNING("%s: Cannot read monsters.ini file, monster attributes not available", __FUNCTION__); return; } - for (int i = (int)MonstersIniFile.NumKeys(); i >= 0; i--) + for (int i = (int)MonstersIniFile.GetNumKeys(); i >= 0; i--) { sAttributesStruct Attributes; - AString Name = MonstersIniFile.KeyName(i); + AString Name = MonstersIniFile.GetKeyName(i); Attributes.m_Name = Name; Attributes.m_AttackDamage = MonstersIniFile.GetValueF(Name, "AttackDamage", 0); Attributes.m_AttackRange = MonstersIniFile.GetValueF(Name, "AttackRange", 0); diff --git a/source/PluginManager.cpp b/source/PluginManager.cpp index a557bdc03..5ae70d48d 100644 --- a/source/PluginManager.cpp +++ b/source/PluginManager.cpp @@ -103,8 +103,8 @@ void cPluginManager::ReloadPluginsNow(void) cServer::BindBuiltInConsoleCommands(); - cIniFile IniFile("settings.ini"); - if (!IniFile.ReadFile()) + cIniFile IniFile; + if (!IniFile.ReadFile("settings.ini")) { LOGWARNING("cPluginManager: Can't find settings.ini, so can't load any plugins."); } diff --git a/source/Root.cpp b/source/Root.cpp index 346bb2c9f..2397fc875 100644 --- a/source/Root.cpp +++ b/source/Root.cpp @@ -116,8 +116,8 @@ void cRoot::Start(void) m_Server = new cServer(); LOG("Reading server config..."); - cIniFile IniFile("settings.ini"); - if (!IniFile.ReadFile()) + cIniFile IniFile; + if (!IniFile.ReadFile("settings.ini")) { LOGWARNING("settings.ini inaccessible, all settings are reset to default values"); } @@ -138,7 +138,7 @@ void cRoot::Start(void) LOGERROR("Failure starting server, aborting..."); return; } - IniFile.WriteFile(); + IniFile.WriteFile("settings.ini"); m_WebAdmin = new cWebAdmin(); m_WebAdmin->Init(); diff --git a/source/WebAdmin.cpp b/source/WebAdmin.cpp index 882969746..8c95e4e21 100644 --- a/source/WebAdmin.cpp +++ b/source/WebAdmin.cpp @@ -44,8 +44,7 @@ public: cWebAdmin::cWebAdmin(void) : m_IsInitialized(false), - m_TemplateScript("<webadmin_template>"), - m_IniFile("webadmin.ini") + m_TemplateScript("<webadmin_template>") { } @@ -86,19 +85,19 @@ void cWebAdmin::RemovePlugin( cWebPlugin * a_Plugin ) bool cWebAdmin::Init(void) { - if (!m_IniFile.ReadFile()) + if (!m_IniFile.ReadFile("webadmin.ini")) { return false; } - LOG("Initialising WebAdmin..."); - if (!m_IniFile.GetValueSetB("WebAdmin", "Enabled", true)) { // WebAdmin is disabled, bail out faking a success return true; } + LOG("Initialising WebAdmin..."); + AString PortsIPv4 = m_IniFile.GetValueSet("WebAdmin", "Port", "8080"); AString PortsIPv6 = m_IniFile.GetValueSet("WebAdmin", "PortsIPv6", ""); diff --git a/source/World.cpp b/source/World.cpp index e62794781..786d97a4d 100644 --- a/source/World.cpp +++ b/source/World.cpp @@ -444,8 +444,8 @@ void cWorld::Start(void) m_SpawnZ = (double)((m_TickRand.randInt() % 1000) - 500); m_GameMode = eGameMode_Creative; - cIniFile IniFile(m_IniFileName); - if (!IniFile.ReadFile()) + cIniFile IniFile; + if (!IniFile.ReadFile(m_IniFileName)) { LOGWARNING("Cannot read world settings from \"%s\", defaults will be used.", m_IniFileName.c_str()); } @@ -555,7 +555,7 @@ void cWorld::Start(void) // Save any changes that the defaults may have done to the ini file: - if (!IniFile.WriteFile()) + if (!IniFile.WriteFile(m_IniFileName)) { LOGWARNING("Could not write world config to %s", m_IniFileName.c_str()); } |