Skip to content

Commit 27d7789

Browse files
plugin is working, can write slice and write to repo but read polling seems to be too slow
1 parent 0314fdf commit 27d7789

File tree

140 files changed

+230
-144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+230
-144
lines changed

.DS_Store

0 Bytes
Binary file not shown.

Assembly-CSharp-firstpass-vs.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
66
<ProductVersion>10.0.20506</ProductVersion>
77
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{D52B06C2-D26C-59DD-D5A5-5A2CE3365B1A}</ProjectGuid>
8+
<ProjectGuid>{840D14ED-223D-B89C-3886-4E35053D5457}</ProjectGuid>
99
<OutputType>Library</OutputType>
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace></RootNamespace>
@@ -18,7 +18,7 @@
1818
<DebugType>full</DebugType>
1919
<Optimize>false</Optimize>
2020
<OutputPath>Temp\bin\Debug\</OutputPath>
21-
<DefineConstants>DEBUG;TRACE;UNITY_3_5_0;UNITY_3_5;UNITY_EDITOR;ENABLE_PROFILER;UNITY_STANDALONE_OSX;ENABLE_GENERICS;ENABLE_DUCK_TYPING;ENABLE_TERRAIN;ENABLE_MOVIES;ENABLE_WEBCAM;ENABLE_MICROPHONE;ENABLE_NETWORK;ENABLE_CLOTH;ENABLE_WWW;ENABLE_SUBSTANCE</DefineConstants>
21+
<DefineConstants>DEBUG;TRACE;UNITY_3_5_1;UNITY_3_5;UNITY_EDITOR;ENABLE_PROFILER;UNITY_STANDALONE_OSX;ENABLE_GENERICS;ENABLE_DUCK_TYPING;ENABLE_TERRAIN;ENABLE_MOVIES;ENABLE_WEBCAM;ENABLE_MICROPHONE;ENABLE_NETWORK;ENABLE_CLOTH;ENABLE_WWW;ENABLE_SUBSTANCE</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
2424
<NoWarn>0169</NoWarn>
@@ -44,9 +44,9 @@
4444
</Reference>
4545
</ItemGroup>
4646
<ItemGroup>
47+
<Compile Include="Assets\Plugins\CCN.cs" />
48+
<Compile Include="Assets\Plugins\Enum.cs" />
4749
<Compile Include="Assets\Standard Assets\Gem Rendering\Example\GemSpawner.cs" />
48-
<None Include="Assets\Plugins\CCNxPlugin.bundle\Contents\Resources\crib.txt" />
49-
<None Include="Assets\Plugins\CCNxPlugin.bundle\Contents\Resources\SyncSetup.txt" />
5050
<None Include="Assets\Shader\glass.shader" />
5151
<None Include="Assets\Standard Assets\Gem Rendering\diamond shader.shader" />
5252
</ItemGroup>

Assembly-CSharp-firstpass.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
66
<ProductVersion>10.0.20506</ProductVersion>
77
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{D52B06C2-D26C-59DD-D5A5-5A2CE3365B1A}</ProjectGuid>
8+
<ProjectGuid>{840D14ED-223D-B89C-3886-4E35053D5457}</ProjectGuid>
99
<OutputType>Library</OutputType>
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace></RootNamespace>
@@ -18,7 +18,7 @@
1818
<DebugType>full</DebugType>
1919
<Optimize>false</Optimize>
2020
<OutputPath>Temp\bin\Debug\</OutputPath>
21-
<DefineConstants>DEBUG;TRACE;UNITY_3_5_0;UNITY_3_5;UNITY_EDITOR;ENABLE_PROFILER;UNITY_STANDALONE_OSX;ENABLE_GENERICS;ENABLE_DUCK_TYPING;ENABLE_TERRAIN;ENABLE_MOVIES;ENABLE_WEBCAM;ENABLE_MICROPHONE;ENABLE_NETWORK;ENABLE_CLOTH;ENABLE_WWW;ENABLE_SUBSTANCE</DefineConstants>
21+
<DefineConstants>DEBUG;TRACE;UNITY_3_5_1;UNITY_3_5;UNITY_EDITOR;ENABLE_PROFILER;UNITY_STANDALONE_OSX;ENABLE_GENERICS;ENABLE_DUCK_TYPING;ENABLE_TERRAIN;ENABLE_MOVIES;ENABLE_WEBCAM;ENABLE_MICROPHONE;ENABLE_NETWORK;ENABLE_CLOTH;ENABLE_WWW;ENABLE_SUBSTANCE</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
2424
<NoWarn>0169</NoWarn>
@@ -44,9 +44,9 @@
4444
</Reference>
4545
</ItemGroup>
4646
<ItemGroup>
47+
<Compile Include="Assets\Plugins\CCN.cs" />
48+
<Compile Include="Assets\Plugins\Enum.cs" />
4749
<Compile Include="Assets\Standard Assets\Gem Rendering\Example\GemSpawner.cs" />
48-
<None Include="Assets\Plugins\CCNxPlugin.bundle\Contents\Resources\crib.txt" />
49-
<None Include="Assets\Plugins\CCNxPlugin.bundle\Contents\Resources\SyncSetup.txt" />
5050
<None Include="Assets\Shader\glass.shader" />
5151
<None Include="Assets\Standard Assets\Gem Rendering\diamond shader.shader" />
5252
</ItemGroup>

