• 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!

Nostalrius 7.7

data/globalevents/globalevents.xml
XML:
<globalevent name="Player Save" interval="1800000" script="playersave.lua" />


data/globalevents/scripts/playersave.lua
Lua:
local function serverSave()
    Game.saveGameState()
    broadcastMessage("Server saved, next save in 30 minutes.", MESSAGE_STATUS_WARNING)
    return true
end

function onThink(interval, lastExecution, thinkInterval)
    broadcastMessage("Automatic Serversave in 10 seconds!", MESSAGE_STATUS_WARNING)
    addEvent(serverSave, 10000)
end


data/talkactions/scripts/saveserver.lua
Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    Game.saveGameState()
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Server is now saved.")
end


data/talkactions/talkactions.xml
XML:
<talkaction words="/saveserver" script="saveserver.lua" />


src/luascript.cpp add on line 1635 ~

C++:
registerMethod("Game", "saveGameState", LuaScriptInterface::luaGameSaveGameState);
and add on line 3939 (after luaGameSetGameState)
C++:
int LuaScriptInterface::luaGameSaveGameState(lua_State* L)
{
    // Game.saveGameState()
    g_game.saveGameState();
    pushBoolean(L, true);
    return 1;
}

src/luascript.h add on line 538 ~
C++:
static int luaGameSaveGameState(lua_State* L);


enjoy

Are 3 different alternatives? Or does one complement the other in some way? And what is the most efficient way?


PS: Compiling - Problems when copying the SRC (Nostalrius 7.7) (https://otland.net/threads/problems-when-copying-the-src-nostalrius-7-7.273548/)
 
Last edited:
Please, remove werror from your cmakelists files.


i remove:
add_compile_options(-Wall -Werror -pipe -fvisibility=hidden)

add:

add_compile_options(-Wall -pipe -fvisibility=hidden)



My Cmakelist.txt

Lua:
include(cotire)

add_compile_options(-Wall -pipe -fvisibility=hidden)

if (CMAKE_COMPILER_IS_GNUCXX)
    add_compile_options(-fno-strict-aliasing)
endif()



I keep getting the warnings. Am I doing something wrong here? Thanks.
 
I just compiled nostalrius 7.7, imported the sql schema and opened the server locally.

But when I disconnect a character, he cannot save the progression, the error is this:

Lua:
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1




In advance, thanks for everyone who tried to help!
 

Attachments

Issue relies on the server, due to newer MySQL I'd say, you have to change the sex query for uint instead of raw sex type.
the Sex is Int(11) in schema
1607812327712.png

I used the last version of mysql installed by Xampp.

I try install the last version of MariaDB in port 3307, but the same error occurs.
 
the Sex is Int(11) in schema
View attachment 52416

I used the last version of mysql installed by Xampp.

I try install the last version of MariaDB in port 3307, but the same error occurs.

In iologindata.cpp, the query that sets "sex" should be cast as uint16 in order for the error not to occur.
 
I have a problem with keyboard walking using otclient (edubart).
When using autowalk (click on the map) it works well

On otclientv8 it is smoother when walking through the keyboard

Is there anything i can do on the server / protocol to improve or is it on the client?

Here my post with some videos about problem:
 
I can't find the problem, I tested OTHire with the same OTClient and it is much smoother with fewer frames locking when walking.

I tried to change the getSpeedDuration method of creature.cpp and leave the duration equal to that of OTHire, but that didn't work either.
I tried to change several parts of the code from player.cpp, creature.cpp and even OTClient but nothing works. Nostalrius is much slower / freezing when using otclient.

@Ezzz do you have any idea how i can improve the nostalrius keyboard walking system to make it smoother or equal to that of OTHire?
I have a problem with keyboard walking using otclient (edubart).
When using autowalk (click on the map) it works well

On otclientv8 it is smoother when walking through the keyboard

Is there anything i can do on the server / protocol to improve or is it on the client?

Here my post with some videos about problem:
 
Does it work compile with visual studio 2019? Or do i need a earlier version?
 
Does it work compile with visual studio 2019? Or do i need a earlier version?

Visual Studio 2019 and up works.

I can't find the problem, I tested OTHire with the same OTClient and it is much smoother with fewer frames locking when walking.

I tried to change the getSpeedDuration method of creature.cpp and leave the duration equal to that of OTHire, but that didn't work either.
I tried to change several parts of the code from player.cpp, creature.cpp and even OTClient but nothing works. Nostalrius is much slower / freezing when using otclient.

@Ezzz do you have any idea how i can improve the nostalrius keyboard walking system to make it smoother or equal to that of OTHire?

It's odd that you're having this issue, could be related to first step on OTC.
 
Visual Studio 2019 and up works.



It's odd that you're having this issue, could be related to first step on OTC.
I solved some problem related to first step on this thread:
OTClient - Problem in the walking system (auto walk) when there is an obstacle in front (https://otland.net/threads/problem-in-the-walking-system-auto-walk-when-there-is-an-obstacle-in-front.274008/#post-2640343)

But while walking in different grounds and characters speed you can see that it's not so smooth yet.
According to the videos I posted here: OTClient - Screen render freezing while keyboard walking (https://otland.net/threads/screen-render-freezing-while-keyboard-walking.274148/)

I realized that only occurs in the regular otclient (edubart) with the older protocols.

An alternative to make it smoother i believe it is adapting @Mehah work's (mehah/otclient (https://github.com/mehah/otclient)) to old protocols
 
Back
Top