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
module.exports.Client = function (name, socket) { | |
this.name = name | |
this.socket = socket | |
this.send = function (msg) { | |
this.socket.send(msg) | |
} | |
this.toString = function (msg) { | |
return this.name |
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
/* | |
* A minimalistic http server for serving static files with Node.js. | |
* Don't use this in a production enviroment, this http server is not fast or secure! | |
* | |
* Autor: Guido Krömer <mail@cacodaemon.de> | |
* Page: www.cacodaemon.de | |
* Date: 2012-11-07 | |
*/ | |
module.exports.MiniHttp = function (path, port, ip, indexPage) { | |
var path = path; |
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
module.exports.Session = function () { | |
var getRandom = function () { | |
return Math.floor(Math.random() * 1e16).toString(36); | |
} | |
this.sessionId = getRandom() + '-' + new Date().getTime().toString(36) + '-' + getRandom(); | |
this.doDestroy = false; | |
this.toString = function () { | |
return this.sessionId; |
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
"use strict"; | |
var User = require('./User.js').User; | |
var Message = require('./Message.js').Message; | |
var PrivateMessage = require('./Message.js').PrivateMessage; | |
var Command = require('./Message.js').Command; | |
var SessionHandler = require('./SessionHandler.js').SessionHandler; | |
module.exports.ChatServer = function (port, debug) { | |
var http = require('http'); | |
var qs = require('querystring'); |
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
module.exports.ChatClient = function () { | |
if (module.exports.ChatClient.instance) { | |
return module.exports.ChatClient.instance; | |
} | |
module.exports.ChatClient.instance = this; | |
this.host = null; | |
this.welcomeTime = 0; | |
var interval = 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>JSONP example</title> | |
<script> | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = 'http://cacodaemon.de/tutorials/jsonp_example.js'; | |
document.getElementsByTagName('head')[0].appendChild(script); |
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
/* | |
* Simple JavaScript game manager. | |
* | |
* (c) 2012 Guido Krömer <mail@cacodaemon.de> | |
* | |
*/ | |
function GameManager () { | |
var canvas = null; | |
var ctx = null; | |
var delta = 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
/* | |
* Simple JavaScript game manager. | |
* | |
* By Guido Krömer <mail@cacodaemon.de> | |
* | |
*/ | |
function GameManager () { | |
var canvas = null; | |
var ctx = null; | |
var delta = 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
<?php | |
/** | |
* Creates some kind of combined image from a given set of images. | |
* All images should have the same resolution. | |
* Used and explained at www.cacodaemon.de | |
* | |
* Autor Guido Krömer | |
* E-Mail: mail<at>cacodaemon.de | |
* | |
*/ |
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
/* | |
* Simple JavaScript game manager. | |
* | |
* By Guido Krömer <mail@cacodaemon.de> 2013 | |
* | |
*/ | |
function GameManager () { | |
var canvas = null; | |
var ctx = null; | |
var delta = 0; |