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

[Feature] Cast system

amatria

Well-Known Member
Joined
May 15, 2021
Messages
74
Solutions
6
Reaction score
80
Location
Spain
GitHub
amatria
Hi!

A few days ago I came across this issue on GitHub (#984 - Znote - Live cast system) and it has been echoing in my head ever since then. I did some research and saw that some have tried to implement the system ---!2230, !994--- but ended up abandoning it. So, is it worth the effort? I'm willing to give it a try and challenge myself ---I am not that interested in the money, though.

Also, I am aware that there exist these "code quality guidelines":
The use of the dispatcher thread must be minimal.
All caster variables must be stored in the ProtocolGame instance of the caster player.
However, the issue is quite old ---it was posted back in 2014. So, should I consider any other restriction?

So, to wrap up, I would appreciate your opinions, thoughts, advice etc. on the matter before actually committing.

Cheers.

amatria.
 

Maybe this
 
Thank you very much. I'll get in contact with him to try and see in which state the system is and if there's any work left to do.
 
Thank you very much. I'll get in contact with him to try and see in which state the system is and if there's any work left to do.
Slavi is not with us anymore, so you might not want to contact him.
 
Oh, I had no idea. My most sincere condolences. However, I meant I was going to get in contact with ltutorial.
 
About djarek ( Casting system by djarek · Pull Request #994 · otland/forgottenserver (https://github.com/otland/forgottenserver/pull/994) ) cast system:
It had one known issue. Maybe it's already fixed, not tested it. Spawn 30 demons by GM, login some player next to them and start cast by that player. When you try to join, it debugs spectator client. There was missing some synchonization and high number of running monsters on screen made connecting spectator debug (monster make step in milisecond when server send 'monster on screen' to new spectator).
 
About djarek ( Casting system by djarek · Pull Request #994 · otland/forgottenserver (https://github.com/otland/forgottenserver/pull/994) ) cast system:
It had one known issue. Maybe it's already fixed, not tested it. Spawn 30 demons by GM, login some player next to them and start cast by that player. When you try to join, it debugs spectator client. There was missing some synchonization and high number of running monsters on screen made connecting spectator debug (monster make step in milisecond when server send 'monster on screen' to new spectator).
Pretty sure you had this fixed - don't you wanna share your solution with us?
 
Last edited:
Pretty sure you had this fixed - don't you wanna share your solution with us?
I just had reports from X people and tested it on my PC to confirm it debugs. Never fixed it.
Problem with it was that 'casts' run in other thread. There is no synchronization with dispatcher thread. All is good as long as there is not too much action on screen. Cast spectator may receive packet with 'creature move' before he get packets with tiles (send on login/on join cast) and monsters on them. Then it debugs with 'unknown creature' error message in client.
Maybe some simple 'if' with 'if tiles not send to spectator, ignore other packets' would work.

On Kasteria I added 'elf cast system' from TFS 0.4 - waste a lot of CPU, run in main (dispatcher) thread, but 'it works'.
 
no one has a finished cast system ? does somebody knows a cast system for tfs 1.3/1.5?
 
Thank you. It has the commits? Or I have to search through the files?
Edit: I already review it thank I have to search through files u.u

u can use this datapack as a base for your project, it is very good.
 
Last edited:
who can help me? ii have added cast sytem mys creen look fucked up
might be because of this?
Lua:
void ProtocolGame::parseSpectatorPacket(NetworkMessage& msg)
{
    if (!acceptPackets || g_game.getGameState() == GAME_STATE_SHUTDOWN || msg.getLength() <= 0) {
        return;
    }

    if (getThis() == nullptr) {
        return;
    }

    uint8_t recvbyte = msg.getByte();

    if (!player) {
        if (recvbyte == 0x0F) {
            disconnect();
        }
        return;
    }

    if (player->isRemoved() || player->getHealth() <= 0) {
        disconnect();
        return;
    }
    for (auto& info : spectInfo) {
        if (info.liveName == spect->getLiveCastName() && info.spectIp == convertIPToString(spect->getIP()) && info.spectBan) {
            disconnect();
            disconnectClient("You are banned from this live!");
            return;
        }
    }

    //std::cout << "Recvbyte CastSystem: 0x" << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(recvbyte) << std::endl;

    switch (recvbyte)
    {
    case 0x14: g_dispatcher.addTask(createTask(std::bind(&ProtocolGame::spectatelogout, getThis()))); break;
    case !0x1E: g_dispatcher.addTask(createTask(std::bind(&ProtocolGame::sendPing, getThis()))); break;
    case 0x1D: disconnect(); break;
        //case 0x1D: g_dispatcher.addTask(createTask(std::bind(&ProtocolGame::sendPingBack, getThis()))); break;
    case 0x64:
    case 0x65:
    case 0x66:
    case 0x67:
    case 0x68:
    case 0x6A:
    case 0x6B:
    case 0x6C:
    case 0x6D: g_dispatcher.addTask(createTask(std::bind(&ProtocolGame::sendCancelWalk, getThis()))); break;
    case 0x96: parseSpectatorSay(msg); break;
    case 0x99: g_dispatcher.addTask(createTask(std::bind(&ProtocolGame::spectatelogout, getThis()))); break;
        /*
            case 0x6F:
            case 0x70: g_dispatcher.addTask(createTask(std::bind(&ProtocolGame::nextSpectator, getThis())));
            case 0x71:
            case 0x72:
        */
    default:
        break;
    }

    if (msg.isOverrun()) {
        disconnect();
    }
}

log in cast.png
 
lol man stop, just use a f** fork original with cast system i dunno why are u wasting your time
 
lol man stop, just use a f** fork original with cast system i dunno why are u wasting your time
Because almost every project with that system has many things that should be removed(I use protocol8.x also because that system is not released for TFS 1.5 the code is different. Also because every system released is buggy or unfinished. So is not that easy as you say or think otherwise the system would be available and not being sold for 100 USD just as you tried to sell me a deprecated crap, teñling me that your shart is like "medivia" lol
Also you tried to tell me that you were able to adapt that code into TFS 1.x which was not true at all, like every bullshit that you try to sell me ROFL.

Ps: I will succeed on this, just as everything like I've wanted to do ^^ it's matter of time
 
lol ! good luck I've tried to open your eyes
 
Last edited:
Back
Top