Skip to content

Instantly share code, notes, and snippets.

<ul class="deviants">
{{#deviants}}
<li><a href="http://{{username}}.deviantart.com/" title="{{username}}" class="upage">{{symbol}}{{username}}</a><a href="/account/remove/{{username}}" title="remove {{username}} from account" class="rem">Remove</a></li>
{{/deviants}}
{{^deviants}}
<li><em>No accounts authorised</em></li>
{{/deviants}}
</ul>
var callback = function( ) {
// Stuff you actually want to do.
};
var afterFirst = function( callback ) {
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.
Server
AppManager app
AppManager
add(name, cls)
apps[name] = cls
get(name)
return apps[name] || null;
function init_lobber() {
// Create a lobber server!
var lserv = new lobber.Server( {
server: {
websocket: 8044,
socket: 8080
}
});
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"]) {
@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"
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
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
''' Huffman Encoding and Decoding.
Henry Rapley, 2014.
Shitty implementation.
Got damn this code is messy.
But it works! Wooo!
'''
def cmpval(x, y):