Skip to content

Commit

Permalink
Complete Work (#1)
Browse files Browse the repository at this point in the history
* Changed to UnityWebRequest

Now we know that the problem might be around the service controller, or
the server itself. (The body of request got discarded)

* Finish Work

Changed to UnityWebRequest with POST method and proper data model.

Cleaned up and polished the server-side code

* Finish Work

Cleaned up the unused projects in the solution.
  • Loading branch information
Wasenshi123 authored Aug 22, 2016
1 parent cc272dd commit 94f145d
Show file tree
Hide file tree
Showing 29 changed files with 8,238 additions and 21 deletions.
216 changes: 216 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
#################
## Eclipse
#################

*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml
*.pubxml
*.publishproj

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf

#############
## Windows detritus
#############

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac crap
.DS_Store


#############
## Python
#############

*.py[cod]

# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo

#Mr Developer
.mr.developer.cfg
Binary file modified FabricServer/.vs/FabricServer/v14/.suo
Binary file not shown.
6 changes: 6 additions & 0 deletions FabricServer/FabricServer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebService", "WebService\We
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0DF9FA20-E5C3-4A4F-94E2-2567BE23B585}.Debug|Any CPU.ActiveCfg = Debug|x64
{0DF9FA20-E5C3-4A4F-94E2-2567BE23B585}.Debug|x64.ActiveCfg = Debug|x64
{0DF9FA20-E5C3-4A4F-94E2-2567BE23B585}.Debug|x64.Build.0 = Debug|x64
{0DF9FA20-E5C3-4A4F-94E2-2567BE23B585}.Debug|x64.Deploy.0 = Debug|x64
{0DF9FA20-E5C3-4A4F-94E2-2567BE23B585}.Release|Any CPU.ActiveCfg = Release|x64
{0DF9FA20-E5C3-4A4F-94E2-2567BE23B585}.Release|x64.ActiveCfg = Release|x64
{0DF9FA20-E5C3-4A4F-94E2-2567BE23B585}.Release|x64.Build.0 = Release|x64
{0DF9FA20-E5C3-4A4F-94E2-2567BE23B585}.Release|x64.Deploy.0 = Release|x64
{4F103F42-61F4-4BD6-B4F0-250DCF11B563}.Debug|Any CPU.ActiveCfg = Debug|x64
{4F103F42-61F4-4BD6-B4F0-250DCF11B563}.Debug|x64.ActiveCfg = Debug|x64
{4F103F42-61F4-4BD6-B4F0-250DCF11B563}.Debug|x64.Build.0 = Debug|x64
{4F103F42-61F4-4BD6-B4F0-250DCF11B563}.Release|Any CPU.ActiveCfg = Release|x64
{4F103F42-61F4-4BD6-B4F0-250DCF11B563}.Release|x64.ActiveCfg = Release|x64
{4F103F42-61F4-4BD6-B4F0-250DCF11B563}.Release|x64.Build.0 = Release|x64
EndGlobalSection
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
26 changes: 19 additions & 7 deletions FabricServer/WebService/Controllers/MessageController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;

Expand All @@ -9,19 +11,29 @@ public class MessageController : ApiController
[HttpGet]
public string Msg(string msg)
{
if (string.IsNullOrEmpty(msg))
{
ServiceEventSource.Current.Message("A client has sent a corrupted message.");
return "You are doing something wrong! specify a proper message!";
}
ServiceEventSource.Current.Message("A client has sent a message: " + msg);
return "You have said : '" + msg + "' to the server!";
}
[HttpPost]
public async Task<string> PostMsg([FromBody]string msg)
public string PostMsg([FromBody]PostData data)
{
ServiceEventSource.Current.Message("request detail: \n" + Request);
string content = await Request.Content.ReadAsStringAsync();
ServiceEventSource.Current.Message("body: " + content);

if (data == null || string.IsNullOrEmpty(data.msg))
{
ServiceEventSource.Current.Message("A client has sent a corrupted message.");
return "You are doing something wrong! specify a proper message!";
}
ServiceEventSource.Current.Message("A client has sent a message: " + data.msg);
return "You have said : '" + data.msg + "' to the server!";
}

ServiceEventSource.Current.Message("A client has sent a message: " + msg);
return "You have said : '" + msg + "' to the server!";
public class PostData
{
public string msg;
}
}
}
2 changes: 1 addition & 1 deletion FabricServer/WebService/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static void ConfigureApp(IAppBuilder appBuilder)
config.Routes.MapHttpRoute(
name: "Recieve String",
routeTemplate: "msg:{msg}",
defaults: new { controller = "message" }
defaults: new { controller = "message"}
);

appBuilder.UseWebApi(config);
Expand Down
Binary file modified FabricServer/WebService/bin/x64/Debug/WebService.exe
Binary file not shown.
Binary file modified FabricServer/WebService/bin/x64/Debug/WebService.pdb
Binary file not shown.
Binary file not shown.
Binary file modified FabricServer/WebService/obj/x64/Debug/WebService.exe
Binary file not shown.
Binary file modified FabricServer/WebService/obj/x64/Debug/WebService.pdb
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 94f145d

Please sign in to comment.