Skip to content

Instantly share code, notes, and snippets.

View DylanLukes's full-sized avatar

Dylan Lukes DylanLukes

  • University of California San Diego
  • San Diego, CA
View GitHub Profile
java.net.SocketException: Resource temporarily unavailable
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.net.SocketInputStream.read(SocketInputStream.java:182)
at java.io.FilterInputStream.read(FilterInputStream.java:66)
at fn.b(SourceFile:77)
at ii.c(SourceFile:147)
at ii.c(SourceFile:9)
at ni.run(SourceFile:57)
//
// MHProxy.m
// MineHelmet
//
// Created by Dylan Lukes on 10/24/10.
// Copyright 2010 Dylan Lukes. All rights reserved.
//
#import "MHProxy.h"
#define eglMultMatrix( C, A, B )\
{\
C[0 ] = ( ( A[0] * B[0 ] ) + ( A[4] * B[1 ] ) + ( A[8 ] * B[2 ] ) + ( A[12] * B[3 ] ) );\
C[4 ] = ( ( A[0] * B[4 ] ) + ( A[4] * B[5 ] ) + ( A[8 ] * B[6 ] ) + ( A[12] * B[7 ] ) );\
C[8 ] = ( ( A[0] * B[8 ] ) + ( A[4] * B[9 ] ) + ( A[8 ] * B[10] ) + ( A[12] * B[11] ) );\
C[12] = ( ( A[0] * B[12] ) + ( A[4] * B[13] ) + ( A[8 ] * B[14] ) + ( A[12] * B[15] ) );\
\
C[1 ] = ( ( A[1] * B[0 ] ) + ( A[5] * B[1 ] ) + ( A[9 ] * B[2 ] ) + ( A[13] * B[3 ] ) );\
C[5 ] = ( ( A[1] * B[4 ] ) + ( A[5] * B[5 ] ) + ( A[9 ] * B[6 ] ) + ( A[13] * B[7 ] ) );\
C[9 ] = ( ( A[1] * B[8 ] ) + ( A[5] * B[9 ] ) + ( A[9 ] * B[10] ) + ( A[13] * B[11] ) );\
- (int)handleConnectAttempt:(int)socket addr:(const struct sockaddr *)addr addrlen:(socklen_t)addrlen {
static BOOL javaStackTestConnect = NO;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Ignore the first connect() attempt (java test)
static dispatch_once_t pred;
dispatch_once(&pred, ^{javaStackTestConnect = YES;});
if (javaStackTestConnect) {
javaStackTestConnect = NO;
typedef enum {
NullaryNode = 0,
UnaryNode = 1,
BinaryNode = 2,
TernaryNode = 3
} NodeType;
typedef struct node_struct Node;
struct node_struct {
int pheromoneA;
struct vec4 {
union {
struct {
int x;
int y;
int z;
int w;
}
struct {
int r;
//
// MHProxy.m
// MineHelmet
//
// Created by Dylan Lukes on 10/24/10.
// Copyright 2010 Dylan Lukes. All rights reserved.
//
#import "MHProxy.h"
#import "sys/socket.h"
typedef struct {
union {
struct {
int r;
int g;
int b;
int a;
}
struct {
int x;
@protocol MHPacketDecoderDelegate <NSObject>
- (void)packetDecoder:(id)sender didDecodeKeepAlive:(BOOL)unused;
- (void)packetDecoder:(id)sender didDecodeLoginRequest:(int32_t)protocolVersion username:(NSString *)username password:(NSString *)password mapseed:(int64_t)mapseed dimension:(int8_t)dimension;
- (void)packetDecoder:(id)sender didDecodeHandshake:(NSString*)username;
- (void)packetDecoder:(id)sender didDecodeChatMessage:(NSString*)message;
- (void)packetDecoder:(id)sender didDecodeTimeUpdate:(int64_t)time;
- (void)packetDecoder:(id)sender didDecodePlayerInventory:(int32_t)type count:(int16_t)count payload:(NSArray*)payload;
- (void)packetDecoder:(id)sender didDecodeSpawnPosition:(int32_t)x y:(int32_t)y z:(int32_t)z;
- (void)packetDecoder:(id)sender didDecodeClientState:(BOOL)onGround;
- (void)packetDecoder:(id)sender didDecodePlayerMove:(double)x y:(double)y stance:(double)stance z:(double)z onGround:(BOOL)onGround;
@protocol MHPacketDecoderDelegate <NSObject>
@required
- (void)packetDecoder:(id)sender didNotDecodePacket:(NSData *)packet;
@optional
- (void)packetDecoder:(id)sender didDecodeKeepAlive:(BOOL)unused;
- (void)packetDecoder:(id)sender didDecodeLoginRequest:(int32_t)protocolVersion username:(NSString *)username password:(NSString *)password mapseed:(int64_t)mapseed dimension:(int8_t)dimension;
- (void)packetDecoder:(id)sender didDecodeHandshake:(NSString*)username;
- (void)packetDecoder:(id)sender didDecodeChatMessage:(NSString*)message;
- (void)packetDecoder:(id)sender didDecodeTimeUpdate:(int64_t)time;
- (void)packetDecoder:(id)sender didDecodePlayerInventory:(int32_t)type count:(int16_t)count payload:(NSArray*)payload;