Author Topic: Programming Megathread  (Read 107206 times)

ok so im asking for everybodys opinion on this
(theoretically)
we have a client, cl, two servers, point a and point b, and a cdn. the two servers have been patched to not post to master server, but instead authenticate only. point c (or cdn) is the actual place we want clients to connect to, so we'll have it authenticate that way. lets assume cl tries to connect. he'll first connect to the cdn, who can understand the packets hes sending. we will send an PING request to point a and point b. depending on which servers are up, it'll route the connection to the most favorable. and if one server goes down, it'll play a prerecorded event that will tell all clients to disconnect and reconnect. in that split second, the server modifys the routes, changing the packet routing dest from point a to point b. vice versa.
whats your ideas on this because i want to make a seamless transition between servers and maybe have a sort of hub server where you can connect to other servers via it

I mean I know this is basically what a router does but I'm thinking more of on a larger scale, and since we'd be doing this in tork I could steal the netcode and use it to listen on our ports. Especially for servers like (((Jew Years))) where server crashes are often, I'd like to know if it's actually possible

also I have a headache so if you don't understand it now I'll try and explain it more in the morning

Well that already sounds fair enough. I'd say it would be as simple as tunneling UDP packets but the connect request chain does do a few things with source IP, so you may want to modify that a bit if it turns out to be a problem. You're going to have trouble with just using a prerecorded event however, given the amount of state in each packet that will just cause the client to ignore it if it's not appropriate.

I've looked into seamless transitions before and you'd think you could just connect the client to another server without sending a new manifest or datablocks if they're identical, but it seems like you can't just manage that from TorqueScript (the game crashes if any ghost objects are left over after your local client is deleted), and of course making everyone inject a DLL is not viable.

Well that already sounds fair enough. I'd say it would be as simple as tunneling UDP packets but the connect request chain does do a few things with source IP, so you may want to modify that a bit if it turns out to be a problem. You're going to have trouble with just using a prerecorded event however, given the amount of state in each packet that will just cause the client to ignore it if it's not appropriate.

I've looked into seamless transitions before and you'd think you could just connect the client to another server without sending a new manifest or datablocks if they're identical, but it seems like you can't just manage that from TorqueScript (the game crashes if any ghost objects are left over after your local client is deleted), and of course making everyone inject a DLL is not viable.
well so like it'd call clientCmdGameModeChange to first disconnect and delete all of the bullstuff, then reconnect to the CDN which has its routes modified because of point A being down
also modifying the source IP would be a pain in the ass but I could understand if we wanted to keep it secure
« Last Edit: April 18, 2017, 01:03:28 PM by Metario »

every once in a while i like to peek into this thread and pretend i understand even a fraction of what the forget you guys are talking about

That sounds more like Malbolge to me

Just for reference, here's Hello World in Malbolge:
Code: [Select]
(=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc
Yes, there's a space at the start. Yes, it's on purpose. No, you can't get rid of it.
Malbolge would be the second chaos mastermind found in season 2 that was located in a second underground secret cryo prison directly underneath the first one, and takes at least three seasons to defeat.

What would the Piet language be?


guess you could say malbolge

brainforgets you

What would the Piet language be?
Piet is one of Pee-wee Herman's rube-goldberg machines. It's not really practical for anything, but someone probably thinks it's fun to use.

I needed to disable my network connection quickly so I wrote this script to disable the network adapter via WMI. Requires UAC elevation. I'm not sure why I turned the argument into a Ruby symbol.

Code: [Select]
unless ARGV.length == 1
  puts "Missing arguments. Lockdown --start to begin and --stop to finish lockdown."
  exit
end
if ARGV[0] != '--start' && ARGV[0] != '--stop'
  puts "Invalid argument. Use --start or --stop"
  exit
end
mode = ARGV[0][2..-1].to_sym # '--start' -> :start

require 'win32ole'
wmi = WIN32OLE.connect('winmgmts://./root/standardcimv2')
adapters = wmi.ExecQuery("select * from MSFT_NetAdapter")
for adapter in adapters do
  if adapter.Name == 'Ethernet'
    if mode == :start
      adapter.Enable
    else
      adapter.Disable
    end
  end
end

can someone explain to me what a pointer is and how you're supposed to use it? i've really been stuck because i gave up early on c in favor of web design languages, but recently tried to get back into it, and still can't grasp much of the application without knowing pointers

can someone explain to me what a pointer is and how you're supposed to use it? i've really been stuck because i gave up early on c in favor of web design languages, but recently tried to get back into it, and still can't grasp much of the application without knowing pointers
the only "web design language" is arguably PHP, which sucks butt

I'd try to explain pointers but I think I'll leave that to someone who would probably be able to provide a better explanation lol

the only "web design language" is arguably PHP, which sucks butt
ofc technicalities

can someone explain to me what a pointer is and how you're supposed to use it? i've really been stuck because i gave up early on c in favor of web design languages, but recently tried to get back into it, and still can't grasp much of the application without knowing pointers
a pointer is a thing that just points to a value in the programs memory referenced usually via addresses

can someone explain to me what a pointer is and how you're supposed to use it? i've really been stuck because i gave up early on c in favor of web design languages, but recently tried to get back into it, and still can't grasp much of the application without knowing pointers
I'll try to use a terrible brown townogy.

Imagine there is a very long book shelf (with only one shelf) and many millions of books (each book representing a portion of computer memory being used). Some of these books are much bigger than others and take up more space. A pointer is a very small book that's stored in our bookshelf and it contains only one page, that page simply describes where to find another book. A "pointer-book" doesn't need to tell us where another book is, the page might contain a single "0" which means it points to nothing. This is what's called a null pointer.

Example:
Code: [Select]
BOOK *pointer_book = nullptr; // "pointing to nothing"

It's very convenient if the cover of our "pointer-book" says what it's pointing to. For example, the book it's pointing to could be a book about a particular model of car so we say "this is a pointer-book about where to find a car". This is called static typing and it's used by many languages. If you are lazy you can always say 'Our "pointer-book" points to any book of any type!', in which case, the cover of your book will be called "void" which means your "pointer-book" can be used to point to anything.

Code: [Select]
CAR *pointer_book1 = &a_book_on_our_car; // A particular model of car
void *pointer_book2 = &a_book_on_our_car; // A new pointer but telling us where our car is again
pointer_book2 = &a_book_on_bicycles; // Reusing our previous pointer, this is valid because it's a "void pointer"

What happens if the our "pointer-book" points us to a book that's no longer there? What happens if our "pointer-book" points us to a book that's not about that car anymore but instead about bicycles? These are very bad conditions that can crash and burn our whole book-keeping system (our program).

Segmentation fault (core dumped).