Skip to content

Instantly share code, notes, and snippets.

@photofroggy
photofroggy / bds.group.txt
Created April 14, 2014 00:07
Idea for a BDS protocol to allow private group chats on dAmn.
Ok, so, protocol for making private group chats possible on dAmn.
These messages must happen in a private chat between users and a service bot.
BDS:GROUP:NEW:user1[,user2[,...]]
Sent by clients.
Open a new group chat with the named users.
''' Huffman Encoding and Decoding.
Henry Rapley, 2014.
Shitty implementation.
Got damn this code is messy.
But it works! Wooo!
'''
def cmpval(x, y):
Possible classes for a dAmn client.
BASIC NETWORKING
This stuff is used to open and manage a connection to a server.
Possibly have some of this stuff as a separate project.
Connection
protocol() - create a socket protocol
Video Chat Server
Video calls should be associated with a particular channel.
They should also have a host.
Should users have privilege levels?
Data:
User
Connection
@photofroggy
photofroggy / PFYPacket.m
Last active August 29, 2015 14:00
Lol wtf
//
// PFYPacket.m
// dAmnGDCAsyncTest
//
// Created by Henry on 05/05/2014.
// Copyright (c) 2014 dAmnLab. All rights reserved.
//
#import "PFYPacket.h"
PFYPacket *pkt = [PFYPacket fromNSData:data];
if([[pkt cmd] isEqualToString:@"dAmnServer"]) {
NSLog(@"Connected to dAmnServer %@",[pkt param]);
NSString *pkt = @"login photofroggy\npk=*****************\n\0";
[socket writeData:[pkt dataUsingEncoding:NSUTF8StringEncoding] withTimeout:-1 tag:2];
}
if([[pkt cmd] isEqualToString:@"login"]) {
if(![[pkt argument:@"e"] isEqualToString:@"ok"]) {
function init_lobber() {
// Create a lobber server!
var lserv = new lobber.Server( {
server: {
websocket: 8044,
socket: 8080
}
});
Server
AppManager app
AppManager
add(name, cls)
apps[name] = cls
get(name)
return apps[name] || null;
Some ideas for how the dAmn protocol could be adapted for video calls.
Sticking to existing protocol packet structures as closely as possible,
send and recv packets could be used if subpacket namespaces were permitted.
For subpackets, namespaces of the form call:callname could be used. Any
name could be used for a call, so long as that name is not already in use
within the channel the call is being operated in.
var callback = function( ) {
// Stuff you actually want to do.
};
var afterFirst = function( callback ) {