Coder Social home page Coder Social logo

Comments (8)

LiquidityC avatar LiquidityC commented on June 27, 2024 1

Ok, I had to test this. I have a working implementation for blight:send_bytes({ 0xff, 0xf1 }).
I just need to write some helpfiles and confirm but my initial tests seem to work. Should be available on the dev branch before the weekend is over.

As for the keep alive function I'll check that out later. That might not be such a quick fix. We'll have to see.

from blightmud.

LiquidityC avatar LiquidityC commented on June 27, 2024

Seems doable. I’ll take a swing at it when I get some spare time. For now I think you can get your lua timer working by escaping your slashes. Eg. \xFF should be \\xFF in lua

from blightmud.

robg204 avatar robg204 commented on June 27, 2024

Seems doable. I’ll take a swing at it when I get some spare time. For now I think you can get your lua timer working by escaping your slashes. Eg. \xFF should be \\xFF in lua

I had tried that, unfortunately, \xFF\xF1 sends literally "\xFF\xF1" to the mud (like.. as if you just typed that at the prompt with nothing converting it to ), rather than the keepalive sequence. It's possible there is a way to make it go, but I have yet to figure it out. I'll keep poking at it, as well. :)

from blightmud.

LiquidityC avatar LiquidityC commented on June 27, 2024

Ok. Then this amounts to two new features. One for keep alive and one for sending byte data from lua. 😊

from blightmud.

LiquidityC avatar LiquidityC commented on June 27, 2024

Come to think of it try concatenation good bytes with a string in lua. I’m no lua expert but it might work.

blight:send(“” .. 0xff .. 0xf1)

It might not work. But it’s worth a shot

from blightmud.

robg204 avatar robg204 commented on June 27, 2024

Come to think of it try concatenation good bytes with a string in lua. I’m no lua expert but it might work.

blight:send(“” .. 0xff .. 0xf1)

It might not work. But it’s worth a shot

I actually had that thought as well, that just sends "255241" to the mud though. I'll keep noodling around. I had thought that set_keepalive(&self, time) had stabilized as part of std::net::TcpStream but apparently it hasn't, yet. I think I must have been using it in nightly.

from blightmud.

robg204 avatar robg204 commented on June 27, 2024

I also tried using string.char(0xff), unfortunately I get the same error as if I just did blight:send("\0xFF"):
callback error: error converting Lua string to &str (invalid utf-8 sequence of 1 bytes from index 0)

from blightmud.

LiquidityC avatar LiquidityC commented on June 27, 2024

I've decided against hard coding any keep alive logic into blightmud. The tools are there if you want to build something on your own but I don't want lot's of scheduling and stuff ticking in the background. So I'm closing this.

from blightmud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.