Commit af46f4c7 authored by Chengzhao Li's avatar Chengzhao Li
Browse files

- add chat room scene

- make the chat app work
parent 9208178a
......@@ -82,15 +82,15 @@
9B28F0261D219148008B35B3 /* NCMCAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B28F0251D219148008B35B3 /* NCMCAlertView.m */; };
9B28F0271D219148008B35B3 /* NCMCAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B28F0251D219148008B35B3 /* NCMCAlertView.m */; };
9B28F0281D219148008B35B3 /* NCMCAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B28F0251D219148008B35B3 /* NCMCAlertView.m */; };
9B2A23611D2428E800C6EEC5 /* ChatRoomScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A23601D2428E800C6EEC5 /* ChatRoomScene.m */; };
9B2A23621D2428E800C6EEC5 /* ChatRoomScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A23601D2428E800C6EEC5 /* ChatRoomScene.m */; };
9B2A23631D2428E800C6EEC5 /* ChatRoomScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2A23601D2428E800C6EEC5 /* ChatRoomScene.m */; };
9B6B1ED11D18944F0008B45D /* LoginScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1ED01D18944F0008B45D /* LoginScene.m */; };
9B6B1ED21D18944F0008B45D /* LoginScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1ED01D18944F0008B45D /* LoginScene.m */; };
9B6B1ED31D18944F0008B45D /* LoginScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1ED01D18944F0008B45D /* LoginScene.m */; };
9B6B1ED61D1895860008B45D /* SettingScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1ED51D1895860008B45D /* SettingScene.m */; };
9B6B1ED71D1895860008B45D /* SettingScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1ED51D1895860008B45D /* SettingScene.m */; };
9B6B1ED81D1895860008B45D /* SettingScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1ED51D1895860008B45D /* SettingScene.m */; };
9B6B1EDB1D1895A50008B45D /* ConnectionScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1EDA1D1895A50008B45D /* ConnectionScene.m */; };
9B6B1EDC1D1895A50008B45D /* ConnectionScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1EDA1D1895A50008B45D /* ConnectionScene.m */; };
9B6B1EDD1D1895A50008B45D /* ConnectionScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1EDA1D1895A50008B45D /* ConnectionScene.m */; };
9B6B1EEC1D1899850008B45D /* MultiplayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1EEB1D1899850008B45D /* MultiplayerController.m */; };
9B6B1EED1D1899850008B45D /* MultiplayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1EEB1D1899850008B45D /* MultiplayerController.m */; };
9B6B1EEE1D1899850008B45D /* MultiplayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6B1EEB1D1899850008B45D /* MultiplayerController.m */; };
......@@ -226,12 +226,12 @@
9B24307D1D1C849D00F5DFC1 /* NCMCDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NCMCDeviceInfo.m; path = Source/NCMultipeerConnectiviy/Core/NCMCDeviceInfo.m; sourceTree = "<group>"; };
9B28F0241D219148008B35B3 /* NCMCAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NCMCAlertView.h; path = Source/NCMCAlertView.h; sourceTree = "<group>"; };
9B28F0251D219148008B35B3 /* NCMCAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NCMCAlertView.m; path = Source/NCMCAlertView.m; sourceTree = "<group>"; };
9B2A235F1D2428E800C6EEC5 /* ChatRoomScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ChatRoomScene.h; path = Source/ChatRoomScene.h; sourceTree = "<group>"; };
9B2A23601D2428E800C6EEC5 /* ChatRoomScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ChatRoomScene.m; path = Source/ChatRoomScene.m; sourceTree = "<group>"; };
9B6B1ECF1D18944F0008B45D /* LoginScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LoginScene.h; path = Source/LoginScene.h; sourceTree = "<group>"; };
9B6B1ED01D18944F0008B45D /* LoginScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LoginScene.m; path = Source/LoginScene.m; sourceTree = "<group>"; };
9B6B1ED41D1895860008B45D /* SettingScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SettingScene.h; path = Source/SettingScene.h; sourceTree = "<group>"; };
9B6B1ED51D1895860008B45D /* SettingScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SettingScene.m; path = Source/SettingScene.m; sourceTree = "<group>"; };
9B6B1ED91D1895A50008B45D /* ConnectionScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConnectionScene.h; path = Source/ConnectionScene.h; sourceTree = "<group>"; };
9B6B1EDA1D1895A50008B45D /* ConnectionScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ConnectionScene.m; path = Source/ConnectionScene.m; sourceTree = "<group>"; };
9B6B1EE41D1898340008B45D /* Parameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Parameters.h; path = Source/Parameters.h; sourceTree = "<group>"; };
9B6B1EEA1D1899850008B45D /* MultiplayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MultiplayerController.h; path = Source/MultiplayerController.h; sourceTree = "<group>"; };
9B6B1EEB1D1899850008B45D /* MultiplayerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MultiplayerController.m; path = Source/MultiplayerController.m; sourceTree = "<group>"; };
......@@ -523,8 +523,8 @@
9B6B1ED51D1895860008B45D /* SettingScene.m */,
B7378992180767190076A88C /* LobbyScene.h */,
B7378993180767190076A88C /* LobbyScene.m */,
9B6B1ED91D1895A50008B45D /* ConnectionScene.h */,
9B6B1EDA1D1895A50008B45D /* ConnectionScene.m */,
9B2A235F1D2428E800C6EEC5 /* ChatRoomScene.h */,
9B2A23601D2428E800C6EEC5 /* ChatRoomScene.m */,
);
name = Scenes;
sourceTree = "<group>";
......@@ -925,12 +925,12 @@
7A4036E819DE3F33007B6E8F /* LobbyScene.m in Sources */,
7A40360419DDEE84007B6E8F /* main.m in Sources */,
9B1F83EE1D19E1E400837DA1 /* NCMCPeripheralInfo.m in Sources */,
9B6B1EDD1D1895A50008B45D /* ConnectionScene.m in Sources */,
9B6B1ED31D18944F0008B45D /* LoginScene.m in Sources */,
7A59498E19E3941300F65F90 /* AppDelegate.m in Sources */,
9B2430801D1C849D00F5DFC1 /* NCMCDeviceInfo.m in Sources */,
9B6B1ED81D1895860008B45D /* SettingScene.m in Sources */,
9B1F83CF1D19B5AF00837DA1 /* NCMCBluetoothLEManager.m in Sources */,
9B2A23631D2428E800C6EEC5 /* ChatRoomScene.m in Sources */,
9B1F83DE1D19CFCE00837DA1 /* NCMCMessageData.m in Sources */,
9B28F0281D219148008B35B3 /* NCMCAlertView.m in Sources */,
9B6B1EEE1D1899850008B45D /* MultiplayerController.m in Sources */,
......@@ -941,7 +941,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9B6B1EDC1D1895A50008B45D /* ConnectionScene.m in Sources */,
9B2A23621D2428E800C6EEC5 /* ChatRoomScene.m in Sources */,
9B6B1ED21D18944F0008B45D /* LoginScene.m in Sources */,
9B24307F1D1C849D00F5DFC1 /* NCMCDeviceInfo.m in Sources */,
9B1F83ED1D19E1E400837DA1 /* NCMCPeripheralInfo.m in Sources */,
......@@ -960,9 +960,9 @@
buildActionMask = 2147483647;
files = (
B73789871807631A0076A88C /* main.m in Sources */,
9B2A23611D2428E800C6EEC5 /* ChatRoomScene.m in Sources */,
9B1F83C71D19AEEF00837DA1 /* NCMCPeerID.m in Sources */,
7A046D8C19E8A20E004C4763 /* LobbyScene.m in Sources */,
9B6B1EDB1D1895A50008B45D /* ConnectionScene.m in Sources */,
9B6B1ED11D18944F0008B45D /* LoginScene.m in Sources */,
9B1F83C91D19AEEF00837DA1 /* NCMCSession.m in Sources */,
9B1F83CD1D19B5AF00837DA1 /* NCMCBluetoothLEManager.m in Sources */,
......
This diff is collapsed.
......@@ -192,7 +192,7 @@
<key>value</key>
<array>
<real>0.5</real>
<real>0.79374998807907104</real>
<real>0.73385411500930786</real>
<integer>0</integer>
<integer>2</integer>
<integer>2</integer>
......@@ -365,6 +365,8 @@
</array>
</dict>
</array>
<key>selected</key>
<true/>
<key>seqExpanded</key>
<true/>
</dict>
......@@ -1417,8 +1419,6 @@
</array>
</dict>
</array>
<key>selected</key>
<true/>
</dict>
<key>notes</key>
<array/>
......
//
// ConnectionScene.h
// ChatRoomScene.h
// NCMultipeerConnectivity
//
// Created by Chengzhao Li on 2016-06-20.
// Created by Chengzhao Li on 2016-06-29.
// Copyright © 2016 Apportable. All rights reserved.
//
#import "CCNode.h"
@interface ConnectionScene : CCNode
@interface ChatRoomScene : CCNode
@end
//
// ChatRoomScene.m
// NCMultipeerConnectivity
//
// Created by Chengzhao Li on 2016-06-29.
// Copyright © 2016 Apportable. All rights reserved.
//
#import "ChatRoomScene.h"
#import "MultiplayerController.h"
#import "Parameters.h"
@implementation ChatRoomScene
{
CCTextField* tfMsg;
CCButton* btnSendTo1;
CCButton* btnSendTo2;
CCButton* btnSendTo3;
CCLabelTTF* lbPlayer1;
CCLabelTTF* lbPlayer2;
CCLabelTTF* lbPlayer3;
CCLabelTTF* lbChat;
CCLabelTTF* lbPlayerLocal;
}
-(void)didLoadFromCCB
{
[self resetUI];
lbChat.string = @"";
}
-(void)onEnter
{
[super onEnter];
[self resetUI];
lbChat.string = @"";;
[self setPlayerList];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleReceivedMessageWithNotification:)
name:RECEIVED_MESSAGE_NOTIFICATION
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleUpdatePlayerlistWithNotification:)
name:UPDATE_PLAYERLIST_NOTIFICATION
object:nil];
}
-(void)onExit
{
[super onExit];
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
-(void)resetUI
{
lbPlayer1.color = [CCColor darkGrayColor];
lbPlayer1.string = @"--empty--";
btnSendTo1.enabled = NO;
lbPlayer2.color = [CCColor darkGrayColor];
lbPlayer2.string = @"--empty--";
btnSendTo2.enabled = NO;
lbPlayer3.color = [CCColor darkGrayColor];
lbPlayer3.string = @"--empty--";
btnSendTo3.enabled = NO;
}
-(void)setPlayerList
{
NSArray* playerData = [[MultiplayerController instance] currentSessionPlayerIDs];
int i = 0;
NSString* localName = [[MultiplayerController instance]localName];
for(NCMCPeerID* pd in playerData) {
if( i < 3 && ![localName isEqualToString:[pd getDisplayName]]) {
if (i == 0) {
lbPlayer1.string = [pd getDisplayName];
lbPlayer1.color = [CCColor whiteColor];
btnSendTo1.enabled = YES;
}
if (i == 1) {
lbPlayer2.string = [pd getDisplayName];
lbPlayer2.color = [CCColor whiteColor];
btnSendTo2.enabled = YES;
}
if (i == 2) {
lbPlayer3.string = [pd getDisplayName];
lbPlayer3.color = [CCColor whiteColor];
btnSendTo3.enabled = YES;
}
i++;
}
}
lbPlayerLocal.string = localName;
}
-(void)onMsgEntered:(id)sender
{
}
-(void)onBtnSendTo1
{
NSString* msg = tfMsg.string;
if (msg.length > 0) {
NSData* data = [msg dataUsingEncoding:NSUTF8StringEncoding];
[[MultiplayerController instance] sendData:data to:lbPlayer1.string];
}
}
-(void)onBtnSendTo2
{
NSString* msg = tfMsg.string;
if (msg.length > 0) {
NSData* data = [msg dataUsingEncoding:NSUTF8StringEncoding];
[[MultiplayerController instance] sendData:data to:lbPlayer2.string];
}
}
-(void)onBtnSendTo3
{
NSString* msg = tfMsg.string;
if (msg.length > 0) {
NSData* data = [msg dataUsingEncoding:NSUTF8StringEncoding];
[[MultiplayerController instance] sendData:data to:lbPlayer3.string];
}
}
- (void)handleReceivedMessageWithNotification:(NSNotification *)notification
{
NSData* msgData = [[notification userInfo] objectForKey:@"message"];
NSString* msg = [[NSString alloc]initWithData:msgData encoding:NSUTF8StringEncoding];
NSString* name = [[notification userInfo] objectForKey:@"name"];
NSString* status = [NSString stringWithFormat:@"\n%@ : %@", name, msg];
lbChat.string = [lbChat.string stringByAppendingString:status];
}
- (void)handleUpdatePlayerlistWithNotification:(NSNotification *)notification
{
[self resetUI];
[self setPlayerList];
}
@end
//
// ConnectionScene.m
// NCMultipeerConnectivity
//
// Created by Chengzhao Li on 2016-06-20.
// Copyright © 2016 Apportable. All rights reserved.
//
#import "ConnectionScene.h"
@implementation ConnectionScene
@end
......@@ -46,6 +46,7 @@
-(void)onStart
{
CCLOG(@"onBtnStartClicked");
[[MultiplayerController instance] gotoChatRoom];
}
-(void)disconnectAndBack
......
......@@ -23,7 +23,6 @@
+ (MultiplayerController *) instance;
// SETUP FUNCS
- (void) initializeControllerForNewMatch;
- (void) createServerHostedGame;
- (void) joinServerHostedGame;
......@@ -31,4 +30,7 @@
-(void) startHost;
-(void) startClient;
-(void)sendData:(NSData*)data to:(NSString*)name;
-(void)gotoChatRoom;
@end
......@@ -10,6 +10,7 @@
#import "NCMCPeerID.h"
#import "NCMCAlertView.h"
#import "Parameters.h"
#import "LobbyScene.h"
@implementation MultiplayerController
......@@ -100,10 +101,104 @@ static MultiplayerController *_sharedMultiplayerController = nil;
}
}
// session delegate
-(void)sendData:(NSData *)msgData to:(NSString *)name
{
NCMCPeerID *peer = [self getPeerIDByName:name];
if (peer != nil) {
CCLOG(@"MultiplayerController send data to %@", name);
NSData *data = [self packMessageWithType:MSG_CHAT_MSG andMessage:msgData];
NSArray *targets = @[peer];
[self.currentSession sendData:data toPeers:targets];
}
}
-(NCMCPeerID*)getPeerIDByName:(NSString*)name
{
for (NCMCPeerID *pid in self.currentSessionPlayerIDs) {
if ([[pid getDisplayName] isEqualToString:name]) {
return pid;
}
}
return nil;
}
-(void)gotoChatRoom
{
if (self.currentPeripheralService != nil) {
[self.currentPeripheralService stopAdvertisingPeer];
self.currentPeripheralService.delegate = nil;
self.currentPeripheralService = nil;
}
if (self.currentCentralService != nil) {
[self.currentCentralService stopBrowsingForPeers];
self.currentCentralService.delegate = nil;
self.currentCentralService = nil;
}
if (isHost) {
NSData *data = [self packMessageWithType:MSG_SERVER_CLIENT_GO_TO_CHAT andMessage:nil];
[self.currentSession sendData:data toPeers:self.currentSessionPlayerIDs];
}
CCScene *chatScene = [CCBReader loadAsScene:@"ChatRoomScene"];
[[CCDirector sharedDirector] replaceScene:chatScene];
}
-(NSData*)packMessageWithType:(char)msgType andMessage:(NSData*)msg{
char* target = msgBuffer;
msgBuffer[0] = msgType;
target++;
if(msg == nil) {
// this message has no content
return [NSData dataWithBytesNoCopy:msgBuffer length:1 freeWhenDone:NO];
}
NSUInteger len = [msg length];
memcpy(target, [msg bytes], len);
return [NSData dataWithBytesNoCopy:msgBuffer length:len+1 freeWhenDone:NO];
}
- (void)processMessage:(NSData*)data fromPeer:(NCMCPeerID*)peer
{
char* msgPointer = (char*)[data bytes];
int msgLength = [data length];
int msgType = (int)msgPointer[0];
msgPointer++;
NSData* msgData;
msgData = [NSData dataWithBytes:msgPointer length:msgLength-1];
switch (msgType) {
case MSG_SERVER_CLIENT_GO_TO_CHAT:
{
[self gotoChatRoom];
break;
}
case MSG_CHAT_MSG:
{
NSDictionary *userInfo = @{ @"name": [peer getDisplayName],
@"message": msgData};
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:RECEIVED_MESSAGE_NOTIFICATION
object:nil
userInfo:userInfo];
});
break;
}
}
}
/***********************************************************************/
/* DELEGATE FUNCTIONS */
/***********************************************************************/
-(void)session:(NCMCSession *)session peer:(NCMCPeerID *)peerID didChangeState:(NCMCSessionState)state
{
CCLOG(@"MCSession session peer didChangeState : %@, state : %d", [peerID getDisplayName], state);
CCLOG(@"MCSession session peer didChangeState : %@, state : %ld", [peerID getDisplayName], (long)state);
dispatch_async(dispatch_get_main_queue(), ^{
switch (state) {
......@@ -131,6 +226,11 @@ static MultiplayerController *_sharedMultiplayerController = nil;
for (NCMCPeerID *pid in self.currentSessionPlayerIDs) {
if ([[pid getDisplayName] isEqualToString:[peerID getDisplayName]]) {
[self.currentSessionPlayerIDs removeObject:pid];
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:UPDATE_PLAYERLIST_NOTIFICATION
object:nil
userInfo:nil];
});
break;
}
}
......@@ -143,7 +243,7 @@ static MultiplayerController *_sharedMultiplayerController = nil;
-(void)session:(NCMCSession *)session didReceiveData:(NSData *)data fromPeer:(NCMCPeerID *)peerID
{
[self processMessage:data fromPeer:peerID];
}
-(void)centralService:(NCMCCentralService *)centralService foundPeer:(NCMCPeerID *)peerID
......
......@@ -658,7 +658,7 @@ static NCMCBluetoothLEManager *_sharedNCMCBluetoothLEManager = nil;
if (centralDevice != nil) {
NSArray* targets = @[centralDevice];
[self.peripheralManager updateValue:[data data] forCharacteristic:self.sendCharacteristic onSubscribedCentrals:targets];
didSent = [self.peripheralManager updateValue:[data data] forCharacteristic:self.sendCharacteristic onSubscribedCentrals:targets];
if (!didSent) {
CCLOG(@"message didn't send, break.");
......
......@@ -18,9 +18,10 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithSession:(NCMCSession*)ncmcsession NS_DESIGNATED_INITIALIZER;
- (Boolean)startBrowsingForPeers;
- (Boolean)startBrowsingForPeers; // before call this function, should check isDeviceReady, otherwise this function would return NO
- (void)stopBrowsingForPeers;
- (void)invitePeer:(NCMCPeerID *)peerID;
- (Boolean)isDeviceReady;
@property (weak, NS_NONATOMIC_IOSONLY, nullable) id<NCMCCentralServiceDelegate> delegate;
......
......@@ -26,6 +26,11 @@
return self;
}
-(Boolean)isDeviceReady
{
return [[NCMCBluetoothLEManager instance]isDeviceReady];
}
-(Boolean)startBrowsingForPeers
{
return [[NCMCBluetoothLEManager instance]startBrowsing];
......
......@@ -18,9 +18,12 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithSession:(NCMCSession*)session NS_DESIGNATED_INITIALIZER;
- (Boolean)startAdvertisingPeer;
- (Boolean)startAdvertisingPeer;// before call this function, should check isDeviceReady, otherwise this function would return NO
- (void)stopAdvertisingPeer;
- (Boolean)isDeviceReady;
@property (weak, NS_NONATOMIC_IOSONLY, nullable) id<NCMCPeripheralServiceDelegate> delegate;
@end
......
......@@ -26,6 +26,11 @@
return self;
}
-(Boolean)isDeviceReady
{
return [[NCMCBluetoothLEManager instance]isDeviceReady];
}
-(Boolean)startAdvertisingPeer
{
return [[NCMCBluetoothLEManager instance]startAdvertising];
......
......@@ -276,7 +276,7 @@ void(^myInvitationHandler)(BOOL, NCMCSession*, NCMCPeerID*) = ^(BOOL accept, NCM
char* dataPointer = (char*)[data bytes];
NSUInteger dataLength = [data length];
BOOL isSysMsg = (BOOL)dataPointer[0];
char extraInfo = (char)dataPointer[1];
char extraInfo = (char)dataPointer[1]; // sys : sysmsg type; user : target
dataPointer++;
dataPointer++;
......
......@@ -9,6 +9,11 @@
#ifndef Parameters_h
#define Parameters_h
typedef enum ChatAppMessageType {
MSG_SERVER_CLIENT_GO_TO_CHAT = 0,
MSG_CHAT_MSG = 1,
} ChatAppMessageType;
#define TRANSFER_SERVICE_UUID @"ABE00C6E-58F1-44B2-BE41-20E66874B97D"
#define TRANSFER_CHARACTERISTIC_MSG_FROM_PERIPHERAL_UUID @"446EF5DD-3E31-40DA-897F-22C31065C861"
#define TRANSFER_CHARACTERISTIC_MSG_FROM_CENTRAL_UUID @"88376596-5F9F-4923-A30C-D17044687B53"
......@@ -25,5 +30,10 @@ typedef int64_t HEADER_TYPE;
#define SCREEN_HEIGHT ([CCDirector sharedDirector].viewSize.height)
#define SCREEN_WIDTH ([CCDirector sharedDirector].viewSize.width)
#define MSG_BUFFER_SIZE 3000
static char msgBuffer[MSG_BUFFER_SIZE];
#define RECEIVED_MESSAGE_NOTIFICATION @"NoodlecakeNCMC_DidReceiveMessageNotification"
#define UPDATE_PLAYERLIST_NOTIFICATION @"NoodlecakeNCMC_DidUpdatePlayerlistNotification"
#endif /* Parameters_h */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment