34 lines
910 B
Objective-C
34 lines
910 B
Objective-C
//
|
|
// Network.h
|
|
// Pong
|
|
//
|
|
// Created by Jeena on 27.02.11.
|
|
// Copyright 2011 __MyCompanyName__. All rights reserved.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import "AsyncSocket.h"
|
|
#import "GGSDelegate.h"
|
|
|
|
@protocol GGSDelegate;
|
|
|
|
@interface GGSNetwork : NSObject {
|
|
AsyncSocket *asyncSocket;
|
|
id<GGSDelegate> delegate;
|
|
NSString *gameToken;
|
|
NSDictionary *currentHeaders;
|
|
}
|
|
|
|
@property (nonatomic, retain) AsyncSocket *asyncSocket;
|
|
@property (nonatomic, retain) id<GGSDelegate> delegate;
|
|
@property (nonatomic, retain) NSDictionary *currentHeaders;
|
|
@property (nonatomic, retain) NSString *gameToken;
|
|
|
|
- (id)initWithDelegate:(id)delegate;
|
|
- (NSData *)makeMessageFor:(NSString *)serverOrGame withCommand:(NSString *)command andArgs:(NSString *)args;
|
|
- (void)parseAndSetHeader:(NSData *)headerData;
|
|
|
|
- (void)define:(NSString *)sourceCode;
|
|
- (void)sendCommand:(NSString *)command withArgs:(NSString *)args;
|
|
|
|
@end
|