Skip to content

Instantly share code, notes, and snippets.

View TokyoDan's full-sized avatar

Theron Daniel Huffman TokyoDan

View GitHub Profile
@TokyoDan
TokyoDan / onGetAllRoomsDone
Created August 27, 2013 11:35
onGetAllRoomsDone
public void onGetAllRoomsDone (AllRoomsEvent eventObj)
{
//Log ("onGetAllRoomsDone : " + eventObj.getResult());
byte rslt = eventObj.getResult();
if(rslt == 0)
{
string[] roomIds = eventObj.getRoomIds();
if( roomIds.Length == 1 )
{
TOTlog("2 onGetAllRoomsDone because you called GetAllRooms(): Only default room so we are creating a new one");
struct TOTmoveCommand
{
public string cmd; // INIT, SETP, MOV, etc
public int plr;
public int typ;
public int rot;
public int lx;
public int ly;
public float px;
public float pz;
Dictionary<string, object> roomProps = new Dictionary<string, object>();
roomProps.Add("Blue", "empty");
roomProps.Add("Red", "empty");
roomProps.Add("Green", "empty");
roomProps.Add("Orange", "empty");
WarpClient.GetInstance().CreateRoom("Echo", "Mich", 4, roomProps);
@TokyoDan
TokyoDan / Dictionary problem
Last active December 18, 2015 19:49
Is a Dictionary format different when it is returned as a callback compared to when it is accessed directly?
This top code snippet works if the Dictionary is accessed directly and it's not returned in a call back.
--------------------------------------------------------------------------------------------------------------
properties = new Dictionary<string, object>();
properties.Add("Blue", "Dan");
properties.Add("Red", "Joe");
foreach(KeyValuePair<string, object> pair in properties)
{
if(pair.Value == "Dan" )
{
{
"name": "TheOctagonTheory",
"subdomain": "tot",
"scripts": {
"start": "server.js"
},
"dependencies": {
"socket.io": "0.9.x"
},
"engines": {
@TokyoDan
TokyoDan / jitsu deploy error
Created June 29, 2012 05:47
deploy error
iMac27:Nodejitsu Caster$ jitsu deploy
path.existsSync is now called `fs.existsSync`.
info: Welcome to Nodejitsu tot
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
warn: There in no valid package.json file in /Users/Caster/Desktop/Nodejitsu
warn: Creating package.json at /Users/Caster/Desktop/Nodejitsu/package.json
help:
help: A package.json stores meta-data about your application
help: In order to continue we'll need to gather some information about your app
@TokyoDan
TokyoDan / Bad Jitsu output
Created June 29, 2012 04:53
Bad Jitsu output
iMac27:~ Caster$ sudo jitsu users confirm tot Sq*********oGlz-
path.existsSync is now called `fs.existsSync`.
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command users confirm tot SqtWj_pxcP6oGlz-
info: Confirming user tot
error: Error running command users confirm tot SqtWj_pxcP6oGlz-
error: socket hang up
error: Error: socket hang up
error: at createHangUpError (http.js:1253:15)
@TokyoDan
TokyoDan / npm-ls-g
Created June 29, 2012 04:33
npm ls -g output
iMac27:~ Caster$ sudo npm ls -g
/usr/local/n/versions/0.8.1/lib
├─┬ jitsu@0.8.9
│ ├── colors@0.6.0-1
│ ├── complete@0.3.1
│ ├── dateformat@1.0.2-1.2.3
│ ├─┬ flatiron@0.1.16
│ │ ├─┬ broadway@0.1.14
│ │ │ ├─┬ cliff@0.1.7
│ │ │ │ └── eyes@0.1.7