forked from guigomesa/ScrapyTibiaCSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Project to all people (:
- Loading branch information
Showing
98 changed files
with
3,779 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.dockerignore | ||
.env | ||
.git | ||
.gitignore | ||
.vs | ||
.vscode | ||
*/bin | ||
*/obj | ||
**/.toolstarget |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
Oops, something went wrong.