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
std::vector<Player> players (MAX_CONNECTIONS); | |
// pull out the type of messages sent by our config | |
typedef server::message_ptr message_ptr; | |
// Define a callback to handle incoming messages | |
void on_message(server* s, websocketpp::connection_hdl hdl, message_ptr msg) { | |
std::cout << "on_message called with hdl: " << hdl.lock().get() | |
<< " and message: " << msg->get_payload() | |
<< std::endl; |
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 pixi = require('pixi.js'); | |
module.exports = function(host) { | |
return new Game(host); | |
} | |
function Game (host) { | |
this.host = host; | |
console.log("Creating game") |
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 pixi = require('pixi.js'); | |
module.exports = function(host) { | |
return new game(host); | |
} | |
function game (host) { | |
this.host = host; | |
console.log("creating game") |
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 pixi = require('pixi.js'); | |
var player = require('./player.js') | |
module.exports = function(host) { | |
return new Game(host); | |
} | |
function Game (host) { | |
this.host = host; |
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
function Server (host, port) { | |
// Create WebSocketServer | |
var wss = new WebSocketServer({host: host, port: port}) | |
wss.on('connection', this.onConnect(ws)) | |
} | |
Server.prototype.onConnect = function (ws) { | |
// Debug |
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
// Nolag Client Implementation : Client | |
// Rafi Khan | |
// Require Modules | |
var WebSocket = require('ws') | |
// Returns Client Object | |
module.exports = function(host) { | |
return new Client(host) | |
} |
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
// Nolag Server : Main | |
// Rafi Khan | |
extern crate time; | |
use std::thread::sleep; | |
use std::time::Duration; | |
// runs loop update_rate times a second |
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
// Create a game | |
Debug.Log("Create a single player game: " + gameMode); | |
SceneManager.LoadScene ("dmGame", LoadSceneMode.Single); | |
switch (gameMode) { | |
case Game.GameMode.DEATH_MATCH: | |
Debug.Log ("create a deathmatch game"); | |
GameObject go = GameObject.Find ("/Everything/Game"); | |
if (go == null) |
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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System; | |
using UnityEngine.SceneManagement; | |
using System.Reflection; | |
public class GameManager : MonoBehaviour { | |
public GameManager Instance; |
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 ndarray = require('ndarray') | |
var block = require('./block.js') | |
module.exports = function() { | |
return new Chunk() | |
} | |
function Chunk() { | |
this.size = 16 | |
this.dims = [this.size, this.size, this.size] |