Assembly-CSharp-firstpass.pidb

6.61 KB
Binary file not shown.

Assembly-CSharp-vs.csproj

+4-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
66
<ProductVersion>10.0.20506</ProductVersion>
77
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{93ED29F5-0264-4CC0-FD77-F52F1D08BEB5}</ProjectGuid>
8+
<ProjectGuid>{E51E0C7F-78CC-70BD-CCF1-297F16BF968E}</ProjectGuid>
99
<OutputType>Library</OutputType>
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace></RootNamespace>
@@ -18,7 +18,7 @@
1818
<DebugType>full</DebugType>
1919
<Optimize>false</Optimize>
2020
<OutputPath>Temp\bin\Debug\</OutputPath>
21-
<DefineConstants>DEBUG;TRACE;UNITY_3_5_0;UNITY_3_5;UNITY_EDITOR;ENABLE_PROFILER;UNITY_STANDALONE_OSX;ENABLE_GENERICS;ENABLE_DUCK_TYPING;ENABLE_TERRAIN;ENABLE_MOVIES;ENABLE_WEBCAM;ENABLE_MICROPHONE;ENABLE_NETWORK;ENABLE_CLOTH;ENABLE_WWW;ENABLE_SUBSTANCE</DefineConstants>
21+
<DefineConstants>DEBUG;TRACE;UNITY_3_5_1;UNITY_3_5;UNITY_EDITOR;ENABLE_PROFILER;UNITY_STANDALONE_OSX;ENABLE_GENERICS;ENABLE_DUCK_TYPING;ENABLE_TERRAIN;ENABLE_MOVIES;ENABLE_WEBCAM;ENABLE_MICROPHONE;ENABLE_NETWORK;ENABLE_CLOTH;ENABLE_WWW;ENABLE_SUBSTANCE</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
2424
<NoWarn>0169</NoWarn>
@@ -45,17 +45,14 @@
4545
</ItemGroup>
4646
<ItemGroup>
4747
<Compile Include="Assets\Script\Control.cs" />
48-
<Compile Include="Assets\Script\Enum.cs" />
4948
<Compile Include="Assets\Script\Sync.cs" />
50-
<Compile Include="Assets\Script\wrapper.cs" />
51-
<None Include="Assets\Plugins\CCNxPlugin.bundle\Contents\Resources\crib.txt" />
52-
<None Include="Assets\Plugins\CCNxPlugin.bundle\Contents\Resources\SyncSetup.txt" />
49+
<Compile Include="Assets\Script\test.cs" />
5350
<None Include="Assets\Shader\glass.shader" />
5451
<None Include="Assets\Standard Assets\Gem Rendering\diamond shader.shader" />
5552
</ItemGroup>
5653
<ItemGroup>
5754
<ProjectReference Include="Assembly-CSharp-firstpass-vs.csproj">
58-
<Project>{D52B06C2-D26C-59DD-D5A5-5A2CE3365B1A}</Project> <Name>Assembly-CSharp-firstpass-vs</Name> </ProjectReference>
55+
<Project>{840D14ED-223D-B89C-3886-4E35053D5457}</Project> <Name>Assembly-CSharp-firstpass-vs</Name> </ProjectReference>
5956
</ItemGroup>
6057
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
6158
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

Assembly-CSharp.csproj

