//
//  InitBuddyListRequest.m
//  SFS2X
//
//  Original development by Infosfer Game Technologies Ltd. | http://www.infosfer.com.
//
//  Maintained and developed by A51 Integrated.
//  Copyright 2012 A51 Integrated | http://a51integrated.com. All rights reserved.
//


#import "InitBuddyListRequest.h"
#import "SmartFox2XClient.h"

NSString * const InitBuddyListRequest_KEY_BLIST = @"bl";
NSString * const InitBuddyListRequest_KEY_BUDDY_STATES = @"bs";
NSString * const InitBuddyListRequest_KEY_MY_VARS = @"mv";


@implementation InitBuddyListRequest

-(id)init {
	
	if ((self = [super initWithId:BaseRequest_InitBuddyList])) {
		
	}

	return self;
}

+(id)request {
	InitBuddyListRequest *req = [[InitBuddyListRequest alloc] init];
	return req;
}

-(void)validate:(SmartFox2XClient *)sfs {
	
	NSMutableArray *errors = [NSMutableArray array];
	
	if ([sfs.buddyManager isInited]) {
		[errors addObject:@"Buddy List is already initialized."];
	}
	
	if ([errors count] > 0) {
		@throw [SFSValidationException validationExceptionWithReason:@"InitBuddyRequest error" errors:errors];
	}
}

@end
