Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 22 23 [24] 25 26 ... 79

Author Topic: McFry's Minecraft Server: Vogons Inbound  (Read 104526 times)

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #345 on: February 01, 2015, 06:41:56 am »

Alright. I fixed the next thing. Let's see if it's stable this time.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #346 on: February 01, 2015, 01:07:51 pm »

Y'know, I suddenly had a thought. Maybe CC improperly closes file handles... In my reactor control program, I open a file, read the date written in it, then close the file, a lot of times per hour. If the script spams f.open and f.close, maybe java gets confused and improperly handles that thing.

Whenever you start the server up, could you go to my reactor computer and terminate the program, then rm "startup" to see if it helps? It's farfetched, seeing that CCraft has been around for forever and I'm sure someone other than me thrashed the filesystem, but it's worth a shot.

If that actually was ththe cause, I'm going to feel soooo bad about myself for a while...
« Last Edit: February 01, 2015, 01:25:49 pm by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #347 on: February 01, 2015, 02:41:00 pm »

Y'know, I suddenly had a thought. Maybe CC improperly closes file handles... In my reactor control program, I open a file, read the date written in it, then close the file, a lot of times per hour. If the script spams f.open and f.close, maybe java gets confused and improperly handles that thing.

Wow, here's how I do uptime in my script:

Code: [Select]
local timeOperationTable={
  __sub=function(a,b)
    if not a or not b then return false end
    if b[2]>a[2] then
          return setmetatable({(a[1]-1)-b[1],(a[2]-b[2])%24},timeOperationTable)
        else
          return setmetatable({a[1]-b[1],a[2]-b[2]},timeOperationTable)
        end
  end,
  __tostring=function(t)
    return t[1]..' in-game days, ' .. math.floor(t[2]) ..' hours'
  end
}

Then, with that metatable, I make a table like so:

Code: [Select]
timeStarted={os.day(),os.time()}
setmetatable(timeStarted,timeOperationTable)

And then I show the current uptime like so:

Code: [Select]
term.write('Uptime: ' .. timeOperationTable.__tostring(setmetatable({os.day(),os.time()},timeOperationTable)-timeStarted))
The weird __tostring thing is because computercraft either does or used to handle metatables really stupidly so I had to do that for maximum compatibility.

Of course, the uptime is measured in Minecraft days/hours, but whatever.

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #348 on: February 01, 2015, 02:49:36 pm »

Good news everyone! The server is running perfectly fine now, it's no longer leaking filehandles. Turns out everything was Skyrunner's fault. Yes, even the broken hard drive. :V
Logged

Remuthra

  • Bay Watcher
  • I live once more...
    • View Profile
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #349 on: February 01, 2015, 02:51:12 pm »

Just goes to show, children, don't build towers unless you're a wizard.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #350 on: February 01, 2015, 10:12:56 pm »

Huzzah.
(edit: it might be worth reportigreporting this as a bug to computercraft if it's reproducible. Does anyone know what normally happens if a script does that? I suspect it wouldn't crash the computer.)

Putnam: I have no idea what the heck is going on in that script x.X

I have thought of a way to do uptime better without thrashing the file system though. It involves loading the file only on startup or status change :P
« Last Edit: February 01, 2015, 10:15:13 pm by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #351 on: February 01, 2015, 10:29:03 pm »

os.time() and os.day() give you the current time of day (in Minecraft time) and day since world generation. The metatable makes it something akin to a class. It requires 0 file io because I can subtract one date from another using the metatable (operator overloading).

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #352 on: February 01, 2015, 10:35:41 pm »

Does the metatable survive between server reboots, though?

My script used to put the date and time (minecraft) into a file, then read the contents and do math with the current date and time to get real world hours and minutes.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #353 on: February 01, 2015, 10:39:57 pm »

It only really accounts for current uptime.

You could always do the file i/o only once per boot.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #354 on: February 01, 2015, 10:40:50 pm »

Yes, that's exactly what I was going to change the thing to do.

I am also considering a lazy screen update, where it checks that the reactor status has changed at all before redrawing the screen.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #355 on: February 01, 2015, 10:44:52 pm »

Screen writing isn't exactly expensive AFAIK, so I just refresh it as often as possible, sometimes even between ticks (my reactor ticks are usually 2 seconds apart). Unless you're doing something weird when writing, I guess....

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #356 on: February 03, 2015, 04:01:57 am »

So... does anyone want a Tier 5 jetplate? My system for making jetplates completely automatically is almost complete, and i have enough material to spare, but nobody to give jetplates to D:

Don't worry about charging, because you can just come near my cliff base or Sky Tower and watch as your levels go up.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

bluejello

  • Bay Watcher
    • View Profile
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #357 on: February 04, 2015, 04:10:55 pm »

so, dark trilogy updated,  don't know what all changed though.
Logged

Reudh

  • Bay Watcher
  • Perge scelus mihi diem perficias.
    • View Profile
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #358 on: February 04, 2015, 06:46:34 pm »

so, dark trilogy updated,  don't know what all changed though.

Probably got made even more grindy. In other news, I will be extending the railway to Sky's cliff base, and after that begins the laborious duplication of the line.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: McFry's Minecraft Server: Please Insert Disk 2
« Reply #359 on: February 04, 2015, 07:26:41 pm »

I woke up early for once, but sadly there are no people online now, either D:

edit: wow, apparently the Bauble API tracks baubles using user name. My Angel Ring and Runic Shield ring are gone :/

edit2: suddenly 10 second server (as opposed to latency/ping) lag... I'm not entirely sure if it's my fault, or if the internet is just suddenly wonky. I did install a set of IC2 machines, which are infamous for being laggy.
« Last Edit: February 04, 2015, 11:26:01 pm by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward
Pages: 1 ... 22 23 [24] 25 26 ... 79