+4-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
66
<ProductVersion>10.0.20506</ProductVersion>
77
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{93ED29F5-0264-4CC0-FD77-F52F1D08BEB5}</ProjectGuid>
8+
<ProjectGuid>{E51E0C7F-78CC-70BD-CCF1-297F16BF968E}</ProjectGuid>
99
<OutputType>Library</OutputType>
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace></RootNamespace>
@@ -18,7 +18,7 @@
1818
<DebugType>full</DebugType>
1919
<Optimize>false</Optimize>
2020
<OutputPath>Temp\bin\Debug\</OutputPath>
21-
<DefineConstants>DEBUG;TRACE;UNITY_3_5_0;UNITY_3_5;UNITY_EDITOR;ENABLE_PROFILER;UNITY_STANDALONE_OSX;ENABLE_GENERICS;ENABLE_DUCK_TYPING;ENABLE_TERRAIN;ENABLE_MOVIES;ENABLE_WEBCAM;ENABLE_MICROPHONE;ENABLE_NETWORK;ENABLE_CLOTH;ENABLE_WWW;ENABLE_SUBSTANCE</DefineConstants>
21+
<DefineConstants>DEBUG;TRACE;UNITY_3_5_1;UNITY_3_5;UNITY_EDITOR;ENABLE_PROFILER;UNITY_STANDALONE_OSX;ENABLE_GENERICS;ENABLE_DUCK_TYPING;ENABLE_TERRAIN;ENABLE_MOVIES;ENABLE_WEBCAM;ENABLE_MICROPHONE;ENABLE_NETWORK;ENABLE_CLOTH;ENABLE_WWW;ENABLE_SUBSTANCE</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
2424
<NoWarn>0169</NoWarn>
@@ -45,17 +45,14 @@
4545
</ItemGroup>
4646
<ItemGroup>
4747
<Compile Include="Assets\Script\Control.cs" />
48-
<Compile Include="Assets\Script\Enum.cs" />
4948
<Compile Include="Assets\Script\Sync.cs" />
50-
<Compile Include="Assets\Script\wrapper.cs" />
51-
<None Include="Assets\Plugins\CCNxPlugin.bundle\Contents\Resources\crib.txt" />
52-
<None Include="Assets\Plugins\CCNxPlugin.bundle\Contents\Resources\SyncSetup.txt" />
49+
<Compile Include="Assets\Script\test.cs" />
5350
<None Include="Assets\Shader\glass.shader" />
5451
<None Include="Assets\Standard Assets\Gem Rendering\diamond shader.shader" />
5552
</ItemGroup>
5653
<ItemGroup>
5754
<ProjectReference Include="Assembly-CSharp-firstpass.csproj">
58-
<Project>{D52B06C2-D26C-59DD-D5A5-5A2CE3365B1A}</Project> <Name>Assembly-CSharp-firstpass</Name> </ProjectReference>
55+
<Project>{840D14ED-223D-B89C-3886-4E35053D5457}</Project> <Name>Assembly-CSharp-firstpass</Name> </ProjectReference>
5956
</ItemGroup>
6057
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
6158
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

Assembly-CSharp.pidb

-7.53 KB
Binary file not shown.

Assets/.DS_Store

0 Bytes
Binary file not shown.

Assets/Plugins/.DS_Store

0 Bytes
Binary file not shown.

Assets/Script/wrapper.cs renamed to Assets/Plugins/CCN.cs

+9-11
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,8 @@
33
using System.Collections;
44
using System.Runtime.InteropServices;
55

