Skip to content

Commit

Permalink
Public project
Browse files Browse the repository at this point in the history
Project to all people (:
  • Loading branch information
guigomesa committed Mar 19, 2020
1 parent 594abf5 commit 66c0ba1
Show file tree
Hide file tree
Showing 98 changed files with 3,779 additions and 45 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.dockerignore
.env
.git
.gitignore
.vs
.vscode
*/bin
*/obj
**/.toolstarget
60 changes: 15 additions & 45 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
Expand All @@ -13,23 +12,17 @@
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Mono auto generated files
mono_crash.*

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/

# Visual Studio 2015/2017 cache/options directory
.vs/
Expand All @@ -43,10 +36,9 @@ Generated\ Files/
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUnit
# NUNIT
*.VisualState.xml
TestResult.xml
nunit-*.xml

# Build Results of an ATL Project
[Dd]ebugPS/
Expand All @@ -60,21 +52,20 @@ BenchmarkDotNet.Artifacts/
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

# StyleCop
StyleCopReport.xml

# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*_i.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
Expand All @@ -84,7 +75,6 @@ StyleCopReport.xml
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
Expand Down Expand Up @@ -127,6 +117,9 @@ _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

Expand Down Expand Up @@ -184,8 +177,6 @@ PublishScripts/

# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
Expand All @@ -210,14 +201,12 @@ BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
!*.[Cc]ache/

# Others
ClientBin/
Expand All @@ -230,7 +219,7 @@ ClientBin/
*.publishsettings
orleans.codegen.cs

# Including strong name files can present a security risk
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk

Expand All @@ -249,7 +238,6 @@ Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak

# SQL Server files
*.mdf
Expand All @@ -260,10 +248,6 @@ ServiceFabricBackup/
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl

# Microsoft Fakes
FakesAssemblies/
Expand Down Expand Up @@ -299,8 +283,12 @@ paket-files/
# FAKE - F# Make
.fake/

# CodeRush personal settings
.cr/personal
# JetBrains Rider
.idea/
*.sln.iml

# CodeRush
.cr/

# Python Tools for Visual Studio (PTVS)
__pycache__/
Expand All @@ -325,26 +313,8 @@ __pycache__/
# OpenCover UI analysis results
OpenCover/

# Azure Stream Analytics local run output
# Azure Stream Analytics local run output
ASALocalRun/

# MSBuild Binary and Structured Log
*.binlog

# NVidia Nsight GPU debugger configuration file
*.nvuser

# MFractors (Xamarin productivity tool) working folder
.mfractor/

# Local History for Visual Studio
.localhistory/

# BeatPulse healthcheck temp database
healthchecksdb

# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/
47 changes: 47 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/TibiaApi/bin/Debug/netcoreapp2.1/TibiaApi.Web.dll",
"args": [],
"cwd": "${workspaceFolder}/TibiaApi",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart",
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open",
"args": "http://localhost:5000/swagger"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
19 changes: 19 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/TibiaApi.sln"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,5 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

end
19 changes: 19 additions & 0 deletions Tibia.Comum/Constantes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TibiaApi.Comum
{
public static class Constantes
{

public static class FilasConstantes
{
public const string DEFAULT = "default";
public const string PLAYER_SCRAPY = "player_scrapy";
public const string WORLD_SCRAPY = "world_scrapy";
public const string WORLD_SERVICE = "world_service";
public const string PLAYER_SERVICE = "player_service";
}
}
}
25 changes: 25 additions & 0 deletions Tibia.Comum/Extensions/DateTimeExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Globalization;

namespace TibiaApi.Comum.Extensions
{
public static class DateTimeExtensions
{
public static string[] TibiaFormatDate = new[]
{
"MMM dd yyyy, HH:mm:ss CEST",
"MMM dd yyyy, HH:mm:ss CET"
};


public static DateTime ConvertDateFromSite(string dataStr)
{
if (DateTime.TryParseExact(dataStr, TibiaFormatDate, CultureInfo.InvariantCulture, DateTimeStyles.None, out var retorno))
{
return retorno;
}

return DateTime.MinValue;
}
}
}
50 changes: 50 additions & 0 deletions Tibia.Comum/Extensions/EnumExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using TibiaApi.Comum.Utils;

namespace TibiaApi.Comum.Extensions
{
public static class EnumExtensions
{
public static PvpType PvpSite(string pvp)
{
switch (pvp.ToLower())
{
case ("open pvp"):
return PvpType.OpenPvp;
case "optional pvp":
return PvpType.OptionalPvp;
case "retro open pvp":
return PvpType.RetroOpenPvp;
case "retro hardcore pvp":
return PvpType.RetroHardCorePvp;
case "hardcore pvp":
return PvpType.HardCorePvp; ;
default:
return PvpType.Undefined;
}
}
public static Profession ProfessionSite(string profession)
{
switch (profession.ToLower())
{
case "knight":
return Profession.Knight;
case "druid":
return Profession.Druid;
case "paladin":
return Profession.Paladin;
case "sorcerer":
return Profession.Sorcerer;
case "elite knight":
return Profession.EliteKnight;
case "elder druid":
return Profession.ElderDruid;
case "royal paladin":
return Profession.RoyalPaladin;
case "master sorcerer":
return Profession.MasterSorcerer;
default:
return Profession.Undefined;
}
}
}
}
19 changes: 19 additions & 0 deletions Tibia.Comum/Extensions/LinqExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TibiaApi.Comum.Extensions
{
public static class LinqExtensions
{
public static IEnumerable<IEnumerable<T>> Chunk<T>(this IEnumerable<T> source, int chunksize)
{
while (source.Any())
{
yield return source.Take(chunksize);
source = source.Skip(chunksize);
}
}
}
}
8 changes: 8 additions & 0 deletions Tibia.Comum/ScrapyModels/AchievmentPlayerScrapy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace TibiaApi.Comum.ScrapyModels
{
public class AchievmentPlayerScrapy : BasicScrapy
{
public int Star { get; set; }
public string AchievementName { get; set; }
}
}
Loading

0 comments on commit 66c0ba1

Please sign in to comment.