• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Error with groups.xml

Tibia Rox

Member
Joined
Feb 4, 2009
Messages
1,181
Reaction score
9
Location
U.S.A
I'm trying to start up my 10.77 server, but every time I do I get this in my console:


photo hosting


When I try and log in to a character, it says "Your character could not be loaded" and in the console it says "Account manager has group id 1 which does not exist."

When I go into phpmyadmin and look for groups, everything is normal. When I go into groups.xml this is what shows:
Code:
<?xml version="1.0" encoding="UTF-8"?>

<groups>

Whenever I try and edit my groups.xml to the following image and start my server, the file automatically changes back to the above code.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<groups>
    <group id="1" name="player" flags="0" access="0" maxdepotitems="0" maxvipentries="0" />
    <group id="2" name="gamemaster" flags="137438953471" access="1" maxdepotitems="0" maxvipentries="200" />
    <group id="3" name="god" flags="272730398714" access="1" maxdepotitems="0" maxvipentries="200" />
</groups>

Here is my migrations/14 folder in case you need it.
Code:
function onUpdateDatabase()
    print("> Updating database to version 15 (moving groups to data/XML/groups.xml)")

    db.query("ALTER TABLE players DROP FOREIGN KEY players_ibfk_2")
    db.query("DROP INDEX group_id ON players")

    db.query("ALTER TABLE accounts DROP FOREIGN KEY accounts_ibfk_1")
    db.query("DROP INDEX group_id ON accounts")
    db.query("ALTER TABLE `accounts` DROP `group_id`")

    local groupsFile = io.open("data/XML/groups.xml", "w")
    if groupsFile ~= nil then
        groupsFile:write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n")
        groupsFile:write("<groups>\r\n")

        local resultId = db.storeQuery("SELECT `id`, `name`, `flags`, `access`, `maxdepotitems`, `maxviplist` FROM `groups` ORDER BY `id` ASC")
        if resultId ~= false then
            repeat
                groupsFile:write("\t<group id=\"" .. result.getDataInt(resultId, "id") .. "\" name=\"" .. result.getDataString(resultId, "name") .. "\" flags=\"" .. string.format("%u", result.getDataLong(resultId, "flags")) .. "\" access=\"" .. result.getDataInt(resultId, "access") .. "\" maxdepotitems=\"" .. result.getDataInt(resultId, "maxdepotitems") .. "\" maxvipentries=\"" .. result.getDataInt(resultId, "maxviplist") .. "\" />\r\n")
            until not result.next(resultId)
            result.free(resultId)
        end

        groupsFile:write("</groups>\r\n")
        groupsFile:close()

        db.query("DROP TABLE `groups`")
    end
    return true
end

Any help is appreciated. Thanks in advance.
 
Back
Top