6-
public class wrapper : MonoBehaviour {
6+
public class CCN : MonoBehaviour {
77

8-
[DllImport ("helloworld_bundle")]
9-
public static extern String helloworld_wrapper();
10-
11-
[DllImport ("helloworld_bundle")]
12-
public static extern String helloworld();
13-
14-
[DllImport ("CCNxPlugin")]
15-
public static extern IntPtr ccn_create();
168

179
// ccn/charbuf.h
1810
[StructLayout (LayoutKind.Sequential)]
@@ -27,10 +19,16 @@ public struct ccn_charbuf
2719
//[return: MarshalAs(UnmanagedType.LPStruct)]
2820
public static extern IntPtr ccn_charbuf_create();
2921

22+
3023
[DllImport ("CCNxPlugin")]
31-
public static extern int ccnb_element_begin(IntPtr c, int dtag);
24+
public static extern int WriteSlice(System.String prefix, System.String topo);
25+
// returns 0 for success
3226

3327
[DllImport ("CCNxPlugin")]
34-
public static extern int SyncAppendTaggedNumber(IntPtr cb, int dtag, uint val);
28+
public static extern IntPtr ReadFromRepo(System.String name);
29+
30+
31+
[DllImport ("CCNxPlugin")]
32+
public static extern void WriteToRepo(System.String name, System.String content);
3533

3634
}

Assets/Plugins/CCNxPlugin.bundle/Contents/Info.plist

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<plist version="1.0">
44
<dict>
55
<key>BuildMachineOSBuild</key>
6-
<string>11D50b</string>
6+
<string>11D50d</string>
77
<key>CFBundleDevelopmentRegion</key>
88
<string>English</string>
99
<key>CFBundleExecutable</key>
1010
<string>CCNxPlugin</string>
1111
<key>CFBundleIdentifier</key>
12-
<string>CherryTree.CCNxPlugin</string>
12+
<string>REMAP-UCLA.CCNxPlugin</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
1414
<string>6.0</string>
1515
<key>CFBundleName</key>
@@ -25,18 +25,18 @@
2525
<key>DTCompiler</key>
2626
<string>com.apple.compilers.llvm.clang.1_0</string>
2727
<key>DTPlatformBuild</key>
28-
<string>4D502</string>
28+
<string>4E2002</string>
2929
<key>DTPlatformVersion</key>
3030
<string>GM</string>
3131
<key>DTSDKBuild</key>
32-
<string>11C63</string>
32+
<string>11D50a</string>
3333
<key>DTSDKName</key>
3434
<string>macosx10.7</string>
3535
<key>DTXcode</key>
36-
<string>0421</string>
36+
<string>0432</string>
3737
<key>DTXcodeBuild</key>
38-
<string>4D502</string>
38+
<string>4E2002</string>
3939
<key>NSHumanReadableCopyright</key>
40-
<string>Copyright © 2012 UCLA. All rights reserved.</string>
40+
<string>Copyright © 2012 REMAP/UCLA. All rights reserved.</string>
4141
</dict>
4242
</plist>
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SyncTest
2+
*.a
3+
*.o
4+
*.dSYM
5+
*.dSYM/*
6+
Makefile

Assets/Plugins/CCNxPlugin.bundle/Contents/Resources/SyncSetup.txt

-5
This file was deleted.

Assets/Plugins/CCNxPlugin.bundle/Contents/Resources/crib.txt

-37
This file was deleted.
File renamed without changes.

Assets/Plugins/helloworld_bundle.bundle/Contents/Info.plist

-42
This file was deleted.
Binary file not shown.

Assets/Scenes/test.unity

11.7 KB
Binary file not shown.

Assets/Script/Control.cs

+26-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
11
using UnityEngine;
2+
using System;
23
using System.Collections;
34

5+
46
public class Control : MonoBehaviour {
57

68
public GameObject[] GemArray = new GameObject[4];
9+
public static int MaxN = -1;
10+
private static int ObjID = -1;
711

8-
9-
void OnGUI() {
10-
Event e = Event.current;
11-
if (e.type == EventType.KeyUp && e.keyCode == KeyCode.Space)
12+
void Update() {
13+
if(Sync.NewObj == true)
1214
{
13-
Vector3 pos = new Vector3(Random.Range(30, 50), 10, Random.Range(3, 18));
14-
int type = Random.Range(0, 4);
15+
// read from Sync for the new object
16+
print ("Got Object: " + Sync.NewObjInfo);
17+
// next is just instantiating... simple things...
18+
19+
Sync.NewObj = false;
20+
Sync.NewObjInfo = null;
21+
}
22+
23+
if (Input.GetKeyUp (KeyCode.Space))
24+
{
25+
Vector3 pos = new Vector3(UnityEngine.Random.Range(30, 50), 10, UnityEngine.Random.Range(3, 18));
26+
int type = UnityEngine.Random.Range(0, 4);
1527
GameObject NewGem;
1628
NewGem = Instantiate(GemArray[type], pos, Quaternion.identity) as GameObject;
17-
}
18-
29+
30+
ObjID++;
31+
MaxN++;
32+
System.String name = Sync.prefix + "/" + ObjID;
33+
System.String content = "" + pos.x + "," + pos.y + "," + pos.z;
34+
print ("Writing " + name + " to repo: " + content);
35+
CCN.WriteToRepo(name, content);
36+
}
1937
}
2038
}

0 commit comments

Comments
 (0)