This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var reqs = []; | |
window.jsonp_handler = function(id, res) { | |
reqs[id].handle(res); | |
}; | |
function Req(url, data, handler) { | |
this.url = url; | |
this.data = typeof data == "object" ? data : {}; | |
this.handler = handler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.mast3rplan.rust.ping; | |
import java.net.DatagramPacket; | |
import java.net.DatagramSocket; | |
import java.net.InetAddress; | |
import java.nio.ByteBuffer; | |
import java.nio.ByteOrder; | |
public class RustPing { | |
static class ServerData { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Info used: http://wiki.vg/Server_List_Ping | |
// (Original varint parsing: https://gist.github.com/thinkofname/e975ddee04e9c87faf22) | |
// Reads a varint from the socket | |
function read_varint($socket) { | |
$i = 0; $j = 0; | |
while(true) { | |
socket_recv($socket, $buf, 1, null); | |
$k = ord($buf[0]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if not initialized then | |
-- make sure all monitors are the same resolution | |
-- set initial resolution | |
local width, height | |
local tempWidth, tempHeight | |
width, height = gpuGetResolution(1) | |
tempWidth, tempHeight = gpuGetResolution(2) | |
if not (tempWidth == width and tempHeight == height) then | |
error("Monitor 2 does not match monitor 1 it's resolution.") |