├── Service Side
├── .DS_Store
├── Service Side
│ ├── .DS_Store
│ ├── Service Side.entitlements
│ ├── Service_Side.entitlements
│ ├── ViewController.h
│ ├── main.m
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Info.plist
│ ├── ViewController.m
│ └── Base.lproj
│ │ └── Main.storyboard
└── Service Side.xcodeproj
│ ├── xcuserdata
│ └── minecode.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
│ ├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── minecode.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
│ └── project.pbxproj
├── Client Side
├── Client Side
│ ├── Client Side.entitlements
│ ├── Client_Side.entitlements
│ ├── ViewController.h
│ ├── main.m
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Info.plist
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ └── ViewController.m
└── Client Side.xcodeproj
│ ├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── minecode.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
│ ├── xcuserdata
│ └── minecode.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
│ └── project.pbxproj
├── README.md
└── LICENSE
/Service Side/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JaylenCoding/TCP-IP-Model-Simulation/HEAD/Service Side/.DS_Store
--------------------------------------------------------------------------------
/Service Side/Service Side/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JaylenCoding/TCP-IP-Model-Simulation/HEAD/Service Side/Service Side/.DS_Store
--------------------------------------------------------------------------------
/Service Side/Service Side.xcodeproj/xcuserdata/minecode.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/Client Side/Client Side/Client Side.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Client Side/Client Side/Client_Side.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Service Side/Service Side/Service Side.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Service Side/Service Side/Service_Side.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Client Side/Client Side.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Service Side/Service Side.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Client Side/Client Side.xcodeproj/project.xcworkspace/xcuserdata/minecode.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JaylenCoding/TCP-IP-Model-Simulation/HEAD/Client Side/Client Side.xcodeproj/project.xcworkspace/xcuserdata/minecode.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/Service Side/Service Side.xcodeproj/project.xcworkspace/xcuserdata/minecode.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JaylenCoding/TCP-IP-Model-Simulation/HEAD/Service Side/Service Side.xcodeproj/project.xcworkspace/xcuserdata/minecode.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/Client Side/Client Side/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // Client Side
4 | //
5 | // Created by Minecode on 2017/12/6.
6 | // Copyright © 2017年 Minecode. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : NSViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/Client Side/Client Side/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // Client Side
4 | //
5 | // Created by Minecode on 2017/12/6.
6 | // Copyright © 2017年 Minecode. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | int main(int argc, const char * argv[]) {
12 | return NSApplicationMain(argc, argv);
13 | }
14 |
--------------------------------------------------------------------------------
/Service Side/Service Side/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // Service Side
4 | //
5 | // Created by Minecode on 2017/12/6.
6 | // Copyright © 2017年 Minecode. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : NSViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/Service Side/Service Side/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // Service Side
4 | //
5 | // Created by Minecode on 2017/12/6.
6 | // Copyright © 2017年 Minecode. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | int main(int argc, const char * argv[]) {
12 | return NSApplicationMain(argc, argv);
13 | }
14 |
--------------------------------------------------------------------------------
/Client Side/Client Side/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // Client Side
4 | //
5 | // Created by Minecode on 2017/12/6.
6 | // Copyright © 2017年 Minecode. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : NSObject
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/Service Side/Service Side/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // Service Side
4 | //
5 | // Created by Minecode on 2017/12/6.
6 | // Copyright © 2017年 Minecode. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : NSObject
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/Client Side/Client Side.xcodeproj/xcuserdata/minecode.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Client Side.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Service Side/Service Side.xcodeproj/xcuserdata/minecode.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Service Side.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Client Side/Client Side/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // Client Side
4 | //
5 | // Created by Minecode on 2017/12/6.
6 | // Copyright © 2017年 Minecode. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
18 | // Insert code here to initialize your application
19 | }
20 |
21 |
22 | - (void)applicationWillTerminate:(NSNotification *)aNotification {
23 | // Insert code here to tear down your application
24 | }
25 |
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Service Side/Service Side/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // Service Side
4 | //
5 | // Created by Minecode on 2017/12/6.
6 | // Copyright © 2017年 Minecode. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
18 | // Insert code here to initialize your application
19 | }
20 |
21 |
22 | - (void)applicationWillTerminate:(NSNotification *)aNotification {
23 | // Insert code here to tear down your application
24 | }
25 |
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # TCP/IP Five-Level Model Simulation
2 | ---
3 | This is a teaching tool for five layer model show that using a connection-oriented Socket, it can communicate with each other between two devices, or use the Server Side to bind the port then communicate with each other in the same computer.
4 |
5 | | Language | Objective-C + C|
6 | | --- | --- |
7 | | Platform | Mac OSX |
8 | | Tool | XCode (LLVM) |
9 |
10 |
11 | ## Showcase
12 |
13 | 
14 |
15 | ## How to use
16 | The source code and project is in "Client Side" & "Service Side", just open it and complie in XCode :)
17 |
18 | ## Tutorial (In Chinese)
19 | [Minecode's Blog](http://minecode.link/2017/12/09/TCP%E4%BA%94%E5%B1%82%E6%A8%A1%E5%9E%8B%E6%B6%88%E6%81%AF%E8%A7%A3-%E5%B0%81%E8%A3%85%E4%BB%BF%E7%9C%9F)
20 |
21 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 JunLin Bian
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Client Side/Client Side/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | Copyright © 2017年 Minecode. All rights reserved.
27 | NSMainStoryboardFile
28 | Main
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Client Side/Client Side/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "mac",
5 | "size" : "16x16",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "mac",
10 | "size" : "16x16",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "mac",
15 | "size" : "32x32",
16 | "scale" : "1x"
17 | },
18 | {
19 | "idiom" : "mac",
20 | "size" : "32x32",
21 | "scale" : "2x"
22 | },
23 | {
24 | "idiom" : "mac",
25 | "size" : "128x128",
26 | "scale" : "1x"
27 | },
28 | {
29 | "idiom" : "mac",
30 | "size" : "128x128",
31 | "scale" : "2x"
32 | },
33 | {
34 | "idiom" : "mac",
35 | "size" : "256x256",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "mac",
40 | "size" : "256x256",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "mac",
45 | "size" : "512x512",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "mac",
50 | "size" : "512x512",
51 | "scale" : "2x"
52 | }
53 | ],
54 | "info" : {
55 | "version" : 1,
56 | "author" : "xcode"
57 | }
58 | }
--------------------------------------------------------------------------------
/Service Side/Service Side/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "mac",
5 | "size" : "16x16",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "mac",
10 | "size" : "16x16",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "mac",
15 | "size" : "32x32",
16 | "scale" : "1x"
17 | },
18 | {
19 | "idiom" : "mac",
20 | "size" : "32x32",
21 | "scale" : "2x"
22 | },
23 | {
24 | "idiom" : "mac",
25 | "size" : "128x128",
26 | "scale" : "1x"
27 | },
28 | {
29 | "idiom" : "mac",
30 | "size" : "128x128",
31 | "scale" : "2x"
32 | },
33 | {
34 | "idiom" : "mac",
35 | "size" : "256x256",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "mac",
40 | "size" : "256x256",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "mac",
45 | "size" : "512x512",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "mac",
50 | "size" : "512x512",
51 | "scale" : "2x"
52 | }
53 | ],
54 | "info" : {
55 | "version" : 1,
56 | "author" : "xcode"
57 | }
58 | }
--------------------------------------------------------------------------------
/Service Side/Service Side/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSAppTransportSecurity
26 |
27 | NSAllowsArbitraryLoads
28 |
29 |
30 | NSHumanReadableCopyright
31 | Copyright © 2017年 Minecode. All rights reserved.
32 | NSMainStoryboardFile
33 | Main
34 | NSPrincipalClass
35 | NSApplication
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Service Side/Service Side/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // Service Side
4 | //
5 | // Created by Minecode on 2017/12/6.
6 | // Copyright © 2017年 Minecode. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | #import
12 | #import
13 | #import
14 | #import
15 | #import
16 | #import
17 | #import
18 | #import
19 | #import
20 |
21 | #define RECV_BUFFER_SIZE 1024
22 | #define REPLY_BUFFER_SIZE 1024
23 |
24 |
25 | @interface ViewController ()
26 |
27 | // 分割线
28 | @property (weak) IBOutlet NSView *separatorLine1;
29 | @property (weak) IBOutlet NSView *separatorLine2;
30 | @property (weak) IBOutlet NSView *separatorLine3;
31 | // 输入框
32 | @property (weak) IBOutlet NSTextField *portField;
33 | @property (weak) IBOutlet NSTextField *msgField;
34 | @property (weak) IBOutlet NSTextField *appLayer;
35 | @property (weak) IBOutlet NSTextField *transLayer;
36 | @property (weak) IBOutlet NSTextField *networkLayer;
37 | @property (weak) IBOutlet NSTextField *dlinkLayer;
38 | @property (weak) IBOutlet NSTextField *phyLayer;
39 | // 按钮
40 | @property (weak) IBOutlet NSButton *bindButton;
41 | // 标签
42 | @property (weak) IBOutlet NSTextField *msgLabel;
43 |
44 |
45 | @end
46 |
47 | @implementation ViewController
48 |
49 | - (void)viewDidLoad {
50 | [super viewDidLoad];
51 |
52 | [self setupSeparatorLine];
53 | [self setupEnabled];
54 | }
55 |
56 |
57 | - (void)setRepresentedObject:(id)representedObject {
58 | [super setRepresentedObject:representedObject];
59 |
60 | // Update the view, if already loaded.
61 | }
62 |
63 | #pragma mark - 初始化方法
64 | - (void)setupSeparatorLine {
65 | [self.separatorLine1 setWantsLayer:YES];
66 | [self.separatorLine1.layer setBackgroundColor:[[NSColor lightGrayColor] CGColor]];
67 | [self.separatorLine2 setWantsLayer:YES];
68 | [self.separatorLine2.layer setBackgroundColor:[[NSColor lightGrayColor] CGColor]];
69 | [self.separatorLine3 setWantsLayer:YES];
70 | [self.separatorLine3.layer setBackgroundColor:[[NSColor lightGrayColor] CGColor]];
71 | }
72 |
73 | // 设置控件开关
74 | - (void)setupEnabled {
75 | self.msgField.editable = NO;
76 | }
77 |
78 | #pragma mark - 私有API
79 | - (IBAction)bindButtonClicked:(id)sender {
80 | NSString *portStr = [self.portField stringValue];
81 | // 开启子线程,创建服务端
82 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
83 | [self bindSocketWithPort:[portStr integerValue]];
84 | });
85 | }
86 |
87 | - (void)clearCurrentMsg {
88 | dispatch_async(dispatch_get_main_queue(), ^{
89 | self.appLayer.stringValue = @"";
90 | self.transLayer.stringValue = @"";
91 | self.networkLayer.stringValue = @"";
92 | self.dlinkLayer.stringValue = @"";
93 | self.phyLayer.stringValue = @"";
94 | });
95 | }
96 |
97 | - (void)bindSocketWithPort:(NSInteger)port {
98 | // 创建Socket地址
99 | struct sockaddr_in server_addr; // socket地址
100 | server_addr.sin_len = sizeof(struct sockaddr_in); // 设置地址结构体大小
101 | server_addr.sin_family = AF_INET; // AF_INET地址簇
102 | server_addr.sin_port = htons((short)port); // 设置端口
103 | server_addr.sin_addr.s_addr = htonl(INADDR_ANY); // 服务器地址
104 |
105 | // 创建Socket
106 | int server_socket = socket(AF_INET, SOCK_STREAM, 0); // 创建Socket
107 | if (server_socket == -1) {
108 | [self showMessageWithMsg:@"创建Socket失败"];
109 | return;
110 | }
111 | else {
112 | [self showMessageWithMsg:@"创建Socket成功"];
113 | [NSThread sleepForTimeInterval:0.3];
114 | }
115 |
116 | int reuse = 1;
117 | int sockOpt = setsockopt(server_socket, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));
118 | if (sockOpt == -1) {
119 | [self showMessageWithMsg:@"重设Socket失败"];
120 | return;
121 | }
122 |
123 | // 绑定Socket
124 | // 将创建的Socket绑定到本地IP和端口,用于侦听客户端请求
125 | int bind_result = bind(server_socket, (struct sockaddr *)&server_addr, sizeof(server_addr));
126 | if (bind_result == -1) {
127 | [self showMessageWithMsg:@"绑定Socket失败"];
128 | return;
129 | }
130 | else {
131 | [self showMessageWithMsg:@"绑定Socket成功"];
132 | [NSThread sleepForTimeInterval:0.3];
133 | }
134 |
135 | // 侦听客户端消息
136 | if (listen(server_socket, 5) == -1) {
137 | [self showMessageWithMsg:@"开启侦听失败"];
138 | return;
139 | }
140 | else {
141 | [self showMessageWithMsg:@"开启侦听成功"];
142 | [NSThread sleepForTimeInterval:0.3];
143 | [self showMessageWithMsg:@"搜索客户端中..."];
144 | }
145 |
146 | // 获取客户端端口信息
147 | struct sockaddr_in client_address;
148 | socklen_t address_len;
149 | int client_socket = accept(server_socket, (struct sockaddr *)&client_address, &address_len);
150 | if (client_socket == -1) {
151 | [self showMessageWithMsg:@"客户端握手失败"];
152 | return;
153 | }
154 | else {
155 | [self showMessageWithMsg:@"客户端握手成功"];
156 | [NSThread sleepForTimeInterval:0.3];
157 | }
158 |
159 | [self showMessageWithMsg:@"侦听客户端消息中..."];
160 |
161 | char recv_msg[RECV_BUFFER_SIZE];
162 | char reply_msg[REPLY_BUFFER_SIZE];
163 | // 子线程开启循环持续检测客户端消息,避免阻塞主线程
164 | // 收到消息后,于主线程回调更新UI
165 | while (YES) {
166 | bzero(recv_msg, RECV_BUFFER_SIZE);
167 | bzero(reply_msg, REPLY_BUFFER_SIZE);
168 |
169 | // 设置服务器回复数据
170 | // 也可由用户自行输入,添加文本框即可
171 |
172 | long byteLen = recv(client_socket, recv_msg, RECV_BUFFER_SIZE, 0);
173 | recv_msg[byteLen] = '\0'; // 添加消息结尾
174 | NSMutableString *msgStr = [NSMutableString stringWithFormat:@"%s", recv_msg];
175 | [self clearCurrentMsg];
176 | strcpy(recv_msg, [[self reciveFromClient:msgStr] UTF8String]);
177 |
178 | if (strcmp(recv_msg, "") != 0) {
179 | strcpy(reply_msg, "服务端消息:收到");
180 | strcat(reply_msg, recv_msg);
181 | send(client_socket, reply_msg, REPLY_BUFFER_SIZE, 0);
182 | }
183 | }
184 | }
185 |
186 | - (void)showMessageWithMsg:(NSString *)msg {
187 | dispatch_async(dispatch_get_main_queue(), ^{
188 | [self.msgLabel setStringValue:[msg copy]];
189 | });
190 | }
191 |
192 | - (NSMutableString *)reciveFromClient:(NSMutableString *)msg {
193 | NSMutableString *resStr = [self phyProcessWithString:[msg copy]];
194 |
195 | dispatch_async(dispatch_get_main_queue(), ^{
196 | [self.msgField setStringValue:resStr];
197 | });
198 |
199 | return [resStr copy];
200 | }
201 |
202 | #pragma mark - 五层模型解包
203 | - (NSMutableString *)phyProcessWithString:(NSMutableString *)str {
204 | dispatch_async(dispatch_get_main_queue(), ^{
205 | self.phyLayer.stringValue = [str copy];
206 | });
207 |
208 | [NSThread sleepForTimeInterval:0.3];
209 |
210 | return [self dlinkLayerWithstring: [str substringFromIndex:14]];
211 | }
212 |
213 | - (NSMutableString *)dlinkLayerWithstring:(NSMutableString *)str {
214 | dispatch_async(dispatch_get_main_queue(), ^{
215 | self.dlinkLayer.stringValue = [str copy];
216 | });
217 |
218 | [NSThread sleepForTimeInterval:0.3];
219 |
220 | NSMutableString *noPrefixString = [str substringFromIndex:25];
221 | NSMutableString *resStr = [noPrefixString substringWithRange:NSMakeRange(0, noPrefixString.length-17)];
222 | return [self networkLayerWithstring:resStr];
223 | }
224 |
225 | - (NSMutableString *)networkLayerWithstring:(NSMutableString *)str {
226 | dispatch_async(dispatch_get_main_queue(), ^{
227 | self.networkLayer.stringValue = [str copy];
228 | });
229 |
230 | [NSThread sleepForTimeInterval:0.3];
231 |
232 | return [self transLayerWithstring:[str substringFromIndex:161]];
233 | }
234 |
235 | - (NSMutableString *)transLayerWithstring:(NSMutableString *)str {
236 | dispatch_async(dispatch_get_main_queue(), ^{
237 | self.transLayer.stringValue = [str copy];
238 | });
239 |
240 | [NSThread sleepForTimeInterval:0.3];
241 |
242 | return [self appLayerWithstring:[str substringFromIndex:177]];
243 | }
244 |
245 | - (NSMutableString *)appLayerWithstring:(NSMutableString *)str {
246 | dispatch_async(dispatch_get_main_queue(), ^{
247 | self.appLayer.stringValue = [str copy];
248 | });
249 |
250 | [NSThread sleepForTimeInterval:0.3];
251 |
252 | return [str substringFromIndex:10];
253 | }
254 |
255 | @end
256 |
--------------------------------------------------------------------------------
/Client Side/Client Side/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // Client Side
4 | //
5 | // Created by Minecode on 2017/12/6.
6 | // Copyright © 2017年 Minecode. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | #import
12 | #import
13 | #import
14 | #import
15 | #import
16 | #import
17 | #import
18 | #import
19 | #import
20 |
21 | #define RECV_BUFFER_SIZE 1024
22 | #define REPLY_BUFFER_SIZE 1024
23 |
24 | @interface ViewController ()
25 |
26 | // 分割线
27 | @property (weak) IBOutlet NSView *separatorLine1;
28 | @property (weak) IBOutlet NSView *separatorLine2;
29 | @property (weak) IBOutlet NSView *separatorLine3;
30 | // 输入框
31 | @property (weak) IBOutlet NSTextField *ipField;
32 | @property (weak) IBOutlet NSTextField *portField;
33 | @property (weak) IBOutlet NSTextField *msgField;
34 | @property (weak) IBOutlet NSTextField *replyField;
35 | @property (weak) IBOutlet NSTextField *appLayer;
36 | @property (weak) IBOutlet NSTextField *transLayer;
37 | @property (weak) IBOutlet NSTextField *networkLayer;
38 | @property (weak) IBOutlet NSTextField *dlinkLayer;
39 | @property (weak) IBOutlet NSTextField *phyLayer;
40 | // 按钮
41 | @property (weak) IBOutlet NSButton *connectButton;
42 | @property (weak) IBOutlet NSButton *sendButton;
43 | // 标签
44 | @property (weak) IBOutlet NSTextField *msgLabel;
45 | // 连接属性
46 | @property (nonatomic, assign) int server_socket;
47 | @property (nonatomic, assign) short port_num;
48 |
49 | @end
50 |
51 |
52 | @implementation ViewController
53 |
54 | - (void)viewDidLoad {
55 | [super viewDidLoad];
56 |
57 | [self setupSeparatorLine];
58 | [self setupEnabled];
59 | }
60 |
61 |
62 | - (void)setRepresentedObject:(id)representedObject {
63 | [super setRepresentedObject:representedObject];
64 |
65 | // Update the view, if already loaded.
66 | }
67 |
68 | #pragma mark - 初始化方法
69 | - (void)setupSeparatorLine {
70 | [self.separatorLine1 setWantsLayer:YES];
71 | [self.separatorLine1.layer setBackgroundColor:[[NSColor lightGrayColor] CGColor]];
72 | [self.separatorLine2 setWantsLayer:YES];
73 | [self.separatorLine2.layer setBackgroundColor:[[NSColor lightGrayColor] CGColor]];
74 | [self.separatorLine3 setWantsLayer:YES];
75 | [self.separatorLine3.layer setBackgroundColor:[[NSColor lightGrayColor] CGColor]];
76 | }
77 |
78 | // 设置控件开关
79 | - (void)setupEnabled {
80 | self.msgField.editable = NO;
81 | self.msgField.selectable = NO;
82 | self.msgField.placeholderString = @"请先连接主机";
83 |
84 | self.replyField.editable = NO;
85 |
86 | self.sendButton.enabled = NO;
87 | }
88 |
89 | - (void)didConnected {
90 | dispatch_async(dispatch_get_main_queue(), ^{
91 | self.msgField.editable = YES;
92 | self.msgField.selectable = YES;
93 | self.msgField.stringValue = @"";
94 |
95 | self.sendButton.enabled = YES;
96 | });
97 | }
98 |
99 | #pragma mark - 私有API
100 |
101 | - (IBAction)connectButtonClicked:(id)sender {
102 | NSString *portStr = [self.portField stringValue];
103 | // 开启子线程,连接服务端
104 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
105 | [self bindSocketWithIP:[self.ipField.stringValue copy] andPort:[portStr integerValue]];
106 | });
107 | }
108 |
109 | - (IBAction)sendButtonClicked:(id)sender {
110 | // 开启子线程,发送并接收消息
111 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
112 | [self sendMsgAction];
113 | });
114 | }
115 |
116 | - (void)clearCurrentMsg {
117 | dispatch_async(dispatch_get_main_queue(), ^{
118 | self.appLayer.stringValue = @"";
119 | self.transLayer.stringValue = @"";
120 | self.networkLayer.stringValue = @"";
121 | self.dlinkLayer.stringValue = @"";
122 | self.phyLayer.stringValue = @"";
123 | });
124 | }
125 |
126 | - (NSString *)intToBinary:(int)intValue{
127 | int byteBlock = 8; // 8 bits per byte
128 | int totalBits = (sizeof(int)) * byteBlock; // Total bits
129 | int binaryDigit = totalBits; // Which digit are we processing // C array - storage plus one for null
130 | char ndigit[totalBits + 1];
131 | while (binaryDigit-- > 0) {
132 | // Set digit in array based on rightmost bit
133 | ndigit[binaryDigit] = (intValue & 1) ? '1' : '0';
134 | // Shift incoming value one to right
135 | intValue >>= 1;
136 | } // Append null
137 | ndigit[totalBits] = 0;
138 | // Return the binary string
139 | return [NSString stringWithUTF8String:ndigit];
140 | }
141 |
142 | - (void)sendMsgAction {
143 | NSMutableString *msg = [NSMutableString stringWithFormat:@"%@",self.msgField.stringValue];
144 |
145 | char recv_msg[RECV_BUFFER_SIZE];
146 | char send_msg[REPLY_BUFFER_SIZE];
147 | // 发送消息,并接收服务器回信
148 | // 收到消息后,于主线程回调更新UI
149 | bzero(recv_msg, RECV_BUFFER_SIZE);
150 | bzero(send_msg, REPLY_BUFFER_SIZE);
151 |
152 | // 清除现有消息
153 | [self clearCurrentMsg];
154 |
155 | // 向服务端通过socket发消息
156 | NSMutableString *resStr = [self appLayerWithString:msg];
157 | strcpy(send_msg, resStr.UTF8String);
158 | long send_result = send(self.server_socket, send_msg, REPLY_BUFFER_SIZE, 0);
159 | if (send_result == -1) {
160 | [self showMessageWithMsg:@"消息发送失败"];
161 | return;
162 | }
163 | else {
164 | [self showMessageWithMsg:@"消息发送成功"];
165 | [NSThread sleepForTimeInterval:0.3];
166 | }
167 |
168 | // 接收服务端消息
169 | long recv_result = recv(self.server_socket, recv_msg, RECV_BUFFER_SIZE, 0);
170 | [self reciveFromServer:[NSString stringWithUTF8String:recv_msg]];
171 |
172 | }
173 |
174 | - (void)bindSocketWithIP:(NSString *)ipStr andPort:(NSInteger)port {
175 |
176 | // 创建Socket地址
177 | struct sockaddr_in server_addr; // 创建Socket地址
178 | server_addr.sin_len = sizeof(struct sockaddr_in); // 设置结构体长度
179 | server_addr.sin_family = AF_INET; // AF_INET地址簇
180 | server_addr.sin_port = htons((short)port); // 设置端口
181 | server_addr.sin_addr.s_addr = htonl(INADDR_ANY); // 服务器地址
182 |
183 | // 创建Socket
184 | int server_socket = socket(AF_INET, SOCK_STREAM, 0);
185 | if (server_socket == -1) {
186 | [self showMessageWithMsg:@"创建Socket失败"];
187 | return;
188 | }
189 | else {
190 | // 保存Socket
191 | self.server_socket = server_socket;
192 | // 保存port
193 | self.port_num = (short)port;
194 | [self showMessageWithMsg:@"创建Socket成功"];
195 | [NSThread sleepForTimeInterval:0.3];
196 | }
197 |
198 | int connect_result = connect(server_socket, (struct sockaddr *)&server_addr, sizeof(struct sockaddr_in));
199 | if (connect_result == -1) {
200 | [self showMessageWithMsg:@"连接主机失败"];
201 | return;
202 | }
203 | else {
204 | [self showMessageWithMsg:@"连接主机成功,等待发送消息..."];
205 | [NSThread sleepForTimeInterval:0.3];
206 | }
207 |
208 | // 连接成功后的操作
209 | [self didConnected];
210 | }
211 |
212 | - (void)showMessageWithMsg:(NSString *)msg {
213 | dispatch_async(dispatch_get_main_queue(), ^{
214 | [self.msgLabel setStringValue:[msg copy]];
215 | });
216 | }
217 |
218 | - (void)reciveFromServer:(NSString *)msg {
219 | dispatch_async(dispatch_get_main_queue(), ^{
220 | self.replyField.stringValue = [msg copy];
221 | });
222 | }
223 |
224 | #pragma mark - 五层传输协议
225 | // 模拟网络层对数据的包装
226 | - (NSMutableString *)appLayerWithString:(NSMutableString *)str {
227 | NSMutableString *resStr = [NSMutableString stringWithFormat:@"AppHeader#%@", str];
228 |
229 | dispatch_async(dispatch_get_main_queue(), ^{
230 | self.appLayer.stringValue = [resStr copy];
231 | });
232 |
233 | [NSThread sleepForTimeInterval:0.3];
234 |
235 | return [self transferLayerWithString:resStr];
236 | }
237 |
238 | // 模拟传输层对数据的包装
239 | - (NSMutableString *)transferLayerWithString:(NSMutableString *)str {
240 | NSMutableString *resStr = [NSMutableString string];
241 | // 添加源端口 16位(0-15)
242 | [resStr appendFormat:@"0000000011111111"];
243 | // 添加目的端口 16位(16-31)
244 | [resStr appendFormat:@"%@", [self intToBinary:self.port_num]];
245 | // 添加序列编号 32位
246 | [resStr appendFormat:@"00000000000000000000000000001011"];
247 | // 添加确认帧 32位
248 | [resStr appendFormat:@"00000000000000000000000011111011"];
249 | // 添加报头长度
250 | [resStr appendFormat:@"0101"];
251 | // 添加保留长度
252 | [resStr appendFormat:@"000000"];
253 | // 添加FLag
254 | [resStr appendFormat:@"000000"];
255 | // 添加窗口大小
256 | [resStr appendFormat:@"0000000000000111"];
257 | // 添加确认值
258 | [resStr appendFormat:@"0101010101010010"];
259 | // 添加UrgentPointer
260 | [resStr appendFormat:@"0000000000001111"];
261 | // 添加Header结尾
262 | [resStr appendFormat:@"#%@", str];
263 |
264 | dispatch_async(dispatch_get_main_queue(), ^{
265 | self.transLayer.stringValue = [resStr copy];
266 | });
267 |
268 | [NSThread sleepForTimeInterval:0.3];
269 |
270 | return [self networkLayerWith:resStr];
271 | }
272 |
273 | // 模拟网络层对数据的包装
274 | - (NSMutableString *)networkLayerWith:(NSMutableString *)str {
275 | NSMutableString *resStr = [NSMutableString string];
276 |
277 | // 添加VER
278 | [resStr appendFormat:@"0100"];
279 | // 添加HLEN
280 | [resStr appendFormat:@"1111"];
281 | // 添加Service
282 | [resStr appendFormat:@"00000000"];
283 | // 添加totalLength
284 | [resStr appendFormat:@"0101010101010101"];
285 | // 添加Identification
286 | [resStr appendFormat:@"0000000000000000"];
287 | // 添加Flag
288 | [resStr appendFormat:@"000"];
289 | // 添加FragmentationOffset
290 | [resStr appendFormat:@"0000000000000"];
291 | // 添加TTL
292 | [resStr appendFormat:@"00000000"];
293 | // 添加Protocol
294 | [resStr appendFormat:@"00000000"];
295 | // 添加HeaderChecksum
296 | [resStr appendFormat:@"0000000000000000"];
297 | // 添加SourIPAddress
298 | [resStr appendFormat:@"00000000000000000000000000000000"];
299 | // 添加DestinationIPAddress
300 | [resStr appendFormat:@"00000000000000000000000000000000"];
301 |
302 | // 添加Header结尾
303 | [resStr appendFormat:@"#%@", str];
304 |
305 | dispatch_async(dispatch_get_main_queue(), ^{
306 | self.networkLayer.stringValue = [resStr copy];
307 | });
308 |
309 | [NSThread sleepForTimeInterval:0.3];
310 |
311 | return [self dlinkLayerWithString:resStr];
312 | }
313 |
314 | // 模拟链路层对数据的包装
315 | - (NSMutableString *)dlinkLayerWithString:(NSMutableString *)str {
316 | NSMutableString *resStr1 = [NSMutableString string];
317 | // 添加FrameFlag1
318 | [resStr1 appendFormat:@"00001111"];
319 | // 添加FrameAdd
320 | [resStr1 appendFormat:@"11101011"];
321 | // 添加FrameControl
322 | [resStr1 appendFormat:@"01111000"];
323 |
324 | NSMutableString *resStr2 = [NSMutableString string];
325 | // 添加FrameFCS
326 | [resStr2 appendFormat:@"00001111"];
327 | // 添加FrameFlag2
328 | [resStr2 appendFormat:@"11101011"];
329 |
330 | // 合成帧
331 | NSMutableString *resStr = [NSMutableString stringWithFormat:@"%@#%@#%@", resStr1, str, resStr2];
332 |
333 | dispatch_async(dispatch_get_main_queue(), ^{
334 | self.dlinkLayer.stringValue = [resStr copy];
335 | });
336 |
337 | [NSThread sleepForTimeInterval:0.3];
338 |
339 | return [self phyLayerWithString:resStr];
340 | }
341 |
342 | - (NSMutableString *)phyLayerWithString:(NSMutableString *)str {
343 | NSMutableString *resStr = [NSMutableString stringWithFormat:@"PhysicsHeader#%@", str];
344 |
345 | dispatch_async(dispatch_get_main_queue(), ^{
346 | self.phyLayer.stringValue = [resStr copy];
347 | });
348 |
349 | [NSThread sleepForTimeInterval:0.3];
350 |
351 | return resStr;
352 | }
353 |
354 | @end
355 |
--------------------------------------------------------------------------------
/Client Side/Client Side.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 48;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | E73B62991FD8442800D075FC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E73B62981FD8442800D075FC /* AppDelegate.m */; };
11 | E73B629C1FD8442800D075FC /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E73B629B1FD8442800D075FC /* ViewController.m */; };
12 | E73B629E1FD8442800D075FC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E73B629D1FD8442800D075FC /* Assets.xcassets */; };
13 | E73B62A11FD8442800D075FC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E73B629F1FD8442800D075FC /* Main.storyboard */; };
14 | E73B62A41FD8442800D075FC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E73B62A31FD8442800D075FC /* main.m */; };
15 | /* End PBXBuildFile section */
16 |
17 | /* Begin PBXFileReference section */
18 | E73B62941FD8442800D075FC /* Client Side.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Client Side.app"; sourceTree = BUILT_PRODUCTS_DIR; };
19 | E73B62971FD8442800D075FC /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
20 | E73B62981FD8442800D075FC /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
21 | E73B629A1FD8442800D075FC /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
22 | E73B629B1FD8442800D075FC /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
23 | E73B629D1FD8442800D075FC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
24 | E73B62A01FD8442800D075FC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
25 | E73B62A21FD8442800D075FC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
26 | E73B62A31FD8442800D075FC /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
27 | E73B62A51FD8442800D075FC /* Client_Side.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Client_Side.entitlements; sourceTree = ""; };
28 | E73B62AB1FD8446600D075FC /* Client Side.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Client Side.entitlements"; sourceTree = ""; };
29 | /* End PBXFileReference section */
30 |
31 | /* Begin PBXFrameworksBuildPhase section */
32 | E73B62911FD8442800D075FC /* Frameworks */ = {
33 | isa = PBXFrameworksBuildPhase;
34 | buildActionMask = 2147483647;
35 | files = (
36 | );
37 | runOnlyForDeploymentPostprocessing = 0;
38 | };
39 | /* End PBXFrameworksBuildPhase section */
40 |
41 | /* Begin PBXGroup section */
42 | E73B628B1FD8442800D075FC = {
43 | isa = PBXGroup;
44 | children = (
45 | E73B62961FD8442800D075FC /* Client Side */,
46 | E73B62951FD8442800D075FC /* Products */,
47 | );
48 | sourceTree = "";
49 | };
50 | E73B62951FD8442800D075FC /* Products */ = {
51 | isa = PBXGroup;
52 | children = (
53 | E73B62941FD8442800D075FC /* Client Side.app */,
54 | );
55 | name = Products;
56 | sourceTree = "";
57 | };
58 | E73B62961FD8442800D075FC /* Client Side */ = {
59 | isa = PBXGroup;
60 | children = (
61 | E73B62AB1FD8446600D075FC /* Client Side.entitlements */,
62 | E73B62971FD8442800D075FC /* AppDelegate.h */,
63 | E73B62981FD8442800D075FC /* AppDelegate.m */,
64 | E73B629A1FD8442800D075FC /* ViewController.h */,
65 | E73B629B1FD8442800D075FC /* ViewController.m */,
66 | E73B629D1FD8442800D075FC /* Assets.xcassets */,
67 | E73B629F1FD8442800D075FC /* Main.storyboard */,
68 | E73B62A21FD8442800D075FC /* Info.plist */,
69 | E73B62A31FD8442800D075FC /* main.m */,
70 | E73B62A51FD8442800D075FC /* Client_Side.entitlements */,
71 | );
72 | path = "Client Side";
73 | sourceTree = "";
74 | };
75 | /* End PBXGroup section */
76 |
77 | /* Begin PBXNativeTarget section */
78 | E73B62931FD8442800D075FC /* Client Side */ = {
79 | isa = PBXNativeTarget;
80 | buildConfigurationList = E73B62A81FD8442800D075FC /* Build configuration list for PBXNativeTarget "Client Side" */;
81 | buildPhases = (
82 | E73B62901FD8442800D075FC /* Sources */,
83 | E73B62911FD8442800D075FC /* Frameworks */,
84 | E73B62921FD8442800D075FC /* Resources */,
85 | );
86 | buildRules = (
87 | );
88 | dependencies = (
89 | );
90 | name = "Client Side";
91 | productName = "Client Side";
92 | productReference = E73B62941FD8442800D075FC /* Client Side.app */;
93 | productType = "com.apple.product-type.application";
94 | };
95 | /* End PBXNativeTarget section */
96 |
97 | /* Begin PBXProject section */
98 | E73B628C1FD8442800D075FC /* Project object */ = {
99 | isa = PBXProject;
100 | attributes = {
101 | LastUpgradeCheck = 0910;
102 | ORGANIZATIONNAME = Minecode;
103 | TargetAttributes = {
104 | E73B62931FD8442800D075FC = {
105 | CreatedOnToolsVersion = 9.1;
106 | ProvisioningStyle = Automatic;
107 | SystemCapabilities = {
108 | com.apple.Sandbox = {
109 | enabled = 0;
110 | };
111 | };
112 | };
113 | };
114 | };
115 | buildConfigurationList = E73B628F1FD8442800D075FC /* Build configuration list for PBXProject "Client Side" */;
116 | compatibilityVersion = "Xcode 8.0";
117 | developmentRegion = en;
118 | hasScannedForEncodings = 0;
119 | knownRegions = (
120 | en,
121 | Base,
122 | );
123 | mainGroup = E73B628B1FD8442800D075FC;
124 | productRefGroup = E73B62951FD8442800D075FC /* Products */;
125 | projectDirPath = "";
126 | projectRoot = "";
127 | targets = (
128 | E73B62931FD8442800D075FC /* Client Side */,
129 | );
130 | };
131 | /* End PBXProject section */
132 |
133 | /* Begin PBXResourcesBuildPhase section */
134 | E73B62921FD8442800D075FC /* Resources */ = {
135 | isa = PBXResourcesBuildPhase;
136 | buildActionMask = 2147483647;
137 | files = (
138 | E73B629E1FD8442800D075FC /* Assets.xcassets in Resources */,
139 | E73B62A11FD8442800D075FC /* Main.storyboard in Resources */,
140 | );
141 | runOnlyForDeploymentPostprocessing = 0;
142 | };
143 | /* End PBXResourcesBuildPhase section */
144 |
145 | /* Begin PBXSourcesBuildPhase section */
146 | E73B62901FD8442800D075FC /* Sources */ = {
147 | isa = PBXSourcesBuildPhase;
148 | buildActionMask = 2147483647;
149 | files = (
150 | E73B629C1FD8442800D075FC /* ViewController.m in Sources */,
151 | E73B62A41FD8442800D075FC /* main.m in Sources */,
152 | E73B62991FD8442800D075FC /* AppDelegate.m in Sources */,
153 | );
154 | runOnlyForDeploymentPostprocessing = 0;
155 | };
156 | /* End PBXSourcesBuildPhase section */
157 |
158 | /* Begin PBXVariantGroup section */
159 | E73B629F1FD8442800D075FC /* Main.storyboard */ = {
160 | isa = PBXVariantGroup;
161 | children = (
162 | E73B62A01FD8442800D075FC /* Base */,
163 | );
164 | name = Main.storyboard;
165 | sourceTree = "";
166 | };
167 | /* End PBXVariantGroup section */
168 |
169 | /* Begin XCBuildConfiguration section */
170 | E73B62A61FD8442800D075FC /* Debug */ = {
171 | isa = XCBuildConfiguration;
172 | buildSettings = {
173 | ALWAYS_SEARCH_USER_PATHS = NO;
174 | CLANG_ANALYZER_NONNULL = YES;
175 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
176 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
177 | CLANG_CXX_LIBRARY = "libc++";
178 | CLANG_ENABLE_MODULES = YES;
179 | CLANG_ENABLE_OBJC_ARC = YES;
180 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
181 | CLANG_WARN_BOOL_CONVERSION = YES;
182 | CLANG_WARN_COMMA = YES;
183 | CLANG_WARN_CONSTANT_CONVERSION = YES;
184 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
185 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
186 | CLANG_WARN_EMPTY_BODY = YES;
187 | CLANG_WARN_ENUM_CONVERSION = YES;
188 | CLANG_WARN_INFINITE_RECURSION = YES;
189 | CLANG_WARN_INT_CONVERSION = YES;
190 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
191 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
192 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
193 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
194 | CLANG_WARN_STRICT_PROTOTYPES = YES;
195 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
196 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
197 | CLANG_WARN_UNREACHABLE_CODE = YES;
198 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
199 | CODE_SIGN_IDENTITY = "Mac Developer";
200 | COPY_PHASE_STRIP = NO;
201 | DEBUG_INFORMATION_FORMAT = dwarf;
202 | ENABLE_STRICT_OBJC_MSGSEND = YES;
203 | ENABLE_TESTABILITY = YES;
204 | GCC_C_LANGUAGE_STANDARD = gnu11;
205 | GCC_DYNAMIC_NO_PIC = NO;
206 | GCC_NO_COMMON_BLOCKS = YES;
207 | GCC_OPTIMIZATION_LEVEL = 0;
208 | GCC_PREPROCESSOR_DEFINITIONS = (
209 | "DEBUG=1",
210 | "$(inherited)",
211 | );
212 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
213 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
214 | GCC_WARN_UNDECLARED_SELECTOR = YES;
215 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
216 | GCC_WARN_UNUSED_FUNCTION = YES;
217 | GCC_WARN_UNUSED_VARIABLE = YES;
218 | MACOSX_DEPLOYMENT_TARGET = 10.13;
219 | MTL_ENABLE_DEBUG_INFO = YES;
220 | ONLY_ACTIVE_ARCH = YES;
221 | SDKROOT = macosx;
222 | };
223 | name = Debug;
224 | };
225 | E73B62A71FD8442800D075FC /* Release */ = {
226 | isa = XCBuildConfiguration;
227 | buildSettings = {
228 | ALWAYS_SEARCH_USER_PATHS = NO;
229 | CLANG_ANALYZER_NONNULL = YES;
230 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
231 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
232 | CLANG_CXX_LIBRARY = "libc++";
233 | CLANG_ENABLE_MODULES = YES;
234 | CLANG_ENABLE_OBJC_ARC = YES;
235 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
236 | CLANG_WARN_BOOL_CONVERSION = YES;
237 | CLANG_WARN_COMMA = YES;
238 | CLANG_WARN_CONSTANT_CONVERSION = YES;
239 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
240 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
241 | CLANG_WARN_EMPTY_BODY = YES;
242 | CLANG_WARN_ENUM_CONVERSION = YES;
243 | CLANG_WARN_INFINITE_RECURSION = YES;
244 | CLANG_WARN_INT_CONVERSION = YES;
245 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
246 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
247 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
248 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
249 | CLANG_WARN_STRICT_PROTOTYPES = YES;
250 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
251 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
252 | CLANG_WARN_UNREACHABLE_CODE = YES;
253 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
254 | CODE_SIGN_IDENTITY = "Mac Developer";
255 | COPY_PHASE_STRIP = NO;
256 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
257 | ENABLE_NS_ASSERTIONS = NO;
258 | ENABLE_STRICT_OBJC_MSGSEND = YES;
259 | GCC_C_LANGUAGE_STANDARD = gnu11;
260 | GCC_NO_COMMON_BLOCKS = YES;
261 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
262 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
263 | GCC_WARN_UNDECLARED_SELECTOR = YES;
264 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
265 | GCC_WARN_UNUSED_FUNCTION = YES;
266 | GCC_WARN_UNUSED_VARIABLE = YES;
267 | MACOSX_DEPLOYMENT_TARGET = 10.13;
268 | MTL_ENABLE_DEBUG_INFO = NO;
269 | SDKROOT = macosx;
270 | };
271 | name = Release;
272 | };
273 | E73B62A91FD8442800D075FC /* Debug */ = {
274 | isa = XCBuildConfiguration;
275 | buildSettings = {
276 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
277 | CODE_SIGN_STYLE = Automatic;
278 | COMBINE_HIDPI_IMAGES = YES;
279 | DEVELOPMENT_TEAM = XQ4VPYFFH5;
280 | INFOPLIST_FILE = "Client Side/Info.plist";
281 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
282 | MACOSX_DEPLOYMENT_TARGET = 10.10;
283 | PRODUCT_BUNDLE_IDENTIFIER = "link.minecode.Client-Side";
284 | PRODUCT_NAME = "$(TARGET_NAME)";
285 | };
286 | name = Debug;
287 | };
288 | E73B62AA1FD8442800D075FC /* Release */ = {
289 | isa = XCBuildConfiguration;
290 | buildSettings = {
291 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
292 | CODE_SIGN_STYLE = Automatic;
293 | COMBINE_HIDPI_IMAGES = YES;
294 | DEVELOPMENT_TEAM = XQ4VPYFFH5;
295 | INFOPLIST_FILE = "Client Side/Info.plist";
296 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
297 | MACOSX_DEPLOYMENT_TARGET = 10.10;
298 | PRODUCT_BUNDLE_IDENTIFIER = "link.minecode.Client-Side";
299 | PRODUCT_NAME = "$(TARGET_NAME)";
300 | };
301 | name = Release;
302 | };
303 | /* End XCBuildConfiguration section */
304 |
305 | /* Begin XCConfigurationList section */
306 | E73B628F1FD8442800D075FC /* Build configuration list for PBXProject "Client Side" */ = {
307 | isa = XCConfigurationList;
308 | buildConfigurations = (
309 | E73B62A61FD8442800D075FC /* Debug */,
310 | E73B62A71FD8442800D075FC /* Release */,
311 | );
312 | defaultConfigurationIsVisible = 0;
313 | defaultConfigurationName = Release;
314 | };
315 | E73B62A81FD8442800D075FC /* Build configuration list for PBXNativeTarget "Client Side" */ = {
316 | isa = XCConfigurationList;
317 | buildConfigurations = (
318 | E73B62A91FD8442800D075FC /* Debug */,
319 | E73B62AA1FD8442800D075FC /* Release */,
320 | );
321 | defaultConfigurationIsVisible = 0;
322 | defaultConfigurationName = Release;
323 | };
324 | /* End XCConfigurationList section */
325 | };
326 | rootObject = E73B628C1FD8442800D075FC /* Project object */;
327 | }
328 |
--------------------------------------------------------------------------------
/Service Side/Service Side.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 48;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | E73B62871FD83D0300D075FC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E73B62851FD83CF400D075FC /* Cocoa.framework */; };
11 | E73B62881FD83D0A00D075FC /* NetFS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E73B62861FD83CF400D075FC /* NetFS.framework */; };
12 | E73B62891FD83D1300D075FC /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E73B62841FD83CF400D075FC /* Security.framework */; };
13 | E7A3B7BC1FD80F9000C0FC00 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E7A3B7BB1FD80F9000C0FC00 /* AppDelegate.m */; };
14 | E7A3B7BF1FD80F9000C0FC00 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E7A3B7BE1FD80F9000C0FC00 /* ViewController.m */; };
15 | E7A3B7C11FD80F9000C0FC00 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E7A3B7C01FD80F9000C0FC00 /* Assets.xcassets */; };
16 | E7A3B7C41FD80F9000C0FC00 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E7A3B7C21FD80F9000C0FC00 /* Main.storyboard */; };
17 | E7A3B7C71FD80F9000C0FC00 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E7A3B7C61FD80F9000C0FC00 /* main.m */; };
18 | /* End PBXBuildFile section */
19 |
20 | /* Begin PBXFileReference section */
21 | E73B62841FD83CF400D075FC /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
22 | E73B62851FD83CF400D075FC /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
23 | E73B62861FD83CF400D075FC /* NetFS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetFS.framework; path = System/Library/Frameworks/NetFS.framework; sourceTree = SDKROOT; };
24 | E73B628A1FD8427400D075FC /* Service Side.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Service Side.entitlements"; sourceTree = ""; };
25 | E7A3B7B71FD80F9000C0FC00 /* Service Side.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Service Side.app"; sourceTree = BUILT_PRODUCTS_DIR; };
26 | E7A3B7BA1FD80F9000C0FC00 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
27 | E7A3B7BB1FD80F9000C0FC00 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
28 | E7A3B7BD1FD80F9000C0FC00 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
29 | E7A3B7BE1FD80F9000C0FC00 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
30 | E7A3B7C01FD80F9000C0FC00 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
31 | E7A3B7C31FD80F9000C0FC00 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
32 | E7A3B7C51FD80F9000C0FC00 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
33 | E7A3B7C61FD80F9000C0FC00 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
34 | E7A3B7C81FD80F9000C0FC00 /* Service_Side.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Service_Side.entitlements; sourceTree = ""; };
35 | /* End PBXFileReference section */
36 |
37 | /* Begin PBXFrameworksBuildPhase section */
38 | E7A3B7B41FD80F9000C0FC00 /* Frameworks */ = {
39 | isa = PBXFrameworksBuildPhase;
40 | buildActionMask = 2147483647;
41 | files = (
42 | E73B62891FD83D1300D075FC /* Security.framework in Frameworks */,
43 | E73B62881FD83D0A00D075FC /* NetFS.framework in Frameworks */,
44 | E73B62871FD83D0300D075FC /* Cocoa.framework in Frameworks */,
45 | );
46 | runOnlyForDeploymentPostprocessing = 0;
47 | };
48 | /* End PBXFrameworksBuildPhase section */
49 |
50 | /* Begin PBXGroup section */
51 | E73B62831FD83CF400D075FC /* Frameworks */ = {
52 | isa = PBXGroup;
53 | children = (
54 | E73B62851FD83CF400D075FC /* Cocoa.framework */,
55 | E73B62861FD83CF400D075FC /* NetFS.framework */,
56 | E73B62841FD83CF400D075FC /* Security.framework */,
57 | );
58 | name = Frameworks;
59 | sourceTree = "";
60 | };
61 | E7A3B7AE1FD80F9000C0FC00 = {
62 | isa = PBXGroup;
63 | children = (
64 | E7A3B7B91FD80F9000C0FC00 /* Service Side */,
65 | E7A3B7B81FD80F9000C0FC00 /* Products */,
66 | E73B62831FD83CF400D075FC /* Frameworks */,
67 | );
68 | sourceTree = "";
69 | };
70 | E7A3B7B81FD80F9000C0FC00 /* Products */ = {
71 | isa = PBXGroup;
72 | children = (
73 | E7A3B7B71FD80F9000C0FC00 /* Service Side.app */,
74 | );
75 | name = Products;
76 | sourceTree = "";
77 | };
78 | E7A3B7B91FD80F9000C0FC00 /* Service Side */ = {
79 | isa = PBXGroup;
80 | children = (
81 | E73B628A1FD8427400D075FC /* Service Side.entitlements */,
82 | E7A3B7BA1FD80F9000C0FC00 /* AppDelegate.h */,
83 | E7A3B7BB1FD80F9000C0FC00 /* AppDelegate.m */,
84 | E7A3B7BD1FD80F9000C0FC00 /* ViewController.h */,
85 | E7A3B7BE1FD80F9000C0FC00 /* ViewController.m */,
86 | E7A3B7C01FD80F9000C0FC00 /* Assets.xcassets */,
87 | E7A3B7C21FD80F9000C0FC00 /* Main.storyboard */,
88 | E7A3B7C51FD80F9000C0FC00 /* Info.plist */,
89 | E7A3B7C61FD80F9000C0FC00 /* main.m */,
90 | E7A3B7C81FD80F9000C0FC00 /* Service_Side.entitlements */,
91 | );
92 | path = "Service Side";
93 | sourceTree = "";
94 | };
95 | /* End PBXGroup section */
96 |
97 | /* Begin PBXNativeTarget section */
98 | E7A3B7B61FD80F9000C0FC00 /* Service Side */ = {
99 | isa = PBXNativeTarget;
100 | buildConfigurationList = E7A3B7CB1FD80F9000C0FC00 /* Build configuration list for PBXNativeTarget "Service Side" */;
101 | buildPhases = (
102 | E7A3B7B31FD80F9000C0FC00 /* Sources */,
103 | E7A3B7B41FD80F9000C0FC00 /* Frameworks */,
104 | E7A3B7B51FD80F9000C0FC00 /* Resources */,
105 | );
106 | buildRules = (
107 | );
108 | dependencies = (
109 | );
110 | name = "Service Side";
111 | productName = "Service Side";
112 | productReference = E7A3B7B71FD80F9000C0FC00 /* Service Side.app */;
113 | productType = "com.apple.product-type.application";
114 | };
115 | /* End PBXNativeTarget section */
116 |
117 | /* Begin PBXProject section */
118 | E7A3B7AF1FD80F9000C0FC00 /* Project object */ = {
119 | isa = PBXProject;
120 | attributes = {
121 | LastUpgradeCheck = 0910;
122 | ORGANIZATIONNAME = Minecode;
123 | TargetAttributes = {
124 | E7A3B7B61FD80F9000C0FC00 = {
125 | CreatedOnToolsVersion = 9.1;
126 | ProvisioningStyle = Automatic;
127 | SystemCapabilities = {
128 | com.apple.Sandbox = {
129 | enabled = 0;
130 | };
131 | };
132 | };
133 | };
134 | };
135 | buildConfigurationList = E7A3B7B21FD80F9000C0FC00 /* Build configuration list for PBXProject "Service Side" */;
136 | compatibilityVersion = "Xcode 8.0";
137 | developmentRegion = en;
138 | hasScannedForEncodings = 0;
139 | knownRegions = (
140 | en,
141 | Base,
142 | );
143 | mainGroup = E7A3B7AE1FD80F9000C0FC00;
144 | productRefGroup = E7A3B7B81FD80F9000C0FC00 /* Products */;
145 | projectDirPath = "";
146 | projectRoot = "";
147 | targets = (
148 | E7A3B7B61FD80F9000C0FC00 /* Service Side */,
149 | );
150 | };
151 | /* End PBXProject section */
152 |
153 | /* Begin PBXResourcesBuildPhase section */
154 | E7A3B7B51FD80F9000C0FC00 /* Resources */ = {
155 | isa = PBXResourcesBuildPhase;
156 | buildActionMask = 2147483647;
157 | files = (
158 | E7A3B7C11FD80F9000C0FC00 /* Assets.xcassets in Resources */,
159 | E7A3B7C41FD80F9000C0FC00 /* Main.storyboard in Resources */,
160 | );
161 | runOnlyForDeploymentPostprocessing = 0;
162 | };
163 | /* End PBXResourcesBuildPhase section */
164 |
165 | /* Begin PBXSourcesBuildPhase section */
166 | E7A3B7B31FD80F9000C0FC00 /* Sources */ = {
167 | isa = PBXSourcesBuildPhase;
168 | buildActionMask = 2147483647;
169 | files = (
170 | E7A3B7BF1FD80F9000C0FC00 /* ViewController.m in Sources */,
171 | E7A3B7C71FD80F9000C0FC00 /* main.m in Sources */,
172 | E7A3B7BC1FD80F9000C0FC00 /* AppDelegate.m in Sources */,
173 | );
174 | runOnlyForDeploymentPostprocessing = 0;
175 | };
176 | /* End PBXSourcesBuildPhase section */
177 |
178 | /* Begin PBXVariantGroup section */
179 | E7A3B7C21FD80F9000C0FC00 /* Main.storyboard */ = {
180 | isa = PBXVariantGroup;
181 | children = (
182 | E7A3B7C31FD80F9000C0FC00 /* Base */,
183 | );
184 | name = Main.storyboard;
185 | sourceTree = "";
186 | };
187 | /* End PBXVariantGroup section */
188 |
189 | /* Begin XCBuildConfiguration section */
190 | E7A3B7C91FD80F9000C0FC00 /* Debug */ = {
191 | isa = XCBuildConfiguration;
192 | buildSettings = {
193 | ALWAYS_SEARCH_USER_PATHS = NO;
194 | CLANG_ANALYZER_NONNULL = YES;
195 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
196 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
197 | CLANG_CXX_LIBRARY = "libc++";
198 | CLANG_ENABLE_MODULES = YES;
199 | CLANG_ENABLE_OBJC_ARC = YES;
200 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
201 | CLANG_WARN_BOOL_CONVERSION = YES;
202 | CLANG_WARN_COMMA = YES;
203 | CLANG_WARN_CONSTANT_CONVERSION = YES;
204 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
205 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
206 | CLANG_WARN_EMPTY_BODY = YES;
207 | CLANG_WARN_ENUM_CONVERSION = YES;
208 | CLANG_WARN_INFINITE_RECURSION = YES;
209 | CLANG_WARN_INT_CONVERSION = YES;
210 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
211 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
212 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
213 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
214 | CLANG_WARN_STRICT_PROTOTYPES = YES;
215 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
216 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
217 | CLANG_WARN_UNREACHABLE_CODE = YES;
218 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
219 | CODE_SIGN_IDENTITY = "Mac Developer";
220 | COPY_PHASE_STRIP = NO;
221 | DEBUG_INFORMATION_FORMAT = dwarf;
222 | ENABLE_STRICT_OBJC_MSGSEND = YES;
223 | ENABLE_TESTABILITY = YES;
224 | GCC_C_LANGUAGE_STANDARD = gnu11;
225 | GCC_DYNAMIC_NO_PIC = NO;
226 | GCC_NO_COMMON_BLOCKS = YES;
227 | GCC_OPTIMIZATION_LEVEL = 0;
228 | GCC_PREPROCESSOR_DEFINITIONS = (
229 | "DEBUG=1",
230 | "$(inherited)",
231 | );
232 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
233 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
234 | GCC_WARN_UNDECLARED_SELECTOR = YES;
235 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
236 | GCC_WARN_UNUSED_FUNCTION = YES;
237 | GCC_WARN_UNUSED_VARIABLE = YES;
238 | MACOSX_DEPLOYMENT_TARGET = 10.13;
239 | MTL_ENABLE_DEBUG_INFO = YES;
240 | ONLY_ACTIVE_ARCH = YES;
241 | SDKROOT = macosx;
242 | };
243 | name = Debug;
244 | };
245 | E7A3B7CA1FD80F9000C0FC00 /* Release */ = {
246 | isa = XCBuildConfiguration;
247 | buildSettings = {
248 | ALWAYS_SEARCH_USER_PATHS = NO;
249 | CLANG_ANALYZER_NONNULL = YES;
250 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
251 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
252 | CLANG_CXX_LIBRARY = "libc++";
253 | CLANG_ENABLE_MODULES = YES;
254 | CLANG_ENABLE_OBJC_ARC = YES;
255 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
256 | CLANG_WARN_BOOL_CONVERSION = YES;
257 | CLANG_WARN_COMMA = YES;
258 | CLANG_WARN_CONSTANT_CONVERSION = YES;
259 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
260 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
261 | CLANG_WARN_EMPTY_BODY = YES;
262 | CLANG_WARN_ENUM_CONVERSION = YES;
263 | CLANG_WARN_INFINITE_RECURSION = YES;
264 | CLANG_WARN_INT_CONVERSION = YES;
265 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
266 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
267 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
268 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
269 | CLANG_WARN_STRICT_PROTOTYPES = YES;
270 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
271 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
272 | CLANG_WARN_UNREACHABLE_CODE = YES;
273 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
274 | CODE_SIGN_IDENTITY = "Mac Developer";
275 | COPY_PHASE_STRIP = NO;
276 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
277 | ENABLE_NS_ASSERTIONS = NO;
278 | ENABLE_STRICT_OBJC_MSGSEND = YES;
279 | GCC_C_LANGUAGE_STANDARD = gnu11;
280 | GCC_NO_COMMON_BLOCKS = YES;
281 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
282 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
283 | GCC_WARN_UNDECLARED_SELECTOR = YES;
284 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
285 | GCC_WARN_UNUSED_FUNCTION = YES;
286 | GCC_WARN_UNUSED_VARIABLE = YES;
287 | MACOSX_DEPLOYMENT_TARGET = 10.13;
288 | MTL_ENABLE_DEBUG_INFO = NO;
289 | SDKROOT = macosx;
290 | };
291 | name = Release;
292 | };
293 | E7A3B7CC1FD80F9000C0FC00 /* Debug */ = {
294 | isa = XCBuildConfiguration;
295 | buildSettings = {
296 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
297 | CODE_SIGN_STYLE = Automatic;
298 | COMBINE_HIDPI_IMAGES = YES;
299 | DEVELOPMENT_TEAM = XQ4VPYFFH5;
300 | INFOPLIST_FILE = "Service Side/Info.plist";
301 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
302 | MACOSX_DEPLOYMENT_TARGET = 10.10;
303 | PRODUCT_BUNDLE_IDENTIFIER = "link.minecode.Service-Side";
304 | PRODUCT_NAME = "$(TARGET_NAME)";
305 | };
306 | name = Debug;
307 | };
308 | E7A3B7CD1FD80F9000C0FC00 /* Release */ = {
309 | isa = XCBuildConfiguration;
310 | buildSettings = {
311 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
312 | CODE_SIGN_STYLE = Automatic;
313 | COMBINE_HIDPI_IMAGES = YES;
314 | DEVELOPMENT_TEAM = XQ4VPYFFH5;
315 | INFOPLIST_FILE = "Service Side/Info.plist";
316 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
317 | MACOSX_DEPLOYMENT_TARGET = 10.10;
318 | PRODUCT_BUNDLE_IDENTIFIER = "link.minecode.Service-Side";
319 | PRODUCT_NAME = "$(TARGET_NAME)";
320 | };
321 | name = Release;
322 | };
323 | /* End XCBuildConfiguration section */
324 |
325 | /* Begin XCConfigurationList section */
326 | E7A3B7B21FD80F9000C0FC00 /* Build configuration list for PBXProject "Service Side" */ = {
327 | isa = XCConfigurationList;
328 | buildConfigurations = (
329 | E7A3B7C91FD80F9000C0FC00 /* Debug */,
330 | E7A3B7CA1FD80F9000C0FC00 /* Release */,
331 | );
332 | defaultConfigurationIsVisible = 0;
333 | defaultConfigurationName = Release;
334 | };
335 | E7A3B7CB1FD80F9000C0FC00 /* Build configuration list for PBXNativeTarget "Service Side" */ = {
336 | isa = XCConfigurationList;
337 | buildConfigurations = (
338 | E7A3B7CC1FD80F9000C0FC00 /* Debug */,
339 | E7A3B7CD1FD80F9000C0FC00 /* Release */,
340 | );
341 | defaultConfigurationIsVisible = 0;
342 | defaultConfigurationName = Release;
343 | };
344 | /* End XCConfigurationList section */
345 | };
346 | rootObject = E7A3B7AF1FD80F9000C0FC00 /* Project object */;
347 | }
348 |
--------------------------------------------------------------------------------
/Service Side/Service Side/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
846 |
847 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 |
884 |
885 |
886 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 |
896 |
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 |
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
923 |
924 |
--------------------------------------------------------------------------------