initial commit

This commit is contained in:
hondacrx
2017-06-19 17:30:18 -04:00
commit 6e265ea24b
763 changed files with 488824 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
+159
View File
@@ -0,0 +1,159 @@
## 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/
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
UnitTestResults.html
*_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 Studio cache files
*.sln.ide/
# 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
# NuGet Packages Directory
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
#LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
# =========================
# Windows detritus
# =========================
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac desktop service store files
.DS_Store
+242
View File
@@ -0,0 +1,242 @@
###################################################################################################
# Cypher BNet Server Configuration File #
###################################################################################################
###################################################################################################
# BNet SERVER SETTINGS
#
# LogsDir
# Description: Logs directory setting.
# Important: LogsDir needs to be quoted, as the string might contain space characters.
# Logs directory must exists, or log file creation will be disabled.
# Default: "" - (Log files will be stored in the current path)
LogsDir = "./Logs"
#
# BattlenetPort
# Description: TCP port to reach the auth server for battle.net connections.
# Default: 1119
BattlenetPort = 1119
#
# LoginREST.Port
# Description: TCP port to reach the REST login method.
# Default: 8081
#
# LoginREST.ExternalAddress
# Description: IP address sent to clients connecting from outside the network where bnetserver runs
#
# LoginREST.LocalAddress
# Description: IP address sent to clients connecting from inside the network where bnetserver runs
#
LoginREST.Port = 8081
LoginREST.ExternalAddress=127.0.0.1
LoginREST.LocalAddress=127.0.0.1
#
# BindIP
# Description: Bind auth server to IP/hostname
# Default: "0.0.0.0" - (Bind to all IPs on the system)
BindIP = "0.0.0.0"
#
# RealmsStateUpdateDelay
# Description: Time (in seconds) between realm list updates.
# Default: 10
# 0 - (Disabled)
RealmsStateUpdateDelay = 10
#
# WrongPass.MaxCount
# Description: Number of login attemps with wrong password before the account or IP will be
# banned.
# Default: 0 - (Disabled)
# 1+ - (Enabled)
WrongPass.MaxCount = 0
#
# WrongPass.BanTime
# Description: Time (in seconds) for banning account or IP for invalid login attempts.
# Default: 600 - (10 minutes)
# 0 - (Permanent ban)
WrongPass.BanTime = 600
#
# WrongPass.BanType
# Description: Ban type for invalid login attempts.
# Default: 0 - (Ban IP)
# 1 - (Ban Account)
WrongPass.BanType = 0
#
###################################################################################################
###################################################################################################
# MYSQL SETTINGS
#
# LoginDatabaseInfo
# Description: Database connection settings for the realm server.
# Example: "hostname;port;username;password;database"
# ".;somenumber;username;password;database" - (Use named pipes on Windows
# "enable-named-pipe" to [mysqld]
# section my.ini)
# ".;/path/to/unix_socket;username;password;database" - (use Unix sockets on
# Unix/Linux)
# Default: "127.0.0.1;3306;cypher;cypher;auth"
LoginDatabaseInfo = "127.0.0.1;3306;username;password;auth"
#
# DBQueryWorkerInterval
# Description: Time (milliseconds) for Query Task Worker interval.
# Default: 1000
DBQueryWorkerInterval = 1000
#
###################################################################################################
###################################################################################################
# UPDATE SETTINGS
#
# Updates.EnableDatabases
# Description: A mask that describes which databases shall be updated.
#
# Following flags are available
# DATABASE_LOGIN = 1, // Auth database
#
# Default: 0 - (All Disabled)
# 1 - (All Enabled)
Updates.EnableDatabases = 0
#
# Updates.SourcePath
# Description: The path to your CypherCore source directory.
# If the path is left empty, built-in CMAKE_SOURCE_DIR is used.
# Example: "../CypherCore"
# Default: ""
Updates.SourcePath = ""
#
# Updates.AutoSetup
# Description: Auto populate empty databases.
# Default: 1 - (Enabled)
# 0 - (Disabled)
Updates.AutoSetup = 1
#
# Updates.Redundancy
# Description: Perform data redundancy checks through hashing
# to detect changes on sql updates and reapply it.
# Default: 1 - (Enabled)
# 0 - (Disabled)
Updates.Redundancy = 1
#
# Updates.ArchivedRedundancy
# Description: Check hashes of archived updates (slows down startup).
# Default: 0 - (Disabled)
# 1 - (Enabled)
Updates.ArchivedRedundancy = 0
#
# Updates.AllowRehash
# Description: Inserts the current file hash in the database if it is left empty.
# Useful if you want to mark a file as applied but you don't know its hash.
# Default: 1 - (Enabled)
# 0 - (Disabled)
Updates.AllowRehash = 1
#
# Updates.CleanDeadRefMaxCount
# Description: Cleans dead/ orphaned references that occur if an update was removed or renamed and edited in one step.
# It only starts the clean up if the count of the missing updates is below or equal the Updates.CleanDeadRefMaxCount value.
# This way prevents erasing of the update history due to wrong source directory state (maybe wrong branch or bad revision).
# Disable this if you want to know if the database is in a possible "dirty state".
# Default: 3 - (Enabled)
# 0 - (Disabled)
# -1 - (Enabled - unlimited)
Updates.CleanDeadRefMaxCount = 3
#
###################################################################################################
###################################################################################################
#
# LOGGING SYSTEM SETTINGS
#
# Appender config values: Given a appender "name"
# Appender.name
# Description: Defines 'where to log'
# Format: Type,LogLevel,Flags,optional1,optional2,optional3
#
# Type
# 0 - (None)
# 1 - (Console)
# 2 - (File)
# 3 - (DB)
#
# LogLevel
# 0 - (Disabled)
# 1 - (Trace)
# 2 - (Debug)
# 3 - (Info)
# 4 - (Warn)
# 5 - (Error)
# 6 - (Fatal)
#
# Flags:
# 0 - None
# 1 - Prefix Timestamp to the text
# 2 - Prefix Log Level to the text
# 4 - Prefix Log Filter type to the text
#
# File: Name of the file (read as optional1 if Type = File)
# Allows to use one "{0}" to create dynamic files
#
Appender.Console=1,2,0
Appender.Bnet=2,2,0,Bnet.log
# Logger config values: Given a logger "name"
# Logger.name
# Description: Defines 'What to log'
# Format: LogLevel,AppenderList
#
# LogLevel
# 0 - (Disabled)
# 1 - (Trace)
# 2 - (Debug)
# 3 - (Info)
# 4 - (Warn)
# 5 - (Error)
# 6 - (Fatal)
#
# AppenderList: List of appenders linked to logger
# (Using spaces as separator).
#
Logger.Server=3,Console Bnet
Logger.Realmlist=3,Console Bnet
Logger.Session=3,Console Bnet
Logger.Network=3,Console Bnet
Logger.SqlUpdates=3,Console Bnet
Logger.ServiceProtobuf=2,Console Bnet
#
###################################################################################################
+168
View File
@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{668E1664-FB63-47DA-9EA1-93B59851BF1E}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BNetServer</RootNamespace>
<AssemblyName>BNetServer</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup>
<StartupObject>BNetServer.Server</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Red.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\Build\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\Build\Debug\</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\Build\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup />
<PropertyGroup>
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>7EA13AA3A2003652283599344471651FF1C1100A</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>BNetServer_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<ItemGroup>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Libs\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Runtime.Serialization.Formatters.Soap" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Managers\SessionManager.cs" />
<Compile Include="Networking\RestSession.cs" />
<Compile Include="Managers\Global.cs" />
<Compile Include="Networking\Session.cs" />
<Compile Include="Server.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\AccountService.cs" />
<Compile Include="Services\AuthenticationService.cs" />
<Compile Include="Services\ChallengeService.cs" />
<Compile Include="Services\ChannelService.cs" />
<Compile Include="Services\ConnectionService.cs" />
<Compile Include="Services\FriendService.cs" />
<Compile Include="Services\GameUtilitiesService.cs" />
<Compile Include="Services\PresenceService.cs" />
<Compile Include="Services\ReportService.cs" />
<Compile Include="Services\ResourcesService.cs" />
<Compile Include="Services\ServiceDispatcher.cs" />
<Compile Include="Services\UserManagerService.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Red.ico" />
</ItemGroup>
<ItemGroup>
<None Include="BNetServer.conf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Framework\Framework.csproj">
<Project>{82d442a9-18c0-4c59-8ec6-0dfe3e34d334}</Project>
<Name>Framework</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
+28
View File
@@ -0,0 +1,28 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using BNetServer.Services;
namespace BNetServer
{
public static class Global
{
public static RealmManager RealmMgr { get { return RealmManager.Instance; } }
public static SessionManager SessionMgr { get { return SessionManager.Instance; } }
public static ServiceDispatcher ServiceDispatcher { get { return ServiceDispatcher.Instance; } }
}
}
+164
View File
@@ -0,0 +1,164 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using BNetServer.Networking;
using Framework.Configuration;
using Framework.Rest;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
namespace BNetServer
{
public class SessionManager : Singleton<SessionManager>
{
SessionManager()
{
_formInputs = new FormInputs();
}
public bool Initialize()
{
int _port = ConfigMgr.GetDefaultValue("LoginREST.Port", 8081);
if (_port < 0 || _port > 0xFFFF)
{
Log.outError(LogFilter.Network, "Specified login service port ({0}) out of allowed range (1-65535), defaulting to 8081", _port);
_port = 8081;
}
string configuredAddress = ConfigMgr.GetDefaultValue("LoginREST.ExternalAddress", "127.0.0.1");
IPAddress address;
if (!IPAddress.TryParse(configuredAddress, out address))
{
Log.outError(LogFilter.Network, "Could not resolve LoginREST.ExternalAddress {0}", configuredAddress);
return false;
}
_externalAddress = new IPEndPoint(address, _port);
configuredAddress = ConfigMgr.GetDefaultValue("LoginREST.LocalAddress", "127.0.0.1");
if (!IPAddress.TryParse(configuredAddress, out address))
{
Log.outError(LogFilter.Network, "Could not resolve LoginREST.ExternalAddress {0}", configuredAddress);
return false;
}
_localAddress = new IPEndPoint(address, _port);
// set up form inputs
_formInputs.Type = "LOGIN_FORM";
var input = new FormInput();
input.Id = "account_name";
input.Type = "text";
input.Label = "E-mail";
input.MaxLength = 320;
_formInputs.Inputs.Add(input);
input = new FormInput();
input.Id = "password";
input.Type = "password";
input.Label = "Password";
input.MaxLength = 16;
_formInputs.Inputs.Add(input);
input = new FormInput();
input.Id = "log_in_submit";
input.Type = "submit";
input.Label = "Log In";
_formInputs.Inputs.Add(input);
_loginTicketCleanupTimer = new Timer(CleanupLoginTickets);
_loginTicketCleanupTimer.Change(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10));
_certificate = new X509Certificate2("BNetServer.pfx");
return true;
}
public IPEndPoint GetAddressForClient(IPAddress address)
{
if (IPAddress.IsLoopback(address))
return _localAddress;
return _externalAddress;
}
public FormInputs GetFormInput()
{
return _formInputs;
}
public X509Certificate2 GetCertificate()
{
return _certificate;
}
public void AddLoginTicket(string id, AccountInfo accountInfo)
{
_validLoginTickets[id] = new LoginTicket() { Id = id, Account = accountInfo, ExpiryTime = Time.UnixTime + 10 };
}
public AccountInfo VerifyLoginTicket(string id)
{
var accountInfo = _validLoginTickets.LookupByKey(id);
if (accountInfo != null)
{
if (accountInfo.ExpiryTime > Time.UnixTime)
{
_validLoginTickets.Remove(id);
return accountInfo.Account;
}
}
return new AccountInfo();
}
public void CleanupLoginTickets(object state)
{
long now = Time.UnixTime;
foreach (var pair in _validLoginTickets.ToList())
{
if (pair.Value.ExpiryTime < now)
_validLoginTickets.Remove(pair.Key);
}
}
FormInputs _formInputs;
IPEndPoint _externalAddress;
IPEndPoint _localAddress;
Dictionary<string, LoginTicket> _validLoginTickets = new Dictionary<string, LoginTicket>();
Timer _loginTicketCleanupTimer;
X509Certificate2 _certificate;
}
class LoginTicket
{
public string Id;
public AccountInfo Account;
public long ExpiryTime;
}
public enum BanMode
{
Ip = 0,
Account = 1
}
}
+215
View File
@@ -0,0 +1,215 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Configuration;
using Framework.Database;
using Framework.Networking;
using Framework.Rest;
using Framework.Serialization;
using Framework.Web;
using System;
using System.Net.Sockets;
using System.Security.Cryptography;
using System.Text;
namespace BNetServer.Networking
{
public class RestSession : SSLSocket
{
public RestSession(Socket socket) : base(socket) { }
public override void Start()
{
AsyncHandshake(Global.SessionMgr.GetCertificate());
}
public override void ReadHandler(int transferredBytes)
{
var httpRequest = HttpHelper.ParseRequest(GetReceiveBuffer(), transferredBytes);
if (httpRequest == null)
return;
switch (httpRequest.Method)
{
case "GET":
default:
HandleConnectRequest(httpRequest);
break;
case "POST":
HandleLoginRequest(httpRequest);
return;
}
AsyncRead();
}
public void HandleConnectRequest(HttpHeader request)
{
// Login form is the same for all clients...
SendResponse(HttpCode.Ok, Global.SessionMgr.GetFormInput());
}
public void HandleLoginRequest(HttpHeader request)
{
LogonData loginForm = Json.CreateObject<LogonData>(request.Content);
LogonResult loginResult = new LogonResult();
if (loginForm == null)
{
loginResult.AuthenticationState = "LOGIN";
loginResult.ErrorCode = "UNABLE_TO_DECODE";
loginResult.ErrorMessage = "There was an internal error while connecting to Battle.net. Please try again later.";
SendResponse(HttpCode.BadRequest, loginResult);
return;
}
string login = "";
string password = "";
for (int i = 0; i < loginForm.Inputs.Count; ++i)
{
switch (loginForm.Inputs[i].Id)
{
case "account_name":
login = loginForm.Inputs[i].Value;
break;
case "password":
password = loginForm.Inputs[i].Value;
break;
}
}
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_ACCOUNT_INFO);
stmt.AddValue(0, login);
SQLResult result = DB.Login.Query(stmt);
if (result.IsEmpty())
{
loginResult.AuthenticationState = "LOGIN";
loginResult.ErrorCode = "UNABLE_TO_DECODE";
loginResult.ErrorMessage = "There was an internal error while connecting to Battle.net. Please try again later.";
SendResponse(HttpCode.BadRequest, loginResult);
return;
}
string pass_hash = result.Read<string>(13);
var accountInfo = new AccountInfo();
accountInfo.LoadResult(result);
if (CalculateShaPassHash(login, password) == pass_hash)
{
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_CHARACTER_COUNTS_BY_BNET_ID);
stmt.AddValue(0, accountInfo.Id);
SQLResult characterCountsResult = DB.Login.Query(stmt);
if (!characterCountsResult.IsEmpty())
{
do
{
accountInfo.GameAccounts[characterCountsResult.Read<uint>(0)]
.CharacterCounts[new RealmHandle(characterCountsResult.Read<byte>(3), characterCountsResult.Read<byte>(4), characterCountsResult.Read<uint>(2)).GetAddress()] = characterCountsResult.Read<byte>(1);
} while (characterCountsResult.NextRow());
}
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_BNET_LAST_PLAYER_CHARACTERS);
stmt.AddValue(0, accountInfo.Id);
SQLResult lastPlayerCharactersResult = DB.Login.Query(stmt);
if (!lastPlayerCharactersResult.IsEmpty())
{
RealmHandle realmId = new RealmHandle(lastPlayerCharactersResult.Read<byte>(1), lastPlayerCharactersResult.Read<byte>(2), lastPlayerCharactersResult.Read<uint>(3));
LastPlayedCharacterInfo lastPlayedCharacter = new LastPlayedCharacterInfo();
lastPlayedCharacter.RealmId = realmId;
lastPlayedCharacter.CharacterName = lastPlayerCharactersResult.Read<string>(4);
lastPlayedCharacter.CharacterGUID = lastPlayerCharactersResult.Read<ulong>(5);
lastPlayedCharacter.LastPlayedTime = lastPlayerCharactersResult.Read<uint>(6);
accountInfo.GameAccounts[lastPlayerCharactersResult.Read<uint>(0)].LastPlayedCharacters[realmId.GetSubRegionAddress()] = lastPlayedCharacter;
}
byte[] ticket = new byte[0].GenerateRandomKey(20);
loginResult.LoginTicket = "TC-" + ticket.ToHexString();
Global.SessionMgr.AddLoginTicket(loginResult.LoginTicket, accountInfo);
}
else if (!accountInfo.IsBanned)
{
uint maxWrongPassword = ConfigMgr.GetDefaultValue("WrongPass.MaxCount", 0u);
if (ConfigMgr.GetDefaultValue("WrongPass.Logging", false))
Log.outDebug(LogFilter.Network, "[{0}, Account {1}, Id {2}] Attempted to connect with wrong password!", request.Host, login, accountInfo.Id);
if (maxWrongPassword != 0)
{
SQLTransaction trans = new SQLTransaction();
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_BNET_FAILED_LOGINS);
stmt.AddValue(0, accountInfo.Id);
trans.Append(stmt);
++accountInfo.FailedLogins;
Log.outDebug(LogFilter.Network, "MaxWrongPass : {0}, failed_login : {1}", maxWrongPassword, accountInfo.Id);
if (accountInfo.FailedLogins >= maxWrongPassword)
{
BanMode banType = ConfigMgr.GetDefaultValue("WrongPass.BanType", BanMode.Ip);
int banTime = ConfigMgr.GetDefaultValue("WrongPass.BanTime", 600);
if (banType == BanMode.Account)
{
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_BNET_ACCOUNT_AUTO_BANNED);
stmt.AddValue(0, accountInfo.Id);
}
else
{
stmt = DB.Login.GetPreparedStatement(LoginStatements.INS_IP_AUTO_BANNED);
stmt.AddValue(0, request.Host);
}
stmt.AddValue(1, banTime);
trans.Append(stmt);
stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_BNET_RESET_FAILED_LOGINS);
stmt.AddValue(0, accountInfo.Id);
trans.Append(stmt);
}
DB.Login.CommitTransaction(trans);
}
}
loginResult.AuthenticationState = "DONE";
SendResponse(HttpCode.Ok, loginResult);
}
void SendResponse<T>(HttpCode code, T response)
{
AsyncWrite(HttpHelper.CreateResponse(code, Json.CreateString(response)));
}
string CalculateShaPassHash(string name, string password)
{
SHA256 sha256 = SHA256.Create();
var i = sha256.ComputeHash(Encoding.UTF8.GetBytes(name));
return sha256.ComputeHash(Encoding.UTF8.GetBytes(i.ToHexString() + ":" + password)).ToHexString();
}
}
}
+661
View File
@@ -0,0 +1,661 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Bgs.Protocol;
using Bgs.Protocol.Challenge.V1;
using Framework.Constants;
using Framework.Database;
using Framework.IO;
using Framework.Networking;
using Framework.Rest;
using Framework.Serialization;
using Google.Protobuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
namespace BNetServer.Networking
{
public partial class Session : SSLSocket
{
public Session(Socket socket) : base(socket)
{
_accountInfo = new AccountInfo();
ClientRequestHandlers.Add("Command_RealmListTicketRequest_v1_b9", GetRealmListTicket);
ClientRequestHandlers.Add("Command_LastCharPlayedRequest_v1_b9", GetLastCharPlayed);
ClientRequestHandlers.Add("Command_RealmListRequest_v1_b9", GetRealmList);
ClientRequestHandlers.Add("Command_RealmJoinRequest_v1_b9", JoinRealm);
}
public override void Start()
{
string ip_address = GetRemoteIpAddress().ToString();
Log.outTrace(LogFilter.Session, "{0} Accepted connection", GetClientInfo());
// Verify that this IP is not in the ip_banned table
DB.Login.Execute(DB.Login.GetPreparedStatement(LoginStatements.DEL_EXPIRED_IP_BANS));
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_IP_INFO);
stmt.AddValue(0, ip_address);
stmt.AddValue(1, BitConverter.ToUInt32(GetRemoteIpAddress().GetAddressBytes(), 0));
_queryProcessor.AddQuery(DB.Login.AsyncQuery(stmt).WithCallback(CheckIpCallback));
}
void CheckIpCallback(SQLResult result)
{
if (!result.IsEmpty())
{
bool banned = false;
do
{
if (result.Read<ulong>(0) != 0)
banned = true;
if (!string.IsNullOrEmpty(result.Read<string>(1)))
_ipCountry = result.Read<string>(1);
} while (result.NextRow());
if (banned)
{
Log.outDebug(LogFilter.Session, "{0} tries to log in using banned IP!", GetClientInfo());
CloseSocket();
return;
}
}
AsyncHandshake(Global.SessionMgr.GetCertificate());
}
public override bool Update()
{
if (!base.Update())
return false;
_queryProcessor.ProcessReadyQueries();
return true;
}
public override void ReadHandler(int transferredBytes)
{
if (!IsOpen())
return;
var stream = new CodedInputStream(GetReceiveBuffer(), 0, transferredBytes);
while (!stream.IsAtEnd)
{
var header = new Header();
stream.ReadMessage(header);
if (header.ServiceId != 0xFE)
{
Global.ServiceDispatcher.Dispatch(this, header.ServiceHash, header.Token, header.MethodId, stream);
}
else
{
var handler = _responseCallbacks.LookupByKey(header.Token);
if (handler != null)
{
handler(stream);
_responseCallbacks.Remove(header.Token);
}
}
}
AsyncRead();
}
void AsyncWrite(ByteBuffer packet)
{
if (!IsOpen())
return;
AsyncWrite(packet.GetData());
}
public void SendResponse(uint token, IMessage response)
{
Header header = new Header();
header.Token = token;
header.ServiceId = 0xFE;
header.Size = (uint)response.CalculateSize();
var headerSizeBytes = BitConverter.GetBytes((ushort)header.CalculateSize());
Array.Reverse(headerSizeBytes);
ByteBuffer packet = new ByteBuffer();
packet.WriteBytes(headerSizeBytes, 2);
packet.WriteBytes(header.ToByteArray());
packet.WriteBytes(response.ToByteArray());
AsyncWrite(packet.GetData());
}
public void SendResponse(uint token, BattlenetRpcErrorCode status)
{
Header header = new Header();
header.Token = token;
header.Status = (uint)status;
header.ServiceId = 0xFE;
var headerSizeBytes = BitConverter.GetBytes((ushort)header.CalculateSize());
Array.Reverse(headerSizeBytes);
ByteBuffer packet = new ByteBuffer();
packet.WriteBytes(headerSizeBytes, 2);
packet.WriteBytes(header.ToByteArray());
AsyncWrite(packet);
}
public void SendRequest(uint serviceHash, uint methodId, IMessage request, Action<CodedInputStream> callback)
{
_responseCallbacks[_requestToken] = callback;
SendRequest(serviceHash, methodId, request);
}
public void SendRequest(uint serviceHash, uint methodId, IMessage request)
{
Header header = new Header();
header.ServiceId = 0;
header.ServiceHash = serviceHash;
header.MethodId = methodId;
header.Size = (uint)request.CalculateSize();
header.Token = _requestToken++;
var headerSizeBytes = BitConverter.GetBytes((ushort)header.CalculateSize());
Array.Reverse(headerSizeBytes);
ByteBuffer packet = new ByteBuffer();
packet.WriteBytes(headerSizeBytes, 2);
packet.WriteBytes(header.ToByteArray());
packet.WriteBytes(request.ToByteArray());
AsyncWrite(packet);
}
public BattlenetRpcErrorCode HandleLogon(Bgs.Protocol.Authentication.V1.LogonRequest logonRequest)
{
if (logonRequest.Program != "WoW")
{
Log.outDebug(LogFilter.Session, "Battlenet.LogonRequest: {0} attempted to log in with game other than WoW (using {1})!", GetClientInfo(), logonRequest.Program);
return BattlenetRpcErrorCode.BadProgram;
}
if (logonRequest.Platform != "Win" && logonRequest.Platform != "Wn64" && logonRequest.Platform != "Mc64")
{
Log.outDebug(LogFilter.Session, "Battlenet.LogonRequest: {0} attempted to log in from an unsupported platform (using {1})!", GetClientInfo(), logonRequest.Platform);
return BattlenetRpcErrorCode.BadPlatform;
}
if (logonRequest.Locale.ToEnum<LocaleConstant>() == LocaleConstant.enUS && logonRequest.Locale != "enUS")
{
Log.outDebug(LogFilter.Session, "Battlenet.LogonRequest: {0} attempted to log in with unsupported locale (using {1})!", GetClientInfo(), logonRequest.Locale);
return BattlenetRpcErrorCode.BadLocale;
}
_locale = logonRequest.Locale;
_os = logonRequest.Platform;
var endpoint = Global.SessionMgr.GetAddressForClient(GetRemoteIpAddress());
ChallengeExternalRequest externalChallenge = new ChallengeExternalRequest();
externalChallenge.PayloadType = "web_auth_url";
externalChallenge.Payload = ByteString.CopyFromUtf8(string.Format("https://{0}:{1}/bnetserver/login/", endpoint.Address, endpoint.Port));
SendRequest((uint)OriginalHash.ChallengeListener, 3, externalChallenge);
return BattlenetRpcErrorCode.Ok;
}
public BattlenetRpcErrorCode HandleVerifyWebCredentials(Bgs.Protocol.Authentication.V1.VerifyWebCredentialsRequest verifyWebCredentialsRequest)
{
Bgs.Protocol.Authentication.V1.LogonResult logonResult = new Bgs.Protocol.Authentication.V1.LogonResult();
logonResult.ErrorCode = 0;
_accountInfo = Global.SessionMgr.VerifyLoginTicket(verifyWebCredentialsRequest.WebCredentials.ToStringUtf8());
if (_accountInfo == null)
return BattlenetRpcErrorCode.Denied;
string ip_address = GetRemoteIpAddress().ToString();
// If the IP is 'locked', check that the player comes indeed from the correct IP address
if (_accountInfo.IsLockedToIP)
{
Log.outDebug(LogFilter.Session, "Session.HandleVerifyWebCredentials: Account '{0}' is locked to IP - '{1}' is logging in from '{2}'",
_accountInfo.Login, _accountInfo.LastIP, ip_address);
if (_accountInfo.LastIP != ip_address)
return BattlenetRpcErrorCode.RiskAccountLocked;
}
else
{
Log.outDebug(LogFilter.Session, "Session.HandleVerifyWebCredentials: Account '{0}' is not locked to ip", _accountInfo.Login);
if (_accountInfo.LockCountry.IsEmpty() || _accountInfo.LockCountry == "00")
Log.outDebug(LogFilter.Session, "Session.HandleVerifyWebCredentials: Account '{0}' is not locked to country", _accountInfo.Login);
else if (!_accountInfo.LockCountry.IsEmpty() && !_ipCountry.IsEmpty())
{
Log.outDebug(LogFilter.Session, "Session.HandleVerifyWebCredentials: Account '{0}' is locked to country: '{1}' Player country is '{2}'",
_accountInfo.Login, _accountInfo.LockCountry, _ipCountry);
if (_ipCountry != _accountInfo.LockCountry)
return BattlenetRpcErrorCode.RiskAccountLocked;
}
}
// If the account is banned, reject the logon attempt
if (_accountInfo.IsBanned)
{
if (_accountInfo.IsPermanenetlyBanned)
{
Log.outDebug(LogFilter.Session, "{0} Session.HandleVerifyWebCredentials: Banned account {1} tried to login!", GetClientInfo(), _accountInfo.Login);
return BattlenetRpcErrorCode.GameAccountBanned;
}
else
{
Log.outDebug(LogFilter.Session, "{0} Session.HandleVerifyWebCredentials: Temporarily banned account {1} tried to login!", GetClientInfo(), _accountInfo.Login);
return BattlenetRpcErrorCode.GameAccountSuspended;
}
}
logonResult.AccountId = new EntityId();
logonResult.AccountId.Low = _accountInfo.Id;
logonResult.AccountId.High = 0x100000000000000;
foreach (var pair in _accountInfo.GameAccounts)
{
if (!pair.Value.IsBanned)
{
EntityId gameAccountId = new EntityId();
gameAccountId.Low = pair.Value.Id;
gameAccountId.High = 0x200000200576F57;
logonResult.GameAccountId.Add(gameAccountId);
}
}
if (!_ipCountry.IsEmpty())
logonResult.GeoipCountry = _ipCountry;
logonResult.SessionKey = ByteString.CopyFrom(new byte[64].GenerateRandomKey(64));
_authed = true;
SendRequest((uint)OriginalHash.AuthenticationListener, 5, logonResult);
return BattlenetRpcErrorCode.Ok;
}
public BattlenetRpcErrorCode HandleGetAccountState(Bgs.Protocol.Account.V1.GetAccountStateRequest request, Bgs.Protocol.Account.V1.GetAccountStateResponse response)
{
if (!_authed)
return BattlenetRpcErrorCode.Denied;
if (request.Options.FieldPrivacyInfo)
{
response.State = new Bgs.Protocol.Account.V1.AccountState();
response.State.PrivacyInfo = new Bgs.Protocol.Account.V1.PrivacyInfo();
response.State.PrivacyInfo.IsUsingRid = false;
response.State.PrivacyInfo.IsRealIdVisibleForViewFriends = false;
response.State.PrivacyInfo.IsHiddenFromFriendFinder = true;
response.Tags = new Bgs.Protocol.Account.V1.AccountFieldTags();
response.Tags.PrivacyInfoTag = 0xD7CA834D;
}
return BattlenetRpcErrorCode.Ok;
}
public BattlenetRpcErrorCode HandleGetGameAccountState(Bgs.Protocol.Account.V1.GetGameAccountStateRequest request, Bgs.Protocol.Account.V1.GetGameAccountStateResponse response)
{
if (!_authed)
return BattlenetRpcErrorCode.Denied;
if (request.Options.FieldGameLevelInfo)
{
var gameAccountInfo = _accountInfo.GameAccounts.LookupByKey(request.GameAccountId.Low);
if (gameAccountInfo != null)
{
response.State = new Bgs.Protocol.Account.V1.GameAccountState();
response.State.GameLevelInfo = new Bgs.Protocol.Account.V1.GameLevelInfo();
response.State.GameLevelInfo.Name = gameAccountInfo.DisplayName;
response.State.GameLevelInfo.Program = 5730135; // WoW
}
response.Tags = new Bgs.Protocol.Account.V1.GameAccountFieldTags();
response.Tags.GameLevelInfoTag = 0x5C46D483;
}
if (request.Options.FieldGameStatus)
{
if (response.State == null)
response.State = new Bgs.Protocol.Account.V1.GameAccountState();
response.State.GameStatus = new Bgs.Protocol.Account.V1.GameStatus();
var gameAccountInfo = _accountInfo.GameAccounts.LookupByKey(request.GameAccountId.Low);
if (gameAccountInfo != null)
{
response.State.GameStatus.IsSuspended = gameAccountInfo.IsBanned;
response.State.GameStatus.IsBanned = gameAccountInfo.IsPermanenetlyBanned;
}
response.State.GameStatus.Program = 5730135; // WoW
response.Tags.GameStatusTag = 0x98B75F99;
}
return BattlenetRpcErrorCode.Ok;
}
public BattlenetRpcErrorCode HandleProcessClientRequest(Bgs.Protocol.GameUtilities.V1.ClientRequest request, Bgs.Protocol.GameUtilities.V1.ClientResponse response)
{
if (!_authed)
return BattlenetRpcErrorCode.Denied;
Bgs.Protocol.Attribute command = null;
Dictionary<string, Variant> Params = new Dictionary<string, Variant>();
for (int i = 0; i < request.Attribute.Count; ++i)
{
Bgs.Protocol.Attribute attr = request.Attribute[i];
Params[attr.Name] = attr.Value;
if (attr.Name.Contains("Command_"))
command = attr;
}
if (command == null)
{
Log.outError(LogFilter.SessionRpc, "{0} sent ClientRequest with no command.", GetClientInfo());
return BattlenetRpcErrorCode.RpcMalformedRequest;
}
var handler = ClientRequestHandlers.LookupByKey(command.Name);
if (handler == null)
{
Log.outError(LogFilter.SessionRpc, "{0} sent ClientRequest with unknown command {1}.", GetClientInfo(), command.Name);
return BattlenetRpcErrorCode.RpcNotImplemented;
}
return handler(Params, response);
}
Variant GetParam(Dictionary<string, Variant> Params, string paramName)
{
return Params.LookupByKey(paramName);
}
delegate BattlenetRpcErrorCode ClientRequestHandler(Dictionary<string, Variant> Params, Bgs.Protocol.GameUtilities.V1.ClientResponse response);
BattlenetRpcErrorCode GetRealmListTicket(Dictionary<string, Variant> Params, Bgs.Protocol.GameUtilities.V1.ClientResponse response)
{
Variant identity = GetParam(Params, "Param_Identity");
if (identity != null)
{
var realmListTicketIdentity = Json.CreateObject<RealmListTicketIdentity>(identity.BlobValue.ToStringUtf8(), true);
var gameAccountInfo = _accountInfo.GameAccounts.LookupByKey(realmListTicketIdentity.GameAccountId);
if (gameAccountInfo != null)
_gameAccountInfo = gameAccountInfo;
}
if (_gameAccountInfo == null)
return BattlenetRpcErrorCode.UtilServerInvalidIdentityArgs;
Variant clientInfo = GetParam(Params, "Param_ClientInfo");
if (clientInfo != null)
{
var realmListTicketClientInformation = Json.CreateObject<RealmListTicketClientInformation>(clientInfo.BlobValue.ToStringUtf8(), true);
_build = (uint)realmListTicketClientInformation.Info.ClientVersion.Build;
_clientSecret.AddRange(realmListTicketClientInformation.Info.Secret.Select(x => Convert.ToByte(x)).ToArray());
}
if (_build == 0)
return BattlenetRpcErrorCode.WowServicesDeniedRealmListTicket;
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.UPD_BNET_LAST_LOGIN_INFO);
stmt.AddValue(0, GetRemoteIpAddress().ToString());
stmt.AddValue(1, Enum.Parse(typeof(LocaleConstant), _locale));
stmt.AddValue(2, _os);
stmt.AddValue(3, _accountInfo.Id);
DB.Login.Execute(stmt);
var attribute = new Bgs.Protocol.Attribute();
attribute.Name = "Param_RealmListTicket";
attribute.Value = new Variant();
attribute.Value.BlobValue = ByteString.CopyFrom("AuthRealmListTicket", System.Text.Encoding.UTF8);
response.Attribute.Add(attribute);
return BattlenetRpcErrorCode.Ok;
}
BattlenetRpcErrorCode GetLastCharPlayed(Dictionary<string, Variant> Params, Bgs.Protocol.GameUtilities.V1.ClientResponse response)
{
Variant subRegion = GetParam(Params, "Command_LastCharPlayedRequest_v1_b9");
if (subRegion != null)
{
var lastPlayerChar = _gameAccountInfo.LastPlayedCharacters.LookupByKey(subRegion.StringValue);
if (lastPlayerChar != null)
{
var compressed = Global.RealmMgr.GetRealmEntryJSON(lastPlayerChar.RealmId, _build);
if (compressed.Length == 0)
return BattlenetRpcErrorCode.UtilServerFailedToSerializeResponse;
var attribute = new Bgs.Protocol.Attribute();
attribute.Name = "Param_RealmEntry";
attribute.Value = new Variant();
attribute.Value.BlobValue = ByteString.CopyFrom(compressed);
response.Attribute.Add(attribute);
attribute = new Bgs.Protocol.Attribute();
attribute.Name = "Param_CharacterName";
attribute.Value = new Variant();
attribute.Value.StringValue = lastPlayerChar.CharacterName;
response.Attribute.Add(attribute);
attribute = new Bgs.Protocol.Attribute();
attribute.Name = "Param_CharacterGUID";
attribute.Value = new Variant();
attribute.Value.BlobValue = ByteString.CopyFrom(BitConverter.GetBytes(lastPlayerChar.CharacterGUID));
response.Attribute.Add(attribute);
attribute = new Bgs.Protocol.Attribute();
attribute.Name = "Param_LastPlayedTime";
attribute.Value = new Variant();
attribute.Value.IntValue = (int)lastPlayerChar.LastPlayedTime;
response.Attribute.Add(attribute);
}
return BattlenetRpcErrorCode.Ok;
}
return BattlenetRpcErrorCode.UtilServerUnknownRealm;
}
BattlenetRpcErrorCode GetRealmList(Dictionary<string, Variant> Params, Bgs.Protocol.GameUtilities.V1.ClientResponse response)
{
if (_gameAccountInfo == null)
return BattlenetRpcErrorCode.UserServerBadWowAccount;
string subRegionId = "";
Variant subRegion = GetParam(Params, "Command_RealmListRequest_v1_b9");
if (subRegion != null)
subRegionId = subRegion.StringValue;
var compressed = Global.RealmMgr.GetRealmList(_build, subRegionId);
if (compressed.Length == 0)
return BattlenetRpcErrorCode.UtilServerFailedToSerializeResponse;
var attribute = new Bgs.Protocol.Attribute();
attribute.Name = "Param_RealmList";
attribute.Value = new Variant();
attribute.Value.BlobValue = ByteString.CopyFrom(compressed);
response.Attribute.Add(attribute);
var realmCharacterCounts = new RealmCharacterCountList();
foreach (var characterCount in _gameAccountInfo.CharacterCounts)
{
var countEntry = new RealmCharacterCountEntry();
countEntry.WowRealmAddress = (int)characterCount.Key;
countEntry.Count = characterCount.Value;
realmCharacterCounts.Counts.Add(countEntry);
}
compressed = Json.Deflate("JSONRealmCharacterCountList", realmCharacterCounts);
attribute = new Bgs.Protocol.Attribute();
attribute.Name = "Param_CharacterCountList";
attribute.Value = new Variant();
attribute.Value.BlobValue = ByteString.CopyFrom(compressed);
response.Attribute.Add(attribute);
return BattlenetRpcErrorCode.Ok;
}
BattlenetRpcErrorCode JoinRealm(Dictionary<string, Variant> Params, Bgs.Protocol.GameUtilities.V1.ClientResponse response)
{
Variant realmAddress = GetParam(Params, "Param_RealmAddress");
if (realmAddress != null)
return Global.RealmMgr.JoinRealm((uint)realmAddress.UintValue, _build, GetRemoteIpAddress(), _clientSecret, (LocaleConstant)Enum.Parse(typeof(LocaleConstant), _locale), _os, _gameAccountInfo.Name, response);
return BattlenetRpcErrorCode.WowServicesInvalidJoinTicket;
}
public BattlenetRpcErrorCode HandleGetAllValuesForAttribute(Bgs.Protocol.GameUtilities.V1.GetAllValuesForAttributeRequest request, Bgs.Protocol.GameUtilities.V1.GetAllValuesForAttributeResponse response)
{
if (!_authed)
return BattlenetRpcErrorCode.Denied;
if (request.AttributeKey == "Command_RealmListRequest_v1_b9")
{
Global.RealmMgr.WriteSubRegions(response);
return BattlenetRpcErrorCode.Ok;
}
return BattlenetRpcErrorCode.RpcNotImplemented;
}
public string GetClientInfo()
{
string stream = '[' + GetRemoteIpAddress().ToString() + ':' + GetRemotePort();
if (_accountInfo != null && !string.IsNullOrEmpty(_accountInfo.Login))
stream += ", Account: " + _accountInfo.Login;
if (_gameAccountInfo != null)
stream += ", Game account: " + _gameAccountInfo.Name;
stream += ']';
return stream;
}
public uint GetAccountId() { return _accountInfo.Id; }
public uint GetGameAccountId() { return _gameAccountInfo.Id; }
Dictionary<string, ClientRequestHandler> ClientRequestHandlers = new Dictionary<string, ClientRequestHandler>();
AccountInfo _accountInfo;
GameAccountInfo _gameAccountInfo; // Points at selected game account (inside _gameAccounts)
string _locale;
string _os;
uint _build;
string _ipCountry;
Array<byte> _clientSecret = new Array<byte>(32);
bool _authed;
QueryCallbackProcessor _queryProcessor = new QueryCallbackProcessor();
Dictionary<uint, Action<CodedInputStream>> _responseCallbacks = new Dictionary<uint, Action<CodedInputStream>>();
uint _requestToken;
}
public class AccountInfo
{
public void LoadResult(SQLResult result)
{
Id = result.Read<uint>(0);
Login = result.Read<string>(1);
IsLockedToIP = result.Read<bool>(2);
LockCountry = result.Read<string>(3);
LastIP = result.Read<string>(4);
FailedLogins = result.Read<uint>(5);
IsBanned = result.Read<ulong>(6) != 0;
IsPermanenetlyBanned = result.Read<ulong>(7) != 0;
PasswordVerifier = result.Read<string>(9);
Salt = result.Read<string>(10);
const int GameAccountFieldsOffset = 8;
do
{
var account = new GameAccountInfo();
account.LoadResult(result.GetFields(), GameAccountFieldsOffset);
GameAccounts[result.Read<uint>(GameAccountFieldsOffset)] = account;
} while (result.NextRow());
}
public uint Id;
public string Login;
public bool IsLockedToIP;
public string LockCountry;
public string LastIP;
public uint FailedLogins;
public bool IsBanned;
public bool IsPermanenetlyBanned;
public string PasswordVerifier;
public string Salt;
public Dictionary<uint, GameAccountInfo> GameAccounts = new Dictionary<uint, GameAccountInfo>();
}
public class GameAccountInfo
{
public void LoadResult(SQLFields fields, int startColumn)
{
Id = fields.Read<uint>(startColumn + 0);
Name = fields.Read<string>(startColumn + 1);
IsBanned = fields.Read<ulong>(startColumn + 2) != 0;
IsPermanenetlyBanned = fields.Read<ulong>(startColumn + 3) != 0;
SecurityLevel = (AccountTypes)fields.Read<byte>(startColumn + 4);
int hashPos = Name.IndexOf('#');
if (hashPos != -1)
DisplayName = "WoW" + Name.Substring(hashPos + 1);
else
DisplayName = Name;
}
public uint Id;
public string Name;
public string DisplayName;
public bool IsBanned;
public bool IsPermanenetlyBanned;
public AccountTypes SecurityLevel;
public Dictionary<uint /*realmAddress*/, byte> CharacterCounts = new Dictionary<uint, byte>();
public Dictionary<string /*subRegion*/, LastPlayedCharacterInfo> LastPlayedCharacters = new Dictionary<string, LastPlayedCharacterInfo>();
}
public class LastPlayedCharacterInfo
{
public RealmHandle RealmId;
public string CharacterName;
public ulong CharacterGUID;
public uint LastPlayedTime;
}
}
+36
View File
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("BNetServer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BNetServer")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ffe6ae44-fd7a-431f-b65d-fe8ac7bfc86a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

+154
View File
@@ -0,0 +1,154 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using BNetServer.Networking;
using Framework.Configuration;
using Framework.Database;
using Framework.Networking;
using Framework.Runtime;
using System;
using System.Timers;
namespace BNetServer
{
class Server
{
static void Main()
{
ApplicationSignal.SetConsoleCtrlHandler(AbortHandler, true);
ApplicationSignal.RemoveConsoleQuickEditMode();
if (!ConfigMgr.Load(System.Diagnostics.Process.GetCurrentProcess().ProcessName + ".conf"))
ExitNow();
testing();
// Initialize the database connection
if (!StartDB())
ExitNow();
string bindIp = ConfigMgr.GetDefaultValue("BindIP", "0.0.0.0");
var restSocketServer = new SocketManager<RestSession>();
int restPort = ConfigMgr.GetDefaultValue("LoginREST.Port", 8081);
if (restPort < 0 || restPort > 0xFFFF)
{
Log.outError(LogFilter.Network, "Specified login service port ({0}) out of allowed range (1-65535), defaulting to 8081", restPort);
restPort = 8081;
}
if (!restSocketServer.StartNetwork(bindIp, restPort))
{
Log.outError(LogFilter.Server, "Failed to initialize Rest Socket Server");
ExitNow();
}
// Get the list of realms for the server
Global.RealmMgr.Initialize(ConfigMgr.GetDefaultValue("RealmsStateUpdateDelay", 10));
Global.SessionMgr.Initialize();
var sessionSocketServer = new SocketManager<Session>();
// Start the listening port (acceptor) for auth connections
int bnPort = ConfigMgr.GetDefaultValue("BattlenetPort", 1119);
if (bnPort < 0 || bnPort > 0xFFFF)
{
Log.outError(LogFilter.Server, "Specified battle.net port ({0}) out of allowed range (1-65535)", bnPort);
ExitNow();
}
if (!sessionSocketServer.StartNetwork(bindIp, bnPort))
{
Log.outError(LogFilter.Network, "Failed to start BnetServer Network");
ExitNow();
}
uint _banExpiryCheckInterval = ConfigMgr.GetDefaultValue("BanExpiryCheckInterval", 60u);
_banExpiryCheckTimer = new Timer(_banExpiryCheckInterval);
_banExpiryCheckTimer.Elapsed += _banExpiryCheckTimer_Elapsed;
while (true) ;
}
static bool StartDB()
{
DatabaseLoader loader = new DatabaseLoader(DatabaseTypeFlags.None);
loader.AddDatabase(DB.Login, "Login");
if (!loader.Load())
return false;
Log.SetRealmId(0); // Enables DB appenders when realm is set.
return true;
}
static void ExitNow()
{
Log.outInfo(LogFilter.Server, "Halting process...");
Environment.Exit(-1);
}
static void _banExpiryCheckTimer_Elapsed(object sender, ElapsedEventArgs e)
{
DB.Login.Execute(DB.Login.GetPreparedStatement(LoginStatements.DEL_EXPIRED_IP_BANS));
DB.Login.Execute(DB.Login.GetPreparedStatement(LoginStatements.UPD_EXPIRED_ACCOUNT_BANS));
DB.Login.Execute(DB.Login.GetPreparedStatement(LoginStatements.DEL_BNET_EXPIRED_ACCOUNT_BANNED));
}
static bool AbortHandler(CtrlType sig)
{
Global.RealmMgr.Close();
Log.outInfo(LogFilter.Server, "Halting process...");
Environment.Exit(-1);
return true;
}
static void testing()
{
}
static Timer _banExpiryCheckTimer;
static void Profile(string description, int iterations, Action func)
{
//Run at highest priority to minimize fluctuations caused by other processes/threads
System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.High;
System.Threading.Thread.CurrentThread.Priority = System.Threading.ThreadPriority.Highest;
// warm up
func();
var watch = new System.Diagnostics.Stopwatch();
// clean up
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
watch.Start();
for (int i = 0; i < iterations; i++)
{
func();
}
watch.Stop();
Console.Write(description);
Console.WriteLine(" Time Elapsed {0} ms", watch.Elapsed.TotalMilliseconds);
}
}
}
+582
View File
@@ -0,0 +1,582 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Bgs.Protocol;
using Bgs.Protocol.Account.V1;
using BNetServer.Services;
using Framework.Constants;
using Google.Protobuf;
namespace BNetServer.Networking
{
class AccountService : ServiceBase
{
public AccountService(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 12:
{
GameAccountHandle request = new GameAccountHandle();
request.MergeFrom(stream);
GameAccountBlob response = new GameAccountBlob();
BattlenetRpcErrorCode status = HandleGetGameAccountBlob(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.GetGameAccountBlob(GameAccountHandle: {1}) returned GameAccountBlob: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 13:
{
GetAccountRequest request = new GetAccountRequest();
request.MergeFrom(stream);
GetAccountResponse response = new GetAccountResponse();
BattlenetRpcErrorCode status = HandleGetAccount(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.GetAccount(GetAccountRequest: {1}) returned GetAccountResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 14:
{
CreateGameAccountRequest request = new CreateGameAccountRequest();
request.MergeFrom(stream);
GameAccountHandle response = new GameAccountHandle();
BattlenetRpcErrorCode status = HandleCreateGameAccount(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.CreateGameAccount(CreateGameAccountRequest: {1}) returned GameAccountHandle: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 15:
{
IsIgrAddressRequest request = new IsIgrAddressRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleIsIgrAddress(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.IsIgrAddress(IsIgrAddressRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 20:
{
CacheExpireRequest request = new CacheExpireRequest();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleCacheExpire(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.CacheExpire(CacheExpireRequest: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 21:
{
CredentialUpdateRequest request = new CredentialUpdateRequest();
request.MergeFrom(stream);
CredentialUpdateResponse response = new CredentialUpdateResponse();
BattlenetRpcErrorCode status = HandleCredentialUpdate(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.CredentialUpdate(CredentialUpdateRequest: {1}) returned CredentialUpdateResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 25:
{
SubscriptionUpdateRequest request = new SubscriptionUpdateRequest();
request.MergeFrom(stream);
SubscriptionUpdateResponse response = new SubscriptionUpdateResponse();
BattlenetRpcErrorCode status = HandleSubscribe(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.Subscribe(SubscriptionUpdateRequest: {1}) returned SubscriptionUpdateResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 26:
{
SubscriptionUpdateRequest request = new SubscriptionUpdateRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleUnsubscribe(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.Unsubscribe(SubscriptionUpdateRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 30:
{
GetAccountStateRequest request = new GetAccountStateRequest();
request.MergeFrom(stream);
GetAccountStateResponse response = new GetAccountStateResponse();
BattlenetRpcErrorCode status = HandleGetAccountState(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.GetAccountState(GetAccountStateRequest: {1}) returned GetAccountStateResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 31:
{
GetGameAccountStateRequest request = new GetGameAccountStateRequest();
request.MergeFrom(stream);
GetGameAccountStateResponse response = new GetGameAccountStateResponse();
BattlenetRpcErrorCode status = HandleGetGameAccountState(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.GetGameAccountState(GetGameAccountStateRequest: {1}) returned GetGameAccountStateResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 32:
{
GetLicensesRequest request = new GetLicensesRequest();
request.MergeFrom(stream);
GetLicensesResponse response = new GetLicensesResponse();
BattlenetRpcErrorCode status = HandleGetLicenses(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.GetLicenses(GetLicensesRequest: {1}) returned GetLicensesResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 33:
{
GetGameTimeRemainingInfoRequest request = new GetGameTimeRemainingInfoRequest();
request.MergeFrom(stream);
GetGameTimeRemainingInfoResponse response = new GetGameTimeRemainingInfoResponse();
BattlenetRpcErrorCode status = HandleGetGameTimeRemainingInfo(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.GetGameTimeRemainingInfo(GetGameTimeRemainingInfoRequest: {1}) returned GetGameTimeRemainingInfoResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 34:
{
GetGameSessionInfoRequest request = new GetGameSessionInfoRequest();
request.MergeFrom(stream);
GetGameSessionInfoResponse response = new GetGameSessionInfoResponse();
BattlenetRpcErrorCode status = HandleGetGameSessionInfo(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.GetGameSessionInfo(GetGameSessionInfoRequest: {1}) returned GetGameSessionInfoResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 35:
{
GetCAISInfoRequest request = new GetCAISInfoRequest();
request.MergeFrom(stream);
GetCAISInfoResponse response = new GetCAISInfoResponse();
BattlenetRpcErrorCode status = HandleGetCAISInfo(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.GetCAISInfo(GetCAISInfoRequest: {1}) returned GetCAISInfoResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 36:
{
ForwardCacheExpireRequest request = new ForwardCacheExpireRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleForwardCacheExpire(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.ForwardCacheExpire(ForwardCacheExpireRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 37:
{
GetAuthorizedDataRequest request = new GetAuthorizedDataRequest();
request.MergeFrom(stream);
GetAuthorizedDataResponse response = new GetAuthorizedDataResponse();
BattlenetRpcErrorCode status = HandleGetAuthorizedData(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.GetAuthorizedData(GetAuthorizedDataRequest: {1}) returned GetAuthorizedDataResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 38:
{
AccountFlagUpdateRequest request = new AccountFlagUpdateRequest();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleAccountFlagUpdate(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.AccountFlagUpdate(AccountFlagUpdateRequest: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 39:
{
GameAccountFlagUpdateRequest request = new GameAccountFlagUpdateRequest();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleGameAccountFlagUpdate(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.GameAccountFlagUpdate(GameAccountFlagUpdateRequest: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
/* case 40:
{
UpdateParentalControlsAndCAISRequest request = new UpdateParentalControlsAndCAISRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleUpdateParentalControlsAndCAIS(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.UpdateParentalControlsAndCAIS(UpdateParentalControlsAndCAISRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 41:
{
CreateGameAccountRequest request = new CreateGameAccountRequest();
request.MergeFrom(stream);
CreateGameAccountResponse response = new CreateGameAccountResponse();
BattlenetRpcErrorCode status = HandleCreateGameAccount2(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.CreateGameAccount2(CreateGameAccountRequest: {1}) returned CreateGameAccountResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 42:
{
GetGameAccountRequest request = new GetGameAccountRequest();
request.MergeFrom(stream);
GetGameAccountResponse response = new GetGameAccountResponse();
BattlenetRpcErrorCode status = HandleGetGameAccount(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.GetGameAccount(GetGameAccountRequest: {1}) returned GetGameAccountResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, &response);
else
SendResponse(token, status);
break;
}
case 43:
{
QueueDeductRecordRequest request = new QueueDeductRecordRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleQueueDeductRecord(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountService.QueueDeductRecord(QueueDeductRecordRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}*/
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleGetGameAccountBlob(GameAccountHandle request, GameAccountBlob response)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.GetAccount({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleGetAccount(GetAccountRequest request, GetAccountResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.GetAccount({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleCreateGameAccount(CreateGameAccountRequest request, GameAccountHandle response)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.CreateGameAccount({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleIsIgrAddress(IsIgrAddressRequest request, NoData response)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.IsIgrAddress({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleCacheExpire(CacheExpireRequest request)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.CacheExpire({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleCredentialUpdate(CredentialUpdateRequest request, CredentialUpdateResponse response)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.CredentialUpdate({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleSubscribe(SubscriptionUpdateRequest request, SubscriptionUpdateResponse response)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.Subscribe({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleUnsubscribe(SubscriptionUpdateRequest request, NoData response)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.Unsubscribe({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleGetAccountState(GetAccountStateRequest request, GetAccountStateResponse response)
{
return _session.HandleGetAccountState(request, response);
}
BattlenetRpcErrorCode HandleGetGameAccountState(GetGameAccountStateRequest request, GetGameAccountStateResponse response)
{
return _session.HandleGetGameAccountState(request, response);
}
BattlenetRpcErrorCode HandleGetLicenses(GetLicensesRequest request, GetLicensesResponse response)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.GetLicenses({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleGetGameTimeRemainingInfo(GetGameTimeRemainingInfoRequest request, GetGameTimeRemainingInfoResponse response)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.GetGameTimeRemainingInfo({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleGetGameSessionInfo(GetGameSessionInfoRequest request, GetGameSessionInfoResponse response)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.GetGameSessionInfo({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleGetCAISInfo(GetCAISInfoRequest request, GetCAISInfoResponse response)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.GetCAISInfo({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleForwardCacheExpire(ForwardCacheExpireRequest request, NoData response)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.ForwardCacheExpire({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleGetAuthorizedData(GetAuthorizedDataRequest request, GetAuthorizedDataResponse response)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.GetAuthorizedData({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleAccountFlagUpdate(AccountFlagUpdateRequest request)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.AccountFlagUpdate({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleGameAccountFlagUpdate(GameAccountFlagUpdateRequest request)
{
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.GameAccountFlagUpdate({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
/*BattlenetRpcErrorCode HandleUpdateParentalControlsAndCAIS(UpdateParentalControlsAndCAISRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.UpdateParentalControlsAndCAIS: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleCreateGameAccount2(CreateGameAccountRequest request, CreateGameAccountResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.CreateGameAccount2: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleGetGameAccount(GetGameAccountRequest request, GetGameAccountResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.GetGameAccount: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleQueueDeductRecord(QueueDeductRecordRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountService.QueueDeductRecord: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
*/
}
class AccountListener : ServiceBase
{
public AccountListener(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
AccountStateNotification request = new AccountStateNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnAccountStateUpdated(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountListener.OnAccountStateUpdated(AccountStateNotification: {1} status: {2}.", GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 2:
{
GameAccountStateNotification request = new GameAccountStateNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnGameAccountStateUpdated(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountListener.OnGameAccountStateUpdated(GameAccountStateNotification: {1} status: {2}.", GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 3:
{
GameAccountNotification request = new GameAccountNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnGameAccountsUpdated(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountListener.OnGameAccountsUpdated(GameAccountNotification: {1} status: {2}.", GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 4:
{
GameAccountSessionNotification request = new GameAccountSessionNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnGameSessionUpdated(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AccountListener.OnGameSessionUpdated(GameAccountSessionNotification: {1} status: {2}.", GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleOnAccountStateUpdated(AccountStateNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountListener.OnAccountStateUpdated: {1}", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnGameAccountStateUpdated(GameAccountStateNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountListener.OnGameAccountStateUpdated: {1}", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnGameAccountsUpdated(GameAccountNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountListener.OnGameAccountsUpdated: {1}", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnGameSessionUpdated(GameAccountSessionNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AccountListener.OnGameSessionUpdated: {1}", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
}
}
@@ -0,0 +1,442 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Bgs.Protocol;
using Bgs.Protocol.Authentication.V1;
using BNetServer.Services;
using Framework.Constants;
using Google.Protobuf;
namespace BNetServer.Networking
{
class AuthenticationService : ServiceBase
{
public AuthenticationService(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
LogonRequest request = new LogonRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleLogon(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationService.Logon(bgs.protocol.authentication.v1.LogonRequest: {1}) returned bgs.protocol.NoData: {2} status {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 2:
{
ModuleNotification request = new ModuleNotification();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleModuleNotify(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationService.ModuleNotify(bgs.protocol.authentication.v1.ModuleNotification: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 3:
{
ModuleMessageRequest request = new ModuleMessageRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleModuleMessage(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationService.ModuleMessage(bgs.protocol.authentication.v1.ModuleMessageRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 4:
{
EntityId request = new EntityId();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleSelectGameAccount_DEPRECATED(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationService.SelectGameAccount_DEPRECATED(bgs.protocol.EntityId: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 5:
{
GenerateSSOTokenRequest request = new GenerateSSOTokenRequest();
request.MergeFrom(stream);
GenerateSSOTokenResponse response = new GenerateSSOTokenResponse();
BattlenetRpcErrorCode status = HandleGenerateSSOToken(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationService.GenerateSSOToken(bgs.protocol.authentication.v1.GenerateSSOTokenRequest: {1}) returned bgs.protocol.authentication.v1.GenerateSSOTokenResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 6:
{
SelectGameAccountRequest request = new SelectGameAccountRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleSelectGameAccount(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationService.SelectGameAccount(bgs.protocol.authentication.v1.SelectGameAccountRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 7:
{
VerifyWebCredentialsRequest request = new VerifyWebCredentialsRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleVerifyWebCredentials(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationService.VerifyWebCredentials(bgs.protocol.authentication.v1.VerifyWebCredentialsRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 8:
{
GenerateWebCredentialsRequest request = new GenerateWebCredentialsRequest();
request.MergeFrom(stream);
GenerateWebCredentialsResponse response = new GenerateWebCredentialsResponse();
BattlenetRpcErrorCode status = HandleGenerateWebCredentials(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationService.GenerateWebCredentials(bgs.protocol.authentication.v1.GenerateWebCredentialsRequest: {1}) returned bgs.protocol.authentication.v1.GenerateWebCredentialsResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleLogon(LogonRequest request, NoData response)
{
return _session.HandleLogon(request);
}
BattlenetRpcErrorCode HandleModuleNotify(ModuleNotification request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationService.ModuleNotify: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleModuleMessage(ModuleMessageRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationService.ModuleMessage: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleSelectGameAccount_DEPRECATED(EntityId request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationService.SelectGameAccount_DEPRECATED: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleGenerateSSOToken(GenerateSSOTokenRequest request, GenerateSSOTokenResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationService.GenerateSSOToken: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleSelectGameAccount(SelectGameAccountRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationService.SelectGameAccount: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleVerifyWebCredentials(VerifyWebCredentialsRequest request, NoData response)
{
return _session.HandleVerifyWebCredentials(request);
}
BattlenetRpcErrorCode HandleGenerateWebCredentials(GenerateWebCredentialsRequest request, GenerateWebCredentialsResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationService.GenerateWebCredentials: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
}
class AuthenticationListener : ServiceBase
{
public AuthenticationListener(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
ModuleLoadRequest request = new ModuleLoadRequest();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnModuleLoad(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationListener.OnModuleLoad(bgs.protocol.authentication.v1.ModuleLoadRequest: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 2:
{
ModuleMessageRequest request = new ModuleMessageRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleOnModuleMessage(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationListener.OnModuleMessage(bgs.protocol.authentication.v1.ModuleMessageRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 4:
{
ServerStateChangeRequest request = new ServerStateChangeRequest();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnServerStateChange(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationListener.OnServerStateChange(bgs.protocol.authentication.v1.ServerStateChangeRequest: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 5:
{
LogonResult request = new LogonResult();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnLogonComplete(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationListener.OnLogonComplete(bgs.protocol.authentication.v1.LogonResult: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 6:
{
MemModuleLoadRequest request = new MemModuleLoadRequest();
request.MergeFrom(stream);
MemModuleLoadResponse response = new MemModuleLoadResponse();
BattlenetRpcErrorCode status = HandleOnMemModuleLoad(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationListener.OnMemModuleLoad(bgs.protocol.authentication.v1.MemModuleLoadRequest: {1}) returned bgs.protocol.authentication.v1.MemModuleLoadResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 10:
{
LogonUpdateRequest request = new LogonUpdateRequest();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnLogonUpdate(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationListener.OnLogonUpdate(bgs.protocol.authentication.v1.LogonUpdateRequest: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 11:
{
VersionInfoNotification request = new VersionInfoNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnVersionInfoUpdated(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationListener.OnVersionInfoUpdated(bgs.protocol.authentication.v1.VersionInfoNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 12:
{
LogonQueueUpdateRequest request = new LogonQueueUpdateRequest();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnLogonQueueUpdate(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationListener.OnLogonQueueUpdate(bgs.protocol.authentication.v1.LogonQueueUpdateRequest: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 13:
{
NoData request = new NoData();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnLogonQueueEnd(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationListener.OnLogonQueueEnd(bgs.protocol.NoData: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 14:
{
GameAccountSelectedRequest request = new GameAccountSelectedRequest();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnGameAccountSelected(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method AuthenticationListener.OnGameAccountSelected(bgs.protocol.authentication.v1.GameAccountSelectedRequest: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleOnModuleLoad(ModuleLoadRequest request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationListener.OnModuleLoad: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnModuleMessage(ModuleMessageRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationListener.OnModuleMessage: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnServerStateChange(ServerStateChangeRequest request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationListener.OnServerStateChange: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnLogonComplete(LogonResult request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationListener.OnLogonComplete: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnMemModuleLoad(MemModuleLoadRequest request, MemModuleLoadResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationListener.OnMemModuleLoad: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnLogonUpdate(LogonUpdateRequest request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationListener.OnLogonUpdate: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnVersionInfoUpdated(VersionInfoNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationListener.OnVersionInfoUpdated: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnLogonQueueUpdate(LogonQueueUpdateRequest request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationListener.OnLogonQueueUpdate: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnLogonQueueEnd(NoData request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationListener.OnLogonQueueEnd: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnGameAccountSelected(GameAccountSelectedRequest request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method AuthenticationListener.OnGameAccountSelected: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
}
}
+228
View File
@@ -0,0 +1,228 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Bgs.Protocol;
using Bgs.Protocol.Challenge.V1;
using BNetServer.Services;
using Framework.Constants;
using Google.Protobuf;
namespace BNetServer.Networking
{
class ChallengeService : ServiceBase
{
public ChallengeService(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
ChallengePickedRequest request = new ChallengePickedRequest();
request.MergeFrom(stream);
ChallengePickedResponse response = new ChallengePickedResponse();
BattlenetRpcErrorCode status = HandleChallengePicked(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeService.ChallengePicked(bgs.protocol.challenge.v1.ChallengePickedRequest: {1}) returned bgs.protocol.challenge.v1.ChallengePickedResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 2:
{
ChallengeAnsweredRequest request = new ChallengeAnsweredRequest();
request.MergeFrom(stream);
ChallengeAnsweredResponse response = new ChallengeAnsweredResponse();
BattlenetRpcErrorCode status = HandleChallengeAnswered(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeService.ChallengeAnswered(bgs.protocol.challenge.v1.ChallengeAnsweredRequest: {1}) returned bgs.protocol.challenge.v1.ChallengeAnsweredResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 3:
{
ChallengeCancelledRequest request = new ChallengeCancelledRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleChallengeCancelled(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeService.ChallengeCancelled(bgs.protocol.challenge.v1.ChallengeCancelledRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 4:
{
SendChallengeToUserRequest request = new SendChallengeToUserRequest();
request.MergeFrom(stream);
SendChallengeToUserResponse response = new SendChallengeToUserResponse();
BattlenetRpcErrorCode status = HandleSendChallengeToUser(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeService.SendChallengeToUser(bgs.protocol.challenge.v1.SendChallengeToUserRequest: {1}) returned bgs.protocol.challenge.v1.SendChallengeToUserResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleChallengePicked(ChallengePickedRequest request, ChallengePickedResponse response) {
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChallengeService.ChallengePicked: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleChallengeAnswered(ChallengeAnsweredRequest request, ChallengeAnsweredResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChallengeService.ChallengeAnswered: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleChallengeCancelled(ChallengeCancelledRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChallengeService.ChallengeCancelled: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleSendChallengeToUser(SendChallengeToUserRequest request, SendChallengeToUserResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChallengeService.SendChallengeToUser: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
}
class ChallengeListener : ServiceBase
{
public ChallengeListener(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
ChallengeUserRequest request = new ChallengeUserRequest();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnChallengeUser(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeListener.OnChallengeUser(bgs.protocol.challenge.v1.ChallengeUserRequest: {1} status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 2:
{
ChallengeResultRequest request = new ChallengeResultRequest();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnChallengeResult(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeListener.OnChallengeResult(bgs.protocol.challenge.v1.ChallengeResultRequest: {1} status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 3:
{
ChallengeExternalRequest request = new ChallengeExternalRequest();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnExternalChallenge(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeListener.OnExternalChallenge(bgs.protocol.challenge.v1.ChallengeExternalRequest: {1} status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 4:
{
ChallengeExternalResult request = new ChallengeExternalResult();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnExternalChallengeResult(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChallengeListener.OnExternalChallengeResult(bgs.protocol.challenge.v1.ChallengeExternalResult: {1} status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleOnChallengeUser(ChallengeUserRequest request) {
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChallengeListener.OnChallengeUser: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnChallengeResult(ChallengeResultRequest request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChallengeListener.OnChallengeResult: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnExternalChallenge(ChallengeExternalRequest request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChallengeListener.OnExternalChallenge: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnExternalChallengeResult(ChallengeExternalResult request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChallengeListener.OnExternalChallengeResult: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
}
}
+312
View File
@@ -0,0 +1,312 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Bgs.Protocol;
using Bgs.Protocol.Channel.V1;
using BNetServer.Services;
using Framework.Constants;
using Google.Protobuf;
namespace BNetServer.Networking
{
class ChannelService : ServiceBase
{
public ChannelService(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 2:
{
RemoveMemberRequest request = new RemoveMemberRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleRemoveMember(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelService.RemoveMember(bgs.protocol.channel.v1.RemoveMemberRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 3:
{
SendMessageRequest request = new SendMessageRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleSendMessage(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelService.SendMessage(bgs.protocol.channel.v1.SendMessageRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 4:
{
UpdateChannelStateRequest request = new UpdateChannelStateRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleUpdateChannelState(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelService.UpdateChannelState(bgs.protocol.channel.v1.UpdateChannelStateRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 5:
{
UpdateMemberStateRequest request = new UpdateMemberStateRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleUpdateMemberState(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelService.UpdateMemberState(bgs.protocol.channel.v1.UpdateMemberStateRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 6:
{
DissolveRequest request = new DissolveRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleDissolve(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelService.Dissolve(bgs.protocol.channel.v1.DissolveRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleRemoveMember(RemoveMemberRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelService.RemoveMember: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleSendMessage(SendMessageRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelService.SendMessage: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleUpdateChannelState(UpdateChannelStateRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelService.UpdateChannelState: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleUpdateMemberState(UpdateMemberStateRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelService.UpdateMemberState: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleDissolve(DissolveRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelService.Dissolve: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
}
class ChannelListener : ServiceBase
{
public ChannelListener(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
JoinNotification request = new JoinNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnJoin(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnJoin(bgs.protocol.channel.v1.JoinNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 2:
{
MemberAddedNotification request = new MemberAddedNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnMemberAdded(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnMemberAdded(bgs.protocol.channel.v1.MemberAddedNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 3:
{
LeaveNotification request = new LeaveNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnLeave(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnLeave(bgs.protocol.channel.v1.LeaveNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 4:
{
MemberRemovedNotification request = new MemberRemovedNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnMemberRemoved(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnMemberRemoved(bgs.protocol.channel.v1.MemberRemovedNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 5:
{
SendMessageNotification request = new SendMessageNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnSendMessage(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnSendMessage(bgs.protocol.channel.v1.SendMessageNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 6:
{
UpdateChannelStateNotification request = new UpdateChannelStateNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnUpdateChannelState(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnUpdateChannelState(bgs.protocol.channel.v1.UpdateChannelStateNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 7:
{
UpdateMemberStateNotification request = new UpdateMemberStateNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnUpdateMemberState(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ChannelListener.OnUpdateMemberState(bgs.protocol.channel.v1.UpdateMemberStateNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleOnJoin(JoinNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelListener.OnJoin: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnMemberAdded(MemberAddedNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelListener.OnMemberAdded: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnLeave(LeaveNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelListener.OnLeave: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnMemberRemoved(MemberRemovedNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelListener.OnMemberRemoved: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnSendMessage(SendMessageNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelListener.OnSendMessage: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnUpdateChannelState(UpdateChannelStateNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelListener.OnUpdateChannelState: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnUpdateMemberState(UpdateMemberStateNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ChannelListener.OnUpdateMemberState: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
}
}
+187
View File
@@ -0,0 +1,187 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Bgs.Protocol;
using Bgs.Protocol.Connection.V1;
using BNetServer.Services;
using Framework.Constants;
using Google.Protobuf;
using System.Diagnostics;
namespace BNetServer.Networking
{
class ConnectionService : ServiceBase
{
public ConnectionService(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
ConnectRequest request = ConnectRequest.Parser.ParseFrom(stream);
ConnectResponse response = new ConnectResponse();
BattlenetRpcErrorCode status = HandleConnect(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ConnectionService.Connect(bgs.protocol.connection.v1.ConnectRequest: {1}) returned bgs.protocol.connection.v1.ConnectResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 2:
{
BindRequest request = new BindRequest();
request.MergeFrom(stream);
BindResponse response = new BindResponse();
BattlenetRpcErrorCode status = HandleBind(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ConnectionService.Bind(bgs.protocol.connection.v1.BindRequest: {1}) returned bgs.protocol.connection.v1.BindResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 3:
{
EchoRequest request = new EchoRequest();
request.MergeFrom(stream);
EchoResponse response = new EchoResponse();
BattlenetRpcErrorCode status = HandleEcho(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ConnectionService.Echo(bgs.protocol.connection.v1.EchoRequest: {1}) returned bgs.protocol.connection.v1.EchoResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 4:
{
DisconnectNotification request = DisconnectNotification.Parser.ParseFrom(stream);
BattlenetRpcErrorCode status = HandleForceDisconnect(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ConnectionService.ForceDisconnect(bgs.protocol.connection.v1.DisconnectNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 5:
{
NoData request = NoData.Parser.ParseFrom(stream);
BattlenetRpcErrorCode status = HandleKeepAlive(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ConnectionService.KeepAlive(bgs.protocol.NoData: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 6:
{
EncryptRequest request = EncryptRequest.Parser.ParseFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleEncrypt(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ConnectionService.Encrypt(bgs.protocol.connection.v1.EncryptRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 7:
{
DisconnectRequest request = DisconnectRequest.Parser.ParseFrom(stream);
BattlenetRpcErrorCode status = HandleRequestDisconnect(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ConnectionService.RequestDisconnect(bgs.protocol.connection.v1.DisconnectRequest: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleConnect(ConnectRequest request, ConnectResponse response)
{
if (request.ClientId != null)
response.ClientId.MergeFrom(request.ClientId);
response.ServerId = new ProcessId();
response.ServerId.Label = (uint)Process.GetCurrentProcess().Id;
response.ServerId.Epoch = (uint)Time.UnixTime;
response.ServerTime = (ulong)Time.UnixTimeMilliseconds;
response.UseBindlessRpc = request.UseBindlessRpc;
return BattlenetRpcErrorCode.Ok;
}
BattlenetRpcErrorCode HandleBind(BindRequest request, BindResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ConnectionService.Bind: {1}", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleEcho(EchoRequest request, EchoResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ConnectionService.Echo: {1}", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleForceDisconnect(DisconnectNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ConnectionService.ForceDisconnect: {1}", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleKeepAlive(NoData request)
{
return BattlenetRpcErrorCode.Ok;
}
BattlenetRpcErrorCode HandleEncrypt(EncryptRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ConnectionService.Encrypt: {1}", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleRequestDisconnect(DisconnectRequest request)
{
var disconnectNotification = new DisconnectNotification();
disconnectNotification.ErrorCode = request.ErrorCode;
SendRequest(4, disconnectNotification);
_session.CloseSocket();
return BattlenetRpcErrorCode.Ok;
}
}
}
+520
View File
@@ -0,0 +1,520 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Bgs.Protocol;
using Bgs.Protocol.Friends.V1;
using BNetServer.Services;
using Framework.Constants;
using Google.Protobuf;
namespace BNetServer.Networking
{
class FriendsService : ServiceBase
{
public FriendsService(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
SubscribeRequest request = new SubscribeRequest();
request.MergeFrom(stream);
SubscribeResponse response = new SubscribeResponse();
BattlenetRpcErrorCode status = HandleSubscribe(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.Subscribe(bgs.protocol.friends.v1.SubscribeRequest: {1}) returned bgs.protocol.friends.v1.SubscribeResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 2:
{
SendInvitationRequest request = new SendInvitationRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleSendInvitation(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.SendInvitation(bgs.protocol.SendInvitationRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 3:
{
GenericInvitationRequest request = new GenericInvitationRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleAcceptInvitation(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.AcceptInvitation(bgs.protocol.GenericInvitationRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 4:
{
GenericInvitationRequest request = new GenericInvitationRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleRevokeInvitation(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.RevokeInvitation(bgs.protocol.GenericInvitationRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 5:
{
GenericInvitationRequest request = new GenericInvitationRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleDeclineInvitation(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.DeclineInvitation(bgs.protocol.GenericInvitationRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 6:
{
GenericInvitationRequest request = new GenericInvitationRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleIgnoreInvitation(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.IgnoreInvitation(bgs.protocol.GenericInvitationRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 7:
{
AssignRoleRequest request = new AssignRoleRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleAssignRole(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.AssignRole(bgs.protocol.friends.v1.AssignRoleRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 8:
{
GenericFriendRequest request = new GenericFriendRequest();
request.MergeFrom(stream);
GenericFriendResponse response = new GenericFriendResponse();
BattlenetRpcErrorCode status = HandleRemoveFriend(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.RemoveFriend(bgs.protocol.friends.v1.GenericFriendRequest: {1}) returned bgs.protocol.friends.v1.GenericFriendResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 9:
{
ViewFriendsRequest request = new ViewFriendsRequest();
request.MergeFrom(stream);
ViewFriendsResponse response = new ViewFriendsResponse();
BattlenetRpcErrorCode status = HandleViewFriends(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.ViewFriends(bgs.protocol.friends.v1.ViewFriendsRequest: {1}) returned bgs.protocol.friends.v1.ViewFriendsResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 10:
{
UpdateFriendStateRequest request = new UpdateFriendStateRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleUpdateFriendState(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.UpdateFriendState(bgs.protocol.friends.v1.UpdateFriendStateRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 11:
{
UnsubscribeRequest request = new UnsubscribeRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleUnsubscribe(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.Unsubscribe(bgs.protocol.friends.v1.UnsubscribeRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 12:
{
GenericFriendRequest request = new GenericFriendRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleRevokeAllInvitations(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.RevokeAllInvitations(bgs.protocol.friends.v1.GenericFriendRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
/*case 13:
{
GetFriendListRequest request = new GetFriendListRequest();
request.MergeFrom(stream);
GetFriendListResponse response = new GetFriendListResponse();
BattlenetRpcErrorCode status = HandleGetFriendList(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.GetFriendList(bgs.protocol.friends.v1.GetFriendListRequest: {1}) returned bgs.protocol.friends.v1.GetFriendListResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 14:
{
CreateFriendshipRequest request = new CreateFriendshipRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleCreateFriendship(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsService.CreateFriendship(bgs.protocol.friends.v1.CreateFriendshipRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}*/
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleSubscribe(SubscribeRequest request, SubscribeResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.Subscribe: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleSendInvitation(SendInvitationRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.SendInvitation: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleAcceptInvitation(GenericInvitationRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.AcceptInvitation: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleRevokeInvitation(GenericInvitationRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.RevokeInvitation: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleDeclineInvitation(GenericInvitationRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.DeclineInvitation: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleIgnoreInvitation(GenericInvitationRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.IgnoreInvitation: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleAssignRole(AssignRoleRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.AssignRole: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleRemoveFriend(GenericFriendRequest request, GenericFriendResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.RemoveFriend: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleViewFriends(ViewFriendsRequest request, ViewFriendsResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.ViewFriends: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleUpdateFriendState(UpdateFriendStateRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.UpdateFriendState: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleUnsubscribe(UnsubscribeRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.Unsubscribe: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleRevokeAllInvitations(GenericFriendRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.RevokeAllInvitations: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
/*BattlenetRpcErrorCode HandleGetFriendList(GetFriendListRequest request, GetFriendListResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.GetFriendList: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleCreateFriendship(CreateFriendshipRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsService.CreateFriendship: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
*/
}
class FriendsListener : ServiceBase
{
public FriendsListener(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
FriendNotification request = new FriendNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnFriendAdded(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnFriendAdded(bgs.protocol.friends.v1.FriendNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 2:
{
FriendNotification request = new FriendNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnFriendRemoved(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnFriendRemoved(bgs.protocol.friends.v1.FriendNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 3:
{
InvitationNotification request = new InvitationNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnReceivedInvitationAdded(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnReceivedInvitationAdded(bgs.protocol.friends.v1.InvitationNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 4:
{
InvitationNotification request = new InvitationNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnReceivedInvitationRemoved(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnReceivedInvitationRemoved(bgs.protocol.friends.v1.InvitationNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 5:
{
InvitationNotification request = new InvitationNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnSentInvitationAdded(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnSentInvitationAdded(bgs.protocol.friends.v1.InvitationNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 6:
{
InvitationNotification request = new InvitationNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnSentInvitationRemoved(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnSentInvitationRemoved(bgs.protocol.friends.v1.InvitationNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 7:
{
UpdateFriendStateNotification request = new UpdateFriendStateNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnUpdateFriendState(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method FriendsListener.OnUpdateFriendState(bgs.protocol.friends.v1.UpdateFriendStateNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleOnFriendAdded(FriendNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsListener.OnFriendAdded: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnFriendRemoved(FriendNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsListener.OnFriendRemoved: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnReceivedInvitationAdded(InvitationNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsListener.OnReceivedInvitationAdded: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnReceivedInvitationRemoved(InvitationNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsListener.OnReceivedInvitationRemoved: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnSentInvitationAdded(InvitationNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsListener.OnSentInvitationAdded: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnSentInvitationRemoved(InvitationNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsListener.OnSentInvitationRemoved: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnUpdateFriendState(UpdateFriendStateNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method FriendsListener.OnUpdateFriendState: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
}
}
+215
View File
@@ -0,0 +1,215 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Bgs.Protocol;
using Bgs.Protocol.GameUtilities.V1;
using BNetServer.Services;
using Framework.Constants;
using Google.Protobuf;
namespace BNetServer.Networking
{
class GameUtilitiesService : ServiceBase
{
public GameUtilitiesService(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
ClientRequest request = new ClientRequest();
request.MergeFrom(stream);
ClientResponse response = new ClientResponse();
BattlenetRpcErrorCode status = HandleProcessClientRequest(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.ProcessClientRequest(bgs.protocol.game_utilities.v1.ClientRequest: {1}) returned bgs.protocol.game_utilities.v1.ClientResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 2:
{
PresenceChannelCreatedRequest request = new PresenceChannelCreatedRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandlePresenceChannelCreated(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.PresenceChannelCreated(bgs.protocol.game_utilities.v1.PresenceChannelCreatedRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 3:
{
GetPlayerVariablesRequest request = new GetPlayerVariablesRequest();
request.MergeFrom(stream);
GetPlayerVariablesResponse response = new GetPlayerVariablesResponse();
BattlenetRpcErrorCode status = HandleGetPlayerVariables(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.GetPlayerVariables(bgs.protocol.game_utilities.v1.GetPlayerVariablesRequest: {1}) returned bgs.protocol.game_utilities.v1.GetPlayerVariablesResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 6:
{
ServerRequest request = new ServerRequest();
request.MergeFrom(stream);
ServerResponse response = new ServerResponse();
BattlenetRpcErrorCode status = HandleProcessServerRequest(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.ProcessServerRequest(bgs.protocol.game_utilities.v1.ServerRequest: {1}) returned bgs.protocol.game_utilities.v1.ServerResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 7:
{
GameAccountOnlineNotification request = new GameAccountOnlineNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnGameAccountOnline(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.OnGameAccountOnline(bgs.protocol.game_utilities.v1.GameAccountOnlineNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 8:
{
GameAccountOfflineNotification request = new GameAccountOfflineNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnGameAccountOffline(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.OnGameAccountOffline(bgs.protocol.game_utilities.v1.GameAccountOfflineNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 9:
{
GetAchievementsFileRequest request = new GetAchievementsFileRequest();
request.MergeFrom(stream);
GetAchievementsFileResponse response = new GetAchievementsFileResponse();
BattlenetRpcErrorCode status = HandleGetAchievementsFile(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.GetAchievementsFile(bgs.protocol.game_utilities.v1.GetAchievementsFileRequest: {1}) returned bgs.protocol.game_utilities.v1.GetAchievementsFileResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 10:
{
GetAllValuesForAttributeRequest request = new GetAllValuesForAttributeRequest();
request.MergeFrom(stream);
GetAllValuesForAttributeResponse response = new GetAllValuesForAttributeResponse();
BattlenetRpcErrorCode status = HandleGetAllValuesForAttribute(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method GameUtilitiesService.GetAllValuesForAttribute(bgs.protocol.game_utilities.v1.GetAllValuesForAttributeRequest: {1}) returned bgs.protocol.game_utilities.v1.GetAllValuesForAttributeResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleProcessClientRequest(ClientRequest request, ClientResponse response)
{
return _session.HandleProcessClientRequest(request, response);
}
BattlenetRpcErrorCode HandlePresenceChannelCreated(PresenceChannelCreatedRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method GameUtilitiesService.PresenceChannelCreated: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleGetPlayerVariables(GetPlayerVariablesRequest request, GetPlayerVariablesResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method GameUtilitiesService.GetPlayerVariables: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleProcessServerRequest(ServerRequest request, ServerResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method GameUtilitiesService.ProcessServerRequest: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnGameAccountOnline(GameAccountOnlineNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method GameUtilitiesService.OnGameAccountOnline: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnGameAccountOffline(GameAccountOfflineNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method GameUtilitiesService.OnGameAccountOffline: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleGetAchievementsFile(GetAchievementsFileRequest request, GetAchievementsFileResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method GameUtilitiesService.GetAchievementsFile: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleGetAllValuesForAttribute(GetAllValuesForAttributeRequest request, GetAllValuesForAttributeResponse response)
{
return _session.HandleGetAllValuesForAttribute(request, response);
}
}
}
+203
View File
@@ -0,0 +1,203 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Bgs.Protocol;
using Bgs.Protocol.Presence.V1;
using BNetServer.Services;
using Framework.Constants;
using Google.Protobuf;
namespace BNetServer.Networking
{
class PresenceService : ServiceBase
{
public PresenceService(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
SubscribeRequest request = new SubscribeRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleSubscribe(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method PresenceService.Subscribe(bgs.protocol.presence.v1.SubscribeRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 2:
{
UnsubscribeRequest request = new UnsubscribeRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleUnsubscribe(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method PresenceService.Unsubscribe(bgs.protocol.presence.v1.UnsubscribeRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 3:
{
UpdateRequest request = new UpdateRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleUpdate(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method PresenceService.Update(bgs.protocol.presence.v1.UpdateRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 4:
{
QueryRequest request = new QueryRequest();
request.MergeFrom(stream);
QueryResponse response = new QueryResponse();
BattlenetRpcErrorCode status = HandleQuery(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method PresenceService.Query(bgs.protocol.presence.v1.QueryRequest: {1}) returned bgs.protocol.presence.v1.QueryResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 5:
{
OwnershipRequest request = new OwnershipRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleOwnership(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method PresenceService.Ownership(bgs.protocol.presence.v1.OwnershipRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 7:
{
SubscribeNotificationRequest request = new SubscribeNotificationRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleSubscribeNotification(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method PresenceService.SubscribeNotification(bgs.protocol.presence.v1.SubscribeNotificationRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
/*case 8:
{
MigrateOlympusCustomMessageRequest request = new MigrateOlympusCustomMessageRequest();
request.MergeFrom(stream);
MigrateOlympusCustomMessageResponse response = new MigrateOlympusCustomMessageResponse();
BattlenetRpcErrorCode status = HandleMigrateOlympusCustomMessage(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method PresenceService.MigrateOlympusCustomMessage(bgs.protocol.presence.v1.MigrateOlympusCustomMessageRequest: {1}) returned bgs.protocol.presence.v1.MigrateOlympusCustomMessageResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}*/
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleSubscribe(SubscribeRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method PresenceService.Subscribe: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleUnsubscribe(UnsubscribeRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method PresenceService.Unsubscribe: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleUpdate(UpdateRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method PresenceService.Update: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleQuery(QueryRequest request, QueryResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method PresenceService.Query: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOwnership(OwnershipRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method PresenceService.Ownership: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleSubscribeNotification(SubscribeNotificationRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method PresenceService.SubscribeNotification: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
/*BattlenetRpcErrorCode HandleMigrateOlympusCustomMessage(MigrateOlympusCustomMessageRequest request, MigrateOlympusCustomMessageResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method PresenceService.MigrateOlympusCustomMessage: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
*/
}
}
+87
View File
@@ -0,0 +1,87 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Bgs.Protocol;
using Bgs.Protocol.Report.V1;
using BNetServer.Services;
using Framework.Constants;
using Google.Protobuf;
namespace BNetServer.Networking
{
class ReportService : ServiceBase
{
public ReportService(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
SendReportRequest request = new SendReportRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleSendReport(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ReportService.SendReport(bgs.protocol.report.v1.SendReportRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
/*case 2:
{
SubmitReportRequest request = new SubmitReportRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleSubmitReport(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ReportService.SubmitReport(bgs.protocol.report.v1.SubmitReportRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}*/
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleSendReport(SendReportRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ReportService.SendReport: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
/* BattlenetRpcErrorCode HandleSubmitReport(SubmitReportRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ReportService.SubmitReport: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}*/
}
}
+60
View File
@@ -0,0 +1,60 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using BNetServer.Services;
using Framework.Constants;
using Google.Protobuf;
namespace BNetServer.Networking
{
class ResourcesService : ServiceBase
{
public ResourcesService(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
/*case 1:
{
ContentHandleRequest request = new ContentHandleRequest();
request.MergeFrom(stream);
ContentHandle response = new ContentHandle();
BattlenetRpcErrorCode status = HandleGetContentHandle(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method ResourcesService.GetContentHandle(bgs.protocol.resources.v1.ContentHandleRequest: {1}) returned bgs.protocol.ContentHandle: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}*/
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
/*BattlenetRpcErrorCode HandleGetContentHandle(ContentHandleRequest request, ContentHandle response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method ResourcesService.GetContentHandle({1})", GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}*/
}
}
+93
View File
@@ -0,0 +1,93 @@
/*
* Copyright (C) 2012-2016 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using BNetServer.Networking;
using Framework.Constants;
using Google.Protobuf;
using System;
using System.Collections.Generic;
namespace BNetServer.Services
{
public class ServiceDispatcher : Singleton<ServiceDispatcher>
{
ServiceDispatcher()
{
AddService<AccountService>(OriginalHash.AccountService);
AddService<AccountListener>(OriginalHash.AccountListener);
AddService<AuthenticationService>(OriginalHash.AuthenticationService);
AddService<ChallengeService>(OriginalHash.ChallengeService);
AddService<ChannelService>(OriginalHash.ChannelService);
AddService<ConnectionService>(OriginalHash.ConnectionService);
AddService<FriendsService>(OriginalHash.FriendsService);
AddService<GameUtilitiesService>(OriginalHash.GameUtilitiesService);
AddService<PresenceService>(OriginalHash.PresenceService);
AddService<ReportService>(OriginalHash.ReportService);
AddService<ResourcesService>(OriginalHash.ResourcesService);
AddService<UserManagerService>(OriginalHash.UserManagerService);
}
public void Dispatch(Session session, uint serviceHash, uint token, uint methodId, CodedInputStream stream)
{
Log.outInfo(LogFilter.Server, "ServiceHash = {0}, methodId = {1}", serviceHash, methodId);
var action = _dispatchers.LookupByKey(serviceHash);
if (action != null)
action(session, serviceHash, token, methodId, stream);
else
Log.outDebug(LogFilter.SessionRpc, "{0} tried to call invalid service {1}", session.GetClientInfo(), serviceHash);
}
void AddService<Service>(OriginalHash OriginalHash) where Service : ServiceBase
{
_dispatchers[(uint)OriginalHash] = Dispatch<Service>;
}
void Dispatch<Service>(Session session, uint serviceHash, uint token, uint methodId, CodedInputStream stream) where Service : ServiceBase
{
var obj = (Service)Activator.CreateInstance(typeof(Service), session, serviceHash);
obj.CallServerMethod(token, methodId, stream);
}
Dictionary<uint, DispatcherHandler> _dispatchers = new Dictionary<uint, DispatcherHandler>();
delegate void DispatcherHandler(Session session, uint serviceHash, uint token, uint methodId, CodedInputStream stream);
}
abstract class ServiceBase
{
public ServiceBase(Session session, uint serviceHash)
{
_session = session;
_serviceHash = serviceHash;
}
public abstract void CallServerMethod(uint token, uint methodId, CodedInputStream stream);
public void SendRequest(uint methodId, IMessage request, Action<CodedInputStream> callback) { _session.SendRequest(_serviceHash, methodId, request, callback); }
public void SendRequest(uint methodId, IMessage request) { _session.SendRequest(_serviceHash, methodId, request); }
public void SendResponse(uint token, BattlenetRpcErrorCode status) { _session.SendResponse(token, status); }
public void SendResponse(uint token, IMessage response) { _session.SendResponse(token, response); }
public string GetCallerInfo()
{
return _session.GetClientInfo();
}
protected Session _session;
protected uint _serviceHash;
}
}
+319
View File
@@ -0,0 +1,319 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Bgs.Protocol;
using Bgs.Protocol.UserManager.V1;
using BNetServer.Services;
using Framework.Constants;
using Google.Protobuf;
namespace BNetServer.Networking
{
class UserManagerService : ServiceBase
{
public UserManagerService(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
SubscribeRequest request = new SubscribeRequest();
request.MergeFrom(stream);
SubscribeResponse response = new SubscribeResponse();
BattlenetRpcErrorCode status = HandleSubscribe(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method UserManagerService.Subscribe(bgs.protocol.user_manager.v1.SubscribeRequest: {1}) returned bgs.protocol.user_manager.v1.SubscribeResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 10:
{
AddRecentPlayersRequest request = new AddRecentPlayersRequest();
request.MergeFrom(stream);
AddRecentPlayersResponse response = new AddRecentPlayersResponse();
BattlenetRpcErrorCode status = HandleAddRecentPlayers(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method UserManagerService.AddRecentPlayers(bgs.protocol.user_manager.v1.AddRecentPlayersRequest: {1}) returned bgs.protocol.user_manager.v1.AddRecentPlayersResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 11:
{
ClearRecentPlayersRequest request = new ClearRecentPlayersRequest();
request.MergeFrom(stream);
ClearRecentPlayersResponse response = new ClearRecentPlayersResponse();
BattlenetRpcErrorCode status = HandleClearRecentPlayers(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method UserManagerService.ClearRecentPlayers(bgs.protocol.user_manager.v1.ClearRecentPlayersRequest: {1}) returned bgs.protocol.user_manager.v1.ClearRecentPlayersResponse: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 20:
{
BlockPlayerRequest request = new BlockPlayerRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleBlockPlayer(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method UserManagerService.BlockPlayer(bgs.protocol.user_manager.v1.BlockPlayerRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 21:
{
UnblockPlayerRequest request = new UnblockPlayerRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleUnblockPlayer(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method UserManagerService.UnblockPlayer(bgs.protocol.user_manager.v1.UnblockPlayerRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 40:
{
BlockPlayerRequest request = new BlockPlayerRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleBlockPlayerForSession(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method UserManagerService.BlockPlayerForSession(bgs.protocol.user_manager.v1.BlockPlayerRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 50:
{
EntityId request = new EntityId();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleLoadBlockList(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method UserManagerService.LoadBlockList(bgs.protocol.EntityId: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
case 51:
{
UnsubscribeRequest request = new UnsubscribeRequest();
request.MergeFrom(stream);
NoData response = new NoData();
BattlenetRpcErrorCode status = HandleUnsubscribe(request, response);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method UserManagerService.Unsubscribe(bgs.protocol.user_manager.v1.UnsubscribeRequest: {1}) returned bgs.protocol.NoData: {2} status: {3}.",
GetCallerInfo(), request.ToString(), response.ToString(), status);
if (status == 0)
SendResponse(token, response);
else
SendResponse(token, status);
break;
}
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleSubscribe(SubscribeRequest request, SubscribeResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method UserManagerService.Subscribe: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleAddRecentPlayers(AddRecentPlayersRequest request, AddRecentPlayersResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method UserManagerService.AddRecentPlayers: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleClearRecentPlayers(ClearRecentPlayersRequest request, ClearRecentPlayersResponse response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method UserManagerService.ClearRecentPlayers: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleBlockPlayer(BlockPlayerRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method UserManagerService.BlockPlayer: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleUnblockPlayer(UnblockPlayerRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method UserManagerService.UnblockPlayer: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleBlockPlayerForSession(BlockPlayerRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method UserManagerService.BlockPlayerForSession: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleLoadBlockList(EntityId request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method UserManagerService.LoadBlockList: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleUnsubscribe(UnsubscribeRequest request, NoData response)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method UserManagerService.Unsubscribe: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
}
class UserManagerListener : ServiceBase
{
public UserManagerListener(Session session, uint serviceHash) : base(session, serviceHash) { }
public override void CallServerMethod(uint token, uint methodId, CodedInputStream stream)
{
switch (methodId)
{
case 1:
{
BlockedPlayerAddedNotification request = new BlockedPlayerAddedNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnBlockedPlayerAdded(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method UserManagerListener.OnBlockedPlayerAdded(bgs.protocol.user_manager.v1.BlockedPlayerAddedNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 2:
{
BlockedPlayerRemovedNotification request = new BlockedPlayerRemovedNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnBlockedPlayerRemoved(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method UserManagerListener.OnBlockedPlayerRemoved(bgs.protocol.user_manager.v1.BlockedPlayerRemovedNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 11:
{
RecentPlayersAddedNotification request = new RecentPlayersAddedNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnRecentPlayersAdded(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method UserManagerListener.OnRecentPlayersAdded(bgs.protocol.user_manager.v1.RecentPlayersAddedNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
case 12:
{
RecentPlayersRemovedNotification request = new RecentPlayersRemovedNotification();
request.MergeFrom(stream);
BattlenetRpcErrorCode status = HandleOnRecentPlayersRemoved(request);
Log.outDebug(LogFilter.ServiceProtobuf, "{0} Client called server method UserManagerListener.OnRecentPlayersRemoved(bgs.protocol.user_manager.v1.RecentPlayersRemovedNotification: {1}) status: {2}.",
GetCallerInfo(), request.ToString(), status);
if (status != 0)
SendResponse(token, status);
break;
}
default:
Log.outError(LogFilter.ServiceProtobuf, "Bad method id {0}.", methodId);
SendResponse(token, BattlenetRpcErrorCode.RpcInvalidMethod);
break;
}
}
BattlenetRpcErrorCode HandleOnBlockedPlayerAdded(BlockedPlayerAddedNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method UserManagerListener.OnBlockedPlayerAdded: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnBlockedPlayerRemoved(BlockedPlayerRemovedNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method UserManagerListener.OnBlockedPlayerRemoved: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnRecentPlayersAdded(RecentPlayersAddedNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method UserManagerListener.OnRecentPlayersAdded: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
BattlenetRpcErrorCode HandleOnRecentPlayersRemoved(RecentPlayersRemovedNotification request)
{
Log.outError(LogFilter.ServiceProtobuf, "{0} Client tried to call not implemented method UserManagerListener.OnRecentPlayersRemoved: {1}",
GetCallerInfo(), request.ToString());
return BattlenetRpcErrorCode.RpcNotImplemented;
}
}
}
+115
View File
@@ -0,0 +1,115 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorldServer", "WorldServer\WorldServer.csproj", "{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}"
ProjectSection(ProjectDependencies) = postProject
{9E28B9C1-E473-4DAE-813F-3243CE318736} = {9E28B9C1-E473-4DAE-813F-3243CE318736}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BNetServer", "BNetServer\BNetServer.csproj", "{668E1664-FB63-47DA-9EA1-93B59851BF1E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Game", "Game\Game.csproj", "{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Scripts", "Scripts\Scripts.csproj", "{9E28B9C1-E473-4DAE-813F-3243CE318736}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Framework", "Framework\Framework.csproj", "{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
DebugMono|x64 = DebugMono|x64
DebugMono|x86 = DebugMono|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
ReleaseMono|x64 = ReleaseMono|x64
ReleaseMono|x86 = ReleaseMono|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.Debug|x64.ActiveCfg = Debug|x64
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.Debug|x64.Build.0 = Debug|x64
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.Debug|x86.ActiveCfg = Debug|x86
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.Debug|x86.Build.0 = Debug|x86
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.DebugMono|x64.ActiveCfg = Debug|x64
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.DebugMono|x64.Build.0 = Debug|x64
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.DebugMono|x86.ActiveCfg = Debug|x86
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.DebugMono|x86.Build.0 = Debug|x86
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.Release|x64.ActiveCfg = Release|x64
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.Release|x64.Build.0 = Release|x64
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.Release|x86.ActiveCfg = Release|x86
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.Release|x86.Build.0 = Release|x86
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.ReleaseMono|x64.ActiveCfg = Release|x64
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.ReleaseMono|x64.Build.0 = Release|x64
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.ReleaseMono|x86.ActiveCfg = Release|x86
{D157534F-86F1-4E8E-80B0-ECAD321ECAA6}.ReleaseMono|x86.Build.0 = Release|x86
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.Debug|x64.ActiveCfg = Debug|x64
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.Debug|x64.Build.0 = Debug|x64
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.Debug|x86.ActiveCfg = Debug|x86
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.Debug|x86.Build.0 = Debug|x86
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.DebugMono|x64.ActiveCfg = Debug|x64
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.DebugMono|x64.Build.0 = Debug|x64
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.DebugMono|x86.ActiveCfg = Debug|x86
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.DebugMono|x86.Build.0 = Debug|x86
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.Release|x64.ActiveCfg = Release|x64
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.Release|x64.Build.0 = Release|x64
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.Release|x86.ActiveCfg = Release|x86
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.Release|x86.Build.0 = Release|x86
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.ReleaseMono|x64.ActiveCfg = Release|x64
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.ReleaseMono|x64.Build.0 = Release|x64
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.ReleaseMono|x86.ActiveCfg = Release|x86
{668E1664-FB63-47DA-9EA1-93B59851BF1E}.ReleaseMono|x86.Build.0 = Release|x86
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.Debug|x64.ActiveCfg = Debug|x64
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.Debug|x64.Build.0 = Debug|x64
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.Debug|x86.ActiveCfg = Debug|x86
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.Debug|x86.Build.0 = Debug|x86
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.DebugMono|x64.ActiveCfg = Debug|x64
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.DebugMono|x64.Build.0 = Debug|x64
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.DebugMono|x86.ActiveCfg = Debug|x86
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.DebugMono|x86.Build.0 = Debug|x86
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.Release|x64.ActiveCfg = Release|x64
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.Release|x64.Build.0 = Release|x64
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.Release|x86.ActiveCfg = Release|x86
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.Release|x86.Build.0 = Release|x86
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.ReleaseMono|x64.ActiveCfg = Release|x64
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.ReleaseMono|x64.Build.0 = Release|x64
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.ReleaseMono|x86.ActiveCfg = Release|x86
{83EF8D5C-AFA1-4546-BCDD-6422D55B1515}.ReleaseMono|x86.Build.0 = Release|x86
{9E28B9C1-E473-4DAE-813F-3243CE318736}.Debug|x64.ActiveCfg = Debug|x64
{9E28B9C1-E473-4DAE-813F-3243CE318736}.Debug|x64.Build.0 = Debug|x64
{9E28B9C1-E473-4DAE-813F-3243CE318736}.Debug|x86.ActiveCfg = Debug|x86
{9E28B9C1-E473-4DAE-813F-3243CE318736}.Debug|x86.Build.0 = Debug|x86
{9E28B9C1-E473-4DAE-813F-3243CE318736}.DebugMono|x64.ActiveCfg = Debug|x64
{9E28B9C1-E473-4DAE-813F-3243CE318736}.DebugMono|x64.Build.0 = Debug|x64
{9E28B9C1-E473-4DAE-813F-3243CE318736}.DebugMono|x86.ActiveCfg = Debug|x86
{9E28B9C1-E473-4DAE-813F-3243CE318736}.DebugMono|x86.Build.0 = Debug|x86
{9E28B9C1-E473-4DAE-813F-3243CE318736}.Release|x64.ActiveCfg = Release|x64
{9E28B9C1-E473-4DAE-813F-3243CE318736}.Release|x64.Build.0 = Release|x64
{9E28B9C1-E473-4DAE-813F-3243CE318736}.Release|x86.ActiveCfg = Release|x86
{9E28B9C1-E473-4DAE-813F-3243CE318736}.Release|x86.Build.0 = Release|x86
{9E28B9C1-E473-4DAE-813F-3243CE318736}.ReleaseMono|x64.ActiveCfg = Release|x64
{9E28B9C1-E473-4DAE-813F-3243CE318736}.ReleaseMono|x64.Build.0 = Release|x64
{9E28B9C1-E473-4DAE-813F-3243CE318736}.ReleaseMono|x86.ActiveCfg = Release|x86
{9E28B9C1-E473-4DAE-813F-3243CE318736}.ReleaseMono|x86.Build.0 = Release|x86
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.Debug|x64.ActiveCfg = Debug|x64
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.Debug|x64.Build.0 = Debug|x64
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.Debug|x86.ActiveCfg = Debug|x86
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.Debug|x86.Build.0 = Debug|x86
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.DebugMono|x64.ActiveCfg = Debug|x64
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.DebugMono|x64.Build.0 = Debug|x64
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.DebugMono|x86.ActiveCfg = Debug|x86
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.DebugMono|x86.Build.0 = Debug|x86
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.Release|x64.ActiveCfg = Release|x64
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.Release|x64.Build.0 = Release|x64
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.Release|x86.ActiveCfg = Release|x86
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.Release|x86.Build.0 = Release|x86
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.ReleaseMono|x64.ActiveCfg = Release|x64
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.ReleaseMono|x64.Build.0 = Release|x64
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.ReleaseMono|x86.ActiveCfg = Release|x86
{82D442A9-18C0-4C59-8EC6-0DFE3E34D334}.ReleaseMono|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+81
View File
@@ -0,0 +1,81 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System.IO;
namespace System.Collections.Generic
{
public class Array<T> : List<T>
{
public Array(int size) : base(size)
{
_limit = size;
}
public Array(params T[] args) : base(args)
{
_limit = args.Length;
}
public Array(int size, T defaultFillValue) : this(size)
{
Fill(defaultFillValue);
}
public void Fill(T value)
{
for (var i = 0; i < _limit; ++i)
Add(value);
}
public new void Add(T value)
{
if (base.Count >= _limit)
throw new InternalBufferOverflowException("Attempted to read more array elements from packet " + base.Count + 1 + " than allowed " + _limit);
base.Add(value);
}
public new T this[int index]
{
get
{
return base[index];
}
set
{
if (index >= Count)
{
if (Count >= _limit)
throw new InternalBufferOverflowException("Attempted to read more array elements from packet " + base.Count + 1 + " than allowed " + _limit);
base.Insert(index, value);
}
else
base[index] = value;
}
}
public int GetLimit() { return _limit; }
public static implicit operator T[] (Array<T> array)
{
return array.ToArray();
}
int _limit;
}
}
+414
View File
@@ -0,0 +1,414 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Diagnostics.Contracts;
namespace System.Collections
{
public class BitSet : ICollection, ICloneable
{
public BitSet(int length, bool defaultValue = false)
{
if (length < 0)
{
throw new ArgumentOutOfRangeException("length");
}
Contract.EndContractBlock();
m_array = new uint[GetArrayLength(length, BitsPerInt32)];
m_length = length;
uint fillValue = defaultValue ? 0xffffffff : 0;
for (int i = 0; i < m_array.Length; i++)
{
m_array[i] = fillValue;
}
_version = 0;
}
public BitSet(uint[] values)
{
if (values == null)
{
throw new ArgumentNullException("values");
}
Contract.EndContractBlock();
// this value is chosen to prevent overflow when computing m_length
if (values.Length > UInt32.MaxValue / BitsPerInt32)
{
throw new ArgumentException();
}
m_array = new uint[values.Length];
m_length = values.Length * BitsPerInt32;
Array.Copy(values, m_array, values.Length);
_version = 0;
}
public BitSet(BitSet bits)
{
if (bits == null)
{
throw new ArgumentNullException("bits");
}
Contract.EndContractBlock();
int arrayLength = GetArrayLength(bits.m_length, BitsPerInt32);
m_array = new uint[arrayLength];
m_length = bits.m_length;
Array.Copy(bits.m_array, m_array, arrayLength);
_version = bits._version;
}
public bool this[int index]
{
get
{
return Get(index);
}
set
{
Set(index, value);
}
}
public bool Get(int index)
{
if (index < 0 || index >= Length)
{
throw new ArgumentOutOfRangeException("index");
}
Contract.EndContractBlock();
return (Convert.ToInt64(m_array[index / 32]) & (1 << (index % 32))) != 0;
}
public void Set(int index, bool value)
{
if (index < 0 || index >= Length)
{
throw new ArgumentOutOfRangeException("index");
}
Contract.EndContractBlock();
if (value)
{
m_array[index / 32] |= (1u << (index % 32));
}
else
{
m_array[index / 32] &= ~(1u << (index % 32));
}
_version++;
}
public void SetAll(bool value)
{
uint fillValue = value ? 0xffffffff : 0u;
int ints = GetArrayLength(m_length, BitsPerInt32);
for (int i = 0; i < ints; i++)
{
m_array[i] = fillValue;
}
_version++;
}
public BitSet And(BitSet value)
{
if (value == null)
throw new ArgumentNullException("value");
if (Length != value.Length)
throw new ArgumentException();
Contract.EndContractBlock();
int ints = GetArrayLength(m_length, BitsPerInt32);
for (int i = 0; i < ints; i++)
{
m_array[i] &= value.m_array[i];
}
_version++;
return this;
}
public BitSet Or(BitSet value)
{
if (value == null)
throw new ArgumentNullException("value");
if (Length != value.Length)
throw new ArgumentException();
Contract.EndContractBlock();
int ints = GetArrayLength(m_length, BitsPerInt32);
for (int i = 0; i < ints; i++)
{
m_array[i] |= value.m_array[i];
}
_version++;
return this;
}
public BitSet Xor(BitSet value)
{
if (value == null)
throw new ArgumentNullException("value");
if (Length != value.Length)
throw new ArgumentException();
Contract.EndContractBlock();
int ints = GetArrayLength(m_length, BitsPerInt32);
for (int i = 0; i < ints; i++)
{
m_array[i] ^= value.m_array[i];
}
_version++;
return this;
}
public BitSet Not()
{
int ints = GetArrayLength(m_length, BitsPerInt32);
for (int i = 0; i < ints; i++)
{
m_array[i] = ~m_array[i];
}
_version++;
return this;
}
public int Length
{
get
{
Contract.Ensures(Contract.Result<int>() >= 0);
return m_length;
}
set
{
if (value < 0)
{
throw new ArgumentOutOfRangeException("value");
}
Contract.EndContractBlock();
int newints = GetArrayLength(value, BitsPerInt32);
if (newints > m_array.Length || newints + _ShrinkThreshold < m_array.Length)
{
// grow or shrink (if wasting more than _ShrinkThreshold ints)
uint[] newarray = new uint[newints];
Array.Copy(m_array, newarray, newints > m_array.Length ? m_array.Length : newints);
m_array = newarray;
}
if (value > m_length)
{
// clear high bit values in the last int
int last = GetArrayLength(m_length, BitsPerInt32) - 1;
int bits = m_length % 32;
if (bits > 0)
{
m_array[last] &= (1u << bits) - 1;
}
// clear remaining int values
Array.Clear(m_array, last + 1, newints - last - 1);
}
m_length = value;
_version++;
}
}
// ICollection implementation
public void CopyTo(Array array, int index)
{
if (array == null)
throw new ArgumentNullException("array");
if (index < 0)
throw new ArgumentOutOfRangeException("index");
if (array.Rank != 1)
throw new ArgumentException();
Contract.EndContractBlock();
if (array is uint[])
{
Array.Copy(m_array, 0, array, index, GetArrayLength(m_length, BitsPerInt32));
}
else if (array is byte[])
{
int arrayLength = GetArrayLength(m_length, BitsPerByte);
if ((array.Length - index) < arrayLength)
throw new ArgumentException();
byte[] b = (byte[])array;
for (int i = 0; i < arrayLength; i++)
b[index + i] = (byte)((m_array[i / 4] >> ((i % 4) * 8)) & 0x000000FF); // Shift to bring the required byte to LSB, then mask
}
else if (array is bool[])
{
if (array.Length - index < m_length)
throw new ArgumentException();
bool[] b = (bool[])array;
for (int i = 0; i < m_length; i++)
b[index + i] = ((m_array[i / 32] >> (i % 32)) & 0x00000001) != 0;
}
else
throw new ArgumentException();
}
public int Count
{
get
{
Contract.Ensures(Contract.Result<int>() >= 0);
return (int)m_length;
}
}
public Object Clone()
{
Contract.Ensures(Contract.Result<Object>() != null);
Contract.Ensures(((BitArray)Contract.Result<Object>()).Length == this.Length);
BitSet bitArray = new BitSet(m_array);
bitArray._version = _version;
bitArray.m_length = m_length;
return bitArray;
}
public Object SyncRoot
{
get
{
if (_syncRoot == null)
{
System.Threading.Interlocked.CompareExchange<Object>(ref _syncRoot, new Object(), null);
}
return _syncRoot;
}
}
public bool IsReadOnly
{
get
{
return false;
}
}
public bool IsSynchronized
{
get
{
return false;
}
}
public IEnumerator GetEnumerator()
{
return new BitArrayEnumeratorSimple(this);
}
// XPerY=n means that n Xs can be stored in 1 Y.
private const int BitsPerInt32 = 32;
private const int BytesPerInt32 = 4;
private const int BitsPerByte = 8;
private static int GetArrayLength(int n, int div)
{
Contract.Assert(div > 0, "GetArrayLength: div arg must be greater than 0");
return n > 0 ? (((n - 1) / div) + 1) : 0;
}
[Serializable]
private class BitArrayEnumeratorSimple : IEnumerator, ICloneable
{
private BitSet bitarray;
private int index;
private int version;
private bool currentElement;
internal BitArrayEnumeratorSimple(BitSet bitarray)
{
this.bitarray = bitarray;
this.index = -1;
version = bitarray._version;
}
public Object Clone()
{
return MemberwiseClone();
}
public virtual bool MoveNext()
{
//if (version != bitarray._version) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
if (index < (bitarray.Count - 1))
{
index++;
currentElement = bitarray.Get(index);
return true;
}
else
index = bitarray.Count;
return false;
}
public virtual Object Current
{
get
{
if (index == -1)
throw new InvalidOperationException();
if (index >= bitarray.Count)
throw new InvalidOperationException();
return currentElement;
}
}
public void Reset()
{
//if (version != bitarray._version) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
index = -1;
}
}
private uint[] m_array;
private int m_length;
private int _version;
[NonSerialized]
private Object _syncRoot;
private const int _ShrinkThreshold = 256;
}
}
+41
View File
@@ -0,0 +1,41 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace System.Collections.Generic
{
public interface IMultiMap<TKey, TValue>
{
void AddRange(TKey key, IEnumerable<TValue> valueList);
List<TValue> this[TKey key] { get; set;}
bool Remove(TKey key, TValue value);
void Add(TKey key, TValue value);
bool ContainsKey(TKey key);
ICollection<TKey> Keys {get;}
bool Remove(TKey key);
ICollection<TValue> Values{get;}
void Add(KeyValuePair<TKey, TValue> item);
void Clear();
bool Contains(TKey key, TValue item);
void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex);
int Count {get;}
bool Remove(KeyValuePair<TKey, TValue> item);
List<TValue> LookupByKey(TKey key);
}
}
+117
View File
@@ -0,0 +1,117 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Collections
{
public class LinkedListElement
{
internal LinkedListElement iNext;
internal LinkedListElement iPrev;
public LinkedListElement()
{
iNext = iPrev = null;
}
~LinkedListElement() { delink(); }
bool hasNext() { return (iNext != null && iNext.iNext != null); }
bool hasPrev() { return (iPrev != null && iPrev.iPrev != null); }
public bool isInList() { return (iNext != null && iPrev != null); }
public LinkedListElement GetNextElement() { return hasNext() ? iNext : null; }
public LinkedListElement GetPrevElement() { return hasPrev() ? iPrev : null; }
public void delink()
{
if (isInList())
{
iNext.iPrev = iPrev;
iPrev.iNext = iNext;
iNext = null;
iPrev = null;
}
}
public void insertBefore(LinkedListElement pElem)
{
pElem.iNext = this;
pElem.iPrev = iPrev;
iPrev.iNext = pElem;
iPrev = pElem;
}
public void insertAfter(LinkedListElement pElem)
{
pElem.iPrev = this;
pElem.iNext = iNext;
iNext.iPrev = pElem;
iNext = pElem;
}
}
public class LinkedListHead
{
LinkedListElement iFirst = new LinkedListElement();
LinkedListElement iLast = new LinkedListElement();
uint iSize;
public LinkedListHead()
{
iSize = 0;
// create empty list
iFirst.iNext = iLast;
iLast.iPrev = iFirst;
}
public bool isEmpty() { return (!iFirst.iNext.isInList()); }
public LinkedListElement GetFirstElement() { return (isEmpty() ? null : iFirst.iNext); }
public LinkedListElement GetLastElement() { return (isEmpty() ? null : iLast.iPrev); }
public void insertFirst(LinkedListElement pElem)
{
iFirst.insertAfter(pElem);
}
public void insertLast(LinkedListElement pElem)
{
iLast.insertBefore(pElem);
}
public uint getSize()
{
if (iSize == 0)
{
uint result = 0;
LinkedListElement e = GetFirstElement();
while (e != null)
{
++result;
e = e.GetNextElement();
}
return result;
}
else
return iSize;
}
public void incSize() { ++iSize; }
public void decSize() { --iSize; }
}
}
+508
View File
@@ -0,0 +1,508 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Linq;
namespace System.Collections.Generic
{
public sealed class MultiMap<TKey, TValue> : IMultiMap<TKey, TValue>, IDictionary<TKey, TValue>
{
public MultiMap() { }
public MultiMap(IEnumerable<KeyValuePair<TKey, TValue>> initialData)
{
foreach (var item in initialData)
{
Add(item);
}
}
public void Add(TKey key, TValue value)
{
if (!_interalStorage.ContainsKey(key))
_interalStorage.Add(key, new List<TValue>());
_interalStorage[key].Add(value);
}
public void AddRange(TKey key, IEnumerable<TValue> valueList)
{
if (!_interalStorage.ContainsKey(key))
{
_interalStorage.Add(key, new List<TValue>());
}
foreach (TValue value in valueList)
{
_interalStorage[key].Add(value);
}
}
public void Add(KeyValuePair<TKey, TValue> item)
{
if (!_interalStorage.ContainsKey(item.Key))
{
_interalStorage.Add(item.Key, new List<TValue>());
}
_interalStorage[item.Key].Add(item.Value);
}
public bool Remove(TKey key)
{
return _interalStorage.Remove(key);
}
public bool Remove(KeyValuePair<TKey, TValue> item)
{
if (!ContainsKey(item.Key))
return false;
bool val = _interalStorage[item.Key].Remove(item.Value);
if (!val)
return false;
if (_interalStorage[item.Key].Empty())
_interalStorage.Remove(item.Key);
return true;
}
public bool Remove(TKey key, TValue value)
{
if (!ContainsKey(key))
return false;
bool val = _interalStorage[key].Remove(value);
if (!val)
return false;
if (_interalStorage[key].Empty())
_interalStorage.Remove(key);
return true;
}
public bool ContainsKey(TKey key)
{
return _interalStorage.ContainsKey(key);
}
public bool Contains(KeyValuePair<TKey, TValue> item)
{
List<TValue> valueList;
if (_interalStorage.TryGetValue(item.Key, out valueList))
return valueList.Contains(item.Value);
return false;
}
public bool Contains(TKey key, TValue item)
{
if (!_interalStorage.ContainsKey(key)) return false;
return _interalStorage[key].Contains(item);
}
public List<TValue> LookupByKey(TKey key)
{
if (_interalStorage.ContainsKey(key))
return _interalStorage[key].ToList();
return new List<TValue>();
}
public List<TValue> LookupByKey(object key)
{
TKey newkey = (TKey)Convert.ChangeType(key, typeof(TKey));
if (_interalStorage.ContainsKey(newkey))
return _interalStorage[newkey].ToList();
return new List<TValue>();
}
bool IDictionary<TKey, TValue>.TryGetValue(TKey key, out TValue value)
{
if (!_interalStorage.ContainsKey(key))
{
value = default(TValue);
return false;
}
value = _interalStorage[key].Last();
return true;
}
TValue IDictionary<TKey, TValue>.this[TKey key]
{
get
{
return _interalStorage[key].LastOrDefault();
}
set
{
Add(key, value);
}
}
public List<TValue> this[TKey key]
{
get
{
if (!_interalStorage.ContainsKey(key))
return new List<TValue>();
return _interalStorage[key];
}
set
{
if (!_interalStorage.ContainsKey(key))
_interalStorage.Add(key, value);
else
_interalStorage[key] = value;
}
}
public ICollection<TKey> Keys
{
get { return _interalStorage.Keys; }
}
public ICollection<TValue> Values
{
get
{
List<TValue> retVal = new List<TValue>();
foreach (var item in _interalStorage)
{
retVal.AddRange(item.Value);
}
return retVal;
}
}
public List<KeyValuePair<TKey, TValue>> KeyValueList
{
get
{
List<KeyValuePair<TKey, TValue>> retVal = new List<KeyValuePair<TKey, TValue>>();
foreach (var pair in _interalStorage)
{
foreach (var value in pair.Value)
retVal.Add(new KeyValuePair<TKey, TValue>(pair.Key, value));
}
return retVal;
}
}
public void Clear()
{
_interalStorage.Clear();
}
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
{
if (array == null)
throw new ArgumentNullException("array");
if (arrayIndex < 0)
throw new ArgumentOutOfRangeException("arrayIndex", arrayIndex, "argument 'arrayIndex' cannot be negative");
if (arrayIndex >= array.Length || Count > array.Length - arrayIndex)
array = new KeyValuePair<TKey, TValue>[Count];
int index = arrayIndex;
foreach (KeyValuePair<TKey, TValue> pair in this)
array[index++] = new KeyValuePair<TKey, TValue>(pair.Key, pair.Value);
}
public int Count
{
get
{
int count = 0;
foreach (var item in _interalStorage)
{
count += item.Value.Count;
}
return count;
}
}
int ICollection<KeyValuePair<TKey, TValue>>.Count
{
get { return _interalStorage.Count; }
}
bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly
{
get { return false; }
}
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
{
return new MultiMapEnumerator<TKey, TValue>(this);
}
IEnumerator IEnumerable.GetEnumerator()
{
return new MultiMapEnumerator<TKey, TValue>(this);
}
private Dictionary<TKey, List<TValue>> _interalStorage = new Dictionary<TKey, List<TValue>>();
}
public sealed class SortedMultiMap<TKey, TValue> : IMultiMap<TKey, TValue>, IDictionary<TKey, TValue>
{
public SortedMultiMap() { }
public SortedMultiMap(IEnumerable<KeyValuePair<TKey, TValue>> initialData)
{
foreach (var item in initialData)
{
Add(item);
}
}
public void Add(TKey key, TValue value)
{
if (!_interalStorage.ContainsKey(key))
_interalStorage.Add(key, new List<TValue>());
_interalStorage[key].Add(value);
}
public void AddRange(TKey key, IEnumerable<TValue> valueList)
{
if (!_interalStorage.ContainsKey(key))
{
_interalStorage.Add(key, new List<TValue>());
}
foreach (TValue value in valueList)
{
_interalStorage[key].Add(value);
}
}
public void Add(KeyValuePair<TKey, TValue> item)
{
if (!_interalStorage.ContainsKey(item.Key))
{
_interalStorage.Add(item.Key, new List<TValue>());
}
_interalStorage[item.Key].Add(item.Value);
}
public bool Remove(TKey key)
{
return _interalStorage.Remove(key);
}
public bool Remove(KeyValuePair<TKey, TValue> item)
{
if (!ContainsKey(item.Key))
return false;
bool val = _interalStorage[item.Key].Remove(item.Value);
if (!val)
return false;
if (_interalStorage[item.Key].Empty())
_interalStorage.Remove(item.Key);
return true;
}
public bool Remove(TKey key, TValue value)
{
if (!ContainsKey(key))
return false;
bool val = _interalStorage[key].Remove(value);
if (!val)
return false;
if (_interalStorage[key].Empty())
_interalStorage.Remove(key);
return true;
}
public bool ContainsKey(TKey key)
{
return _interalStorage.ContainsKey(key);
}
public bool Contains(KeyValuePair<TKey, TValue> item)
{
List<TValue> valueList;
if (_interalStorage.TryGetValue(item.Key, out valueList))
return valueList.Contains(item.Value);
return false;
}
public bool Contains(TKey key, TValue item)
{
if (!_interalStorage.ContainsKey(key)) return false;
return _interalStorage[key].Contains(item);
}
public List<TValue> LookupByKey(TKey key)
{
if (_interalStorage.ContainsKey(key))
return _interalStorage[key].ToList();
return new List<TValue>();
}
public List<TValue> LookupByKey(object key)
{
TKey newkey = (TKey)Convert.ChangeType(key, typeof(TKey));
if (_interalStorage.ContainsKey(newkey))
return _interalStorage[newkey].ToList();
return new List<TValue>();
}
bool IDictionary<TKey, TValue>.TryGetValue(TKey key, out TValue value)
{
if (!_interalStorage.ContainsKey(key))
{
value = default(TValue);
return false;
}
value = _interalStorage[key].Last();
return true;
}
TValue IDictionary<TKey, TValue>.this[TKey key]
{
get
{
return _interalStorage[key].LastOrDefault();
}
set
{
Add(key, value);
}
}
public List<TValue> this[TKey key]
{
get
{
if (!_interalStorage.ContainsKey(key))
return new List<TValue>();
return _interalStorage[key];
}
set
{
if (!_interalStorage.ContainsKey(key))
_interalStorage.Add(key, value);
else _interalStorage[key] = value;
}
}
public ICollection<TKey> Keys
{
get { return _interalStorage.Keys; }
}
public ICollection<TValue> Values
{
get
{
List<TValue> retVal = new List<TValue>();
foreach (var item in _interalStorage)
{
retVal.AddRange(item.Value);
}
return retVal;
}
}
public List<KeyValuePair<TKey, TValue>> KeyValueList
{
get
{
List<KeyValuePair<TKey, TValue>> retVal = new List<KeyValuePair<TKey, TValue>>();
foreach (var pair in _interalStorage)
{
foreach (var value in pair.Value)
retVal.Add(new KeyValuePair<TKey, TValue>(pair.Key, value));
}
return retVal;
}
}
public void Clear()
{
_interalStorage.Clear();
}
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
{
if (array == null)
throw new ArgumentNullException("array");
if (arrayIndex < 0)
throw new ArgumentOutOfRangeException("arrayIndex", arrayIndex, "argument 'arrayIndex' cannot be negative");
if (arrayIndex >= array.Length || Count > array.Length - arrayIndex)
array = new KeyValuePair<TKey, TValue>[Count];
int index = arrayIndex;
foreach (KeyValuePair<TKey, TValue> pair in this)
array[index++] = new KeyValuePair<TKey, TValue>(pair.Key, pair.Value);
}
public int Count
{
get
{
int count = 0;
foreach (var item in _interalStorage)
{
count += item.Value.Count;
}
return count;
}
}
int ICollection<KeyValuePair<TKey, TValue>>.Count
{
get { return _interalStorage.Count; }
}
bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly
{
get { return false; }
}
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
{
return new SortedMultiMapEnumerator<TKey, TValue>(this);
}
IEnumerator IEnumerable.GetEnumerator()
{
return new SortedMultiMapEnumerator<TKey, TValue>(this);
}
private SortedDictionary<TKey, List<TValue>> _interalStorage = new SortedDictionary<TKey, List<TValue>>();
}
}
+129
View File
@@ -0,0 +1,129 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace System.Collections.Generic
{
public class MultiMapEnumerator<TKey, TValue> : IEnumerator<KeyValuePair<TKey, TValue>>
{
MultiMap<TKey, TValue> _map;
IEnumerator<TKey> _keyEnumerator;
IEnumerator<TValue> _valueEnumerator;
public MultiMapEnumerator(MultiMap<TKey, TValue> map)
{
_map = map;
Reset();
}
object IEnumerator.Current
{
get
{
return Current;
}
}
public KeyValuePair<TKey, TValue> Current
{
get
{
return new KeyValuePair<TKey, TValue>(_keyEnumerator.Current, _valueEnumerator.Current);
}
}
public void Dispose()
{
_keyEnumerator = null;
_valueEnumerator = null;
_map = null;
}
public bool MoveNext()
{
if (!_valueEnumerator.MoveNext())
{
if (!_keyEnumerator.MoveNext())
return false;
_valueEnumerator = _map[_keyEnumerator.Current].GetEnumerator();
_valueEnumerator.MoveNext();
return true;
}
return true;
}
public void Reset()
{
_keyEnumerator = _map.Keys.GetEnumerator();
_valueEnumerator = new List<TValue>().GetEnumerator();
}
}
public class SortedMultiMapEnumerator<TKey, TValue> : IEnumerator<KeyValuePair<TKey, TValue>>
{
SortedMultiMap<TKey, TValue> _map;
IEnumerator<TKey> _keyEnumerator;
IEnumerator<TValue> _valueEnumerator;
public SortedMultiMapEnumerator(SortedMultiMap<TKey, TValue> map)
{
_map = map;
Reset();
}
object IEnumerator.Current
{
get
{
return Current;
}
}
public KeyValuePair<TKey, TValue> Current
{
get
{
return new KeyValuePair<TKey, TValue>(_keyEnumerator.Current, _valueEnumerator.Current);
}
}
public void Dispose()
{
_keyEnumerator = null;
_valueEnumerator = null;
_map = null;
}
public bool MoveNext()
{
if (!_valueEnumerator.MoveNext())
{
if (!_keyEnumerator.MoveNext())
return false;
_valueEnumerator = _map[_keyEnumerator.Current].GetEnumerator();
_valueEnumerator.MoveNext();
return true;
}
return true;
}
public void Reset()
{
_keyEnumerator = _map.Keys.GetEnumerator();
_valueEnumerator = new List<TValue>().GetEnumerator();
}
}
}
+59
View File
@@ -0,0 +1,59 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections;
namespace Framework.Collections
{
public class StringArray
{
public StringArray(int size)
{
_str = new string[size];
for (var i = 0; i < size; ++i)
_str[i] = "";
}
public StringArray(string str, params string[] separator)
{
_str = str.Split(separator, StringSplitOptions.RemoveEmptyEntries);
}
public StringArray(string str, params char[] separator)
{
_str = str.Split(separator, StringSplitOptions.RemoveEmptyEntries);
}
public string this[int index]
{
get { return _str[index]; }
set { _str[index] = value; }
}
public IEnumerator GetEnumerator()
{
return _str.GetEnumerator();
}
public int Length { get { return _str.Length; } }
string[] _str;
}
}
+85
View File
@@ -0,0 +1,85 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Collections;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace Framework.Configuration
{
public class ConfigMgr
{
public static bool Load(string fileName)
{
string path = "./" + fileName;
if (!File.Exists(path))
{
Console.WriteLine("{0} doesn't exist!", fileName);
return false;
}
string[] ConfigContent = File.ReadAllLines(path, Encoding.UTF8);
int lineCounter = 0;
try
{
string name = string.Empty;
foreach (var line in ConfigContent)
{
lineCounter++;
if (line.StartsWith("#") || line.StartsWith("-") || string.IsNullOrEmpty(line))
continue;
var configOption = new StringArray(line, '=');
_configList.Add(configOption[0].Trim(), configOption[1].Replace("\"", "").Trim());
}
}
catch
{
Console.WriteLine("Error in {0} on Line {1}", fileName, lineCounter);
return false;
}
return true;
}
public static T GetDefaultValue<T>(string name, T defaultValue)
{
string temp = _configList.LookupByKey(name);
var type = typeof(T).IsEnum ? typeof(T).GetEnumUnderlyingType() : typeof(T);
if (temp.IsEmpty())
return (T)Convert.ChangeType(defaultValue, type);
if (Type.GetTypeCode(typeof(T)) == TypeCode.Boolean && temp.IsNumber())
return (T)Convert.ChangeType(temp == "1", typeof(T));
return (T)Convert.ChangeType(temp, type);
}
public static List<string> GetKeysByString(string name)
{
return _configList.Where(p => p.Key.Contains(name)).Select(p => p.Key).ToList();
}
static Dictionary<string, string> _configList = new Dictionary<string, string>();
}
}
+762
View File
@@ -0,0 +1,762 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum AccountDataTypes
{
GlobalConfigCache = 0x00,
PerCharacterConfigCache = 0x01,
GlobalBindingsCache = 0x02,
PerCharacterBindingsCache = 0x03,
GlobalMacrosCache = 0x04,
PerCharacterMacrosCache = 0x05,
PerCharacterLayoutCache = 0x06,
PerCharacterChatCache = 0x07,
Max = 8,
GlobalCacheMask = 0x15,
PerCharacterCacheMask = 0xEA
}
public enum TutorialAction
{
Update = 0,
Clear = 1,
Reset = 2
}
public enum AccountTypes
{
Player = 0,
Moderator = 1,
GameMaster = 2,
Administrator = 3,
Console = 4
}
public enum RBACPermissions
{
None = 0,
InstantLogout = 1,
SkipQueue = 2,
JoinNormalBg = 3,
JoinRandomBg = 4,
JoinArenas = 5,
JoinDungeonFinder = 6,
// 7 - Reuse
// 8 - Reuse
// 9 - Reuse
UseCharacterTemplates = 10,
LogGmTrade = 11,
SkipCheckCharacterCreationDemonHunter = 12,
SkipCheckInstanceRequiredBosses = 13,
SkipCheckCharacterCreationTeammask = 14,
SkipCheckCharacterCreationClassmask = 15,
SkipCheckCharacterCreationRacemask = 16,
SkipCheckCharacterCreationReservedname = 17,
SkipCheckCharacterCreationDeathKnight = 18,
SkipCheckChatChannelReq = 19,
SkipCheckDisableMap = 20,
SkipCheckMoreTalentsThanAllowed = 21,
SkipCheckChatSpam = 22,
SkipCheckOverspeedPing = 23,
TwoSideCharacterCreation = 24,
TwoSideInteractionChat = 25,
TwoSideInteractionChannel = 26,
TwoSideInteractionMail = 27,
TwoSideWhoList = 28,
TwoSideAddFriend = 29,
CommandsSaveWithoutDelay = 30,
CommandsUseUnstuckWithArgs = 31,
CommandsBeAssignedTicket = 32,
CommandsNotifyCommandNotFoundError = 33,
CommandsAppearInGmList = 34,
WhoSeeAllSecLevels = 35,
CanFilterWhispers = 36,
ChatUseStaffBadge = 37,
ResurrectWithFullHps = 38,
RestoreSavedGmState = 39,
AllowGmFriend = 40,
UseStartGmLevel = 41,
OpcodeWorldTeleport = 42,
OpcodeWhois = 43,
ReceiveGlobalGmTextmessage = 44,
SilentlyJoinChannel = 45,
ChangeChannelNotModerator = 46,
CheckForLowerSecurity = 47,
CommandsPinfoCheckPersonalData = 48,
EmailConfirmForPassChange = 49,
MayCheckOwnEmail = 50,
AllowTwoSideTrade = 51,
// Free Space For Core Permissions (Till 149)
// Roles (Permissions With Delegated Permissions) Use 199 And Descending
CommandRbac = 200,
CommandRbacAcc = 201,
CommandRbacAccPermList = 202,
CommandRbacAccPermGrant = 203,
CommandRbacAccPermDeny = 204,
CommandRbacAccPermRevoke = 205,
CommandRbacList = 206,
CommandBnetAccount = 207,
CommandBnetAccountCreate = 208,
CommandBnetAccountLockCountry = 209,
CommandBnetAccountLockIp = 210,
CommandBnetAccountPassword = 211,
CommandBnetAccountSet = 212,
CommandBnetAccountSetPassword = 213,
CommandBnetAccountLink = 214,
CommandBnetAccountUnlink = 215,
CommandBnetAccountCreateGame = 216,
CommandAccount = 217,
CommandAccountAddon = 218,
CommandAccountCreate = 219,
CommandAccountDelete = 220,
CommandAccountLock = 221,
CommandAccountLockCountry = 222,
CommandAccountLockIp = 223,
CommandAccountOnlineList = 224,
CommandAccountPassword = 225,
CommandAccountSet = 226,
CommandAccountSetAddon = 227,
CommandAccountSetGmlevel = 228,
CommandAccountSetPassword = 229,
CommandAchievement = 230,
CommandAchievementAdd = 231,
CommandArena = 232,
CommandArenaCaptain = 233,
CommandArenaCreate = 234,
CommandArenaDisband = 235,
CommandArenaInfo = 236,
CommandArenaLookup = 237,
CommandArenaRename = 238,
CommandBan = 239,
CommandBanAccount = 240,
CommandBanCharacter = 241,
CommandBanIp = 242,
CommandBanPlayeraccount = 243,
CommandBaninfo = 244,
CommandBaninfoAccount = 245,
CommandBaninfoCharacter = 246,
CommandBaninfoIp = 247,
CommandBanlist = 248,
CommandBanlistAccount = 249,
CommandBanlistCharacter = 250,
CommandBanlistIp = 251,
CommandUnban = 252,
CommandUnbanAccount = 253,
CommandUnbanCharacter = 254,
CommandUnbanIp = 255,
CommandUnbanPlayeraccount = 256,
CommandBf = 257,
CommandBfStart = 258,
CommandBfStop = 259,
CommandBfSwitch = 260,
CommandBfTimer = 261,
CommandBfEnable = 262,
CommandAccountEmail = 263,
CommandAccountSetSec = 264,
CommandAccountSetSecEmail = 265,
CommandAccountSetSecRegmail = 266,
CommandCast = 267,
CommandCastBack = 268,
CommandCastDist = 269,
CommandCastSelf = 270,
CommandCastTarget = 271,
CommandCastDest = 272,
CommandCharacter = 273,
CommandCharacterCustomize = 274,
CommandCharacterChangefaction = 275,
CommandCharacterChangerace = 276,
CommandCharacterDeleted = 277,
CommandCharacterDeletedDelete = 278,
CommandCharacterDeletedList = 279,
CommandCharacterDeletedRestore = 280,
CommandCharacterDeletedOld = 281,
CommandCharacterErase = 282,
CommandCharacterLevel = 283,
CommandCharacterRename = 284,
CommandCharacterReputation = 285,
CommandCharacterTitles = 286,
CommandLevelup = 287,
CommandPdump = 288,
CommandPdumpLoad = 289,
CommandPdumpWrite = 290,
CommandCheat = 291,
CommandCheatCasttime = 292,
CommandCheatCooldown = 293,
CommandCheatExplore = 294,
CommandCheatGod = 295,
CommandCheatPower = 296,
CommandCheatStatus = 297,
CommandCheatTaxi = 298,
CommandCheatWaterwalk = 299,
CommandDebug = 300,
CommandDebugAnim = 301,
CommandDebugAreatriggers = 302,
CommandDebugArena = 303,
CommandDebugBg = 304,
CommandDebugEntervehicle = 305,
CommandDebugGetitemstate = 306,
CommandDebugGetitemvalue = 307,
CommandDebugGetvalue = 308,
CommandDebugHostil = 309,
CommandDebugItemexpire = 310,
CommandDebugLootrecipient = 311,
CommandDebugLos = 312,
CommandDebugMod32value = 313,
CommandDebugMoveflags = 314,
CommandDebugPlay = 315,
CommandDebugPlayCinematic = 316,
CommandDebugPlayMovie = 317,
CommandDebugPlaySound = 318,
CommandDebugSend = 319,
CommandDebugSendBuyerror = 320,
CommandDebugSendChannelnotify = 321,
CommandDebugSendChatmessage = 322,
CommandDebugSendEquiperror = 323,
CommandDebugSendLargepacket = 324,
CommandDebugSendOpcode = 325,
CommandDebugSendQinvalidmsg = 326,
CommandDebugSendQpartymsg = 327,
CommandDebugSendSellerror = 328,
CommandDebugSendSetphaseshift = 329,
CommandDebugSendSpellfail = 330,
CommandDebugSetaurastate = 331,
CommandDebugSetbit = 332,
CommandDebugSetitemvalue = 333,
CommandDebugSetvalue = 334,
CommandDebugSetvid = 335,
CommandDebugSpawnvehicle = 336,
CommandDebugThreat = 337,
CommandDebugUpdate = 338,
CommandDebugUws = 339,
CommandWpgps = 340,
CommandDeserter = 341,
CommandDeserterBg = 342,
CommandDeserterBgAdd = 343,
CommandDeserterBgRemove = 344,
CommandDeserterInstance = 345,
CommandDeserterInstanceAdd = 346,
CommandDeserterInstanceRemove = 347,
CommandDisable = 348,
CommandDisableAdd = 349,
CommandDisableAddCriteria = 350,
CommandDisableAddBattleground = 351,
CommandDisableAddMap = 352,
CommandDisableAddMmap = 353,
CommandDisableAddOutdoorpvp = 354,
CommandDisableAddQuest = 355,
CommandDisableAddSpell = 356,
CommandDisableAddVmap = 357,
CommandDisableRemove = 358,
CommandDisableRemoveCriteria = 359,
CommandDisableRemoveBattleground = 360,
CommandDisableRemoveMap = 361,
CommandDisableRemoveMmap = 362,
CommandDisableRemoveOutdoorpvp = 363,
CommandDisableRemoveQuest = 364,
CommandDisableRemoveSpell = 365,
CommandDisableRemoveVmap = 366,
CommandEvent = 367,
CommandEventActivelist = 368,
CommandEventStart = 369,
CommandEventStop = 370,
CommandGm = 371,
CommandGmChat = 372,
CommandGmFly = 373,
CommandGmIngame = 374,
CommandGmList = 375,
CommandGmVisible = 376,
CommandGo = 377,
CommandGoCreature = 378,
CommandGoGraveyard = 379,
CommandGoGrid = 380,
CommandGoObject = 381,
CommandGoTaxinode = 382,
// 383 reuse
CommandGoTrigger = 384,
CommandGoXyz = 385,
CommandGoZonexy = 386,
CommandGobject = 387,
CommandGobjectActivate = 388,
CommandGobjectAdd = 389,
CommandGobjectAddTemp = 390,
CommandGobjectDelete = 391,
CommandGobjectInfo = 392,
CommandGobjectMove = 393,
CommandGobjectNear = 394,
CommandGobjectSet = 395,
CommandGobjectSetPhase = 396,
CommandGobjectSetState = 397,
CommandGobjectTarget = 398,
CommandGobjectTurn = 399,
CommandDebugTransport = 400,
CommandGuild = 401,
CommandGuildCreate = 402,
CommandGuildDelete = 403,
CommandGuildInvite = 404,
CommandGuildUninvite = 405,
CommandGuildRank = 406,
CommandGuildRename = 407,
CommandHonor = 408,
CommandHonorAdd = 409,
CommandHonorAddKill = 410,
CommandHonorUpdate = 411,
CommandInstance = 412,
CommandInstanceListbinds = 413,
CommandInstanceUnbind = 414,
CommandInstanceStats = 415,
CommandInstanceSavedata = 416,
CommandLearn = 417,
CommandLearnAll = 418,
CommandLearnAllMy = 419,
CommandLearnAllMyClass = 420,
CommandLearnAllMyPettalents = 421,
CommandLearnAllMySpells = 422,
CommandLearnAllMyTalents = 423,
CommandLearnAllGm = 424,
CommandLearnAllCrafts = 425,
CommandLearnAllDefault = 426,
CommandLearnAllLang = 427,
CommandLearnAllRecipes = 428,
CommandUnlearn = 429,
CommandLfg = 430,
CommandLfgPlayer = 431,
CommandLfgGroup = 432,
CommandLfgQueue = 433,
CommandLfgClean = 434,
CommandLfgOptions = 435,
CommandList = 436,
CommandListCreature = 437,
CommandListItem = 438,
CommandListObject = 439,
CommandListAuras = 440,
CommandListMail = 441,
CommandLookup = 442,
CommandLookupArea = 443,
CommandLookupCreature = 444,
CommandLookupEvent = 445,
CommandLookupFaction = 446,
CommandLookupItem = 447,
CommandLookupItemset = 448,
CommandLookupObject = 449,
CommandLookupQuest = 450,
CommandLookupPlayer = 451,
CommandLookupPlayerIp = 452,
CommandLookupPlayerAccount = 453,
CommandLookupPlayerEmail = 454,
CommandLookupSkill = 455,
CommandLookupSpell = 456,
CommandLookupSpellId = 457,
CommandLookupTaxinode = 458,
CommandLookupTele = 459,
CommandLookupTitle = 460,
CommandLookupMap = 461,
CommandAnnounce = 462,
CommandChannel = 463,
CommandChannelSet = 464,
CommandChannelSetOwnership = 465,
CommandGmannounce = 466,
CommandGmnameannounce = 467,
CommandGmnotify = 468,
CommandNameannounce = 469,
CommandNotify = 470,
CommandWhispers = 471,
CommandGroup = 472,
CommandGroupLeader = 473,
CommandGroupDisband = 474,
CommandGroupRemove = 475,
CommandGroupJoin = 476,
CommandGroupList = 477,
CommandGroupSummon = 478,
CommandPet = 479,
CommandPetCreate = 480,
CommandPetLearn = 481,
CommandPetUnlearn = 482,
CommandSend = 483,
CommandSendItems = 484,
CommandSendMail = 485,
CommandSendMessage = 486,
CommandSendMoney = 487,
CommandAdditem = 488,
CommandAdditemset = 489,
CommandAppear = 490,
CommandAura = 491,
CommandBank = 492,
CommandBindsight = 493,
CommandCombatstop = 494,
CommandCometome = 495,
CommandCommands = 496,
CommandCooldown = 497,
CommandDamage = 498,
CommandDev = 499,
CommandDie = 500,
CommandDismount = 501,
CommandDistance = 502,
CommandFlusharenapoints = 503,
CommandFreeze = 504,
CommandGps = 505,
CommandGuid = 506,
CommandHelp = 507,
CommandHidearea = 508,
CommandItemmove = 509,
CommandKick = 510,
CommandLinkgrave = 511,
CommandListfreeze = 512,
CommandMaxskill = 513,
CommandMovegens = 514,
CommandMute = 515,
CommandNeargrave = 516,
CommandPinfo = 517,
CommandPlayall = 518,
CommandPossess = 519,
CommandRecall = 520,
CommandRepairitems = 521,
CommandRespawn = 522,
CommandRevive = 523,
CommandSaveall = 524,
CommandSave = 525,
CommandSetskill = 526,
CommandShowarea = 527,
CommandSummon = 528,
CommandUnaura = 529,
CommandUnbindsight = 530,
CommandUnfreeze = 531,
CommandUnmute = 532,
CommandUnpossess = 533,
CommandUnstuck = 534,
CommandWchange = 535,
CommandMmap = 536,
CommandMmapLoadedtiles = 537,
CommandMmapLoc = 538,
CommandMmapPath = 539,
CommandMmapStats = 540,
CommandMmapTestarea = 541,
CommandMorph = 542,
CommandDemorph = 543,
CommandModify = 544,
CommandModifyArenapoints = 545,
CommandModifyBit = 546,
CommandModifyDrunk = 547,
CommandModifyEnergy = 548,
CommandModifyFaction = 549,
CommandModifyGender = 550,
CommandModifyHonor = 551,
CommandModifyHp = 552,
CommandModifyMana = 553,
CommandModifyMoney = 554,
CommandModifyMount = 555,
CommandModifyPhase = 556,
CommandModifyRage = 557,
CommandModifyReputation = 558,
CommandModifyRunicpower = 559,
CommandModifyScale = 560,
CommandModifySpeed = 561,
CommandModifySpeedAll = 562,
CommandModifySpeedBackwalk = 563,
CommandModifySpeedFly = 564,
CommandModifySpeedWalk = 565,
CommandModifySpeedSwim = 566,
CommandModifySpell = 567,
CommandModifyStandstate = 568,
CommandModifyTalentpoints = 569,
CommandNpc = 570,
CommandNpcAdd = 571,
CommandNpcAddFormation = 572,
CommandNpcAddItem = 573,
CommandNpcAddMove = 574,
CommandNpcAddTemp = 575,
CommandNpcDelete = 576,
CommandNpcDeleteItem = 577,
CommandNpcFollow = 578,
CommandNpcFollowStop = 579,
CommandNpcSet = 580,
CommandNpcSetAllowmove = 581,
CommandNpcSetEntry = 582,
CommandNpcSetFactionid = 583,
CommandNpcSetFlag = 584,
CommandNpcSetLevel = 585,
CommandNpcSetLink = 586,
CommandNpcSetModel = 587,
CommandNpcSetMovetype = 588,
CommandNpcSetPhase = 589,
CommandNpcSetSpawndist = 590,
CommandNpcSetSpawntime = 591,
CommandNpcSetData = 592,
CommandNpcInfo = 593,
CommandNpcNear = 594,
CommandNpcMove = 595,
CommandNpcPlayemote = 596,
CommandNpcSay = 597,
CommandNpcTextemote = 598,
CommandNpcWhisper = 599,
CommandNpcYell = 600,
CommandNpcTame = 601,
CommandQuest = 602,
CommandQuestAdd = 603,
CommandQuestComplete = 604,
CommandQuestRemove = 605,
CommandQuestReward = 606,
CommandReload = 607,
CommandReloadAccessRequirement = 608,
CommandReloadCriteriaData = 609,
CommandReloadAchievementReward = 610,
CommandReloadAll = 611,
CommandReloadAllAchievement = 612,
CommandReloadAllArea = 613,
CommandReloadBroadcastText = 614,
CommandReloadAllGossip = 615,
CommandReloadAllItem = 616,
CommandReloadAllLocales = 617,
CommandReloadAllLoot = 618,
CommandReloadAllNpc = 619,
CommandReloadAllQuest = 620,
CommandReloadAllScripts = 621,
CommandReloadAllSpell = 622,
CommandReloadAreatriggerInvolvedrelation = 623,
CommandReloadAreatriggerTavern = 624,
CommandReloadAreatriggerTeleport = 625,
CommandReloadAuctions = 626,
CommandReloadAutobroadcast = 627,
CommandReloadCommand = 628,
CommandReloadConditions = 629,
CommandReloadConfig = 630,
CommandReloadBattlegroundTemplate = 631,
CommandMutehistory = 632,
CommandReloadCreatureLinkedRespawn = 633,
CommandReloadCreatureLootTemplate = 634,
CommandReloadCreatureOnkillReputation = 635,
CommandReloadCreatureQuestender = 636,
CommandReloadCreatureQueststarter = 637,
CommandReloadCreatureSummonGroups = 638,
CommandReloadCreatureTemplate = 639,
CommandReloadCreatureText = 640,
CommandReloadDisables = 641,
CommandReloadDisenchantLootTemplate = 642,
CommandReloadEventScripts = 643,
CommandReloadFishingLootTemplate = 644,
CommandReloadGraveyardZone = 645,
CommandReloadGameTele = 646,
CommandReloadGameobjectQuestender = 647,
CommandReloadGameobjectQuestLootTemplate = 648,
CommandReloadGameobjectQueststarter = 649,
CommandReloadSupportSystem = 650,
CommandReloadGossipMenu = 651,
CommandReloadGossipMenuOption = 652,
CommandReloadItemEnchantmentTemplate = 653,
CommandReloadItemLootTemplate = 654,
CommandReloadItemSetNames = 655,
CommandReloadLfgDungeonRewards = 656,
CommandReloadLocalesAchievementReward = 657,
CommandReloadLocalesCreature = 658,
CommandReloadLocalesCreatureText = 659,
CommandReloadLocalesGameobject = 660,
CommandReloadLocalesGossipMenuOption = 661,
// 662 Unused
CommandReloadLocalesItemSetName = 663,
// 664 Unused
CommandReloadLocalesPageText = 665,
CommandReloadLocalesPointsOfInterest = 666,
CommandReloadQuestLocale = 667,
CommandReloadMailLevelReward = 668,
CommandReloadMailLootTemplate = 669,
CommandReloadMillingLootTemplate = 670,
CommandReloadNpcSpellclickSpells = 671,
CommandReloadNpcTrainer = 672,
CommandReloadNpcVendor = 673,
CommandReloadPageText = 674,
CommandReloadPickpocketingLootTemplate = 675,
CommandReloadPointsOfInterest = 676,
CommandReloadProspectingLootTemplate = 677,
CommandReloadQuestPoi = 678,
CommandReloadQuestTemplate = 679,
CommandReloadRbac = 680,
CommandReloadReferenceLootTemplate = 681,
CommandReloadReservedName = 682,
CommandReloadReputationRewardRate = 683,
CommandReloadSpilloverTemplate = 684,
CommandReloadSkillDiscoveryTemplate = 685,
CommandReloadSkillExtraItemTemplate = 686,
CommandReloadSkillFishingBaseLevel = 687,
CommandReloadSkinningLootTemplate = 688,
CommandReloadSmartScripts = 689,
CommandReloadSpellRequired = 690,
CommandReloadSpellArea = 691,
// 692 Unused
CommandReloadSpellGroup = 693,
CommandReloadSpellLearnSpell = 694,
CommandReloadSpellLootTemplate = 695,
CommandReloadSpellLinkedSpell = 696,
CommandReloadSpellPetAuras = 697,
CommandReloadSpellProcEvent = 698,
CommandReloadSpellProc = 699,
CommandReloadSpellScripts = 700,
CommandReloadSpellTargetPosition = 701,
CommandReloadSpellThreats = 702,
CommandReloadSpellGroupStackRules = 703,
CommandReloadCypherString = 704,
CommandReloadWardenAction = 705,
CommandReloadWaypointScripts = 706,
CommandReloadWaypointData = 707,
CommandReloadVehicleAccesory = 708,
CommandReloadVehicleTemplateAccessory = 709,
CommandReset = 710,
CommandResetAchievements = 711,
CommandResetHonor = 712,
CommandResetLevel = 713,
CommandResetSpells = 714,
CommandResetStats = 715,
CommandResetTalents = 716,
CommandResetAll = 717,
CommandServer = 718,
CommandServerCorpses = 719,
CommandServerExit = 720,
CommandServerIdlerestart = 721,
CommandServerIdlerestartCancel = 722,
CommandServerIdleshutdown = 723,
CommandServerIdleshutdownCancel = 724,
CommandServerInfo = 725,
CommandServerPlimit = 726,
CommandServerRestart = 727,
CommandServerRestartCancel = 728,
CommandServerSet = 729,
CommandServerSetClosed = 730,
CommandServerSetDifftime = 731,
CommandServerSetLoglevel = 732,
CommandServerSetMotd = 733,
CommandServerShutdown = 734,
CommandServerShutdownCancel = 735,
CommandServerMotd = 736,
CommandTele = 737,
CommandTeleAdd = 738,
CommandTeleDel = 739,
CommandTeleName = 740,
CommandTeleGroup = 741,
CommandTicket = 742,
// 743 - 752 reuse
CommandTicketReset = 753,
// 754 - 756 reuse
CommandTicketTogglesystem = 757,
// 758 - 760 reuse
CommandTitles = 761,
CommandTitlesAdd = 762,
CommandTitlesCurrent = 763,
CommandTitlesRemove = 764,
CommandTitlesSet = 765,
CommandTitlesSetMask = 766,
CommandWp = 767,
CommandWpAdd = 768,
CommandWpEvent = 769,
CommandWpLoad = 770,
CommandWpModify = 771,
CommandWpUnload = 772,
CommandWpReload = 773,
CommandWpShow = 774,
CommandModifyCurrency = 775, // Only 4.3.4
CommandDebugPhase = 776, // Only 4.3.4
CommandMailbox = 777,
CommandAhbot = 778,
CommandAhbotItems = 779,
CommandAhbotItemsGray = 780,
CommandAhbotItemsWhite = 781,
CommandAhbotItemsGreen = 782,
CommandAhbotItemsBlue = 783,
CommandAhbotItemsPurple = 784,
CommandAhbotItemsOrange = 785,
CommandAhbotItemsYellow = 786,
CommandAhbotRatio = 787,
CommandAhbotRatioAlliance = 788,
CommandAhbotRatioHorde = 789,
CommandAhbotRatioNeutral = 790,
CommandAhbotRebuild = 791,
CommandAhbotReload = 792,
CommandAhbotStatus = 793,
CommandGuildInfo = 794,
CommandInstanceSetBossState = 795,
CommandInstanceGetBossState = 796,
CommandPvpstats = 797,
CommandModifyXp = 798,
CommandGoBugTicket = 799,
CommandGoComplaintTicket = 800,
CommandGoSuggestionTicket = 801,
CommandTicketBug = 802,
CommandTicketComplaint = 803,
CommandTicketSuggestion = 804,
CommandTicketBugAssign = 805,
CommandTicketBugClose = 806,
CommandTicketBugClosedlist = 807,
CommandTicketBugComment = 808,
CommandTicketBugDelete = 809,
CommandTicketBugList = 810,
CommandTicketBugUnassign = 811,
CommandTicketBugView = 812,
CommandTicketComplaintAssign = 813,
CommandTicketComplaintClose = 814,
CommandTicketComplaintClosedlist = 815,
CommandTicketComplaintComment = 816,
CommandTicketComplaintDelete = 817,
CommandTicketComplaintList = 818,
CommandTicketComplaintUnassign = 819,
CommandTicketComplaintView = 820,
CommandTicketSuggestionAssign = 821,
CommandTicketSuggestionClose = 822,
CommandTicketSuggestionClosedlist = 823,
CommandTicketSuggestionComment = 824,
CommandTicketSuggestionDelete = 825,
CommandTicketSuggestionList = 826,
CommandTicketSuggestionUnassign = 827,
CommandTicketSuggestionView = 828,
CommandTicketResetAll = 829,
CommandBnetAccountListGameAccounts = 830,
CommandTicketResetBug = 831,
CommandTicketResetComplaint = 832,
CommandTicketResetSuggestion = 833,
CommandGoQuest = 834,
CommandDebugLoadcells = 835,
CommandDebugBoundary = 836,
CommandNpcEvade = 837,
CommandPetLevel = 838,
CommandServerShutdownForce = 839,
CommandServerRestartForce = 840,
CommandNearGraveyard = 841,
CommandReloadCharacterTemplate = 842,
CommandReloadQuestGreeting = 843,
CommandScene = 844,
CommandSceneDedug = 845,
CommandScenePlay = 846,
CommandScenePlayPackage = 847,
CommandSceneCancel = 848,
CommandListScenes = 849,
CommandReloacSceneTemplate = 850,
CommandReloadAreatriggerTemplate = 851,
CommandGoOffset = 852,
CommandReloadConversationTemplate = 853,
CommandDebugConversation = 854,
// Custom Permissions 1000+
Max
}
public enum MountStatusFlags
{
None = 0x00,
NeedsFanfare = 0x01,
IsFavorite = 0x02
}
}
+440
View File
@@ -0,0 +1,440 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum AchievementFaction : sbyte
{
Horde = 0,
Alliance = 1,
Any = -1,
}
public enum CriteriaTreeFlags : ushort
{
ProgressBar = 0x0001,
ProgressIsDate = 0x0004,
ShowCurrencyIcon = 0x0008,
AllianceOnly = 0x0200,
HordeOnly = 0x0400,
ShowRequiredCount = 0x0800
}
public enum CriteriaTreeOperator
{
Single = 0,
SinglerNotCompleted = 1,
All = 4,
SumChildren = 5,
MaxChild = 6,
CountDirectChildren = 7,
Any = 8,
SumChildrenWeight = 9
}
public enum AchievementFlags
{
Counter = 0x01,
Hidden = 0x02,
PlayNoVisual = 0x04,
Summ = 0x08,
MaxUsed = 0x10,
ReqCount = 0x20,
Average = 0x40,
Bar = 0x80,
RealmFirstReach = 0x100,
RealmFirstKill = 0x200,
Unk3 = 0x400,
HideIncomplete = 0x800,
ShowInGuildNews = 0x1000,
ShowInGuildHeader = 0x2000,
Guild = 0x4000,
ShowGuildMembers = 0x8000,
ShowCriteriaMembers = 0x10000,
Account = 0x20000,
Unk5 = 0x00040000,
HideZeroCounter = 0x00080000,
TrackingFlag = 0x00100000
}
public enum CriteriaFlagsCu
{
Player = 0x1,
Account = 0x2,
Guild = 0x4,
Scenario = 0x8
}
public enum CriteriaCondition
{
None = 0,
NoDeath = 1,
Unk2 = 2,
BgMap = 3,
NoLose = 4,
Unk5 = 5,
Unk8 = 8,
NoSpellHit = 9,
NotInGroup = 10,
Unk13 = 13
}
public enum CriteriaAdditionalCondition
{
SourceDrunkValue = 1,
Unk2 = 2,
ItemLevel = 3,
TargetCreatureEntry = 4,
TargetMustBePlayer = 5,
TargetMustBeDead = 6,
TargetMustBeEnemy = 7,
SourceHasAura = 8,
TargetHasAura = 10,
TargetHasAuraType = 11,
ItemQualityMin = 14,
ItemQualityEquals = 15,
Unk16 = 16,
SourceAreaOrZone = 17,
TargetAreaOrZone = 18,
MapDifficultyOld = 20,
TargetCreatureYieldsXp = 21,
ArenaType = 24,
SourceRace = 25,
SourceClass = 26,
TargetRace = 27,
TargetClass = 28,
MaxGroupMembers = 29,
TargetCreatureType = 30,
SourceMap = 32,
ItemClass = 33,
ItemSubclass = 34,
CompleteQuestNotInGroup = 35,
MinPersonalRating = 37,
TitleBitIndex = 38,
SourceLevel = 39,
TargetLevel = 40,
TargetZone = 41,
TargetHealthPercentBelow = 46,
Unk55 = 55,
MinAchievementPoints = 56,
RequiresLfgGroup = 58,
Unk60 = 60,
RequiresGuildGroup = 61,
GuildReputation = 62,
RatedBattleground = 63,
RatedBattlegroundRating = 64,
ProjectRarity = 65,
ProjectRace = 66,
WorldState = 67, // Nyi
MapDifficulty = 68, // Nyi
PlayerLevel = 69, // Nyi
TargetPlayerLevel = 70, // Nyi
//PlayerLevelOnAccount = 71, // Not Verified
//Unk73 = 73, // References Another Modifier Tree Id
ScenarioId = 74, // Nyi
BattlePetFamily = 78, // Nyi
BattlePetHealthPct = 79, // Nyi
//Unk80 = 80 // Something To Do With World Bosses
BattlePetEntry = 81, // Nyi
//BattlePetEntryId = 82, // Some Sort Of Data Id?
ChallengeModeMedal = 83, // NYI
//CRITERIA_ADDITIONAL_CONDITION_UNK84 = 84, // Quest id
//CRITERIA_ADDITIONAL_CONDITION_UNK86 = 86, // Some external event id
//CRITERIA_ADDITIONAL_CONDITION_UNK87 = 87, // Achievement id
BattlePetSpecies = 91,
GarrisonFollowerEntry = 144,
GarrisonFollowerQuality = 145,
GarrisonFollowerLevel = 146,
GarrisonRareMission = 147, // NYI
GarrisonBuildingLevel = 149, // NYI
GarrisonMissionType = 167, // NYI
PLayerItemLevel = 169, // NYI
GarrisonFollowILvl = 184,
HonorLevel = 193,
PrestigeLevel = 194
}
public enum CriteriaFlags
{
ShowProgressBar = 0x01,
Hidden = 0x02,
FailAchievement = 0x04,
ResetOnStart = 0x08,
IsDate = 0x10,
MoneyCounter = 0x20
}
public enum CriteriaTimedTypes : byte
{
Event = 1, // Timer Is Started By Internal Event With Id In Timerstartevent
Quest = 2, // Timer Is Started By Accepting Quest With Entry In Timerstartevent
SpellCaster = 5, // Timer Is Started By Casting A Spell With Entry In Timerstartevent
SpellTarget = 6, // Timer Is Started By Being Target Of Spell With Entry In Timerstartevent
Creature = 7, // Timer Is Started By Killing Creature With Entry In Timerstartevent
Item = 9, // Timer Is Started By Using Item With Entry In Timerstartevent
Unk = 10, // Unknown
Unk2 = 13, // Unknown
ScenarioStage = 14, // Timer is started by changing stages in a scenario
Max
}
public enum CriteriaTypes : byte
{
KillCreature = 0,
WinBg = 1,
// 2 - unused (Legion - 23420)
CompleteArchaeologyProjects = 3, // Struct { Uint32 Itemcount; }
SurveyGameobject = 4,
ReachLevel = 5,
ClearDigsite = 6,
ReachSkillLevel = 7,
CompleteAchievement = 8,
CompleteQuestCount = 9,
CompleteDailyQuestDaily = 10, // You Have To Complete A Daily Quest X Times In A Row
CompleteQuestsInZone = 11,
Currency = 12,
DamageDone = 13,
CompleteDailyQuest = 14,
CompleteBattleground = 15,
DeathAtMap = 16,
Death = 17,
DeathInDungeon = 18,
CompleteRaid = 19,
KilledByCreature = 20,
ManualCompleteCriteria = 21,
CompleteChallengeModeGuild = 22,
KilledByPlayer = 23,
FallWithoutDying = 24,
// 25 - unused (Legion - 23420)
DeathsFrom = 26,
CompleteQuest = 27,
BeSpellTarget = 28,
CastSpell = 29,
BgObjectiveCapture = 30,
HonorableKillAtArea = 31,
WinArena = 32,
PlayArena = 33,
LearnSpell = 34,
HonorableKill = 35,
OwnItem = 36,
WinRatedArena = 37,
HighestTeamRating = 38,
HighestPersonalRating = 39,
LearnSkillLevel = 40,
UseItem = 41,
LootItem = 42,
ExploreArea = 43,
OwnRank = 44,
BuyBankSlot = 45,
GainReputation = 46,
GainExaltedReputation = 47,
VisitBarberShop = 48,
EquipEpicItem = 49,
RollNeedOnLoot = 50, /// Todo Itemlevel Is Mentioned In Text But Not Present In Dbc
RollGreedOnLoot = 51,
HkClass = 52,
HkRace = 53,
DoEmote = 54,
HealingDone = 55,
GetKillingBlows = 56, /// Todo In Some Cases Map Not Present, And In Some Cases Need Do Without Die
EquipItem = 57,
// 58 - unused (Legion - 23420)
MoneyFromVendors = 59,
GoldSpentForTalents = 60,
NumberOfTalentResets = 61,
MoneyFromQuestReward = 62,
GoldSpentForTravelling = 63,
DefeatCreatureGroup = 64,
GoldSpentAtBarber = 65,
GoldSpentForMail = 66,
LootMoney = 67,
UseGameobject = 68,
BeSpellTarget2 = 69,
SpecialPvpKill = 70,
CompleteChallengeMode = 71,
FishInGameobject = 72,
SendEvent = 73,
OnLogin = 74,
LearnSkilllineSpells = 75,
WinDuel = 76,
LoseDuel = 77,
KillCreatureType = 78,
CookRecipesGuild = 79,
GoldEarnedByAuctions = 80,
EarnPetBattleAchievementPoints = 81,
CreateAuction = 82,
HighestAuctionBid = 83,
WonAuctions = 84,
HighestAuctionSold = 85,
HighestGoldValueOwned = 86,
GainReveredReputation = 87,
GainHonoredReputation = 88,
KnownFactions = 89,
LootEpicItem = 90,
ReceiveEpicItem = 91,
SendEventScenario = 92,
RollNeed = 93,
RollGreed = 94,
ReleaseSpirit = 95,
OwnPet = 96,
GarrisonCompleteDungeonEncounter = 97,
// 98 - unused (Legion - 23420)
// 99 - unused (Legion - 23420)
// 100 - unused (Legion - 23420)
HighestHitDealt = 101,
HighestHitReceived = 102,
TotalDamageReceived = 103,
HighestHealCasted = 104,
TotalHealingReceived = 105,
HighestHealingReceived = 106,
QuestAbandoned = 107,
FlightPathsTaken = 108,
LootType = 109,
CastSpell2 = 110, /// Todo Target Entry Is Missing
// 111 - unused (Legion - 23420)
LearnSkillLine = 112,
EarnHonorableKill = 113,
AcceptedSummonings = 114,
EarnAchievementPoints = 115,
// 116 - unused (Legion - 23420)
// 117 - unused (Legion - 23420)
CompleteLfgDungeon = 118,
UseLfdToGroupWithPlayers = 119,
LfgVoteKicksInitiatedByPlayer = 120,
LfgVoteKicksNotInitByPlayer = 121,
BeKickedFromLfg = 122,
LfgLeaves = 123,
SpentGoldGuildRepairs = 124,
ReachGuildLevel = 125,
CraftItemsGuild = 126,
CatchFromPool = 127,
BuyGuildBankSlots = 128,
EarnGuildAchievementPoints = 129,
WinRatedBattleground = 130,
// 131 - unused (Legion - 23420)
ReachBgRating = 132,
BuyGuildTabard = 133,
CompleteQuestsGuild = 134,
HonorableKillsGuild = 135,
KillCreatureTypeGuild = 136,
CountOfLfgQueueBoostsByTank = 137,
CompleteGuildChallengeType = 138, //Struct { Flag Flag; Uint32 Count; } 1: Guild Dungeon, 2:Guild Challenge, 3:Guild Battlefield
CompleteGuildChallenge = 139, //Struct { Uint32 Count; } Guild Challenge
// 140 - 1 criteria (16883), unused (Legion - 23420)
// 141 - 1 criteria (16884), unused (Legion - 23420)
// 142 - 1 criteria (16881), unused (Legion - 23420)
// 143 - 1 criteria (16882), unused (Legion - 23420)
// 144 - 1 criteria (17386), unused (Legion - 23420)
LfrDungeonsCompleted = 145,
LfrLeaves = 146,
LfrVoteKicksInitiatedByPlayer = 147,
LfrVoteKicksNotInitByPlayer = 148,
BeKickedFromLfr = 149,
CountOfLfrQueueBoostsByTank = 150,
CompleteScenarioCount = 151,
CompleteScenario = 152,
ReachAreatriggerWithActionset = 153,
// 154 - unused (Legion - 23420)
OwnBattlePet = 155,
OwnBattlePetCount = 156,
CaptureBattlePet = 157,
WinPetBattle = 158,
// 159 - 2 criterias (22312,22314), unused (Legion - 23420)
LevelBattlePet = 160,
CaptureBattlePetCredit = 161, // Triggers A Quest Credit
LevelBattlePetCredit = 162, // Triggers A Quest Credit
EnterArea = 163, // Triggers A Quest Credit
LeaveArea = 164, // Triggers A Quest Credit
CompleteDungeonEncounter = 165,
// 166 - unused (Legion - 23420)
PlaceGarrisonBuilding = 167,
UpgradeGarrisonBuilding = 168,
ConstructGarrisonBuilding = 169,
UpgradeGarrison = 170,
StartGarrisonMission = 171,
StartOrderHallMission = 172,
CompleteGarrisonMissionCount = 173,
CompleteGarrisonMission = 174,
RecruitGarrisonFollowerCount = 175,
RecruitGarrisonFollower = 176,
// 177 - 0 criterias (Legion - 23420)
LearnGarrisonBlueprintCount = 178,
// 179 - 0 criterias (Legion - 23420)
// 180 - 0 criterias (Legion - 23420)
// 181 - 0 criterias (Legion - 23420)
CompleteGarrisonShipment = 182,
RaiseGarrisonFollowerItemLevel = 183,
RaiseGarrisonFollowerLevel = 184,
OwnToy = 185,
OwnToyCount = 186,
RecruitGarrisonFollowerWithQuality = 187,
// 188 - 0 criterias (Legion - 23420)
OwnHeirlooms = 189,
ArtifactPowerEarned = 190,
ArtifactTraitsUnlocked = 191,
HonorLevelReached = 194,
PrestigeReached = 195,
// 196 - CRITERIA_TYPE_REACH_LEVEL_2 or something
// 197 - Order Hall Advancement related
OrderHallTalentLearned = 198,
AppearanceUnlockedBySlot = 199,
OrderHallRecruitTyoop = 200,
// 201 - 0 criterias (Legion - 23420)
// 202 - 0 criterias (Legion - 23420)
CompleteWorldQuest = 203,
// 204 - Special criteria type to award players for some external events? Comes with what looks like an identifier, so guessing it's not unique.
TotalTypes = 208
}
public enum CriteriaDataType
{
None = 0,
TCreature = 1,
TPlayerClassRace = 2,
TPlayerLessHealth = 3,
SAura = 5,
TAura = 7,
Value = 8,
TLevel = 9,
TGender = 10,
Script = 11,
// Reuse
MapPlayerCount = 13,
TTeam = 14,
SDrunk = 15,
Holiday = 16,
BgLossTeamScore = 17,
InstanceScript = 18,
SEquippedItem = 19,
MapId = 20,
SPlayerClassRace = 21,
// Reuse
SKnownTitle = 23,
GameEvent = 24,
SItemQuality = 25,
Max = 25
}
public enum ProgressType
{
Set,
Accumulate,
Highest
}
}
+62
View File
@@ -0,0 +1,62 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum AreaTriggerFlags
{
HasAbsoluteOrientation = 0x01, // Nyi
HasDynamicShape = 0x02, // Implemented For Spheres
HasAttached = 0x04,
HasFaceMovementDir = 0x08,
HasFollowsTerrain = 0x010, // Nyi
Unk1 = 0x020,
HasTargetRollPitchYaw = 0x040, // Nyi
Unk2 = 0x080,
Unk3 = 0x100,
Unk4 = 0x200,
Unk5 = 0x400
}
public enum AreaTriggerTypes
{
Sphere = 0,
Box = 1,
Unk = 2,
Polygon = 3,
Cylinder = 4,
Max = 5
}
public enum AreaTriggerActionTypes
{
Cast = 0,
AddAura = 1,
Max = 2
}
public enum AreaTriggerActionUserTypes
{
Any = 0,
Friend = 1,
Enemy = 2,
Raid = 3,
Party = 4,
Caster = 5,
Max = 6
}
}
+50
View File
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum AuctionError
{
Ok = 0,
Inventory = 1,
DatabaseError = 2,
NotEnoughtMoney = 3,
ItemNotFound = 4,
HigherBid = 5,
BidIncrement = 7,
BidOwn = 10,
RestrictedAccount = 13
}
public enum AuctionAction
{
SellItem = 0,
Cancel = 1,
PlaceBid = 2
}
public enum MailAuctionAnswers
{
Outbidded = 0,
Won = 1,
Successful = 2,
Expired = 3,
CancelledToBidder = 4,
Canceled = 5,
SalePending = 6
}
}
@@ -0,0 +1,133 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum ResponseCodes
{
Success = 0,
Failure = 1,
Cancelled = 2,
Disconnected = 3,
FailedToConnect = 4,
Connected = 5,
VersionMismatch = 6,
CstatusConnecting = 7,
CstatusNegotiatingSecurity = 8,
CstatusNegotiationComplete = 9,
CstatusNegotiationFailed = 10,
CstatusAuthenticating = 11,
RealmListInProgress = 12,
RealmListSuccess = 13,
RealmListFailed = 14,
RealmListInvalid = 15,
RealmListRealmNotFound = 16,
AccountCreateInProgress = 17,
AccountCreateSuccess = 18,
AccountCreateFailed = 19,
CharListRetrieving = 20,
CharListRetrieved = 21,
CharListFailed = 22,
CharCreateInProgress = 23,
CharCreateSuccess = 24,
CharCreateError = 25,
CharCreateFailed = 26,
CharCreateNameInUse = 27,
CharCreateDisabled = 28,
CharCreatePvpTeamsViolation = 29,
CharCreateServerLimit = 30,
CharCreateAccountLimit = 31,
CharCreateServerQueue = 32,
CharCreateOnlyExisting = 33,
CharCreateExpansion = 34,
CharCreateExpansionClass = 35,
CharCreateLevelRequirement = 36,
CharCreateUniqueClassLimit = 37,
CharCreateCharacterInGuild = 38,
CharCreateRestrictedRaceclass = 39,
CharCreateCharacterChooseRace = 40,
CharCreateCharacterArenaLeader = 41,
CharCreateCharacterDeleteMail = 42,
CharCreateCharacterSwapFaction = 43,
CharCreateCharacterRaceOnly = 44,
CharCreateCharacterGoldLimit = 45,
CharCreateForceLogin = 46,
CharCreateTrial = 47,
CharCreateTimeout = 48,
CharCreateThrottle = 49,
CharDeleteInProgress = 50,
CharDeleteSuccess = 51,
CharDeleteFailed = 52,
CharDeleteFailedLockedForTransfer = 53,
CharDeleteFailedGuildLeader = 54,
CharDeleteFailedArenaCaptain = 55,
CharDeleteFailedHasHeirloomOrMail = 56,
CharDeleteFailedUpgradeInProgress = 57,
CharDeleteFailedHasWowToken = 58,
CharDeleteFailedVasTransactionInProgress = 59,
CharLoginInProgress = 60,
CharLoginSuccess = 61,
CharLoginNoWorld = 62,
CharLoginDuplicateCharacter = 63,
CharLoginNoInstances = 64,
CharLoginFailed = 65,
CharLoginDisabled = 66,
CharLoginNoCharacter = 67,
CharLoginLockedForTransfer = 68,
CharLoginLockedByBilling = 69,
CharLoginLockedByMobileAh = 70,
CharLoginTemporaryGmLock = 71,
CharLoginLockedByCharacterUpgrade = 72,
CharLoginLockedByRevokedCharacterUpgrade = 73,
CharLoginLockedByRevokedVasTransaction = 74,
CharNameSuccess = 75,
CharNameFailure = 76,
CharNameNoName = 77,
CharNameTooShort = 78,
CharNameTooLong = 79,
CharNameInvalidCharacter = 80,
CharNameMixedLanguages = 81,
CharNameProfane = 82,
CharNameReserved = 83,
CharNameInvalidApostrophe = 84,
CharNameMultipleApostrophes = 85,
CharNameThreeConsecutive = 86,
CharNameInvalidSpace = 87,
CharNameConsecutiveSpaces = 88,
CharNameRussianConsecutiveSilentCharacters = 89,
CharNameRussianSilentCharacterAtBeginningOrEnd = 90,
CharNameDeclensionDoesntMatchBaseName = 91
}
public enum CharacterUndeleteResult
{
Ok = 0,
Cooldown = 1,
CharCreate = 2,
Disabled = 3,
NameTakenByThisAccount = 4,
Unknown = 5
}
}
@@ -0,0 +1,668 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum BattlenetRpcErrorCode : uint
{
Ok = 0x00000000,
Internal = 0x00000001,
TimedOut = 0x00000002,
Denied = 0x00000003,
NotExists = 0x00000004,
NotStarted = 0x00000005,
InProgress = 0x00000006,
InvalidArgs = 0x00000007,
InvalidSubscriber = 0x00000008,
WaitingForDependency = 0x00000009,
NoAuth = 0x0000000a,
ParentalControlRestriction = 0x0000000b,
NoGameAccount = 0x0000000c,
NotImplemented = 0x0000000d,
ObjectRemoved = 0x0000000e,
InvalidEntityId = 0x0000000f,
InvalidEntityAccountId = 0x00000010,
InvalidEntityGameAccountId = 0x00000011,
InvalidAgentId = 0x00000013,
InvalidTargetId = 0x00000014,
ModuleNotLoaded = 0x00000015,
ModuleNoEntryPoint = 0x00000016,
ModuleSignatureIncorrect = 0x00000017,
ModuleCreateFailed = 0x00000018,
NoProgram = 0x00000019,
ApiNotReady = 0x0000001b,
BadVersion = 0x0000001c,
AttributeTooManyAttributesSet = 0x0000001d,
AttributeMaxSizeExceeded = 0x0000001e,
AttributeQuotaExceeded = 0x0000001f,
ServerPoolServerDisappeared = 0x00000020,
ServerIsPrivate = 0x00000021,
Disabled = 0x00000022,
ModuleNotFound = 0x00000024,
ServerBusy = 0x00000025,
NoBattletag = 0x00000026,
IncompleteProfanityFilters = 0x00000027,
InvalidRegion = 0x00000028,
ExistsAlready = 0x00000029,
InvalidServerThumbprint = 0x0000002a,
PhoneLock = 0x0000002b,
Squelched = 0x0000002c,
TargetOffline = 0x0000002d,
BadServer = 0x0000002e,
NoCookie = 0x0000002f,
ExpiredCookie = 0x00000030,
TokenNotFound = 0x00000031,
GameAccountNoTime = 0x00000032,
GameAccountNoPlan = 0x00000033,
GameAccountBanned = 0x00000034,
GameAccountSuspended = 0x00000035,
GameAccountAlreadySelected = 0x00000036,
GameAccountCancelled = 0x00000037,
GameAccountCreationDisabled = 0x00000038,
GameAccountLocked = 0x00000039,
SessionDuplicate = 0x0000003c,
SessionDisconnected = 0x0000003d,
SessionDataChanged = 0x0000003e,
SessionUpdateFailed = 0x0000003f,
SessionNotFound = 0x00000040,
AdminKick = 0x00000046,
UnplannedMaintenance = 0x00000047,
PlannedMaintenance = 0x00000048,
ServiceFailureAccount = 0x00000049,
ServiceFailureSession = 0x0000004a,
ServiceFailureAuth = 0x0000004b,
ServiceFailureRisk = 0x0000004c,
BadProgram = 0x0000004d,
BadLocale = 0x0000004e,
BadPlatform = 0x0000004f,
LocaleRestrictedLa = 0x00000051,
LocaleRestrictedRu = 0x00000052,
LocaleRestrictedKo = 0x00000053,
LocaleRestrictedTw = 0x00000054,
LocaleRestricted = 0x00000055,
AccountNeedsMaintenance = 0x00000056,
ModuleApiError = 0x00000057,
ModuleBadCacheHandle = 0x00000058,
ModuleAlreadyLoaded = 0x00000059,
NetworkBlacklisted = 0x0000005a,
EventProcessorSlow = 0x0000005b,
ServerShuttingDown = 0x0000005c,
NetworkNotPrivileged = 0x0000005d,
TooManyOutstandingRequests = 0x0000005e,
NoAccountRegistered = 0x0000005f,
BattlenetAccountBanned = 0x00000060,
OkDeprecated = 0x00000064,
ServerInModeZombie = 0x00000065,
LogonModuleRequired = 0x000001f4,
LogonModuleNotConfigured = 0x000001f5,
LogonModuleTimeout = 0x000001f6,
LogonAgreementRequired = 0x000001fe,
LogonAgreementNotConfigured = 0x000001ff,
LogonInvalidServerProof = 0x00000208,
LogonWebVerifyTimeout = 0x00000209,
LogonInvalidAuthToken = 0x0000020a,
ChallengeSmsTooSoon = 0x00000258,
ChallengeSmsThrottled = 0x00000259,
ChallengeSmsTempOutage = 0x0000025a,
ChallengeNoChallenge = 0x0000025b,
ChallengeNotPicked = 0x0000025c,
ChallengeAlreadyPicked = 0x0000025d,
ChallengeInProgress = 0x0000025e,
ConfigFormatInvalid = 0x000002bc,
ConfigNotFound = 0x000002bd,
ConfigRetrieveFailed = 0x000002be,
NetworkModuleBusy = 0x000003e8,
NetworkModuleCantResolveAddress = 0x000003e9,
NetworkModuleConnectionRefused = 0x000003ea,
NetworkModuleInterrupted = 0x000003eb,
NetworkModuleConnectionAborted = 0x000003ec,
NetworkModuleConnectionReset = 0x000003ed,
NetworkModuleBadAddress = 0x000003ee,
NetworkModuleNotReady = 0x000003ef,
NetworkModuleAlreadyConnected = 0x000003f0,
NetworkModuleCantCreateSocket = 0x000003f1,
NetworkModuleNetworkUnreachable = 0x000003f2,
NetworkModuleSocketPermissionDenied = 0x000003f3,
NetworkModuleNotInitialized = 0x000003f4,
NetworkModuleNoSslCertificateForPeer = 0x000003f5,
NetworkModuleNoSslCommonNameForCertificate = 0x000003f6,
NetworkModuleSslCommonNameDoesNotMatchRemoteEndpoint = 0x000003f7,
NetworkModuleSocketClosed = 0x000003f8,
NetworkModuleSslPeerIsNotRegisteredInCertbundle = 0x000003f9,
NetworkModuleSslInitializeLowFirst = 0x000003fa,
NetworkModuleSslCertBundleReadError = 0x000003fb,
NetworkModuleNoCertBundle = 0x000003fc,
NetworkModuleFailedToDownloadCertBundle = 0x000003fd,
NetworkModuleNotReadyToRead = 0x000003fe,
NetworkModuleOpensslX509Ok = 0x000004b0,
NetworkModuleOpensslX509UnableToGetIssuerCert = 0x000004b1,
NetworkModuleOpensslX509UnableToGetCrl = 0x000004b2,
NetworkModuleOpensslX509UnableToDecryptCertSignature = 0x000004b3,
NetworkModuleOpensslX509UnableToDecryptCrlSignature = 0x000004b4,
NetworkModuleOpensslX509UnableToDecodeIssuerPublicKey = 0x000004b5,
NetworkModuleOpensslX509CertSignatureFailure = 0x000004b6,
NetworkModuleOpensslX509CrlSignatureFailure = 0x000004b7,
NetworkModuleOpensslX509CertNotYetValid = 0x000004b8,
NetworkModuleOpensslX509CertHasExpired = 0x000004b9,
NetworkModuleOpensslX509CrlNotYetValid = 0x000004ba,
NetworkModuleOpensslX509CrlHasExpired = 0x000004bb,
NetworkModuleOpensslX509InCertNotBeforeField = 0x000004bc,
NetworkModuleOpensslX509InCertNotAfterField = 0x000004bd,
NetworkModuleOpensslX509InCrlLastUpdateField = 0x000004be,
NetworkModuleOpensslX509InCrlNextUpdateField = 0x000004bf,
NetworkModuleOpensslX509OutOfMem = 0x000004c0,
NetworkModuleOpensslX509DepthZeroSelfSignedCert = 0x000004c1,
NetworkModuleOpensslX509SelfSignedCertInChain = 0x000004c2,
NetworkModuleOpensslX509UnableToGetIssuerCertLocally = 0x000004c3,
NetworkModuleOpensslX509UnableToVerifyLeafSignature = 0x000004c4,
NetworkModuleOpensslX509CertChainTooLong = 0x000004c5,
NetworkModuleOpensslX509CertRevoked = 0x000004c6,
NetworkModuleOpensslX509InvalidCa = 0x000004c7,
NetworkModuleOpensslX509PathLengthExceeded = 0x000004c8,
NetworkModuleOpensslX509InvalidPurpose = 0x000004c9,
NetworkModuleOpensslX509CertUntrusted = 0x000004ca,
NetworkModuleOpensslX509CertRejected = 0x000004cb,
NetworkModuleOpensslX509SubjectIssuerMismatch = 0x000004cc,
NetworkModuleOpensslX509AkidSkidMismatch = 0x000004cd,
NetworkModuleOpensslX509AkidIssuerSerialMismatch = 0x000004ce,
NetworkModuleOpensslX509KeyusageNoCertsign = 0x000004cf,
NetworkModuleOpensslX509ApplicationVerification = 0x000004d0,
NetworkModuleSchannelCannotFindOsVersion = 0x00000514,
NetworkModuleSchannelOsNotSupported = 0x00000515,
NetworkModuleSchannelLoadlibraryFail = 0x00000516,
NetworkModuleSchannelCannotFindInterface = 0x00000517,
NetworkModuleSchannelInitFail = 0x00000518,
NetworkModuleSchannelFunctionCallFail = 0x00000519,
NetworkModuleSchannelX509UnableToGetIssuerCert = 0x00000546,
NetworkModuleSchannelX509TimeInvalid = 0x00000547,
NetworkModuleSchannelX509SignatureInvalid = 0x00000548,
NetworkModuleSchannelX509UnableToVerifyLeafSignature = 0x00000549,
NetworkModuleSchannelX509SelfSignedLeafCertificate = 0x0000054a,
NetworkModuleSchannelX509UnhandledError = 0x0000054b,
NetworkModuleSchannelX509SelfSignedCertInChain = 0x0000054c,
WebsocketHandshake = 0x00000578,
NetworkModuleDurangoUnknown = 0x000005dc,
NetworkModuleDurangoMalformedHostName = 0x000005dd,
NetworkModuleDurangoInvalidConnectionResponse = 0x000005de,
NetworkModuleDurangoInvalidCaCert = 0x000005df,
RpcWriteFailed = 0x00000bb8,
RpcServiceNotBound = 0x00000bb9,
RpcTooManyRequests = 0x00000bba,
RpcPeerUnknown = 0x00000bbb,
RpcPeerUnavailable = 0x00000bbc,
RpcPeerDisconnected = 0x00000bbd,
RpcRequestTimedOut = 0x00000bbe,
RpcConnectionTimedOut = 0x00000bbf,
RpcMalformedResponse = 0x00000bc0,
RpcAccessDenied = 0x00000bc1,
RpcInvalidService = 0x00000bc2,
RpcInvalidMethod = 0x00000bc3,
RpcInvalidObject = 0x00000bc4,
RpcMalformedRequest = 0x00000bc5,
RpcQuotaExceeded = 0x00000bc6,
RpcNotImplemented = 0x00000bc7,
RpcServerError = 0x00000bc8,
RpcShutdown = 0x00000bc9,
RpcDisconnect = 0x00000bca,
RpcDisconnectIdle = 0x00000bcb,
RpcProtocolError = 0x00000bcc,
RpcNotReady = 0x00000bcd,
RpcForwardFailed = 0x00000bce,
RpcEncryptionFailed = 0x00000bcf,
RpcInvalidAddress = 0x00000bd0,
RpcMethodDisabled = 0x00000bd1,
RpcShardNotFound = 0x00000bd2,
RpcInvalidConnectionId = 0x00000bd3,
RpcNotConnected = 0x00000bd4,
RpcInvalidConnectionState = 0x00000bd5,
RpcServiceAlreadyRegistered = 0x00000bd6,
PresenceInvalidFieldId = 0x00000fa0,
PresenceNoValidSubscribers = 0x00000fa1,
PresenceAlreadySubscribed = 0x00000fa2,
PresenceConsumerNotFound = 0x00000fa3,
PresenceConsumerIsNull = 0x00000fa4,
PresenceTemporaryOutage = 0x00000fa5,
PresenceTooManySubscriptions = 0x00000fa6,
PresenceSubscriptionCancelled = 0x00000fa7,
PresenceRichPresenceParseError = 0x00000fa8,
PresenceRichPresenceXmlError = 0x00000fa9,
PresenceRichPresenceLoadError = 0x00000faa,
FriendsTooManySentInvitations = 0x00001389,
FriendsTooManyReceivedInvitations = 0x0000138a,
FriendsFriendshipAlreadyExists = 0x0000138b,
FriendsFriendshipDoesNotExist = 0x0000138c,
FriendsInvitationAlreadyExists = 0x0000138d,
FriendsInvalidInvitation = 0x0000138e,
FriendsAlreadySubscribed = 0x0000138f,
FriendsAccountBlocked = 0x00001391,
FriendsNotSubscribed = 0x00001392,
FriendsInvalidRoleId = 0x00001393,
FriendsDisabledRoleId = 0x00001394,
FriendsNoteMaxSizeExceeded = 0x00001395,
FriendsUpdateFriendStateFailed = 0x00001396,
FriendsInviteeAtMaxFriends = 0x00001397,
FriendsInviterAtMaxFriends = 0x00001398,
PlatformStorageFileWriteDenied = 0x00001770,
WhisperUndeliverable = 0x00001b58,
WhisperMaxSizeExceeded = 0x00001b59,
UserManagerAlreadyBlocked = 0x00001f40,
UserManagerNotBlocked = 0x00001f41,
UserManagerCannotBlockSelf = 0x00001f42,
UserManagerAlreadyRegistered = 0x00001f43,
UserManagerNotRegistered = 0x00001f44,
UserManagerTooManyBlockedEntities = 0x00001f45,
UserManagerTooManyIds = 0x00001f47,
UserManagerBlockRecordUnavailable = 0x00001f4f,
UserManagerBlockEntityFailed = 0x00001f50,
UserManagerUnblockEntityFailed = 0x00001f51,
UserManagerCannotBlockFriend = 0x00001f53,
SocialNetworkDbException = 0x00002328,
SocialNetworkDenialFromProvider = 0x00002329,
SocialNetworkInvalidSnsId = 0x0000232a,
SocialNetworkCantSendToProvider = 0x0000232b,
SocialNetworkExCommFailed = 0x0000232c,
SocialNetworkDisabled = 0x0000232d,
SocialNetworkMissingRequestParam = 0x0000232e,
SocialNetworkUnsupportedOauthVersion = 0x0000232f,
ChannelFull = 0x00002710,
ChannelNoChannel = 0x00002711,
ChannelNotMember = 0x00002712,
ChannelAlreadyMember = 0x00002713,
ChannelNoSuchMember = 0x00002714,
ChannelInvalidChannelId = 0x00002716,
ChannelNoSuchInvitation = 0x00002718,
ChannelTooManyInvitations = 0x00002719,
ChannelInvitationAlreadyExists = 0x0000271a,
ChannelInvalidChannelSize = 0x0000271b,
ChannelInvalidRoleId = 0x0000271c,
ChannelRoleNotAssignable = 0x0000271d,
ChannelInsufficientPrivileges = 0x0000271e,
ChannelInsufficientPrivacyLevel = 0x0000271f,
ChannelInvalidPrivacyLevel = 0x00002720,
ChannelTooManyChannelsJoined = 0x00002721,
ChannelInvitationAlreadySubscribed = 0x00002722,
ChannelInvalidChannelDelegate = 0x00002723,
ChannelSlotAlreadyReserved = 0x00002724,
ChannelSlotNotReserved = 0x00002725,
ChannelNoReservedSlotsAvailable = 0x00002726,
ChannelInvalidRoleSet = 0x00002727,
ChannelRequireFriendValidation = 0x00002728,
ChannelMemberOffline = 0x00002729,
ChannelReceivedTooManyInvitations = 0x0000272a,
ChannelInvitationInvalidGameAccountSelected = 0x0000272b,
ChannelUnreachable = 0x0000272c,
ChannelInvitationNotSubscribed = 0x0000272d,
ChannelInvalidMessageSize = 0x0000272e,
ChannelMaxMessageSizeExceeded = 0x0000272f,
ChannelConfigNotFound = 0x00002730,
ChannelInvalidChannelType = 0x00002731,
LocalStorageFileOpenError = 0x00002af8,
LocalStorageFileCreateError = 0x00002af9,
LocalStorageFileReadError = 0x00002afa,
LocalStorageFileWriteError = 0x00002afb,
LocalStorageFileDeleteError = 0x00002afc,
LocalStorageFileCopyError = 0x00002afd,
LocalStorageFileDecompressError = 0x00002afe,
LocalStorageFileHashMismatch = 0x00002aff,
LocalStorageFileUsageMismatch = 0x00002b00,
LocalStorageDatabaseInitError = 0x00002b01,
LocalStorageDatabaseNeedsRebuild = 0x00002b02,
LocalStorageDatabaseInsertError = 0x00002b03,
LocalStorageDatabaseLookupError = 0x00002b04,
LocalStorageDatabaseUpdateError = 0x00002b05,
LocalStorageDatabaseDeleteError = 0x00002b06,
LocalStorageDatabaseShrinkError = 0x00002b07,
LocalStorageCacheCrawlError = 0x00002b08,
LocalStorageDatabaseIndexTriggerError = 0x00002b09,
LocalStorageDatabaseRebuildInProgress = 0x00002b0a,
LocalStorageOkButNotInCache = 0x00002b0b,
LocalStorageDatabaseRebuildInterrupted = 0x00002b0d,
LocalStorageDatabaseNotInitialized = 0x00002b0e,
LocalStorageDirectoryCreateError = 0x00002b0f,
LocalStorageFilekeyNotFound = 0x00002b10,
LocalStorageNotAvailableOnServer = 0x00002b11,
RegistryCreateKeyError = 0x00002ee0,
RegistryOpenKeyError = 0x00002ee1,
RegistryReadError = 0x00002ee2,
RegistryWriteError = 0x00002ee3,
RegistryTypeError = 0x00002ee4,
RegistryDeleteError = 0x00002ee5,
RegistryEncryptError = 0x00002ee6,
RegistryDecryptError = 0x00002ee7,
RegistryKeySizeError = 0x00002ee8,
RegistryValueSizeError = 0x00002ee9,
RegistryNotFound = 0x00002eeb,
RegistryMalformedString = 0x00002eec,
InterfaceAlreadyConnected = 0x000032c8,
InterfaceNotReady = 0x000032c9,
InterfaceOptionKeyTooLarge = 0x000032ca,
InterfaceOptionValueTooLarge = 0x000032cb,
InterfaceOptionKeyInvalidUtf8String = 0x000032cc,
InterfaceOptionValueInvalidUtf8String = 0x000032cd,
HttpCouldntResolve = 0x000036b0,
HttpCouldntConnect = 0x000036b1,
HttpTimeout = 0x000036b2,
HttpFailed = 0x000036b3,
HttpMalformedUrl = 0x000036b4,
HttpDownloadAborted = 0x000036b5,
HttpCouldntWriteFile = 0x000036b6,
HttpTooManyRedirects = 0x000036b7,
HttpCouldntOpenFile = 0x000036b8,
HttpCouldntCreateFile = 0x000036b9,
HttpCouldntReadFile = 0x000036ba,
HttpCouldntRenameFile = 0x000036bb,
HttpCouldntCreateDirectory = 0x000036bc,
HttpCurlIsNotReady = 0x000036bd,
HttpCancelled = 0x000036be,
HttpFileNotFound = 0x00003844,
AccountMissingConfig = 0x00004650,
AccountDataNotFound = 0x00004651,
AccountAlreadySubscribed = 0x00004652,
AccountNotSubscribed = 0x00004653,
AccountFailedToParseTimezoneData = 0x00004654,
AccountLoadFailed = 0x00004655,
AccountLoadCancelled = 0x00004656,
AccountDatabaseInvalidateFailed = 0x00004657,
AccountCacheInvalidateFailed = 0x00004658,
AccountSubscriptionPending = 0x00004659,
AccountUnknownRegion = 0x0000465a,
AccountDataFailedToParse = 0x0000465b,
AccountUnderage = 0x0000465c,
AccountIdentityCheckPending = 0x0000465d,
AccountIdentityUnverified = 0x0000465e,
DatabaseBindingCountMismatch = 0x00004a38,
DatabaseBindingParseFail = 0x00004a39,
DatabaseResultsetColumnsMismatch = 0x00004a3a,
DatabaseDeadlock = 0x00004a3b,
DatabaseDuplicateKey = 0x00004a3c,
DatabaseCannotConnect = 0x00004a3d,
DatabaseStatementFailed = 0x00004a3e,
DatabaseTransactionNotStarted = 0x00004a3f,
DatabaseTransactionNotEnded = 0x00004a40,
DatabaseTransactionLeak = 0x00004a41,
DatabaseTransactionStateBad = 0x00004a42,
DatabaseServerGone = 0x00004a43,
DatabaseQueryTimeout = 0x00004a44,
DatabaseBindingNotNullable = 0x00004a9c,
DatabaseBindingInvalidInteger = 0x00004a9d,
DatabaseBindingInvalidFloat = 0x00004a9e,
DatabaseBindingInvalidTemporal = 0x00004a9f,
DatabaseBindingInvalidProtobuf = 0x00004aa0,
PartyInvalidPartyId = 0x00004e20,
PartyAlreadyInParty = 0x00004e21,
PartyNotInParty = 0x00004e22,
PartyInvitationUndeliverable = 0x00004e23,
PartyInvitationAlreadyExists = 0x00004e24,
PartyTooManyPartyInvitations = 0x00004e25,
PartyTooManyReceivedInvitations = 0x00004e26,
PartyNoSuchType = 0x00004e27,
GamesNoSuchFactory = 0x000055f0,
GamesNoSuchGame = 0x000055f1,
GamesNoSuchRequest = 0x000055f2,
GamesNoSuchPartyMember = 0x000055f3,
ResourcesOffline = 0x000059d8,
GameServerCreateGameRefused = 0x00005dc0,
GameServerAddPlayersRefused = 0x00005dc1,
GameServerRemovePlayersRefused = 0x00005dc2,
GameServerFinishGameRefused = 0x00005dc3,
GameServerNoSuchGame = 0x00005dc4,
GameServerNoSuchPlayer = 0x00005dc5,
GameServerCreateGameRefusedTransient = 0x00005df2,
GameServerAddPlayersRefusedTransient = 0x00005df3,
GameServerRemovePlayersRefusedTransient = 0x00005df4,
GameServerFinishGameRefusedTransient = 0x00005df5,
GameServerCreateGameRefusedBusy = 0x00005e24,
GameServerAddPlayersRefusedBusy = 0x00005e25,
GameServerRemovePlayersRefusedBusy = 0x00005e26,
GameServerFinishGameRefusedBusy = 0x00005e27,
GameMasterInvalidFactory = 0x000061a8,
GameMasterInvalidGame = 0x000061a9,
GameMasterGameFull = 0x000061aa,
GameMasterRegisterFailed = 0x000061ab,
GameMasterNoGameServer = 0x000061ac,
GameMasterNoUtilityServer = 0x000061ad,
GameMasterNoGameVersion = 0x000061ae,
GameMasterGameJoinFailed = 0x000061af,
GameMasterAlreadyRegistered = 0x000061b0,
GameMasterNoFactory = 0x000061b1,
GameMasterMultipleGameVersions = 0x000061b2,
GameMasterInvalidPlayer = 0x000061b3,
GameMasterInvalidGameRequest = 0x000061b4,
GameMasterInsufficientPrivileges = 0x000061b5,
GameMasterAlreadyInGame = 0x000061b6,
GameMasterInvalidGameServerResponse = 0x000061b7,
GameMasterGameAccountLookupFailed = 0x000061b8,
GameMasterGameEntryCancelled = 0x000061b9,
GameMasterGameEntryAbortedClientDropped = 0x000061ba,
GameMasterGameEntryAbortedByService = 0x000061bb,
GameMasterNoAvailableCapacity = 0x000061bc,
GameMasterInvalidTeamId = 0x000061bd,
GameMasterCreationInProgress = 0x000061be,
NotificationInvalidClientId = 0x00006590,
NotificationDuplicateName = 0x00006591,
NotificationNameNotFound = 0x00006592,
NotificationInvalidServer = 0x00006593,
NotificationQuotaExceeded = 0x00006594,
NotificationInvalidNotificationType = 0x00006595,
NotificationUndeliverable = 0x00006596,
NotificationUndeliverableTemporary = 0x00006597,
AchievementsNothingToUpdate = 0x00006d60,
AchievementsInvalidParams = 0x00006d61,
AchievementsNotRegistered = 0x00006d62,
AchievementsNotReady = 0x00006d63,
AchievementsFailedToParseStaticData = 0x00006d64,
AchievementsUnknownId = 0x00006d65,
AchievementsMissingSnapshot = 0x00006d66,
AchievementsAlreadyRegistered = 0x00006d67,
AchievementsTooManyRegistrations = 0x00006d68,
AchievementsAlreadyInProgress = 0x00006d69,
AchievementsTemporaryOutage = 0x00006d6a,
AchievementsInvalidProgramid = 0x00006d6b,
AchievementsMissingRecord = 0x00006d6c,
AchievementsRegistrationPending = 0x00006d6d,
AchievementsEntityIdNotFound = 0x00006d6e,
AchievementsAchievementIdNotFound = 0x00006d6f,
AchievementsCriteriaIdNotFound = 0x00006d70,
AchievementsStaticDataMismatch = 0x00006d71,
AchievementsWrongThread = 0x00006d72,
AchievementsCallbackIsNull = 0x00006d73,
AchievementsAutoRegisterPending = 0x00006d74,
AchievementsNotInitialized = 0x00006d75,
AchievementsAchievementIdAlreadyExists = 0x00006d76,
AchievementsFailedToDownloadStaticData = 0x00006d77,
AchievementsStaticDataNotFound = 0x00006d78,
GameUtilityServerVariableRequestRefused = 0x000084d1,
GameUtilityServerWrongNumberOfVariablesReturned = 0x000084d2,
GameUtilityServerClientRequestRefused = 0x000084d3,
GameUtilityServerPresenceChannelCreatedRefused = 0x000084d4,
GameUtilityServerVariableRequestRefusedTransient = 0x00008502,
GameUtilityServerClientRequestRefusedTransient = 0x00008503,
GameUtilityServerPresenceChannelCreatedRefusedTransient = 0x00008504,
GameUtilityServerServerRequestRefusedTransient = 0x00008505,
GameUtilityServerVariableRequestRefusedBusy = 0x00008534,
GameUtilityServerClientRequestRefusedBusy = 0x00008535,
GameUtilityServerPresenceChannelCreatedRefusedBusy = 0x00008536,
GameUtilityServerServerRequestRefusedBusy = 0x00008537,
GameUtilityServerNoServer = 0x00008598,
IdentityInsufficientData = 0x0000a028,
IdentityTooManyResults = 0x0000a029,
IdentityBadId = 0x0000a02a,
IdentityNoAccountBlob = 0x0000a02b,
RiskChallengeAction = 0x0000a410,
RiskDelayAction = 0x0000a411,
RiskThrottleAction = 0x0000a412,
RiskAccountLocked = 0x0000a413,
RiskCsDenied = 0x0000a414,
RiskDisconnectAccount = 0x0000a415,
RiskCheckSkipped = 0x0000a416,
ReportUnavailable = 0x0000afc8,
ReportTooLarge = 0x0000afc9,
ReportUnknownType = 0x0000afca,
ReportAttributeInvalid = 0x0000afcb,
ReportAttributeQuotaExceeded = 0x0000afcc,
ReportUnconfirmed = 0x0000afcd,
ReportNotConnected = 0x0000afce,
ReportRejected = 0x0000afcf,
ReportTooManyRequests = 0x0000afd0,
AccountAlreadyRegisterd = 0x0000bb80,
AccountNotRegistered = 0x0000bb81,
AccountRegistrationPending = 0x0000bb82,
MemcachedClientNoError = 0x00010000,
MemcachedClientKeyNotFound = 0x00010001,
MemcachedKeyExists = 0x00010002,
MemcachedValueToLarge = 0x00010003,
MemcachedInvalidArgs = 0x00010004,
MemcachedItemNotStored = 0x00010005,
MemcachedNonNumericValue = 0x00010006,
MemcachedWrongServer = 0x00010007,
MemcachedAuthenticationError = 0x00010008,
MemcachedAuthenticationContinue = 0x00010009,
MemcachedUnknownCommand = 0x0001000a,
MemcachedOutOfMemory = 0x0001000b,
MemcachedNotSupported = 0x0001000c,
MemcachedInternalError = 0x0001000d,
MemcachedTemporaryFailure = 0x0001000e,
MemcachedClientAlreadyConnected = 0x000186a0,
MemcachedClientBadConfig = 0x000186a1,
MemcachedClientNotConnected = 0x000186a2,
MemcachedClientTimeout = 0x000186a3,
MemcachedClientAborted = 0x000186a4,
UtilServerFailedToSerialize = 0x80000064,
UtilServerDisconnectedFromBattlenet = 0x80000065,
UtilServerTimedOut = 0x80000066,
UtilServerNoMeteringData = 0x80000067,
UtilServerFailPermissionCheck = 0x80000068,
UtilServerUnknownRealm = 0x80000069,
UtilServerMissingSessionKey = 0x8000006a,
UtilServerMissingVirtualRealm = 0x8000006b,
UtilServerInvalidSessionKey = 0x8000006c,
UtilServerMissingRealmList = 0x8000006d,
UtilServerInvalidIdentityArgs = 0x8000006e,
UtilServerSessionObjectMissing = 0x8000006f,
UtilServerInvalidBnetSession = 0x80000070,
UtilServerInvalidVirtualRealm = 0x80000071,
UtilServerInvalidClientAddress = 0x80000072,
UtilServerFailedToSerializeResponse = 0x80000073,
UtilServerUnknownRequest = 0x80000074,
UtilServerUnableToGenerateJoinTicket = 0x80000075,
UtilServerUnableToGenerateRealmListTicket = 0x80000076,
UtilServerAccountDenied = 0x80000077,
UtilServerInvalidWowAccount = 0x80000078,
UtilServerUnableToStoreSession = 0x80000079,
UtilServerSessionAlreadyCreated = 0x8000007a,
UserServerFailedToSerialize = 0x800000c8,
UserServerDisconnectedFromUtil = 0x800000c9,
UserServerSessionDuplicate = 0x800000ca,
UserServerFailedToDisableBilling = 0x800000cb,
UserServerPlayerDisconnected = 0x800000cc,
UserServerFailedToParseAccountState = 0x800000cd,
UserServerAccountLoadCancelled = 0x800000ce,
UserServerBadPlatform = 0x800000cf,
UserServerBadVirtualRealm = 0x800000d0,
UserServerLocaleRestricted = 0x800000d1,
UserServerMissingPropass = 0x800000d2,
UserServerBadWowAccount = 0x800000d3,
UserServerBadBnetAccount = 0x800000d4,
UserServerFailedToParseGameAccountState = 0x800000d5,
UserServerFailedToParseGameTimeRemaining = 0x800000d6,
UserServerFailedToParseGameSessionInfo = 0x800000d7,
UserServerAccountStatePoorlyFormed = 0x800000d8,
UserServerGameAccountStatePoorlyFormed = 0x800000d9,
UserServerGameTimeRemainingPoorlyFormed = 0x800000da,
UserServerGameSessionInfoPoorlyFormed = 0x800000db,
UserServerBadSessionTrackerState = 0x800000dc,
UserServerFailedToParseCaisInfo = 0x800000dd,
UserServerGameSessionDisconnected = 0x800000de,
UserServerVersionMismatch = 0x800000df,
UserServerAccountSuspended = 0x800000e0,
UserServerNotPermittedOnRealm = 0x800000e1,
UserServerLoginFailedConnect = 0x800000e2,
WowServicesTimedOut = 0x8000012c,
WowServicesInvalidRealmListTicket = 0x8000012d,
WowServicesInvalidJoinTicket = 0x8000012e,
WowServicesInvalidServerAddresses = 0x8000012f,
WowServicesInvalidSecretBlob = 0x80000130,
WowServicesNoRealmJoinIpFound = 0x80000131,
WowServicesDeniedRealmListTicket = 0x80000132,
WowServicesMissingGameAccount = 0x80000133,
WowServicesLogonInvalidAuthToken = 0x80000134,
WowServicesNoAvailableRealms = 0x80000135,
WowServicesFailedToParseDispatch = 0x80000136,
WowServicesMissingMeteringFile = 0x80000137,
WowServicesLoginInvalidContentType = 0x80000138,
WowServicesLoginUnableToDecode = 0x80000139,
WowServicesLoginPostError = 0x8000013a,
WowServicesAuthenticatorParseFailed = 0x8000013b,
WowServicesLegalParseFailed = 0x8000013c,
WowServicesLoginAuthenticationParseFailed = 0x8000013d,
WowSerivcesUserMustAcceptLegal = 0x8000013e,
WowServicesDisconnected = 0x8000013f,
WowServicesNoHandlerForDispatch = 0x80000140,
WowServicesPreDispatchHandlerFailed = 0x80000141,
WowServicesCriticalStreamingError = 0x80000142,
WowServicesWorldLoadError = 0x80000143,
WowServicesLoginFailed = 0x80000144,
WowServicesLoginFailedOnChallenge = 0x80000145,
WowServicesNoPrepaidTime = 0x80000146,
WowServicesSubscriptionExpired = 0x80000147,
WowServicesCantConnect = 0x80000148,
}
}
@@ -0,0 +1,88 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum RealmFlags
{
None = 0x00,
VersionMismatch = 0x01,
Offline = 0x02,
SpecifyBuild = 0x04,
Unk1 = 0x08,
Unk2 = 0x10,
Recommended = 0x20,
New = 0x40,
Full = 0x80
}
public enum RealmType
{
Normal = 0,
PVP = 1,
Normal2 = 4,
RP = 6,
RPPVP = 8,
MaxType = 14,
FFAPVP = 16 // custom, free for all pvp mode like arena PvP in all zones except rest activated places and sanctuaries
// replaced by REALM_PVP in realm list
}
public enum RealmZones
{
Unknown = 0, // Any Language
Development = 1, // Any Language
UnitedStates = 2, // Extended-Latin
Oceanic = 3, // Extended-Latin
LatinAmerica = 4, // Extended-Latin
Tournament5 = 5, // Basic-Latin At Create, Any At Login
Korea = 6, // East-Asian
Tournament7 = 7, // Basic-Latin At Create, Any At Login
English = 8, // Extended-Latin
German = 9, // Extended-Latin
French = 10, // Extended-Latin
Spanish = 11, // Extended-Latin
Russian = 12, // Cyrillic
Tournament13 = 13, // Basic-Latin At Create, Any At Login
Taiwan = 14, // East-Asian
Tournament15 = 15, // Basic-Latin At Create, Any At Login
China = 16, // East-Asian
Cn1 = 17, // Basic-Latin At Create, Any At Login
Cn2 = 18, // Basic-Latin At Create, Any At Login
Cn3 = 19, // Basic-Latin At Create, Any At Login
Cn4 = 20, // Basic-Latin At Create, Any At Login
Cn5 = 21, // Basic-Latin At Create, Any At Login
Cn6 = 22, // Basic-Latin At Create, Any At Login
Cn7 = 23, // Basic-Latin At Create, Any At Login
Cn8 = 24, // Basic-Latin At Create, Any At Login
Tournament25 = 25, // Basic-Latin At Create, Any At Login
TestServer = 26, // Any Language
Tournament27 = 27, // Basic-Latin At Create, Any At Login
QaServer = 28, // Any Language
Cn9 = 29, // Basic-Latin At Create, Any At Login
TestServer2 = 30, // Any Language
Cn10 = 31, // Basic-Latin At Create, Any At Login
Ctc = 32,
Cnc = 33,
Cn14 = 34, // Basic-Latin At Create, Any At Login
Cn269 = 35, // Basic-Latin At Create, Any At Login
Cn37 = 36, // Basic-Latin At Create, Any At Login
Cn58 = 37 // Basic-Latin At Create, Any At Login
}
}
+62
View File
@@ -0,0 +1,62 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public struct BattlefieldSounds
{
public const uint HordeWins = 8454;
public const uint AllianceWins = 8455;
public const uint Start = 3439;
}
public enum BattleFieldObjectiveStates
{
Neutral = 0,
Alliance,
Horde,
NeutralAllianceChallenge,
NeutralHordeChallenge,
AllianceHordeChallenge,
HordeAllianceChallenge
}
public enum BFLeaveReason
{
Close = 1,
//BF_LEAVE_REASON_UNK1 = 2, (not used)
//BF_LEAVE_REASON_UNK2 = 4, (not used)
Exited = 8,
LowLevel = 10,
NotWhileInRaid = 15,
Deserter = 16
}
public enum BattlefieldState
{
Inactive = 0,
Warnup = 1,
InProgress = 2
}
public struct BattlefieldIds
{
public const uint WG = 1; // Wintergrasp battle
public const uint TB = 21; // Tol Barad
public const uint Ashran = 24; // Ashran
}
}
+386
View File
@@ -0,0 +1,386 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public struct BattlegroundConst
{
//Time Intervals
public const uint CheckPlayerPositionInverval = 1000; // Ms
public const uint ResurrectionInterval = 30000; // Ms
//RemindInterval = 10000, // Ms
public const uint InvitationRemindTime = 20000; // Ms
public const uint InviteAcceptWaitTime = 90000; // Ms
public const uint AutocloseBattleground = 120000; // Ms
public const uint MaxOfflineTime = 300; // Secs
public const uint RespawnOneDay = 86400; // Secs
public const uint RespawnImmediately = 0; // Secs
public const uint BuffRespawnTime = 180; // Secs
public const uint BattlegroundCountdownMax = 120; // Secs
public const uint ArenaCountdownMax = 60; // Secs
public const uint PlayerPositionUpdateInterval = 5; // secs
//EventIds
public const int EventIdFirst = 0;
public const int EventIdSecond = 1;
public const int EventIdThird = 2;
public const int EventIdFourth = 3;
public const int EventIdCount = 4;
//Quests
public const uint WsQuestReward = 43483;
public const uint AbQuestReward = 43484;
public const uint AvQuestReward = 43475;
public const uint AvQuestKilledBoss = 23658;
public const uint EyQuestReward = 43477;
public const uint SaQuestReward = 61213;
public const uint AbQuestReward4Bases = 24061;
public const uint AbQuestReward5Bases = 24064;
//BuffObjects
public const uint SpeedBuff = 179871;
public const uint RegenBuff = 179904;
public const uint BerserkerBuff = 179905;
//QueueGroupTypes
public const uint BgQueuePremadeAlliance = 0;
public const uint BgQueuePremadeHorde = 1;
public const uint BgQueueNormalAlliance = 2;
public const uint BgQueueNormalHorde = 3;
public const int BgQueueTypesCount = 4;
//PlayerPosition
public const sbyte PlayerPositionIconNone = 0;
public const sbyte PlayerPositionIconHordeFlag = 1;
public const sbyte PlayerPositionIconAllianceFlag = 2;
public const sbyte PlayerPositionArenaSlotNone = 1;
public const sbyte PlayerPositionArenaSlot1 = 2;
public const sbyte PlayerPositionArenaSlot2 = 3;
public const sbyte PlayerPositionArenaSlot3 = 4;
public const sbyte PlayerPositionArenaSlot4 = 5;
public const sbyte PlayerPositionArenaSlot5 = 6;
//Spells
public const uint SpellWaitingForResurrect = 2584; // Waiting To Resurrect
public const uint SpellSpiritHealChannel = 22011; // Spirit Heal Channel
public const uint SpellSpiritHeal = 22012; // Spirit Heal
public const uint SpellResurrectionVisual = 24171; // Resurrection Impact Visual
public const uint SpellArenaPreparation = 32727; // Use This One, 32728 Not Correct
public const uint SpellPreparation = 44521; // Preparation
public const uint SpellSpiritHealMana = 44535; // Spirit Heal
public const uint SpellRecentlyDroppedFlag = 42792; // Recently Dropped Flag
public const uint SpellAuraPlayerInactive = 43681; // Inactive
public const uint SpellHonorableDefender25y = 68652; // +50% Honor When Standing At A Capture Point That You Control, 25yards Radius (Added In 3.2)
public const uint SpellHonorableDefender60y = 66157; // +50% Honor When Standing At A Capture Point That You Control, 60yards Radius (Added In 3.2), Probably For 40+ Player Battlegrounds
}
public enum BattlegroundEventFlags
{
None = 0x00,
Event1 = 0x01,
Event2 = 0x02,
Event3 = 0x04,
Event4 = 0x08
}
// indexes of BattlemasterList.dbc
public enum BattlegroundTypeId
{
None = 0, // None
AV = 1, // Alterac Valley
WS = 2, // Warsong Gulch
AB = 3, // Arathi Basin
NA = 4, // Nagrand Arena
BE = 5, // Blade'S Edge Arena
AA = 6, // All Arenas
EY = 7, // Eye Of The Storm
RL = 8, // Ruins Of Lordaernon
SA = 9, // Strand Of The Ancients
DS = 10, // Dalaran Sewers
RV = 11, // The Ring Of Valor
IC = 30, // Isle Of Conquest
RB = 32, // Random Battleground
Rated10Vs10 = 100, // Rated Battleground 10 Vs 10
Rated15Vs15 = 101, // Rated Battleground 15 Vs 15
Rated25Vs25 = 102, // Rated Battleground 25 Vs 25
TP = 108, // Twin Peaks
BFG = 120, // Battle For Gilneas
// 656 = "Rated Eye Of The Storm"
Tk = 699, // Temple Of Kotmogu
// 706 = "Ctf3"
SM = 708, // Silvershard Mines
TVA = 719, // Tol'Viron Arena
DG = 754, // Deepwind Gorge
TTP = 757, // The Tiger'S Peak
SSvsTM = 789, // Southshore Vs. Tarren Mill
SmallD = 803, // Small Battleground D
BRH = 808, // Black Rook Hold Arena
// 809 = "New Nagrand Arena (Legion)"
AF = 816, // Ashamane'S Fall
// 844 = "New Blade'S Edge Arena (Legion)"
Max = 845
}
public enum BattlegroundQueueTypeId
{
None = 0,
AV = 1,
WS = 2,
AB = 3,
EY = 4,
SA = 5,
IC = 6,
TP = 7,
BFG = 8,
RB = 9,
Arena2v2 = 10,
Arena3v3 = 11,
Arena5v5 = 12,
Max
}
public enum BattlegroundQueueInvitationType
{
NoBalance = 0, // no balance: N+M vs N players
Balanced = 1, // teams balanced: N+1 vs N players
Even = 2 // teams even: N vs N players
}
public enum BattlegroundCriteriaId
{
ResilientVictory,
SaveTheDay,
EverythingCounts,
AvPerfection,
DefenseOfTheAncients,
NotEvenAScratch,
}
public enum BattlegroundSounds
{
HordeWins = 8454,
AllianceWins = 8455,
BgStart = 3439,
BgStartL70etc = 11803
}
public enum BattlegroundTeamId
{
Horde = 0, // Battleground: Horde, Arena: Green
Alliance = 1, // Battleground: Alliance, Arena: Gold
Neutral = 2 // Battleground: Neutral, Arena: None
}
public enum BattlegroundMarks
{
SpellWsMarkLoser = 24950,
SpellWsMarkWinner = 24951,
SpellAbMarkLoser = 24952,
SpellAbMarkWinner = 24953,
SpellAvMarkLoser = 24954,
SpellAvMarkWinner = 24955,
SpellSaMarkWinner = 61160,
SpellSaMarkLoser = 61159,
ItemAvMarkOfHonor = 20560,
ItemWsMarkOfHonor = 20558,
ItemAbMarkOfHonor = 20559,
ItemEyMarkOfHonor = 29024,
ItemSaMarkOfHonor = 42425
}
public enum BattlegroundMarksCount
{
WinnterCount = 3,
LoserCount = 1
}
public enum BattlegroundCreatures
{
A_SpiritGuide = 13116, // alliance
H_SpiritGuide = 13117 // horde
}
public enum BattlegroundStartTimeIntervals
{
Delay2m = 120000, // Ms (2 Minutes)
Delay1m = 60000, // Ms (1 Minute)
Delay30s = 30000, // Ms (30 Seconds)
Delay15s = 15000, // Ms (15 Seconds) Used Only In Arena
None = 0 // Ms
}
public enum BattlegroundStatus
{
None = 0, // first status, should mean bg is not instance
WaitQueue = 1, // means bg is empty and waiting for queue
WaitJoin = 2, // this means, that BG has already started and it is waiting for more players
InProgress = 3, // means bg is running
WaitLeave = 4 // means some faction has won BG and it is ending
}
public enum BGHonorMode
{
Normal = 0,
Holiday,
HonorModeNum
}
public enum GroupJoinBattlegroundResult
{
None = 0,
Deserters = 2, // You Cannot Join The BattlegroundYet Because You Or One Of Your Party Members Is Flagged As A Deserter.
ArenaTeamPartySize = 3, // Incorrect Party Size For This Arena.
TooManyQueues = 4, // You Can Only Be Queued For 2 Battles At Once
CannotQueueForRated = 5, // You Cannot Queue For A Rated Match While Queued For Other Battles
BattledgroundQueuedForRated = 6, // You Cannot Queue For Another Battle While Queued For A Rated Arena Match
TeamLeftQueue = 7, // Your Team Has Left The Arena Queue
NotInBattleground= 8, // You Can'T Do That In A Battleground.
JoinXpGain = 9, // Wtf, Doesn'T Exist In Client...
JoinRangeIndex = 10, // Cannot Join The Queue Unless All Members Of Your Party Are In The Same BattlegroundLevel Range.
JoinTimedOut = 11, // %S Was Unavailable To Join The Queue. (Uint64 Guid Exist In Client Cache)
//JoinTimedOut = 12, // Same As 11
//TeamLeftQueue = 13, // Same As 7
LfgCantUseBattleground= 14, // You Cannot Queue For A BattlegroundOr Arena While Using The Dungeon System.
InRandomBg = 15, // Can'T Do That While In A Random BattlegroundQueue.
InNonRandomBg = 16, // Can'T Queue For Random BattlegroundWhile In Another BattlegroundQueue.
BgDeveloperOnly = 17,
InvitationDeclined = 18,
MeetingStoneNotFound = 19,
WargameRequestFailure = 20,
BattlefieldTeamPartySize = 22,
NotOnTournamentRealm = 23,
PlayersFromDifferentRealms = 24,
RemoveFromPvpQueueGrantLevel = 33,
RemoveFromPvpQueueFactionChange = 34,
JoinFailed = 35,
DupeQueue = 43,
JoinNoValidSpecForRole = 44,
JoinRespec = 45,
AlreadyUsingLFGList = 46,
JoinMustCompleteQuest = 47
}
public enum ScoreType
{
KillingBlows = 1,
Deaths = 2,
HonorableKills = 3,
BonusHonor = 4,
DamageDone = 5,
HealingDone = 6,
// Ws And Ey
FlagCaptures = 7,
FlagReturns = 8,
// Ab And Ic
BasesAssaulted = 9,
BasesDefended = 10,
// Av
GraveyardsAssaulted = 11,
GraveyardsDefended = 12,
TowersAssaulted = 13,
TowersDefended = 14,
MinesCaptured = 15,
// Sota
DestroyedDemolisher = 16,
DestroyedWall = 17
}
//Arenas
public struct ArenaSpellIds
{
public const uint AllianceGoldFlag = 32724;
public const uint AllianceGreenFlag = 32725;
public const uint HordeGoldFlag = 35774;
public const uint HordeGreenFlag = 35775;
public const uint LastManStanding = 26549; // Arena Achievement Related
}
public enum ArenaTeamCommandTypes
{
Create_S = 0x00,
Invite_SS = 0x01,
Quit_S = 0x03,
Founder_S = 0x0e
}
public enum ArenaTeamCommandErrors
{
ArenaTeamCreated = 0x00,
ArenaTeamInternal = 0x01,
AlreadyInArenaTeam = 0x02,
AlreadyInArenaTeamS = 0x03,
InvitedToArenaTeam = 0x04,
AlreadyInvitedToArenaTeamS = 0x05,
ArenaTeamNameInvalid = 0x06,
ArenaTeamNameExistsS = 0x07,
ArenaTeamLeaderLeaveS = 0x08,
ArenaTeamPermissions = 0x08,
ArenaTeamPlayerNotInTeam = 0x09,
ArenaTeamPlayerNotInTeamSs = 0x0a,
ArenaTeamPlayerNotFoundS = 0x0b,
ArenaTeamNotAllied = 0x0c,
ArenaTeamIgnoringYouS = 0x13,
ArenaTeamTargetTooLowS = 0x15,
ArenaTeamTargetTooHighS = 0x16,
ArenaTeamTooManyMembersS = 0x17,
ArenaTeamNotFound = 0x1b,
ArenaTeamsLocked = 0x1e,
ArenaTeamTooManyCreate = 0x21,
}
public enum ArenaTeamEvents
{
JoinSs = 3, // Player Name + Arena Team Name
LeaveSs = 4, // Player Name + Arena Team Name
RemoveSss = 5, // Player Name + Arena Team Name + Captain Name
LeaderIsSs = 6, // Player Name + Arena Team Name
LeaderChangedSss = 7, // Old Captain + New Captain + Arena Team Name
DisbandedS = 8 // Captain Name + Arena Team Name
}
public enum ArenaTypes
{
BG = 0,
Team2v2 = 2,
Team3v3 = 3,
Team5v5 = 5
}
public enum ArenaErrorType
{
NoTeam = 0,
ExpiredCAIS = 1,
CantUseBattleground = 2
}
public enum ArenaTeamInfoType
{
Id = 0,
Type = 1, // new in 3.2 - team type?
Member = 2, // 0 - captain, 1 - member
GamesWeek = 3,
GamesSeason = 4,
WinsSeason = 5,
PersonalRating = 6,
End = 7
}
}
+75
View File
@@ -0,0 +1,75 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum FlagsControlType
{
Apply = 1,
Remove = 2
}
public enum BattlePetError
{
CantHaveMorePetsOfThatType = 3,
CantHaveMorePets = 4,
TooHighLevelToUncage = 7,
// TODO: find correct values if possible and needed (also wrong order)
DuplicateConvertedPet,
NeedToUnlock,
BadParam,
LockedPetAlreadyExists,
Ok,
Uncapturable,
CantInvalidCharacterGuid
}
// taken from BattlePetState.db2 - it seems to store some initial values for battle pets
// there are only values used in BattlePetSpeciesState.db2 and BattlePetBreedState.db2
// TODO: expand this enum if needed
public enum BattlePetState
{
MaxHealthBonus = 2,
InternalInitialLevel = 17,
StatPower = 18,
StatStamina = 19,
StatSpeed = 20,
ModDamageDealtPercent = 23,
Gender = 78, // 1 - Male, 2 - Female
CosmeticWaterBubbled = 85,
SpecialIsCockroach = 93,
CosmeticFlyTier = 128,
CosmeticBigglesworth = 144,
PassiveElite = 153,
PassiveBoss = 162,
CosmeticTreasureGoblin = 176,
// These Are Not In Battlepetstate.Db2 But Are Used In Battlepetspeciesstate.Db2
StartWithBuff = 183,
StartWithBuff2 = 184,
//
CosmeticSpectralBlue = 196
}
public enum BattlePetSaveInfo
{
Unchanged = 0,
Changed = 1,
New = 2,
Removed = 3
}
}
+40
View File
@@ -0,0 +1,40 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public struct BlackMarketConst
{
public const ulong MaxBid = 1000000UL* MoneyConstants.Gold;
}
public enum BlackMarketError
{
Ok = 0,
ItemNotFound = 1,
AlreadyBid = 2,
HigherBid = 4,
DatabaseError = 6,
NotEnoughMoney = 7,
RestrictedAccountTrial = 9
}
public enum BMAHMailAuctionAnswers
{
Outbid = 0,
Won = 1,
}
}
+117
View File
@@ -0,0 +1,117 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum CalendarMailAnswers
{
EventRemovedMailSubject = 0,
InviteRemovedMailSubject = 0x100
}
public enum CalendarFlags
{
AllAllowed = 0x001,
InvitesLocked = 0x010,
WithoutInvites = 0x040,
GuildEvent = 0x400
}
public enum CalendarModerationRank
{
Player = 0,
Moderator = 1,
Owner = 2
}
public enum CalendarSendEventType
{
Get = 0,
Add = 1,
Copy = 2
}
public enum CalendarEventType
{
Raid = 0,
Dungeon = 1,
Pvp = 2,
Meeting = 3,
Other = 4,
Heroic = 5
}
public enum CalendarRepeatType
{
Never = 0,
Weekly = 1,
Biweekly = 2,
Monthly = 3
}
public enum CalendarInviteStatus
{
Invited = 0,
Accepted = 1,
Declined = 2,
Confirmed = 3,
Out = 4,
Standby = 5,
SignedUp = 6,
NotSignedUp = 7,
Tentative = 8,
Removed = 9 // Correct Name?
}
public enum CalendarError
{
Ok = 0,
GuildEventsExceeded = 1,
EventsExceeded = 2,
SelfInvitesExceeded = 3,
OtherInvitesExceeded = 4,
Permissions = 5,
EventInvalid = 6,
NotInvited = 7,
Internal = 8,
GuildPlayerNotInGuild = 9,
AlreadyInvitedToEventS = 10,
PlayerNotFound = 11,
NotAllied = 12,
IgnoringYouS = 13,
InvitesExceeded = 14,
InvalidDate = 16,
InvalidTime = 17,
NeedsTitle = 19,
EventPassed = 20,
EventLocked = 21,
DeleteCreatorFailed = 22,
SystemDisabled = 24,
RestrictedAccount = 25,
ArenaEventsExceeded = 26,
RestrictedLevel = 27,
UserSquelched = 28,
NoInvite = 29,
EventWrongServer = 36,
InviteWrongServer = 37,
NoGuildInvites = 38,
InvalidSignup = 39,
NoModerator = 40
}
}
+109
View File
@@ -0,0 +1,109 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum ChatNotify
{
JoinedNotice = 0x00, //+ "%S Joined Channel.";
LeftNotice = 0x01, //+ "%S Left Channel.";
//SuspendedNotice = 0x01, // "%S Left Channel.";
YouJoinedNotice = 0x02, //+ "Joined Channel: [%S]"; -- You Joined
//YouChangedNotice = 0x02, // "Changed Channel: [%S]";
YouLeftNotice = 0x03, //+ "Left Channel: [%S]"; -- You Left
WrongPasswordNotice = 0x04, //+ "Wrong Password For %S.";
NotMemberNotice = 0x05, //+ "Not On Channel %S.";
NotModeratorNotice = 0x06, //+ "Not A Moderator Of %S.";
PasswordChangedNotice = 0x07, //+ "[%S] Password Changed By %S.";
OwnerChangedNotice = 0x08, //+ "[%S] Owner Changed To %S.";
PlayerNotFoundNotice = 0x09, //+ "[%S] Player %S Was Not Found.";
NotOwnerNotice = 0x0a, //+ "[%S] You Are Not The Channel Owner.";
ChannelOwnerNotice = 0x0b, //+ "[%S] Channel Owner Is %S.";
ModeChangeNotice = 0x0c, //?
AnnouncementsOnNotice = 0x0d, //+ "[%S] Channel Announcements Enabled By %S.";
AnnouncementsOffNotice = 0x0e, //+ "[%S] Channel Announcements Disabled By %S.";
ModerationOnNotice = 0x0f, //+ "[%S] Channel Moderation Enabled By %S.";
ModerationOffNotice = 0x10, //+ "[%S] Channel Moderation Disabled By %S.";
MutedNotice = 0x11, //+ "[%S] You Do Not Have Permission To Speak.";
PlayerKickedNotice = 0x12, //? "[%S] Player %S Kicked By %S.";
BannedNotice = 0x13, //+ "[%S] You Are Bannedstore From That Channel.";
PlayerBannedNotice = 0x14, //? "[%S] Player %S Bannedstore By %S.";
PlayerUnbannedNotice = 0x15, //? "[%S] Player %S Unbanned By %S.";
PlayerNotBannedNotice = 0x16, //+ "[%S] Player %S Is Not Bannedstore.";
PlayerAlreadyMemberNotice = 0x17, //+ "[%S] Player %S Is Already On The Channel.";
InviteNotice = 0x18, //+ "%2$S Has Invited You To Join The Channel '%1$S'.";
InviteWrongFactionNotice = 0x19, //+ "Target Is In The Wrong Alliance For %S.";
WrongFactionNotice = 0x1a, //+ "Wrong Alliance For %S.";
InvalidNameNotice = 0x1b, //+ "Invalid Channel Name";
NotModeratedNotice = 0x1c, //+ "%S Is Not Moderated";
PlayerInvitedNotice = 0x1d, //+ "[%S] You Invited %S To Join The Channel";
PlayerInviteBannedNotice = 0x1e, //+ "[%S] %S Has Been Bannedstore.";
ThrottledNotice = 0x1f, //+ "[%S] The Number Of Messages That Can Be Sent To This Channel Is Limited, Please Wait To Send Another Message.";
NotInAreaNotice = 0x20, //+ "[%S] You Are Not In The Correct Area For This Channel."; -- The User Is Trying To Send A Chat To A Zone Specific Channel, And They'Re Not Physically In That Zone.
NotInLfgNotice = 0x21, //+ "[%S] You Must Be Queued In Looking For Group Before Joining This Channel."; -- The User Must Be In The Looking For Group System To Join Lfg Chat Channels.
VoiceOnNotice = 0x22, //+ "[%S] Channel Voice Enabled By %S.";
VoiceOffNotice = 0x23, //+ "[%S] Channel Voice Disabled By %S.";
TrialRestricted = 0x24,
NotAllowedInChannel = 0x25
}
public enum ChannelFlags
{
None = 0x00,
Custom = 0x01,
// 0x02
Trade = 0x04,
NotLfg = 0x08,
General = 0x10,
City = 0x20,
Lfg = 0x40,
Voice = 0x80
// General 0x18 = 0x10 | 0x08
// Trade 0x3C = 0x20 | 0x10 | 0x08 | 0x04
// LocalDefence 0x18 = 0x10 | 0x08
// GuildRecruitment 0x38 = 0x20 | 0x10 | 0x08
// LookingForGroup 0x50 = 0x40 | 0x10
}
public enum ChannelDBCFlags
{
None = 0x00000,
Initial = 0x00001, // General, Trade, Localdefense, Lfg
ZoneDep = 0x00002, // General, Trade, Localdefense, Guildrecruitment
Global = 0x00004, // Worlddefense
Trade = 0x00008, // Trade, Lfg
CityOnly = 0x00010, // Trade, Guildrecruitment, Lfg
CityOnly2 = 0x00020, // Trade, Guildrecruitment, Lfg
Defense = 0x10000, // Localdefense, Worlddefense
GuildReq = 0x20000, // Guildrecruitment
Lfg = 0x40000, // Lfg
Unk1 = 0x80000 // General
}
public enum ChannelMemberFlags
{
None = 0x00,
Owner = 0x01,
Moderator = 0x02,
Voiced = 0x04,
Muted = 0x08,
Custom = 0x10,
MicMuted = 0x20
// 0x40
// 0x80
}
}
File diff suppressed because it is too large Load Diff
+123
View File
@@ -0,0 +1,123 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum ConditionTypes
{ // value1 value2 value3
None = 0, // 0 0 0 Always True
Aura = 1, // Spell_Id Effindex Use Target? True If Player (Or Target, If Value3) Has Aura Of Spell_Id With Effect Effindex
Item = 2, // Item_Id Count Bank True If Has #Count Of Item_Ids (If 'Bank' Is Set It Searches In Bank Slots Too)
ItemEquipped = 3, // Item_Id 0 0 True If Has Item_Id Equipped
Zoneid = 4, // Zone_Id 0 0 True If In Zone_Id
ReputationRank = 5, // Faction_Id Rankmask 0 True If Has Min_Rank For Faction_Id
Team = 6, // Player_Team 0, 0 469 - Alliance, 67 - Horde)
Skill = 7, // Skill_Id Skill_Value 0 True If Has Skill_Value For Skill_Id
QuestRewarded = 8, // Quest_Id 0 0 True If Quest_Id Was Rewarded Before
QuestTaken = 9, // Quest_Id 0, 0 True While Quest Active
DrunkenState = 10, // Drunkenstate 0, 0 True If Player Is Drunk Enough
WorldState = 11, // Index Value 0 True If World Has The Value For The Index
ActiveEvent = 12, // Event_Id 0 0 True If Event Is Active
InstanceInfo = 13, // Entry Data Type True If The Instance Info Defined By Type (Enum Instanceinfo) Equals Data.
QuestNone = 14, // Quest_Id 0 0 True If Doesn'T Have Quest Saved
Class = 15, // Class 0 0 True If Player'S Class Is Equal To Class
Race = 16, // Race 0 0 True If Player'S Race Is Equal To Race
Achievement = 17, // Achievement_Id 0 0 True If Achievement Is Complete
Title = 18, // Title Id 0 0 True If Player Has Title
Spawnmask = 19, // Spawnmask 0 0 True If In Spawnmask
Gender = 20, // Gender 0 0 True If Player'S Gender Is Equal To Gender
UnitState = 21, // Unitstate 0 0 True If Unit Has Unitstate
Mapid = 22, // Map_Id 0 0 True If In Map_Id
Areaid = 23, // Area_Id 0 0 True If In Area_Id
CreatureType = 24, // cinfo.type 0 0 true if creature_template.type = value1
Spell = 25, // Spell_Id 0 0 True If Player Has Learned Spell
PhaseId = 26, // Phasemask 0 0 True If Object Is In PhaseId
Level = 27, // Level Comparisontype 0 True If Unit'S Level Is Equal To Param1 (Param2 Can Modify The Statement)
QuestComplete = 28, // Quest_Id 0 0 True If Player Has Quest_Id With All Objectives Complete, But Not Yet Rewarded
NearCreature = 29, // Creature Entry Distance 0 True If There Is A Creature Of Entry In Range
NearGameobject = 30, // Gameobject Entry Distance 0 True If There Is A Gameobject Of Entry In Range
ObjectEntryGuid = 31, // Typeid Entry 0 True If Object Is Type Typeid And The Entry Is 0 Or Matches Entry Of The Object
TypeMask = 32, // Typemask 0 0 True If Object Is Type Object'S Typemask Matches Provided Typemask
RelationTo = 33, // Conditiontarget Relationtype 0 True If Object Is In Given Relation With Object Specified By Conditiontarget
ReactionTo = 34, // Conditiontarget Rankmask 0 True If Object'S Reaction Matches Rankmask Object Specified By Conditiontarget
DistanceTo = 35, // Conditiontarget Distance Comparisontype True If Object And Conditiontarget Are Within Distance Given By Parameters
Alive = 36, // 0 0 0 True If Unit Is Alive
HpVal = 37, // Hpval Comparisontype 0 True If Unit'S Hp Matches Given Value
HpPct = 38, // Hppct Comparisontype 0 True If Unit'S Hp Matches Given Pct
RealmAchievement = 39, // achievement_id 0 0 true if realm achievement is complete
InWater = 40, // 0 0 0 true if unit in water
TerrainSwap = 41, // terrainSwap 0 0 true if object is in terrainswap
StandState = 42, // stateType state 0 true if unit matches specified sitstate (0,x: has exactly state x; 1,0: any standing state; 1,1: any sitting state;)
DailyQuestDone = 43, // quest id 0 0 true if daily quest has been completed for the day
Charmed = 44, // 0 0 0 true if unit is currently charmed
PetType = 45, // mask 0 0 true if player has a pet of given type(s)
Taxi = 46, // 0 0 0 true if player is on taxi
Queststate = 47, // quest_id state_mask 0 true if player is in any of the provided quest states for the quest (1 = not taken, 2 = completed, 8 = in progress, 32 = failed, 64 = rewarded)
ObjectiveComplete = 48, // ID 0 0 true if player has ID objective complete, but quest not yet rewarded
Max = 49 // Max
}
public enum ConditionSourceType
{
None = 0,
CreatureLootTemplate = 1,
DisenchantLootTemplate = 2,
FishingLootTemplate = 3,
GameobjectLootTemplate = 4,
ItemLootTemplate = 5,
MailLootTemplate = 6,
MillingLootTemplate = 7,
PickpocketingLootTemplate = 8,
ProspectingLootTemplate = 9,
ReferenceLootTemplate = 10,
SkinningLootTemplate = 11,
SpellLootTemplate = 12,
SpellImplicitTarget = 13,
GossipMenu = 14,
GossipMenuOption = 15,
CreatureTemplateVehicle = 16,
Spell = 17,
SpellClickEvent = 18,
QuestAccept = 19,
// Condition source type 20 unused
VehicleSpell = 21,
SmartEvent = 22,
NpcVendor = 23,
SpellProc = 24,
TerrainSwap = 25,
Phase = 26,
Max = 27
}
public enum RelationType
{
Self = 0,
InParty,
InRaidOrParty,
OwnedBy,
PassengerOf,
CreatedBy,
Max
}
public enum InstanceInfo
{
Data = 0,
Data64,
BossState
}
}
+53
View File
@@ -0,0 +1,53 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum ConnectionType
{
Realm = 0,
Instance = 1,
Max
}
public enum ConnectToSerial
{
None = 0,
Realm = 14,
WorldAttempt1 = 17,
WorldAttempt2 = 35,
WorldAttempt3 = 53,
WorldAttempt4 = 71,
WorldAttempt5 = 89
}
public enum LoginFailureReason
{
Failed = 0,
NoWorld = 1,
DuplicateCharacter = 2,
NoInstances = 3,
Disabled = 4,
NoCharacter = 5,
LockedForTransfer = 6,
LockedByBilling = 7,
LockedByMobileAH = 8,
TemporaryGMLock = 9,
LockedByCharacterUpgrade = 10,
LockedByRevokedCharacterUpgrade = 11
}
}
+338
View File
@@ -0,0 +1,338 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum CreatureLinkedRespawnType
{
CreatureToCreature,
CreatureToGO, // Creature is dependant on GO
GOToGO,
GOToCreature // GO is dependant on creature
}
public enum AiReaction
{
Alert = 0, // pre-aggro (used in client packet handler)
Friendly = 1, // (NOT used in client packet handler)
Hostile = 2, // sent on every attack, triggers aggro sound (used in client packet handler)
Afraid = 3, // seen for polymorph (when AI not in control of self?) (NOT used in client packet handler)
Destory = 4 // used on object destroy (NOT used in client packet handler)
}
public enum CreatureEliteType
{
Normal = 0,
Elite = 1,
RareElite = 2,
WorldBoss = 3,
Rare = 4,
Unknown = 5 // found in 2.2.3 for 2 mobs
}
[System.Flags]
public enum UnitFlags : uint
{
ServerControlled = 0x01,
NonAttackable = 0x02,
RemoveClientControl = 0x04, // This is a legacy flag used to disable movement player's movement while controlling other units, SMSG_CLIENT_CONTROL replaces this functionality clientside now. CONFUSED and FLEEING flags have the same effect on client movement asDISABLE_MOVE_CONTROL in addition to preventing spell casts/autoattack (they all allow climbing steeper hills and emotes while moving)
PvpAttackable = 0x08,
Rename = 0x10,
Preparation = 0x20,
Unk6 = 0x40,
NotAttackable1 = 0x80,
ImmuneToPc = 0x100,
ImmuneToNpc = 0x200,
Looting = 0x400,
PetInCombat = 0x800,
Pvp = 0x1000,
Silenced = 0x2000,
CannotSwim = 0x4000,
Unk15 = 0x8000,
Unk16 = 0x10000,
Pacified = 0x20000,
Stunned = 0x40000,
InCombat = 0x80000,
TaxiFlight = 0x100000,
Disarmed = 0x200000,
Confused = 0x400000,
Fleeing = 0x800000,
PlayerControlled = 0x1000000,
NotSelectable = 0x2000000,
Skinnable = 0x4000000,
Mount = 0x8000000,
Unk28 = 0x10000000,
Unk29 = 0x20000000,
Sheathe = 0x40000000,
Unk31 = 0x80000000
}
public enum UnitFlags2 : uint
{
FeignDeath = 0x01,
Unk1 = 0x02,
IgnoreReputation = 0x04,
ComprehendLang = 0x08,
MirrorImage = 0x10,
InstantlyAppearModel = 0x20,
ForceMove = 0x40,
DisarmOffhand = 0x80,
DisablePredStats = 0x100,
DisarmRanged = 0x400,
RegeneratePower = 0x800,
RestrictPartyInteraction = 0x1000,
PreventSpellClick = 0x2000,
AllowEnemyInteract = 0x4000,
DisableTurn = 0x8000,
Unk2 = 0x10000,
PlayDeathAnim = 0x20000,
AllowCheatSpells = 0x40000,
NoActions = 0x800000
}
public enum UnitFlags3 : uint
{
Unk1 = 0x01,
}
public enum NPCFlags : ulong
{
None = 0x00,
Gossip = 0x01,
QuestGiver = 0x02,
Unk1 = 0x04,
Unk2 = 0x08,
Trainer = 0x10,
TrainerClass = 0x20,
TrainerProfession = 0x40,
Vendor = 0x80,
VendorGeneral = 0x100,
VendorFood = 0x200,
VendorPoison = 0x400,
VendorReagent = 0x800,
Repair = 0x1000,
FlightMaster = 0x2000,
SpiritHealer = 0x4000,
SpiritGuide = 0x8000,
Innkeeper = 0x10000,
Banker = 0x20000,
Petitioner = 0x40000,
TabardDesigner = 0x80000,
BattleMaster = 0x100000,
Auctioneer = 0x200000,
StableMaster = 0x400000,
GuildBanker = 0x800000,
SpellClick = 0x1000000,
PlayerVehicle = 0x2000000,
Mailbox = 0x4000000,
ArtifactPowerRespec = 0x8000000,
Transmogrifier = 0x10000000,
VaultKeeper = 0x20000000,
BlackMarket = 0x80000000,
ItemUpgradeMaster = 0x100000000,
GarrisonArchitect = 0x200000000,
Steering = 0x400000000,
ShipmentCrafter = 0x1000000000,
GarrisonMissionNpc = 0x2000000000,
TradeskillNpc = 0x4000000000,
BlackMarketView = 0x8000000000
}
public enum CreatureTypeFlags : uint
{
TameablePet = 0x01, // Makes the mob tameable (must also be a beast and have family set)
GhostVisible = 0x02, // Creature are also visible for not alive player. Allow gossip interaction if npcflag allow?
BossMob = 0x04, // Changes creature's visible level to "??" in the creature's portrait - Immune Knockback.
DoNotPlayWoundParryAnimation = 0x08,
HideFactionTooltip = 0x10,
Unk5 = 0x20, // Sound related
SpellAttackable = 0x40,
CanInteractWhileDead = 0x80, // Player can interact with the creature if its dead (not player dead)
HerbSkinningSkill = 0x100, // Can be looted by herbalist
MiningSkinningSkill = 0x200, // Can be looted by miner
DoNotLogDeath = 0x400, // Death event will not show up in combat log
MountedCombatAllowed = 0x800, // Creature can remain mounted when entering combat
CanAssist = 0x1000, // ? Can aid any player in combat if in range?
IsPetBarUsed = 0x2000,
MaskUID = 0x4000,
EngineeringSkinningSkill = 0x8000, // Can be looted by engineer
ExoticPet = 0x10000, // Can be tamed by hunter as exotic pet
UseDefaultCollisionBox = 0x20000, // Collision related. (always using default collision box?)
IsSiegeWeapon = 0x40000,
CanCollideWithMissiles = 0x80000, // Projectiles can collide with this creature - interacts with TARGET_DEST_TRAJ
HideNamePlate = 0x100000,
DoNotPlayMountedAnimations = 0x200000,
IsLinkAll = 0x400000,
InteractOnlyWithCreator = 0x800000,
DoNotPlayUnitEventSounds = 0x1000000,
HasNoShadowBlob = 0x2000000,
TreatAsRaidUnit = 0x4000000, //! Creature can be targeted by spells that require target to be in caster's party/raid
ForceGossip = 0x8000000, // Allows the creature to display a single gossip option.
DoNotSheathe = 0x10000000,
DoNotTargetOnInteration = 0x20000000,
DoNotRenderObjectName = 0x40000000,
UnitIsQuestBoss = 0x80000000 // Not verified
}
public enum CreatureFlagsExtra : uint
{
InstanceBind = 0x01, // Creature Kill Bind Instance With Killer And Killer'S Group
Civilian = 0x02, // Not Aggro (Ignore Faction/Reputation Hostility)
NoParry = 0x04, // Creature Can'T Parry
NoParryHasten = 0x08, // Creature Can'T Counter-Attack At Parry
NoBlock = 0x10, // Creature Can'T Block
NoCrush = 0x20, // Creature Can'T Do Crush Attacks
NoXpAtKill = 0x40, // Creature Kill Not Provide Xp
Trigger = 0x80, // Trigger Creature
NoTaunt = 0x100, // Creature Is Immune To Taunt Auras And Effect Attack Me
Worldevent = 0x4000, // Custom Flag For World Event Creatures (Left Room For Merging)
Guard = 0x8000, // Creature Is Guard
NoCrit = 0x20000, // Creature Can'T Do Critical Strikes
NoSkillgain = 0x40000, // Creature Won'T Increase Weapon Skills
TauntDiminish = 0x80000, // Taunt Is A Subject To Diminishing Returns On This Creautre
AllDiminish = 0x100000, // Creature Is Subject To All Diminishing Returns As Player Are
NoPlayerDamageReq = 0x200000, // creature does not need to take player damage for kill credit
DungeonBoss = 0x10000000, // Creature Is A Dungeon Boss (Set Dynamically, Do Not Add In Db)
IgnorePathfinding = 0x20000000, // creature ignore pathfinding
ImmunityKnockback = 0x40000000, // creature is immune to knockback effects
DBAllowed = (InstanceBind | Civilian | NoParry | NoParryHasten | NoBlock | NoCrush | NoXpAtKill |
Trigger | NoTaunt | Worldevent | NoCrit | NoSkillgain | TauntDiminish | AllDiminish | Guard |
IgnorePathfinding | NoPlayerDamageReq | ImmunityKnockback)
}
public enum CreatureType
{
Beast = 1,
Dragonkin = 2,
Demon = 3,
Elemental = 4,
Giant = 5,
Undead = 6,
Humanoid = 7,
Critter = 8,
Mechanical = 9,
NotSpecified = 10,
Totem = 11,
NonCombatPet = 12,
GasCloud = 13,
WildPet = 14,
Aberration = 15,
MaskDemonOrUnDead = (1 << (Demon - 1)) | (1 << (Undead - 1)),
MaskHumanoidOrUndead = (1 << (Humanoid - 1)) | (1 << (Undead - 1)),
MaskMechanicalOrElemental = (1 << (Mechanical - 1)) | (1 << (Elemental - 1))
}
public enum CreatureFamily
{
None = 0,
Wolf = 1,
Cat = 2,
Spider = 3,
Bear = 4,
Boar = 5,
Crocolisk = 6,
CarrionBird = 7,
Crab = 8,
Gorilla = 9,
HorseCustom = 10, // Does Not Exist In Dbc But Used For Horse Like Beasts In Db
Raptor = 11,
Tallstrider = 12,
Felhunter = 15,
Voidwalker = 16,
Succubus = 17,
Doomguard = 19,
Scorpid = 20,
Turtle = 21,
Imp = 23,
Bat = 24,
Hyena = 25,
BirdOfPrey = 26,
WindSerpent = 27,
RemoteControl = 28,
Felguard = 29,
Dragonhawk = 30,
Ravager = 31,
WarpStalker = 32,
Sporebat = 33,
NetherRay = 34,
Serpent = 35,
Moth = 37,
Chimaera = 38,
Devilsaur = 39,
Ghoul = 40,
Silithid = 41,
Worm = 42,
Rhino = 43,
Wasp = 44,
CoreHound = 45,
SpiritBeast = 46,
WaterElemental = 49,
Fox = 50,
Monkey = 51,
Dog = 52,
Beetle = 53,
ShaleSpider = 55,
Zombie = 56,
BeetleOld = 57,
Silithid2 = 59,
Wasp2 = 66,
Hydra = 68,
Felimp = 100,
Voidlord = 101,
Shivara = 102,
Observer = 103,
Wrathguard = 104,
Infernal = 108,
Fireelemental = 116,
Earthelemental = 117,
Crane = 125,
Waterstrider = 126,
Porcupine = 127,
Quilen = 128,
Goat = 129,
Basilisk = 130,
Direhorn = 138,
Stormelemental = 145,
Mtwaterelemental = 146,
Torrorguard = 147,
Abyssal = 148,
Rylak = 149,
Riverbeast = 150,
Stag = 151
}
public enum InhabitType
{
Ground = 1,
Water = 2,
Air = 4,
Root = 8,
Anywhere = Ground | Water | Air | Root
}
public enum EvadeReason
{
NoHostiles, // the creature's threat list is empty
Boundary, // the creature has moved outside its evade boundary
NoPath, // the creature was unable to reach its target for over 5 seconds
SequenceBreak, // this is a boss and the pre-requisite encounters for engaging it are not defeated yet
Other
}
}
+128
View File
@@ -0,0 +1,128 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum GameObjectTypes : byte
{
Door = 0,
Button = 1,
QuestGiver = 2,
Chest = 3,
Binder = 4,
Generic = 5,
Trap = 6,
Chair = 7,
SpellFocus = 8,
Text = 9,
Goober = 10,
Transport = 11,
AreaDamage = 12,
Camera = 13,
MapObject = 14,
MapObjTransport = 15,
DuelArbiter = 16,
FishingNode = 17,
Ritual = 18,
Mailbox = 19,
DoNotUse = 20,
GuardPost = 21,
SpellCaster = 22,
MeetingStone = 23,
FlagStand = 24,
FishingHole = 25,
FlagDrop = 26,
MiniGame = 27,
DoNotUse2 = 28,
ControlZone = 29,
AuraGenerator = 30,
DungeonDifficulty = 31,
BarberChair = 32,
DestructibleBuilding = 33,
GuildBank = 34,
TrapDoor = 35,
NewFlag = 36,
NewFlagDrop = 37,
GarrisonBuilding = 38,
GarrisonPlot = 39,
ClientCreature = 40,
ClientItem = 41,
CapturePoint = 42,
PhaseableMo = 43,
GarrisonMonument = 44,
GarrisonShipment = 45,
GarrisonMonumentPlaque = 46,
ArtifactForge = 47,
UILink = 48,
KeystoneReceptacle = 49,
GatheringNode = 50,
ChallengeModeReward = 51,
Max = 52
}
public enum GameObjectState
{
Active = 0,
Ready = 1,
ActiveAlternative = 2,
TransportActive = 24,
TransportStopped = 25,
Max = 3
}
public enum GameObjectDynamicLowFlags
{
HideModel = 0x02,
Activate = 0x04,
Animate = 0x08,
NoInteract = 0x10,
Sparkle = 0x20,
Stopped = 0x40
}
public enum GameObjectFlags
{
InUse = 0x01, // Disables Interaction While Animated
Locked = 0x02, // Require Key, Spell, Event, Etc To Be Opened. Makes "Locked" Appear In Tooltip
InteractCond = 0x04, // cannot interact (condition to interact - requires GO_DYNFLAG_LO_ACTIVATE to enable interaction clientside)
Transport = 0x08, // Any Kind Of Transport? Object Can Transport (Elevator, Boat, Car)
NotSelectable = 0x10, // Not Selectable Even In Gm Mode
NoDespawn = 0x20, // Never Despawn, Typically For Doors, They Just Change State
AiObstacle = 0x40, // makes the client register the object in something called AIObstacleMgr, unknown what it does
FreezeAnimation = 0x80,
Damaged = 0x200,
Destroyed = 0x400,
InteractDistanceUsesTemplateModel = 0x80000, // client checks interaction distance from model sent in SMSG_QUERY_GAMEOBJECT_RESPONSE instead of GAMEOBJECT_DISPLAYID
MapObject = 0x00100000 // pre-7.0 model loading used to be controlled by file extension (wmo vs m2)
}
public enum LootState
{
NotReady = 0,
Ready, // can be ready but despawned, and then not possible activate until spawn
Activated,
JustDeactivated
}
public enum GameObjectDestructibleState
{
Intact = 0,
Damaged = 1,
Destroyed = 2,
Rebuilding = 3
}
}
+164
View File
@@ -0,0 +1,164 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public struct GarrisonFactionIndex
{
public const uint Horde = 0;
public const uint Alliance = 1;
}
public enum GarrisonBuildingFlags : byte
{
NeedsPlan = 0x1
}
enum GarrisonFollowerFlags
{
Unique = 0x1
}
public enum GarrisonFollowerType
{
Garrison = 1,
Shipyard = 2
}
public enum GarrisonAbilityFlags : ushort
{
Trait = 0x01,
CannotRoll = 0x02,
HordeOnly = 0x04,
AllianceOnly = 0x08,
CannotRemove = 0x10,
Exclusive = 0x20,
SingleMissionDuration = 0x40,
ActiveOnlyOnZoneSupport = 0x80,
ApplyToFirstMission = 0x100,
IsSpecialization = 0x200,
IsEmptySlot = 0x400
}
public enum GarrisonError
{
Success = 0,
NoGarrison = 1,
GarrisonExists = 2,
GarrisonSameTypeExists = 3,
InvalidGarrison = 4,
InvalidGarrisonLevel = 5,
GarrisonLevelUnchanged = 6,
NotInGarrison = 7,
NoBuilding = 8,
BuildingExists = 9,
InvalidPlotInstanceId = 10,
InvalidBuildingId = 11,
InvalidUpgradeLevel = 12,
UpgradeLevelExceedsGarrisonLevel = 13,
PlotsNotFull = 14,
InvalidSiteId = 15,
InvalidPlotBuilding = 16,
InvalidFaction = 17,
InvalidSpecialization = 18,
SpecializationExists = 19,
SpecializationOnCooldown = 20,
BlueprintExists = 21,
RequiresBlueprint = 22,
InvalidDoodadSetId = 23,
BuildingTypeExists = 24,
BuildingNotActive = 25,
ConstructionComplete = 26,
FollowerExists = 27,
InvalidFollower = 28,
FollowerAlreadyOnMission = 29,
FollowerInBuilding = 30,
FollowerInvalidForBuilding = 31,
InvalidFollowerLevel = 32,
MissionExists = 33,
InvalidMission = 34,
InvalidMissionTime = 35,
InvalidMissionRewardIndex = 36,
MissionNotOffered = 37,
AlreadyOnMission = 38,
MissionSizeInvalid = 39,
FollowerSoftCapExceeded = 40,
NotOnMission = 41,
AlreadyCompletedMission = 42,
MissionNotComplete = 43,
MissionRewardsPending = 44,
MissionExpired = 45,
NotEnoughCurrency = 46,
NotEnoughGold = 47,
BuildingMissing = 48,
NoArchitect = 49,
ArchitectNotAvailable = 50,
NoMissionNpc = 51,
MissionNpcNotAvailable = 52,
InternalError = 53,
InvalidStaticTableValue = 54,
InvalidItemLevel = 55,
InvalidAvailableRecruit = 56,
FollowerAlreadyRecruited = 57,
RecruitmentGenerationInProgress = 58,
RecruitmentOnCooldown = 59,
RecruitBlockedByGeneration = 60,
RecruitmentNpcNotAvailable = 61,
InvalidFollowerQuality = 62,
ProxyNotOk = 63,
RecallPortalUsedLessThan24HoursAgo = 64,
OnRemoveBuildingSpellFailed = 65,
OperationNotSupported = 66,
FollowerFatigued = 67,
UpgradeConditionFailed = 68,
FollowerInactive = 69,
FollowerActive = 70,
FollowerActivationUnavailable = 71,
FollowerTypeMismatch = 72,
InvalidGarrisonType = 73,
MissionStartConditionFailed = 74,
InvalidFollowerAbility = 75,
InvalidMissionBonusAbility = 76,
HigherBuildingTypeExists = 77,
AtFollowerHardCap = 78,
FollowerCannotGainXp = 79,
NoOp = 80,
AtClassSpecCap = 81,
MissionRequires100ToStart = 82,
MissionMissingRequiredFollower = 83,
InvalidTalent = 84,
AlreadyResearchingTalent = 85,
FailedCondition = 86,
InvalidTier = 87,
InvalidClass = 88
}
public enum GarrisonFollowerStatus
{
Favorite = 0x01,
Exhausted = 0x02,
Inactive = 0x04,
Troop = 0x08,
NoXpGain = 0x10
}
public enum GarrisonType
{
Garrison = 2,
ClassOrder = 3
}
}
+125
View File
@@ -0,0 +1,125 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum GossipOption
{
None = 0, //Unit_Npc_Flag_None (0)
Gossip = 1, //Unit_Npc_Flag_Gossip (1)
Questgiver = 2, //Unit_Npc_Flag_Questgiver (2)
Vendor = 3, //Unit_Npc_Flag_Vendor (128)
Taxivendor = 4, //Unit_Npc_Flag_Taxivendor (8192)
Trainer = 5, //Unit_Npc_Flag_Trainer (16)
Spirithealer = 6, //Unit_Npc_Flag_Spirithealer (16384)
Spiritguide = 7, //Unit_Npc_Flag_Spiritguide (32768)
Innkeeper = 8, //Unit_Npc_Flag_Innkeeper (65536)
Banker = 9, //Unit_Npc_Flag_Banker (131072)
Petitioner = 10, //Unit_Npc_Flag_Petitioner (262144)
Tabarddesigner = 11, //Unit_Npc_Flag_Tabarddesigner (524288)
Battlefield = 12, //Unit_Npc_Flag_Battlefieldperson (1048576)
Auctioneer = 13, //Unit_Npc_Flag_Auctioneer (2097152)
Stablepet = 14, //Unit_Npc_Flag_Stable (4194304)
Armorer = 15, //Unit_Npc_Flag_Armorer (4096)
Unlearntalents = 16, //Unit_Npc_Flag_Trainer (16) (Bonus Option For Trainer)
Unlearnpettalents = 17, //Unit_Npc_Flag_Trainer (16) (Bonus Option For Trainer)
Learndualspec = 18, //Unit_Npc_Flag_Trainer (16) (Bonus Option For Trainer)
Outdoorpvp = 19, //Added By Code (Option For Outdoor Pvp Creatures)
Max
}
public enum GossipOptionIcon
{
Chat = 0, // White Chat Bubble
Vendor = 1, // Brown Bag
Taxi = 2, // Flightmarker (Paperplane)
Trainer = 3, // Brown Book (Trainer)
Interact1 = 4, // Golden Interaction Wheel
Interact2 = 5, // Golden Interaction Wheel
MoneyBag = 6, // Brown Bag (With Gold Coin In Lower Corner)
Talk = 7, // White Chat Bubble (With "..." Inside)
Tabard = 8, // White Tabard
Battle = 9, // Two Crossed Swords
Dot = 10, // Yellow Dot/Point
Chat11 = 11, // White Chat Bubble
Chat12 = 12, // White Chat Bubble
Chat13 = 13, // White Chat Bubble
Unk14 = 14, // Invalid - Do Not Use
Unk15 = 15, // Invalid - Do Not Use
Chat16 = 16, // White Chat Bubble
Chat17 = 17, // White Chat Bubble
Chat18 = 18, // White Chat Bubble
Chat19 = 19, // White Chat Bubble
Chat20 = 20, // White Chat Bubble
Chat21 = 21, // transmogrifier?
Max
}
public struct eTradeskill
{
// Skill Defines
public const uint TradeskillAlchemy = 1;
public const uint TradeskillBlacksmithing = 2;
public const uint TradeskillCooking = 3;
public const uint TradeskillEnchanting = 4;
public const uint TradeskillEngineering = 5;
public const uint TradeskillFirstaid = 6;
public const uint TradeskillHerbalism = 7;
public const uint TradeskillLeatherworking = 8;
public const uint TradeskillPoisons = 9;
public const uint TradeskillTailoring = 10;
public const uint TradeskillMining = 11;
public const uint TradeskillFishing = 12;
public const uint TradeskillSkinning = 13;
public const uint TradeskillJewlcrafting = 14;
public const uint TradeskillInscription = 15;
public const uint TradeskillLevelNone = 0;
public const uint TradeskillLevelApprentice = 1;
public const uint TradeskillLevelJourneyman = 2;
public const uint TradeskillLevelExpert = 3;
public const uint TradeskillLevelArtisan = 4;
public const uint TradeskillLevelMaster = 5;
public const uint TradeskillLevelGrandMaster = 6;
// Gossip Defines
public const uint GossipActionTrade = 1;
public const uint GossipActionTrain = 2;
public const uint GossipActionTaxi = 3;
public const uint GossipActionGuild = 4;
public const uint GossipActionBattle = 5;
public const uint GossipActionBank = 6;
public const uint GossipActionInn = 7;
public const uint GossipActionHeal = 8;
public const uint GossipActionTabard = 9;
public const uint GossipActionAuction = 10;
public const uint GossipActionInnInfo = 11;
public const uint GossipActionUnlearn = 12;
public const uint GossipActionInfoDef = 1000;
public const uint GossipSenderMain = 1;
public const uint GossipSenderInnInfo = 2;
public const uint GossipSenderInfo = 3;
public const uint GossipSenderSecProftrain = 4;
public const uint GossipSenderSecClasstrain = 5;
public const uint GossipSenderSecBattleinfo = 6;
public const uint GossipSenderSecBank = 7;
public const uint GossipSenderSecInn = 8;
public const uint GossipSenderSecMailbox = 9;
public const uint GossipSenderSecStablemaster = 10;
}
}
+166
View File
@@ -0,0 +1,166 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum RemoveMethod
{
Default = 0,
Kick = 1,
Leave = 2,
KickLFG = 3
}
public enum GroupMemberOnlineStatus
{
Offline = 0x00,
Online = 0x01, // Lua_UnitIsConnected
PVP = 0x02, // Lua_UnitIsPVP
Dead = 0x04, // Lua_UnitIsDead
Ghost = 0x08, // Lua_UnitIsGhost
PVPFFA = 0x10, // Lua_UnitIsPVPFreeForAll
Unk3 = 0x20, // used in calls from Lua_GetPlayerMapPosition/Lua_GetBattlefieldFlagPosition
AFK = 0x40, // Lua_UnitIsAFK
DND = 0x80, // Lua_UnitIsDND
RAF = 0x100,
Vehicle = 0x200, // Lua_UnitInVehicle
}
public enum GroupMemberFlags
{
Assistant = 0x01,
MainTank = 0x02,
MainAssist = 0x04
}
public enum GroupMemberAssignment
{
MainTank = 0,
MainAssist = 1
}
public enum GroupType
{
None = 0,
Normal = 1,
WorldPvp = 4,
}
public enum GroupFlags
{
None = 0x00,
FakeRaid = 0x01,
Raid = 0x02,
LfgRestricted = 0x04, // Script_HasLFGRestrictions()
Lfg = 0x08,
Destroyed = 0x10,
OnePersonParty = 0x020, // Script_IsOnePersonParty()
EveryoneAssistant = 0x040, // Script_IsEveryoneAssistant()
GuildGroup = 0x100,
MaskBgRaid = FakeRaid | Raid
}
public enum GroupUpdateFlags
{
None = 0x00, // nothing
Unk704 = 0x01, // Uint8[2] (Unk)
Status = 0x02, // public ushort (Groupmemberstatusflag)
PowerType = 0x04, // Uint8 (Powertype)
Unk322 = 0x08, // public ushort (Unk)
CurHp = 0x10, // Uint32 (Hp)
MaxHp = 0x20, // Uint32 (Max Hp)
CurPower = 0x40, // Int16 (Power Value)
MaxPower = 0x80, // Int16 (Max Power Value)
Level = 0x100, // public ushort (Level Value)
Unk200000 = 0x200, // Int16 (Unk)
Zone = 0x400, // public ushort (Zone Id)
Unk2000000 = 0x800, // Int16 (Unk)
Unk4000000 = 0x1000, // Int32 (Unk)
Position = 0x2000, // public ushort (X), public ushort (Y), public ushort (Z)
VehicleSeat = 0x4000, // Int32 (Vehicle Seat Id)
Auras = 0x8000, // Uint8 (Unk), Uint64 (Mask), Uint32 (Count), For Each Bit Set: Uint32 (Spell Id) + public ushort (Auraflags) (If Has Flags Scalable -> 3x Int32 (Bps))
Pet = 0x10000, // Complex (Pet)
Phase = 0x20000, // Int32 (Unk), Uint32 (Phase Count), For (Count) Uint16(Phaseid)
Full = Unk704 | Status | PowerType | Unk322 | CurHp | MaxHp |
CurPower | MaxPower | Level | Unk200000 | Zone | Unk2000000 |
Unk4000000 | Position | VehicleSeat | Auras | Pet | Phase // All Known Flags
}
public enum GroupUpdatePetFlags
{
None = 0x00000000, // nothing
GUID = 0x00000001, // ObjectGuid (pet guid)
Name = 0x00000002, // cstring (name, NULL terminated string)
ModelId = 0x00000004, // public ushort (model id)
CurHp = 0x00000008, // uint32 (HP)
MaxHp = 0x00000010, // uint32 (max HP)
Auras = 0x00000020, // [see GROUP_UPDATE_FLAG_AURAS]
Full = GUID | Name | ModelId | CurHp | MaxHp | Auras // all pet flags
}
public enum PartyResult
{
Ok = 0,
BadPlayerNameS = 1,
TargetNotInGroupS = 2,
TargetNotInInstanceS = 3,
GroupFull = 4,
AlreadyInGroupS = 5,
NotInGroup = 6,
NotLeader = 7,
PlayerWrongFaction = 8,
IgnoringYouS = 9,
LfgPending = 12,
InviteRestricted = 13,
GroupSwapFailed = 14, // If (Partyoperation == PartyOpSwap) GroupSwapFailed Else InviteInCombat
InviteUnknownRealm = 15,
InviteNoPartyServer = 16,
InvitePartyBusy = 17,
PartyTargetAmbiguous = 18,
PartyLfgInviteRaidLocked = 19,
PartyLfgBootLimit = 20,
PartyLfgBootCooldownS = 21,
PartyLfgBootInProgress = 22,
PartyLfgBootTooFewPlayers = 23,
PartyLfgBootNotEligibleS = 24,
RaidDisallowedByLevel = 25,
PartyLfgBootInCombat = 26,
VoteKickReasonNeeded = 27,
PartyLfgBootDungeonComplete = 28,
PartyLfgBootLootRolls = 29,
PartyLfgTeleportInCombat = 30
}
public enum PartyOperation
{
Invite = 0,
UnInvite = 1,
Leave = 2,
Swap = 4
}
public enum GroupCategory
{
Home = 0,
Instance = 1,
Max
}
}
+283
View File
@@ -0,0 +1,283 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public class GuildConst
{
public const int MaxBankTabs = 8;
public const int MaxBankSlots = 98;
public const int BankMoneyLogsTab = 100;
public const int WithdrawMoneyUnlimited = -1;
public const int WithdrawSlotUnlimited = -1;
public const uint EventLogGuidUndefined = 0xFFFFFFFF;
public const uint ChallengesTypes = 6;
public const uint CharterItemId = 5863;
public const int RankNone = 0xFF;
public const int MinRanks = 5;
public const int MaxRanks = 10;
public const int BankLogMaxRecords = 25;
public const int EventLogMaxRecords = 100;
public const int NewsLogMaxRecords = 250;
public static int[] ChallengeGoldReward = { 0, 250, 1000, 500, 250, 500 };
public static int[] ChallengeMaxLevelGoldReward = { 0, 125, 500, 250, 125, 250 };
public static int[] ChallengesMaxCount = { 0, 7, 1, 3, 0, 3 };
public static uint MinNewsItemLevel = 353;
public static byte OldMaxLevel = 25;
}
public enum GuildRankRights
{
None = 0x00000000,
GChatListen = 0x00000001,
GChatSpeak = 0x00000002,
OffChatListen = 0x00000004,
OffChatSpeak = 0x00000008,
Invite = 0x00000010,
Remove = 0x00000020,
Roster = 0x00000040,
Promote = 0x00000080,
Demote = 0x00000100,
Unk200 = 0x00000200,
Unk400 = 0x00000400,
Unk800 = 0x00000800,
SetMotd = 0x00001000,
EditPublicNote = 0x00002000,
ViewOffNote = 0x00004000,
EOffNote = 0x00008000,
ModifyGuildInfo = 0x00010000,
WithdrawGoldLock = 0x00020000, // remove money withdraw capacity
WithdrawRepair = 0x00040000, // withdraw for repair
WithdrawGold = 0x00080000, // withdraw gold
CreateGuildEvent = 0x00100000, // wotlk
All = 0x00DDFFBF
}
public struct GuildDefaultRanks
{
public const int Master = 0;
public const int Officer = 1;
public const int Veteran = 2;
public const int Member = 3;
public const int Initiate = 4;
}
public enum GuildMemberFlags
{
None = 0,
Online = 1,
AFK = 2,
DND = 3,
Mobile = 4
}
public enum GuildMemberData
{
ZoneId,
AchievementPoints,
Level,
}
public enum GuildCommandType
{
CreateGuild = 0,
InvitePlayer = 1,
LeaveGuild = 3,
GetRoster = 5,
PromotePlayer = 6,
DemotePlayer = 7,
RemovePlayer = 8,
ChangeLeader = 10,
EditMOTD = 11,
GuildChat = 13,
Founder = 14,
ChangeRank = 16,
EditPublicNote = 19,
ViewTab = 21,
MoveItem = 22,
Repair = 25
}
public enum GuildCommandError
{
Success = 0,
GuildInternal = 1,
AlreadyInGuild = 2,
AlreadyInGuild_S = 3,
InvitedToGuild = 4,
AlreadyInvitedToGuild_S = 5,
NameInvalid = 6,
NameExists_S = 7,
LeaderLeave = 8,
Permissions = 8,
PlayerNotInGuild = 9,
PlayerNotInGuild_S = 10,
PlayerNotFound_S = 11,
NotAllied = 12,
RankTooHigh_S = 13,
RankTooLow_S = 14,
RanksLocked = 17,
RankInUse = 18,
IgnoringYou_S = 19,
Unk1 = 20,
WithdrawLimit = 25,
NotEnoughMoney = 26,
BankFull = 28,
ItemNotFound = 29,
TooMuchMoney = 31,
WrongTab = 32,
RequiresAuthenticator = 34,
BankVoucherFailed = 35,
TrialAccount = 36,
UndeletableDueToLevel = 37,
MoveStarting = 38,
RepTooLow = 39
}
public enum GuildEventLogTypes
{
InvitePlayer = 1,
JoinGuild = 2,
PromotePlayer = 3,
DemotePlayer = 4,
UninvitePlayer = 5,
LeaveGuild = 6,
}
public enum GuildBankEventLogTypes
{
DepositItem = 1,
WithdrawItem = 2,
MoveItem = 3,
DepositMoney = 4,
WithdrawMoney = 5,
RepairMoney = 6,
MoveItem2 = 7,
Unk1 = 8,
BuySlot = 9,
CashFlowDeposit = 10
}
public enum GuildEmblemError
{
Success = 0,
InvalidTabardColors = 1,
NoGuild = 2,
NotGuildMaster = 3,
NotEnoughMoney = 4,
InvalidVendor = 5
}
public enum GuildBankRights : int
{
ViewTab = 0x01,
PutItem = 0x02,
UpdateText = 0x04,
DepositItem = ViewTab | PutItem,
Full = -1
}
public enum GuildNews
{
Achievement = 0,
PlayerAchievement = 1,
DungeonEncounter = 2,
ItemLooted = 3,
ItemCrafted = 4,
ItemPurchased = 5,
LevelUp = 6,
Create = 7,
Event = 8
}
public enum PetitionTurns
{
Ok = 0,
AlreadyInGuild = 2,
NeedMoreSignatures = 4,
GuildPermissions = 11,
GuildNameInvalid = 12
}
public enum PetitionSigns
{
Ok = 0,
AlreadySigned = 1,
AlreadyInGuild = 2,
CantSignOwn = 3,
NotServer = 4,
Full = 5,
AlreadySignedOther = 6,
RestrictedAccount = 7
}
public enum CharterTypes
{
Guild = 4,
Arena2v2 = 2,
Arena3v3 = 3,
Arena5v5 = 5,
}
public struct CharterCosts
{
public const uint Guild = 1000;
public const uint Arena2v2 = 800000;
public const uint Arena3v3 = 1200000;
public const uint Arena5v5 = 2000000;
}
public enum GuildFinderOptionsInterest
{
Questing = 0x01,
Dungeons = 0x02,
Raids = 0x04,
PVP = 0x08,
RolePlaying = 0x10,
All = Questing | Dungeons | Raids | PVP | RolePlaying
}
public enum GuildFinderOptionsAvailability
{
Weekdays = 0x1,
Weekends = 0x2,
Always = Weekdays | Weekends
}
public enum GuildFinderOptionsRoles
{
Tank = 0x1,
Healer = 0x2,
DPS = 0x4,
All = Tank | Healer | DPS
}
public enum GuildFinderOptionsLevel
{
Any = 0x1,
Max = 0x2,
All = Any | Max
}
}
File diff suppressed because it is too large Load Diff
+179
View File
@@ -0,0 +1,179 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
namespace Framework.Constants
{
[Flags]
public enum LfgRoles
{
None = 0x00,
Leader = 0x01,
Tank = 0x02,
Healer = 0x04,
Damage = 0x08
}
public enum LfgUpdateType
{
Default = 0, // Internal Use
LeaderUnk1 = 1, // Fixme: At Group Leave
RolecheckAborted = 4,
JoinQueue = 6,
RolecheckFailed = 7,
RemovedFromQueue = 8,
ProposalFailed = 9,
ProposalDeclined = 10,
GroupFound = 11,
AddedToQueue = 13,
ProposalBegin = 14,
UpdateStatus = 15,
GroupMemberOffline = 16,
GroupDisbandUnk16 = 17, // Fixme: Sometimes At Group Disband
JoinQueueInitial = 24,
DungeonFinished = 25,
PartyRoleNotAvailable = 43,
JoinLfgObjectFailed = 45,
}
public enum LfgState
{
None,
Rolecheck,
Queued,
Proposal,
//Boot,
Dungeon = 5,
FinishedDungeon,
Raidbrowser
}
public enum LfgLockStatusType
{
InsufficientExpansion = 1,
TooLowLevel = 2,
TooHighLevel = 3,
TooLowGearScore = 4,
TooHighGearScore = 5,
RaidLocked = 6,
AttunementTooLowLevel = 1001,
AttunementTooHighLevel = 1002,
QuestNotCompleted = 1022,
MissingItem = 1025,
NotInSeason = 1031,
MissingAchievement = 1034
}
public enum LfgOptions
{
EnableDungeonFinder = 0x01,
EnableRaidBrowser = 0x02,
}
public enum LfgFlags
{
Unk1 = 0x1,
Unk2 = 0x2,
Seasonal = 0x4,
Unk3 = 0x8
}
public enum LfgType : byte
{
None = 0,
Dungeon = 1,
Raid = 2,
Zone = 4,
Quest = 5,
RandomDungeon = 6
}
public enum LfgProposalState
{
Initiating = 0,
Failed = 1,
Success = 2
}
public enum LfgTeleportResult
{
// 7 = "You Can'T Do That Right Now" | 5 = No Client Reaction
Ok = 0, // Internal Use
PlayerDead = 1,
Falling = 2,
InVehicle = 3,
Fatigue = 4,
InvalidLocation = 6,
Charming = 8 // Fixme - It Can Be 7 Or 8 (Need Proper Data)
}
public enum LfgJoinResult
{
// 3 = No Client Reaction | 18 = "Rolecheck Failed"
Ok = 0x00, // Joined (No Client Msg)
Failed = 0x1b, // Rolecheck Failed
Groupfull = 0x1c, // Your Group Is Full
InternalError = 0x1e, // Internal Lfg Error
NotMeetReqs = 0x1f, // You Do Not Meet The Requirements For The Chosen Dungeons
PartyNotMeetReqs = 6, // One Or More Party Members Do Not Meet The Requirements For The Chosen Dungeons
MixedRaidDungeon = 0x20, // You Cannot Mix Dungeons, Raids, And Random When Picking Dungeons
MultiRealm = 0x21, // The Dungeon You Chose Does Not Support Players From Multiple Realms
Disconnected = 0x22, // One Or More Party Members Are Pending Invites Or Disconnected
PartyInfoFailed = 0x23, // Could Not Retrieve Information About Some Party Members
DungeonInvalid = 0x24, // One Or More Dungeons Was Not Valid
Deserter = 0x25, // You Can Not Queue For Dungeons Until Your Deserter Debuff Wears Off
PartyDeserter = 0x26, // One Or More Party Members Has A Deserter Debuff
RandomCooldown = 0x27, // You Can Not Queue For Random Dungeons While On Random Dungeon Cooldown
PartyRandomCooldown = 0x28, // One Or More Party Members Are On Random Dungeon Cooldown
TooMuchMembers = 0x29, // You Can Not Enter Dungeons With More That 5 Party Members
UsingBgSystem = 0x2a, // You Can Not Use The Dungeon System While In Bg Or Arenas
RoleCheckFailed = 0x2b // Role Check Failed, Client Shows Special Error
}
public enum LfgRoleCheckState
{
Default = 0, // Internal Use = Not Initialized.
Finished = 1, // Role Check Finished
Initialiting = 2, // Role Check Begins
MissingRole = 3, // Someone Didn'T Selected A Role After 2 Mins
WrongRoles = 4, // Can'T Form A Group With That Role Selection
Aborted = 5, // Someone Leave The Group
NoRole = 6 // Someone Selected No Role
}
public enum LfgAnswer
{
Pending = -1,
Deny = 0,
Agree = 1
}
public enum LfgCompatibility
{
Pending,
WrongGroupSize,
TooMuchPlayers,
MultipleLfgGroups,
HasIgnores,
NoRoles,
NoDungeons,
WithLessPlayers, // Values Under This = Not Compatible (Do Not Modify Order)
BadStates,
Match // Must Be The Last One
}
}
File diff suppressed because it is too large Load Diff
+115
View File
@@ -0,0 +1,115 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum RollType
{
Pass = 0,
Need = 1,
Greed = 2,
Disenchant = 3,
NotEmitedYet = 4,
NotValid = 5,
MaxTypes = 4,
}
public enum RollMask
{
Pass = 0x01,
Need = 0x02,
Greed = 0x04,
Disenchant = 0x08,
AllNoDisenchant = 0x07,
AllMask = 0x0f
}
public enum LootMethod
{
FreeForAll = 0,
MasterLoot = 2,
GroupLoot = 3,
PersonalLoot = 5
}
public enum LootModes
{
Default = 0x1,
HardMode1 = 0x2,
HardMode2 = 0x4,
HardMode3 = 0x8,
HardMode4 = 0x10,
JunkFish = 0x8000
}
public enum PermissionTypes
{
All = 0,
Group = 1,
Master = 2,
Restricted = 3,
Owner = 5,
None = 6
}
public enum LootType
{
None = 0,
Corpse = 1,
Pickpocketing = 2,
Fishing = 3,
Disenchanting = 4,
// Ignored Always By Client
Skinning = 6,
Prospecting = 7,
Milling = 8,
Fishinghole = 20, // Unsupported By Client, Sending Fishing Instead
Insignia = 21, // Unsupported By Client, Sending Corpse Instead
FishingJunk = 22 // unsupported by client, sending LOOT_FISHING instead
}
public enum LootError
{
DidntKill = 0, // You don't have permission to loot that corpse.
TooFar = 4, // You are too far away to loot that corpse.
BadFacing = 5, // You must be facing the corpse to loot it.
Locked = 6, // Someone is already looting that corpse.
NotStanding = 8, // You need to be standing up to loot something!
Stunned = 9, // You can't loot anything while stunned!
PlayerNotFound = 10, // Player not found
PlayTimeExceeded = 11, // Maximum play time exceeded
MasterInvFull = 12, // That player's inventory is full
MasterUniqueItem = 13, // Player has too many of that item already
MasterOther = 14, // Can't assign item to that player
AlreadPickPocketed = 15, // Your target has already had its pockets picked
NotWhileShapeShifted = 16, // You can't do that while shapeshifted.
NoLoot = 17 // There is no loot.
}
// type of Loot Item in Loot View
public enum LootSlotType
{
AllowLoot = 0, // Player Can Loot The Item.
RollOngoing = 1, // Roll Is Ongoing. Player Cannot Loot.
Locked = 2, // Item Is Shown In Red. Player Cannot Loot.
Master = 3, // Item Can Only Be Distributed By Group Loot Master.
Owner = 4 // Ignore Binding Confirmation And Etc, For Single Player Looting
}
}
+94
View File
@@ -0,0 +1,94 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum MailMessageType
{
Normal = 0,
Auction = 2,
Creature = 3,
Gameobject = 4,
Calendar = 5,
Blackmarket = 6
}
public enum MailCheckMask
{
None = 0x00,
Read = 0x01,
Returned = 0x02, /// This Mail Was Returned. Do Not Allow Returning Mail Back Again.
Copied = 0x04, /// This Mail Was Copied. Do Not Allow Making A Copy Of Items In Mail.
CodPayment = 0x08,
HasBody = 0x10 /// This Mail Has Body Text.
}
public enum MailStationery
{
Test = 1,
Default = 41,
Gm = 61,
Auction = 62,
Val = 64, // Valentine
Chr = 65, // Christmas
Orp = 67 // Orphan
}
public enum MailState
{
Unchanged = 1,
Changed = 2,
Deleted = 3
}
public enum MailShowFlags
{
Unk0 = 0x0001,
Delete = 0x0002, // Forced Show Delete Button Instead Return Button
Auction = 0x0004, // From Old Comment
Unk2 = 0x0008, // Unknown, Cod Will Be Shown Even Without That Flag
Return = 0x0010
}
public enum MailResponseType
{
Send = 0,
MoneyTaken = 1,
ItemTaken = 2,
ReturnedToSender = 3,
Deleted = 4,
MadePermanent = 5
}
public enum MailResponseResult
{
Ok = 0,
EquipError = 1,
CannotSendToSelf = 2,
NotEnoughMoney = 3,
RecipientNotFound = 4,
NotYourTeam = 5,
InternalError = 6,
DisabledForTrialAcc = 14,
RecipientCapReached = 15,
CantSendWrappedCod = 16,
MailAndChatSuspended = 17,
TooManyAttachments = 18,
MailAttachmentInvalid = 19,
ItemHasExpired = 21
}
}
+184
View File
@@ -0,0 +1,184 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public class MapConst
{
//Grids
public const int MaxGrids = 64;
public const float SizeofGrids = 533.33333f;
public const float CenterGridCellId = (MaxCells * MaxGrids / 2);
public const float CenterGridId = (MaxGrids / 2);
public const float CenterGridOffset = (SizeofGrids / 2);
public const float CenterGridCellOffset = (SizeofCells / 2);
//Cells
public const int MaxCells = 8;
public const float SizeofCells = (SizeofGrids / MaxCells);
public const int TotalCellsPerMap = (MaxGrids * MaxCells);
public const float MapSize = (SizeofGrids * MaxGrids);
public const float MapHalfSize = (MapSize / 2);
public const uint MaxGroupSize = 5;
public const uint MaxRaidSize = 40;
public const uint MaxRaidSubGroups = MaxRaidSize / MaxGroupSize;
public const uint TargetIconsCount = 8;
public const uint RaidMarkersCount = 8;
public const uint ReadycheckDuration = 35000;
//Liquid
public const int MapLiquidTypeNoWater = 0x00;
public const int MapLiquidTypeWater = 0x01;
public const int MapLiquidTypeOcean = 0x02;
public const int MapLiquidTypeMagma = 0x04;
public const int MapLiquidTypeSlime = 0x08;
public const int MapLiquidTypeDarkWater = 0x10;
public const int MapLiquidTypeWMOWater = 0x20;
public const int MapAllLiquidTypes = (MapLiquidTypeWater | MapLiquidTypeOcean | MapLiquidTypeMagma | MapLiquidTypeSlime);
public const float LiquidTileSize = (533.333f / 128.0f);
public const int MinMapUpdateDelay = 50;
public const int MinGridDelay = (Time.Minute * Time.InMilliseconds);
public const int MapResolution = 128;
public const float DefaultHeightSearch = 50.0f;
public const float InvalidHeight = -100000.0f;
public const float MaxHeight = 100000.0f;
public const float MaxFallDistance = 250000.0f;
public const string MapMagic = "MAPS";
public const string MapVersionMagic = "v1.8";
public const string MapAreaMagic = "AREA";
public const string MapHeightMagic = "MHGT";
public const string MapLiquidMagic = "MLIQ";
public const string mmapMagic = "MMAP";
public const int mmapVersion = 8;
public const string VMapMagic = "VMAP_4.5";
public const float VMAPInvalidHeightValue = -200000.0f;
}
public enum NewWorldReason
{
Normal = 16, // Normal map change
Seamless = 21, // Teleport to another map without a loading screen, used for outdoor scenarios
}
public enum InstanceResetWarningType
{
WarningHours = 1, // WARNING! %s is scheduled to reset in %d hour(s).
WarningMin = 2, // WARNING! %s is scheduled to reset in %d minute(s)!
WarningMinSoon = 3, // WARNING! %s is scheduled to reset in %d minute(s). Please exit the zone or you will be returned to your bind location!
Welcome = 4, // Welcome to %s. This raid instance is scheduled to reset in %s.
Expired = 5
}
public enum InstanceResetMethod
{
All,
ChangeDifficulty,
Global,
GroupDisband,
GroupJoin,
RespawnDelay
}
public enum GridMapTypeMask
{
None = 0x00,
Corpse = 0x01,
Creature = 0x02,
DynamicObject = 0x04,
GameObject = 0x08,
Player = 0x10,
AreaTrigger = 0x20,
Conversation = 0x40,
All = 0x7F,
//GameObjects, Creatures(except pets), DynamicObject, Corpse(Bones), AreaTrigger
AllGrid = GameObject | Creature | DynamicObject | Corpse | AreaTrigger | Conversation,
//Player, Pets, Corpse(resurrectable), DynamicObject(farsight)
AllWorld = Player | Creature | Corpse | DynamicObject
}
public enum ZLiquidStatus
{
NoWater = 0x00,
AboveWater = 0x01,
WaterWalk = 0x02,
InWater = 0x04,
UnderWater = 0x08
}
public enum EncounterFrameType
{
SetCombatResLimit = 0,
ResetCombatResLimit = 1,
Engage = 2,
Disengage = 3,
UpdatePriority = 4,
AddTimer = 5,
EnableObjective = 6,
UpdateObjective = 7,
DisableObjective = 8,
Unk7 = 9, // Seems To Have Something To Do With Sorting The Encounter Units
AddCombatResLimit = 10
}
public enum EncounterState
{
NotStarted = 0,
InProgress = 1,
Fail = 2,
Done = 3,
Special = 4,
ToBeDecided = 5
}
public enum EncounterCreditType
{
KillCreature = 0,
CastSpell = 1
}
public enum DoorType
{
Room = 0, // Door can open if encounter is not in progress
Passage = 1, // Door can open if encounter is done
SpawnHole = 2, // Door can open if encounter is in progress, typically used for spawning places
Max
}
public enum EnterState
{
CanEnter = 0,
CannotEnterAlreadyInMap = 1, // Player Is Already In The Map
CannotEnterNoEntry, // No Map Entry Was Found For The Target Map Id
CannotEnterUninstancedDungeon, // No Instance Template Was Found For Dungeon Map
CannotEnterDifficultyUnavailable, // Requested Instance Difficulty Is Not Available For Target Map
CannotEnterNotInRaid, // Target Instance Is A Raid Instance And The Player Is Not In A Raid Group
CannotEnterCorpseInDifferentInstance, // Player Is Dead And Their Corpse Is Not In Target Instance
CannotEnterInstanceBindMismatch, // Player'S Permanent Instance Save Is Not Compatible With Their Group'S Current Instance Bind
CannotEnterTooManyInstances, // Player Has Entered Too Many Instances Recently
CannotEnterMaxPlayers, // Target Map Already Has The Maximum Number Of Players Allowed
CannotEnterZoneInCombat, // A Boss Encounter Is Currently In Progress On The Target Map
CannotEnterUnspecifiedReason
}
}
@@ -0,0 +1,87 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum MovementSlot
{
Idle,
Active,
Controlled,
Max
}
public enum MovementGeneratorType
{
Idle = 0, // IdleMovement
Random = 1, // RandomMovement
Waypoint = 2, // WaypointMovement
MaxDB = 3, // *** this and below motion types can't be set in DB.
AnimalRandom = MaxDB, // AnimalRandomMovementGenerator.h
Confused = 4, // ConfusedMovementGenerator.h
Chase = 5, // TargetedMovementGenerator.h
Home = 6, // HomeMovementGenerator.h
Flight = 7, // WaypointMovementGenerator.h
Point = 8, // PointMovementGenerator.h
Fleeing = 9, // FleeingMovementGenerator.h
Distract = 10, // IdleMovementGenerator.h
Assistance = 11, // PointMovementGenerator.h (first part of flee for assistance)
AssistanceDistract = 12, // IdleMovementGenerator.h (second part of flee for assistance)
TimedFleeing = 13, // FleeingMovementGenerator.h (alt.second part of flee for assistance)
Follow = 14,
Rotate = 15,
Effect = 16,
Null = 17,
SplineChain = 18,
Max
}
public struct EventId
{
public const uint Charge = 1003;
public const uint Jump = 1004;
/// Special charge event which is used for charge spells that have explicit targets
/// and had a path already generated - using it in PointMovementGenerator will not
/// create a new spline and launch it
public const uint ChargePrepath = 1005;
public const uint SmartRandomPoint = 0xFFFFFE;
public const uint SmartEscortLastOCCPoint = 0xFFFFFF;
}
public enum AnimType
{
ToGround = 0, // 460 = ToGround, index of AnimationData.dbc
FlyToFly = 1, // 461 = FlyToFly?
ToFly = 2, // 458 = ToFly
FlyToGround = 3 // 463 = FlyToGround
}
public enum RotateDirection
{
Left,
Right
}
public enum UpdateCollisionHeightReason
{
Scale = 0,
Mount = 1,
Force = 2
}
}
@@ -0,0 +1,101 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
namespace Framework.Constants
{
[Flags]
public enum MovementFlag
{
None = 0x0,
Forward = 0x1,
Backward = 0x2,
StrafeLeft = 0x4,
StrafeRight = 0x8,
Left = 0x10,
Right = 0x20,
PitchUp = 0x40,
PitchDown = 0x80,
Walking = 0x100,
DisableGravity = 0x200,
Root = 0x400,
Falling = 0x800,
FallingFar = 0x1000,
PendingStop = 0x2000,
PendingStrafeStop = 0x4000,
PendingForward = 0x8000,
PendingBackward = 0x10000,
PendingStrafeLeft = 0x20000,
PendingStrafeRight = 0x40000,
PendingRoot = 0x80000,
Swimming = 0x100000,
Ascending = 0x200000,
Descending = 0x400000,
CanFly = 0x800000,
Flying = 0x1000000,
SplineElevation = 0x2000000,
WaterWalk = 0x4000000,
FallingSlow = 0x8000000,
Hover = 0x10000000,
DisableCollision = 0x20000000,
MaskMoving = Forward | Backward | StrafeLeft | StrafeRight | Falling | Ascending | Descending,
MaskTurning = Left | Right | PitchUp | PitchDown,
MaskMovingFly = Flying | Ascending | Descending,
MaskCreatureAllowed = Forward | DisableGravity | Root | Swimming |
CanFly | WaterWalk | FallingSlow | Hover | DisableCollision,
MaskPlayerOnly = Flying,
MaskHasPlayerStatusOpcode = DisableGravity | Root | CanFly | WaterWalk |
FallingSlow | Hover | DisableCollision
}
[Flags]
public enum MovementFlag2
{
None = 0x0,
NoStrafe = 0x1,
NoJumping = 0x2,
FullSpeedTurning = 0x4,
FullSpeedPitching = 0x8,
AlwaysAllowPitching = 0x10,
IsVehicleExitVoluntary = 0x20,
JumpSplineInAir = 0x40,
AnimTierInTrans = 0x80,
WaterwalkingFullPitch = 0x100, // will always waterwalk, even if facing the camera directly down
VehiclePassengerIsTransitionAllowed = 0x200,
CanSwimToFlyTrans = 0x400,
Unk11 = 0x800, // terrain normal calculation is disabled if this flag is not present, client automatically handles setting this flag
CanTurnWhileFalling = 0x1000,
Unk13 = 0x2000, // will always waterwalk, even if facing the camera directly down
IgnoreMovementForces = 0x4000,
Unk15 = 0x8000,
CanDoubleJump = 0x10000,
DoubleJump = 0x20000,
// these flags cannot be sent (18 bits in packet)
Unk18 = 0x40000,
Unk19 = 0x80000,
InterpolatedMovement = 0x100000,
InterpolatedTurning = 0x200000,
InterpolatedPitching = 0x400000
}
}
@@ -0,0 +1,72 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
namespace Framework.Constants
{
public enum MonsterMoveType
{
Normal = 0,
FacingSpot = 1,
FacingTarget = 2,
FacingAngle = 3
}
[Flags]
public enum SplineFlag : uint
{
None = 0x00,
// x00-x07 used as animation Ids storage in pair with Animation flag
Unknown0 = 0x00000008, // NOT VERIFIED - does someting related to falling/fixed orientation
FallingSlow = 0x00000010,
Done = 0x00000020,
Falling = 0x00000040, // Affects elevation computation, can't be combined with Parabolic flag
NoSpline = 0x00000080,
Unknown1 = 0x00000100, // NOT VERIFIED
Flying = 0x00000200, // Smooth movement(Catmullrom interpolation mode), flying animation
OrientationFixed = 0x00000400, // Model orientation fixed
Catmullrom = 0x00000800, // Used Catmullrom interpolation mode
Cyclic = 0x00001000, // Movement by cycled spline
EnterCycle = 0x00002000, // Everytimes appears with cyclic flag in monster move packet, erases first spline vertex after first cycle done
Frozen = 0x00004000, // Will never arrive
TransportEnter = 0x00008000,
TransportExit = 0x00010000,
Unknown2 = 0x00020000, // NOT VERIFIED
Unknown3 = 0x00040000, // NOT VERIFIED
Backward = 0x00080000,
SmoothGroundPath = 0x00100000,
CanSwim = 0x00200000,
UncompressedPath = 0x00400000,
Unknown4 = 0x00800000, // NOT VERIFIED
Unknown5 = 0x01000000, // NOT VERIFIED
Animation = 0x02000000, // Plays animation after some time passed
Parabolic = 0x04000000, // Affects elevation computation, can't be combined with Falling flag
FadeObject = 0x08000000,
Steering = 0x10000000,
Unknown8 = 0x20000000, // NOT VERIFIED
Unknown9 = 0x40000000, // NOT VERIFIED
Unknown10 = 0x80000000, // NOT VERIFIED
// animation ids stored here, see AnimType enum, used with Animation flag
MaskAnimations = 0x7,
// flags that shouldn't be appended into SMSG_MONSTER_MOVE\SMSG_MONSTER_MOVE_TRANSPORT packet, should be more probably
MaskNoMonsterMove = MaskAnimations | Done,
// Unused, not suported flags
MaskUnused = NoSpline | EnterCycle | Frozen | Unknown0 | Unknown1 | Unknown2 | Unknown3 | Unknown4 | FadeObject | Steering | Unknown8 | Unknown9 | Unknown10
}
}
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
// Player state
public enum SessionStatus
{
Authed = 0, // Player authenticated (_player == NULL, m_playerRecentlyLogout = false or will be reset before handler call, m_GUID have garbage)
Loggedin, // Player in game (_player != NULL, m_GUID == _player->GetGUID(), inWorld())
Transfer, // Player transferring to another map (_player != NULL, m_GUID == _player->GetGUID(), !inWorld())
LoggedinOrRecentlyLogout, // _player != NULL or _player == NULL && m_playerRecentlyLogout && m_playerLogout, m_GUID store last _player guid)
}
public enum PacketProcessing
{
Inplace = 0, //process packet whenever we receive it - mostly for non-handled or non-implemented packets
ThreadUnsafe, //packet is not thread-safe - process it in World.UpdateSessions()
ThreadSafe //packet is thread-safe - process it in Map.Update()
}
}
File diff suppressed because it is too large Load Diff
+229
View File
@@ -0,0 +1,229 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum TypeId
{
Object = 0,
Item = 1,
Container = 2,
Unit = 3,
Player = 4,
GameObject = 5,
DynamicObject = 6,
Corpse = 7,
AreaTrigger = 8,
SceneObject = 9,
Conversation = 10
}
public enum TypeMask
{
Object = 0x01,
Item = 0x02,
Container = Item | 0x04,
Unit = 0x08,
Player = 0x10,
GameObject = 0x20,
DynamicObject = 0x40,
Corpse = 0x80,
AreaTrigger = 0x100,
Sceneobject = 0x200,
Conversation = 0x400,
Seer = Player | Unit | DynamicObject
}
public enum HighGuid
{
Null = 0,
Uniq = 1,
Player = 2,
Item = 3,
WorldTransaction = 4,
StaticDoor = 5, //NYI
Transport = 6,
Conversation = 7,
Creature = 8,
Vehicle = 9,
Pet = 10,
GameObject = 11,
DynamicObject = 12,
AreaTrigger = 13,
Corpse = 14,
LootObject = 15,
SceneObject = 16,
Scenario = 17,
AIGroup = 18,
DynamicDoor = 19,
ClientActor = 20, //NYI
Vignette = 21,
CallForHelp = 22,
AIResource = 23,
AILock = 24,
AILockTicket = 25,
ChatChannel = 26,
Party = 27,
Guild = 28,
WowAccount = 29,
BNetAccount = 30,
GMTask = 31,
MobileSession = 32, //NYI
RaidGroup = 33,
Spell = 34,
Mail = 35,
WebObj = 36, //NYI
LFGObject = 37, //NYI
LFGList = 38, //NYI
UserRouter = 39,
PVPQueueGroup = 40,
UserClient = 41,
PetBattle = 42, //NYI
UniqUserClient = 43,
BattlePet = 44,
CommerceObj = 45,
ClientSession = 46,
Cast = 47
}
public enum NotifyFlags
{
None = 0x00,
AIRelocation = 0x01,
VisibilityChanged = 0x02,
All = 0xFF
}
public enum TempSummonType
{
TimedOrDeadDespawn = 1, // despawns after a specified time OR when the creature disappears
TimedOrCorpseDespawn = 2, // despawns after a specified time OR when the creature dies
TimedDespawn = 3, // despawns after a specified time
TimedDespawnOOC = 4, // despawns after a specified time after the creature is out of combat
CorpseDespawn = 5, // despawns instantly after death
CorpseTimedDespawn = 6, // despawns after a specified time after death
DeadDespawn = 7, // despawns when the creature disappears
ManualDespawn = 8 // despawns when UnSummon() is called
}
public enum SummonCategory
{
Wild = 0,
Ally = 1,
Pet = 2,
Puppet = 3,
Vehicle = 4,
Unk = 5 // as of patch 3.3.5a only Bone Spike in Icecrown Citadel
// uses this category
}
public enum SummonType
{
None = 0,
Pet = 1,
Guardian = 2,
Minion = 3,
Totem = 4,
Minipet = 5,
Guardian2 = 6,
Wild2 = 7,
Wild3 = 8, // Related to phases and DK prequest line (3.3.5a)
Vehicle = 9,
Vehicle2 = 10, // Oculus and Argent Tournament vehicles (3.3.5a)
LightWell = 11,
Jeeves = 12,
Unk13 = 13
}
public enum SummonerType
{
Creature = 0,
GameObject = 1,
Map = 2
}
public enum GhostVisibilityType
{
Alive = 0x1,
Ghost = 0x2
}
public enum StealthType
{
General = 0,
Trap = 1,
Max = 2
}
public enum InvisibilityType
{
General = 0,
Unk1 = 1,
Unk2 = 2,
Trap = 3,
Unk4 = 4,
Unk5 = 5,
Drunk = 6,
Unk7 = 7,
Unk8 = 8,
Unk9 = 9,
Unk10 = 10,
Unk11 = 11,
Unk12 = 12,
Unk13 = 13,
Unk14 = 14,
Unk15 = 15,
Unk16 = 16,
Unk17 = 17,
Unk18 = 18,
Unk19 = 19,
Unk20 = 20,
Unk21 = 21,
Unk22 = 22,
Unk23 = 23,
Unk24 = 24,
Unk25 = 25,
Unk26 = 26,
Unk27 = 27,
Unk28 = 28,
Unk29 = 29,
Unk30 = 30,
Unk31 = 31,
Unk32 = 32,
Unk33 = 33,
Unk34 = 34,
Unk35 = 35,
Unk36 = 36,
Unk37 = 37,
Max = 38
}
public enum ServerSideVisibilityType
{
GM = 0,
Ghost = 1,
}
public enum SessionFlags
{
None = 0x00,
FromRedirect = 0x01,
HasRedirected = 0x02
}
}
+40
View File
@@ -0,0 +1,40 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum ObjectiveStates
{
Neutral = 0,
Alliance,
Horde,
NeutralAllianceChallenge,
NeutralHordeChallenge,
AllianceHordeChallenge,
HordeAllianceChallenge
}
public enum OutdoorPvPTypes
{
HellfirePeninsula = 1,
Nagrand = 2,
TerokkarForest = 3,
Zangarmarsh = 4,
Silithus = 5,
Max = 6
}
}
+114
View File
@@ -0,0 +1,114 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum CharmType
{
Charm,
Possess,
Vehicle,
Convert
}
public enum PetType
{
Summon = 0,
Hunter = 1,
Max = 4
}
public enum PetSaveMode
{
AsDeleted = -1, // not saved in fact
AsCurrent = 0, // in current slot (with player)
FirstStableSlot = 1,
LastStableSlot = 4, // last in DB stable slot index (including), all higher have same meaning as PET_SAVE_NOT_IN_SLOT
NotInSlot = 100 // for avoid conflict with stable size grow will use 100
}
public enum HappinessState
{
UnHappy = 1,
Content = 2,
Happy = 3
}
public enum PetSpellState
{
Unchanged = 0,
Changed = 1,
New = 2,
Removed = 3
}
public enum PetSpellType
{
Normal = 0,
Family = 1,
Talent = 2
}
public enum ActionFeedback
{
None = 0,
PetDead = 1,
NothingToAtt = 2,
CantAttTarget = 3
}
public enum PetTalk
{
SpecialSpell = 0,
Attack = 1
}
public enum CommandStates
{
Stay = 0,
Follow = 1,
Attack = 2,
Abandon = 3,
MoveTo = 4
}
public enum PetNameInvalidReason
{
// custom, not send
Success = 0,
Invalid = 1,
NoName = 2,
TooShort = 3,
TooLong = 4,
MixedLanguages = 6,
Profane = 7,
Reserved = 8,
ThreeConsecutive = 11,
InvalidSpace = 12,
ConsecutiveSpaces = 13,
RussianConsecutiveSilentCharacters = 14,
RussianSilentCharacterAtBeginningOrEnd = 15,
DeclensionDoesntMatchBaseName = 16
}
public enum PetStableinfo
{
Active = 1,
Inactive = 2
}
}
+771
View File
@@ -0,0 +1,771 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
namespace Framework.Constants
{
public struct PlayerConst
{
public const int MaxTalentTiers = 7;
public const int MaxTalentColumns = 3;
public const int MaxTalentRank = 5;
public const int MinSpecializationLevel = 10;
public const int MaxSpecializations = 4;
public const int MaxMasterySpells = 2;
public const int ReqPrimaryTreeTalents = 31;
public const int ExploredZonesSize = 256;
public const long MaxMoneyAmount = long.MaxValue;
public const int MaxActionButtons = 132;
public const int MaxActionButtonActionValue = 0x00FFFFFF + 1;
public const uint KnowTitlesSize = 6;
public const uint MaxTitleIndex = KnowTitlesSize * 64;
public const int MaxDailyQuests = 25;
public const int QuestsCompletedBitsSize = 1750;
public static TimeSpan InfinityCooldownDelay = TimeSpan.FromSeconds(Time.Month); // used for set "infinity cooldowns" for spells and check
public const uint infinityCooldownDelayCheck = Time.Month / 2;
public const int MaxPlayerSummonDelay = 2 * Time.Minute;
public const int TaxiMaskSize = 243;
// corpse reclaim times
public const int DeathExpireStep = (5 * Time.Minute);
public const int MaxDeathCount = 3;
public const int MaxCUFProfiles = 5;
public static uint[] copseReclaimDelay = { 30, 60, 120 };
public const int MaxRunes = 7;
public const int MaxRechargingRunes = 3;
public static uint[] DefaultTalentRowLevels = { 15, 30, 45, 60, 75, 90, 100 };
public static uint[] DKTalentRowLevels = { 57, 58, 59, 60, 75, 90, 100 };
//public static uint[] DHTalentRowLevels = { 99, 100, 102, 104, 106, 108, 110 };
public const int CustomDisplaySize = 3;
public const int ArtifactsAllWeaponsGeneralWeaponEquippedPassive = 197886;
public const byte MaxHonorLevel = 50;
public const byte LevelMinHonor = 110;
}
public struct MoneyConstants
{
public const int Copper = 1;
public const int Silver = Copper * 100;
public const int Gold = Silver * 100;
}
public struct PlayerFieldOffsets
{
public const byte BytesOffsetSkinId = 0;
public const byte BytesOffsetFaceId = 1;
public const byte BytesOffsetHairStyleId = 2;
public const byte BytesOffsetHairColorId = 3;
public const byte Bytes2OffsetCustomDisplayOption = 0; // 3 Bytes
public const byte Bytes2OffsetFacialStyle = 3;
public const byte Bytes3OffsetPartyType = 0;
public const byte Bytes3OffsetBankBagSlots = 1;
public const byte Bytes3OffsetGender = 2;
public const byte Bytes3OffsetInebriation = 3;
public const byte Bytes4OffsetPvpTitle = 0;
public const byte Bytes4OffsetArenaFaction = 1;
public const byte FieldBytesOffsetRafGrantableLevel = 0;
public const byte FieldBytesOffsetActionBarToggles = 1;
public const byte FieldBytesOffsetLifetimeMaxPvpRank = 2;
public const byte FieldBytesOffsetMaxArtifactPowerRanks = 3;
public const byte FieldBytes2OffsetIgnorePowerRegenPredictionMask = 0;
public const byte FieldBytes2OffsetAuraVision = 1;
public const byte FieldBytes3OffsetOverrideSpellsId = 2; // Uint16!
public const byte FieldBytes3OffsetOverrideSpellsIdUint16Offset = FieldBytes3OffsetOverrideSpellsId / 2;
public const byte FieldKillsOffsetTodayKills = 0;
public const byte FieldKillsOffsetYesterdayKills = 1;
public const byte RestStateXp = 0;
public const byte RestRestedXp = 1;
public const byte RestStateHonor = 2;
public const byte RestRestedHonor = 3;
}
public enum TradeSlots
{
Invalid = -1,
NonTraded = 6,
TradedCount = 6,
Count = 7
}
public enum Tutorials
{
Talent = 0,
Spec = 1,
Glyph = 2,
SpellBook = 3,
Professions = 4,
CoreAbilitites = 5,
PetJournal = 6,
WhatHasChanged = 7,
Max = 8
}
public enum TradeStatus
{
PlayerBusy = 0,
Proposed = 1,
Initiated = 2,
Cancelled = 3,
Accepted = 4,
AlreadyTrading = 5,
NoTarget = 6,
Unaccepted = 7,
Complete = 8,
StateChanged = 9,
TooFarAway = 10,
WrongFaction = 11,
Failed = 12,
Petition = 13,
PlayerIgnored = 14,
Stunned = 15,
TargetStunned = 16,
Dead = 17,
TargetDead = 18,
LoggingOut = 19,
TargetLoggingOut = 20,
RestrictedAccount = 21,
WrongRealm = 22,
NotOnTaplist = 23,
CurrencyNotTradable = 24,
NotEnoughCurrency = 25,
}
public enum RestFlag
{
Tavern = 0x01,
City = 0x02,
FactionArea = 0x04
}
public enum ChatFlags
{
None = 0x00,
AFK = 0x01,
DND = 0x02,
GM = 0x04,
Com = 0x08, // Commentator
Dev = 0x10,
BossSound = 0x20, // Plays "RaidBossEmoteWarning" sound on raid boss emote/whisper
Mobile = 0x40
}
public enum DrunkenState
{
Sober = 0,
Tipsy = 1,
Drunk = 2,
Smashed = 3
}
public enum TalentSpecialization // talent tabs
{
MageArcane = 62,
MageFire = 63,
MageFrost = 64,
PaladinHoly = 65,
PaladinProtection = 66,
PaladinRetribution = 70,
WarriorArms = 71,
WarriorFury = 72,
WarriorProtection = 73,
DruidBalance = 102,
DruidFeralCombat = 103,
DruidRestoration = 104,
DeathKnightBlood = 250,
DeathKnightFrost = 251,
DeathKnightUnholy = 252,
HunterBeastMastery = 253,
HunterMarksman = 254,
HunterSurvival = 255,
PriestDiscipline = 256,
PriestHoly = 257,
PriestShadow = 258,
RogueAssassination = 259,
RogueCombat = 260,
RogueSubtlety = 261,
ShamanElemental = 262,
ShamanEnhancement = 263,
ShamanRestoration = 264,
WarlockAffliction = 265,
WarlockDemonology = 266,
WarlockDestruction = 267,
MonkBrewmaster = 268,
MonkBattledancer = 269,
MonkMistweaver = 270,
DemonHunterHavoc = 577,
DemonHunterVengeance = 581
}
public enum SpecResetType
{
Talents = 0,
Specialization = 1,
Glyphs = 2,
PetTalents = 3
}
public enum MirrorTimerType
{
Disabled = -1,
Fatigue = 0,
Breath = 1,
Fire = 2, // feign death
Max = 3
}
public enum TransferAbortReason
{
None = 0,
Error = 1,
MaxPlayers = 2, // Transfer ed: Instance Is Full
NotFound = 3, // Transfer ed: Instance Not Found
TooManyInstances = 4, // You Have Entered Too Many Instances Recently.
ZoneInCombat = 6, // Unable To Zone In While An Encounter Is In Progress.
InsufExpanLvl = 7, // You Must Have <Tbc, Wotlk> Expansion Installed To Access This Area.
Difficulty = 8, // <Normal, Heroic, Epic> Difficulty Mode Is Not Available For %S.
UniqueMessage = 9, // Until You'Ve Escaped Tlk'S Grasp, You Cannot Leave This Place!
TooManyRealmInstances = 10, // Additional Instances Cannot Be Launched, Please Try Again Later.
NeedGroup = 11, // Transfer ed: You Must Be In A Raid Group To Enter This Instance
NotFound2 = 12, // Transfer ed: Instance Not Found
NotFound3 = 13, // Transfer ed: Instance Not Found
NotFound4 = 14, // Transfer ed: Instance Not Found
RealmOnly = 15, // All Players In The Party Must Be From The Same Realm To Enter %S.
MapNotAllowed = 16, // Map Cannot Be Entered At This Time.
LockedToDifferentInstance = 18, // You Are Already Locked To %S
AlreadyCompletedEncounter = 19, // You Are Ineligible To Participate In At Least One Encounter In This Instance Because You Are Already Locked To An Instance In Which It Has Been Defeated.
DifficultyNotFound = 22, // Client Writes To Console "Unable To Resolve Requested Difficultyid %U To Actual Difficulty For Map %D"
XrealmZoneDown = 24, // Transfer ed: Cross-Realm Zone Is Down
SoloPlayerSwitchDifficulty = 26, // This Instance Is Already In Progress. You May Only Switch Difficulties From Inside The Instance.
}
public enum RaidGroupReason
{
None = 0,
Lowlevel = 1, // "You are too low level to enter this instance."
Only = 2, // "You must be in a raid group to enter this instance."
Full = 3, // "The instance is full."
RequirementsUnmatch = 4 // "You do not meet the requirements to enter this instance."
}
public enum ResetFailedReason
{
Failed = 0, // "Cannot reset %s. There are players still inside the instance."
Zoning = 1, // "Cannot reset %s. There are players in your party attempting to zone into an instance."
Offline = 2 // "Cannot reset %s. There are players offline in your party."
}
public enum ActivateTaxiReply
{
Ok = 0,
UnspecifiedServerError = 1,
NoSuchPath = 2,
NotEnoughMoney = 3,
TooFarAway = 4,
NoVendorNearby = 5,
NotVisited = 6,
PlayerBusy = 7,
PlayerAlreadyMounted = 8,
PlayerShapeshifted = 9,
PlayerMoving = 10,
SameNode = 11,
NotStanding = 12,
}
public enum TaxiNodeStatus
{
None = 0,
Learned = 1,
Unlearned = 2,
NotEligible = 3
}
public enum PlayerDelayedOperations
{
SavePlayer = 0x01,
ResurrectPlayer = 0x02,
SpellCastDeserter = 0x04,
BGMountRestore = 0x08, ///< Flag to restore mount state after teleport from BG
BGTaxiRestore = 0x10, ///< Flag to restore taxi state after teleport from BG
BGGroupRestore = 0x20, ///< Flag to restore group state after teleport from BG
End
}
public enum CorpseType
{
Bones = 0,
ResurrectablePVE = 1,
ResurrectablePVP = 2,
Max = 3
}
public enum CorpseFlags
{
None = 0x00,
Bones = 0x01,
Unk1 = 0x02,
PvP = 0x04,
HideHelm = 0x08,
HideCloak = 0x10,
Skinnable = 0x20,
FFAPvP = 0x40
}
public enum ActionButtonUpdateState
{
UnChanged = 0,
Changed = 1,
New = 2,
Deleted = 3
}
public enum ActionButtonType
{
Spell = 0x00,
C = 0x01, // click?
Eqset = 0x20,
Dropdown = 0x30,
Macro = 0x40,
CMacro = C | Macro,
Mount = 0x60,
Item = 0x80
}
public enum TeleportToOptions
{
GMMode = 0x01,
NotLeaveTransport = 0x02,
NotLeaveCombat = 0x04,
NotUnSummonPet = 0x08,
Spell = 0x10,
Seamless = 0x20
}
/// Type of environmental damages
public enum EnviromentalDamage
{
Exhausted = 0,
Drowning = 1,
Fall = 2,
Lava = 3,
Slime = 4,
Fire = 5,
FallToVoid = 6 // custom case for fall without durability loss
}
public enum PlayerUnderwaterState
{
None = 0x00,
InWater = 0x01, // terrain type is water and player is afflicted by it
InLava = 0x02, // terrain type is lava and player is afflicted by it
InSlime = 0x04, // terrain type is lava and player is afflicted by it
InDarkWater = 0x08, // terrain type is dark water and player is afflicted by it
ExistTimers = 0x10
}
public struct RuneCooldowns
{
public const int Base = 10000;
public const int Miss = 1500; // cooldown applied on runes when the spell misses
}
public enum PlayerFlags : uint
{
GroupLeader = 0x01,
AFK = 0x02,
DND = 0x04,
GM = 0x08,
Ghost = 0x10,
Resting = 0x20,
Unk6 = 0x40,
Unk7 = 0x80,
ContestedPVP = 0x100,
InPVP = 0x200,
HideHelm = 0x400,
HideCloak = 0x800,
PlayedLongTime = 0x1000,
PlayedTooLong = 0x2000,
IsOutOfBounds = 0x4000,
Developer = 0x8000,
Unk16 = 0x10000,
TaxiBenchmark = 0x20000,
PVPTimer = 0x40000,
Uber = 0x80000,
Unk20 = 0x100000,
Unk21 = 0x200000,
Commentator2 = 0x400000,
AllowOnlyAbility = 0x800000,
PetBattlesUnlocked = 0x1000000,
NoXPGain = 0x2000000,
Unk26 = 0x4000000,
AutoDeclineGuild = 0x8000000,
GuildLevelEnabled = 0x10000000,
VoidUnlocked = 0x20000000,
Mentor = 0x40000000,
Unk31 = 0x80000000
}
public enum PlayerFlagsEx
{
ReagentBankUnlocked = 0x01,
MercenaryMode = 0x02
}
public enum CharacterFlags : uint
{
None = 0x00000000,
Unk1 = 0x00000001,
Unk2 = 0x00000002,
CharacterLockedForTransfer = 0x00000004,
Unk4 = 0x00000008,
Unk5 = 0x00000010,
Unk6 = 0x00000020,
Unk7 = 0x00000040,
Unk8 = 0x00000080,
Unk9 = 0x00000100,
Unk10 = 0x00000200,
HideHelm = 0x00000400,
HideCloak = 0x00000800,
Unk13 = 0x00001000,
Ghost = 0x00002000,
Rename = 0x00004000,
Unk16 = 0x00008000,
Unk17 = 0x00010000,
Unk18 = 0x00020000,
Unk19 = 0x00040000,
Unk20 = 0x00080000,
Unk21 = 0x00100000,
Unk22 = 0x00200000,
Unk23 = 0x00400000,
Unk24 = 0x00800000,
LockedByBilling = 0x01000000,
Declined = 0x02000000,
Unk27 = 0x04000000,
Unk28 = 0x08000000,
Unk29 = 0x10000000,
Unk30 = 0x20000000,
Unk31 = 0x40000000,
Unk32 = 0x80000000
}
public enum PlayerLocalFlags
{
TrackStealthed = 0x02,
ReleaseTimer = 0x08, // Display time till auto release spirit
NoReleaseWindow = 0x10, // Display no "release spirit" window at all
NoPetBar = 0x00000020, // CGPetInfo::IsPetBarUsed
OverrideCameraMinHeight = 0x00000040,
UsingPartGarrison = 0x00000100,
CanUseObjectsMounted = 0x00000200,
CanVisitPartyGarrison = 0x00000400
}
public enum PlayerFieldByte2Flags
{
None = 0x00,
Stealth = 0x20,
InvisibilityGlow = 0x40
}
public enum AreaTeams
{
None = 0,
Ally = 2,
Horde = 4,
Any = 6
}
public enum RestTypes : byte
{
XP = 0,
Honor = 1,
Max
}
public enum PlayerRestState
{
Rested = 0x01,
NotRAFLinked = 0x02,
RAFLinked = 0x06
}
public enum CharacterCustomizeFlags
{
None = 0x00,
Customize = 0x01, // Name, Gender, Etc...
Faction = 0x10000, // Name, Gender, Faction, Etc...
Race = 0x100000 // Name, Gender, Race, Etc...
}
public enum CharacterFlags3 : uint
{
LockedByRevokedVasTransaction = 0x100000,
LockedByRevokedCharacterUpgrade = 0x80000000,
}
public enum CharacterFlags4
{
TrialBoost = 0x80,
TrialBoostLocked = 0x40000,
}
public enum TextureSection // TODO: Find a better name. Used in CharSections.dbc
{
BaseSkin = 0,
Face = 1,
FacialHair = 2,
Hair = 3,
Underwear = 4,
}
public enum AtLoginFlags
{
None = 0x00,
Rename = 0x01,
ResetSpells = 0x02,
ResetTalents = 0x04,
Customize = 0x08,
ResetPetTalents = 0x10,
FirstLogin = 0x20,
ChangeFaction = 0x40,
ChangeRace = 0x80,
Resurrect = 0x100
}
public enum PlayerSlots
{
// first slot for item stored (in any way in player items data)
Start = 0,
// last+1 slot for item stored (in any way in player items data)
End = 187,
Count = (End - Start)
}
public enum PlayerTitle : ulong
{
Disabled = 0x0000000000000000,
None = 0x0000000000000001,
Private = 0x0000000000000002, // 1
Corporal = 0x0000000000000004, // 2
SergeantA = 0x0000000000000008, // 3
MasterSergeant = 0x0000000000000010, // 4
SergeantMajor = 0x0000000000000020, // 5
Knight = 0x0000000000000040, // 6
KnightLieutenant = 0x0000000000000080, // 7
KnightCaptain = 0x0000000000000100, // 8
KnightChampion = 0x0000000000000200, // 9
LieutenantCommander = 0x0000000000000400, // 10
Commander = 0x0000000000000800, // 11
Marshal = 0x0000000000001000, // 12
FieldMarshal = 0x0000000000002000, // 13
GrandMarshal = 0x0000000000004000, // 14
Scout = 0x0000000000008000, // 15
Grunt = 0x0000000000010000, // 16
SergeantH = 0x0000000000020000, // 17
SeniorSergeant = 0x0000000000040000, // 18
FirstSergeant = 0x0000000000080000, // 19
StoneGuard = 0x0000000000100000, // 20
BloodGuard = 0x0000000000200000, // 21
Legionnaire = 0x0000000000400000, // 22
Centurion = 0x0000000000800000, // 23
Champion = 0x0000000001000000, // 24
LieutenantGeneral = 0x0000000002000000, // 25
General = 0x0000000004000000, // 26
Warlord = 0x0000000008000000, // 27
HighWarlord = 0x0000000010000000, // 28
Gladiator = 0x0000000020000000, // 29
Duelist = 0x0000000040000000, // 30
Rival = 0x0000000080000000, // 31
Challenger = 0x0000000100000000, // 32
ScarabLord = 0x0000000200000000, // 33
Conqueror = 0x0000000400000000, // 34
Justicar = 0x0000000800000000, // 35
ChampionOfTheNaaru = 0x0000001000000000, // 36
MercilessGladiator = 0x0000002000000000, // 37
OfTheShatteredSun = 0x0000004000000000, // 38
HandOfAdal = 0x0000008000000000, // 39
VengefulGladiator = 0x0000010000000000, // 40
}
public enum PlayerExtraFlags
{
// gm abilities
GMOn = 0x01,
AcceptWhispers = 0x04,
TaxiCheat = 0x08,
GMInvisible = 0x10,
GMChat = 0x20, // Show GM badge in chat messages
// other states
PVPDeath = 0x100 // store PvP death status until corpse creating.
}
public enum EquipmentSetUpdateState
{
Unchanged = 0,
Changed = 1,
New = 2,
Deleted = 3
}
public enum CUFBoolOptions
{
KeepGroupsTogether,
DisplayPets,
DisplayMainTankAndAssist,
DisplayHealPrediction,
DisplayAggroHighlight,
DisplayOnlyDispellableDebuffs,
DisplayPowerBar,
DisplayBorder,
UseClassColors,
DisplayHorizontalGroups,
DisplayNonBossDebuffs,
DynamicPosition,
Locked,
Shown,
AutoActivate2Players,
AutoActivate3Players,
AutoActivate5Players,
AutoActivate10Players,
AutoActivate15Players,
AutoActivate25Players,
AutoActivate40Players,
AutoActivateSpec1,
AutoActivateSpec2,
AutoActivateSpec3,
AutoActivateSpec4,
AutoActivatePvp,
AutoActivatePve,
BoolOptionsCount,
}
public enum DuelCompleteType
{
Interrupted = 0,
Won = 1,
Fled = 2
}
public enum ReferAFriendError
{
None = 0,
NotReferredBy = 1,
TargetTooHigh = 2,
InsufficientGrantableLevels = 3,
TooFar = 4,
DifferentFaction = 5,
NotNow = 6,
GrantLevelMaxI = 7,
NoTarget = 8,
NotInGroup = 9,
SummonLevelMaxI = 10,
SummonCooldown = 11,
InsufExpanLvl = 12,
SummonOfflineS = 13,
NoXrealm = 14,
MapIncomingTransferNotAllowed = 15
}
public enum PlayerCommandStates
{
None = 0x00,
God = 0x01,
Casttime = 0x02,
Cooldown = 0x04,
Power = 0x08,
Waterwalk = 0x10
}
public enum AttackSwingErr
{
CantAttack = 0,
BadFacing = 1,
NotInRange = 2,
DeadTarget = 3
}
public enum PlayerLogXPReason
{
Kill = 0,
NoKill = 1
}
public enum HeirloomPlayerFlags
{
None = 0x00,
BonusLevel90 = 0x01,
BonusLevel100 = 0x02,
BonusLevel110 = 0x04
}
public enum HeirloomItemFlags
{
None = 0x00,
ShowOnlyIfKnown = 0x01,
Pvp = 0x02
}
public enum DeclinedNameResult
{
Success = 0,
Error = 1
}
public enum BindExtensionState
{
Expired = 0,
Normal = 1,
Extended = 2,
Keep = 255 // special state: keep current save type
}
public enum TalentLearnResult
{
LearnOk = 0,
FailedUnknown = 1,
FailedNotEnoughTalentsInPrimaryTree = 2,
FailedNoPrimaryTreeSelected = 3,
FailedCantDoThatRightNow = 4,
FailedAffectingCombat = 5,
FailedCantRemoveTalent = 6,
FailedCantDoThatChallengeModeActive = 7,
FailedRestArea = 8
}
}
+339
View File
@@ -0,0 +1,339 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
namespace Framework.Constants
{
public enum QuestObjectiveType
{
Monster = 0,
Item = 1,
GameObject = 2,
TalkTo = 3,
Currency = 4,
LearnSpell = 5,
MinReputation = 6,
MaxReputation = 7,
Money = 8,
PlayerKills = 9,
AreaTrigger = 10,
WinPetBattleAgainstNpc = 11,
DefeatBattlePet = 12,
WinPvpPetBattles = 13,
CriteriaTree = 14,
ProgressBar = 15,
HaveCurrency = 16, // requires the player to have X currency when turning in but does not consume it
ObtainCurrency = 17 // requires the player to gain X currency after starting the quest but not required to keep it until the end (does not consume)
}
public enum QuestObjectiveFlags
{
TrackedOnMinimap = 0x01, // Client Displays Large Yellow Blob On Minimap For Creature/Gameobject
Sequenced = 0x02, // Client Will Not See The Objective Displayed Until All Previous Objectives Are Completed
Optional = 0x04, // Not Required To Complete The Quest
Hidden = 0x08, // Never Displayed In Quest Log
HideItemGains = 0x10, // Skip Showing Item Objective Progress
ProgressCountsItemsInInventory = 0x20, // Item Objective Progress Counts Items In Inventory Instead Of Reading It From Updatefields
PartOfProgressBar = 0x40, // Hidden Objective Used To Calculate Progress Bar Percent (Quests Are Limited To A Single Progress Bar Objective)
}
public struct QuestSlotOffsets
{
public const int Id = 0;
public const int State = 1;
public const int Counts = 2;
public const int Time = 14;
public const int Max = 16;
}
public enum QuestSlotStateMask
{
None = 0x0000,
Complete = 0x0001,
Fail = 0x0002
}
public enum QuestType
{
AutoComplete= 0,
Disabled = 1,
Normal = 2,
Task = 3,
Max = 4
}
public enum QuestInfos
{
Group = 1,
Class = 21,
PVP = 41,
Raid = 62,
Dungeon = 81,
WorldEvent = 82,
Legendary = 83,
Escort = 84,
Heroic = 85,
Raid10 = 88,
Raid25 = 89,
Scenario = 98,
Account = 102,
SideQuest = 104
}
public enum QuestSort
{
Epic = 1,
HallowsEnd = 21,
Seasonal = 22,
Cataclysm = 23,
Herbalism = 24,
Battlegrounds = 25,
DayOfTheDead = 41,
Warlock = 61,
Warrior = 81,
Shaman = 82,
Fishing = 101,
Blacksmithing = 121,
Paladin = 141,
Mage = 161,
Rogue = 162,
Alchemy = 181,
Leatherworking = 182,
Engineering = 201,
TreasureMap = 221,
Tournament = 241,
Hunter = 261,
Priest = 262,
Druid = 263,
Tailoring = 264,
Special = 284,
Cooking = 304,
FirstAid = 324,
Legendary = 344,
DarkmoonFaire = 364,
AhnQirajWar = 365,
LunarFestival = 366,
Reputation = 367,
Invasion = 368,
Midsummer = 369,
Brewfest = 370,
Inscription = 371,
DeathKnight = 372,
Jewelcrafting = 373,
Noblegarden = 374,
PilgrimsBounty = 375,
LoveIsInTheAir = 376,
Archaeology = 377,
ChildrensWeek = 378,
FirelandsInvasion = 379,
TheZandalari = 380,
ElementalBonds = 381,
PandarenBrewmaster = 391,
Scenario = 392,
BattlePets = 394,
Monk = 395,
Landfall = 396,
PandarenCampaign = 397,
Riding = 398,
BrawlersGuild = 399,
ProvingGrounds = 400,
GarrisonCampaign = 401,
AssaultOnTheDarkPortal = 402,
GarrisonSupport = 403,
Logging = 404,
Pickpocketing = 405
}
public enum QuestFailedReasons
{
None = 0,
FailedLowLevel = 1, // "You Are Not High Enough Level For That Quest.""
FailedWrongRace = 6, // "That Quest Is Not Available To Your Race."
AlreadyDone = 7, // "You Have Completed That Daily Quest Today."
OnlyOneTimed = 12, // "You Can Only Be On One Timed Quest At A Time"
AlreadyOn1 = 13, // "You Are Already On That Quest"
FailedExpansion = 16, // "This Quest Requires An Expansion Enabled Account."
AlreadyOn2 = 18, // "You Are Already On That Quest"
FailedMissingItems = 21, // "You Don'T Have The Required Items With You. Check Storage."
FailedNotEnoughMoney = 23, // "You Don'T Have Enough Money For That Quest"
FailedCais = 24, // "You Cannot Complete Quests Once You Have Reached Tired Time"
AlreadyDoneDaily = 26, // "You Have Completed That Daily Quest Today."
FailedSpell = 28, // "You Haven'T Learned The Required Spell."
HasInProgress = 30 // "Progress Bar Objective Not Completed"
}
public enum QuestPushReason
{
Success = 0,
Invalid = 1,
Accepted = 2,
Declined = 3,
Busy = 4,
Dead = 5,
LogFull = 6,
OnQuest = 7,
AlreadyDone = 8,
NotDaily = 9,
TimerExpired = 10,
NotInParty = 11,
DifferentServerDaily = 12,
NotAllowed = 13
}
public enum QuestTradeSkill
{
None = 0,
Alchemy = 1,
Blacksmithing = 2,
Cooking = 3,
Enchanting = 4,
Engineering = 5,
Firstaid = 6,
Herbalism = 7,
Leatherworking = 8,
Poisons = 9,
Tailoring = 10,
Mining = 11,
Fishing = 12,
Skinning = 13,
Jewelcrafting = 14
}
public enum QuestStatus
{
None = 0,
Complete = 1,
//Unavailable = 2,
Incomplete = 3,
//Available = 4,
Failed = 5,
Rewarded = 6, // Not Used In Db
Max
}
public enum QuestGiverStatus
{
None = 0x000,
Unk = 0x001,
Unavailable = 0x002,
LowLevelAvailable = 0x004,
LowLevelRewardRep = 0x008,
LowLevelAvailableRep = 0x010,
Incomplete = 0x020,
RewardRep = 0x040,
AvailableRep = 0x080,
Available = 0x100,
Reward2 = 0x200, // No Yellow Dot On Minimap
Reward = 0x400, // Yellow Dot On Minimap
// Custom value meaning that script call did not return any valid quest status
ScriptedNoStatus = 0x1000
}
[Flags]
public enum QuestFlags
{
None = 0x00,
StayAlive = 0x01, // Not Used Currently
PartyAccept = 0x02, // Not Used Currently. If Player In Party, All Players That Can Accept This Quest Will Receive Confirmation Box To Accept Quest Cmsg_Quest_Confirm_Accept/Smsg_Quest_Confirm_Accept
Exploration = 0x04, // Not Used Currently
Sharable = 0x08, // Can Be Shared: Player.Cansharequest()
HasCondition = 0x10, // Not Used Currently
HideRewardPoi = 0x20, // Not Used Currently: Unsure Of Content
Raid = 0x40, // Can be completed while in raid
TBC = 0x80, // Not Used Currently: Available If Tbc Expansion Enabled Only
NoMoneyFromXp = 0x100, // Not Used Currently: Experience Is Not Converted To Gold At Max Level
HiddenRewards = 0x200, // Items And Money Rewarded Only Sent In Smsg_Questgiver_Offer_Reward (Not In Smsg_Questgiver_Quest_Details Or In Client Quest Log(Smsg_Quest_Query_Response))
Tracking = 0x400, // These Quests Are Automatically Rewarded On Quest Complete And They Will Never Appear In Quest Log Client Side.
DeprecateReputation = 0x800, // Not Used Currently
Daily = 0x1000, // Used To Know Quest Is Daily One
Pvp = 0x2000, // Having This Quest In Log Forces Pvp Flag
Unavailable = 0x4000, // Used On Quests That Are Not Generically Available
Weekly = 0x8000,
AutoComplete = 0x10000, // Quests with this flag player submit automatically by special button in player gui
DisplayItemInTracker = 0x20000, // Displays Usable Item In Quest Tracker
ObjText = 0x40000, // Use Objective Text As Complete Text
AutoAccept = 0x80000, // The client recognizes this flag as auto-accept. However, NONE of the current quests (3.3.5a) have this flag. Maybe blizz used to use it, or will use it in the future.
Unk1 = 0x100000, //
AutoTake = 0x200000, // Automatically Suggestion Of Accepting Quest. Not From Npc.
//Unk2 = 0x400000,
//Unk3 = 0x800000, // Found In Quest 14069
//Unk4 = 0x1000000,
// ... 4.X Added Flags Up To 0x80000000 - All Unknown For Now
}
// last checked in 19802
[Flags]
public enum QuestFlagsEx
{
None = 0x00,
KeepAdditionalItems = 0x01,
SuppressGossipComplete = 0x02,
SuppressGossipAccept = 0x04,
DisallowPlayerAsQuestgiver = 0x08,
DisplayClassChoiceRewards = 0x10,
DisplaySpecChoiceRewards = 0x20,
RemoveFromLogOnPeriodicReset = 0x40,
AccountLevelQuest = 0x80,
LegendaryQuest = 0x100,
NoGuildXp = 0x200,
ResetCacheOnAccept = 0x400,
NoAbandonOnceAnyObjectiveComplete = 0x800,
RecastAcceptSpellOnLogin = 0x1000,
UpdateZoneAuras = 0x2000,
NoCreditForProxy = 0x4000,
DisplayAsDailyQuest = 0x8000,
PartOfQuestLine = 0x10000,
QuestForInternalBuildsOnly = 0x20000,
SuppressSpellLearnTextLine = 0x40000,
DisplayHeaderAsObjectiveForTasks = 0x80000,
GarrisonNonOwnersAllowed = 0x100000,
RemoveQuestOnWeeklyReset = 0x200000,
SuppressFarewellAudioAfterQuestAccept = 0x0400000,
RewardsBypassWeeklyCapsAndSeasonTotal = 0x0800000,
ClearProgressOfCriteriaTreeObjectivesOnAccept = 0x1000000
}
public enum QuestSpecialFlags
{
None = 0x00,
// Flags For Set Specialflags In Db If Required But Used Only At Server
Repeatable = 0x001,
ExplorationOrEvent = 0x002, // If Required Area Explore, Spell Spell_Effect_Quest_Complete Casting, Table `*_Script` Command Script_Command_Quest_Explored Use, Set From Script)
AutoAccept = 0x004, // Quest Is To Be Auto-Accepted.
DfQuest = 0x008, // Quest Is Used By Dungeon Finder.
Monthly = 0x010, // Quest Is Reset At The Begining Of The Month
Cast = 0x20, // Set by 32 in SpecialFlags in DB if the quest requires RequiredOrNpcGo killcredit but NOT kill (a spell cast)
// Room For More Custom Flags
DbAllowed = Repeatable | ExplorationOrEvent | AutoAccept | DfQuest | Monthly | Cast,
Deliver = 0x080, // Internal Flag Computed Only
Speakto = 0x100, // Internal Flag Computed Only
Kill = 0x200, // Internal Flag Computed Only
Timed = 0x400, // Internal Flag Computed Only
PlayerKill = 0x800 // Internal Flag Computed Only
}
public enum QuestSaveType
{
Default = 0,
Delete,
ForceDelete
}
}
+78
View File
@@ -0,0 +1,78 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
// AuraScript interface - enum used for runtime checks of script function calls
public enum AuraScriptHookType
{
None = 0,
Registration,
Loading,
Unloading,
EffectApply,
EffectAfterApply,
EffectRemove,
EffectAfterRemove,
EffectPeriodic,
EffectUpdatePeriodic,
EffectCalcAmount,
EffectCalcPeriodic,
EffectCalcSpellmod,
EffectAbsorb,
EffectAfterAbsorb,
EffectManaShield,
EffectAfterManaShield,
EffectSplit,
CheckAreaTarget,
Dispel,
AfterDispel,
// Spell Proc Hooks
CheckProc,
PrepareProc,
Proc,
EffectProc,
EffectAfterProc,
AfterProc,
//Apply,
//Remove
}
// SpellScript interface - enum used for runtime checks of script function calls
public enum SpellScriptHookType
{
None = 0,
Registration,
Loading,
Unloading,
Launch,
LaunchTarget,
EffectHit,
EffectHitTarget,
EffectSuccessfulDispel,
BeforeHit,
OnHit,
AfterHit,
ObjectAreaTargetSelect,
ObjectTargetSelect,
DestinationTargetSelect,
CheckCast,
BeforeCast,
OnCast,
AfterCast
}
}
+61
View File
@@ -0,0 +1,61 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum OriginalHash : uint
{
AccountService = 0x62DA0891u,
AccountListener = 0x54DFDA17u,
AuthenticationListener = 0x71240E35u,
AuthenticationService = 0xDECFC01u,
ChallengeService = 0xDBBF6F19u,
ChallengeListener = 0xBBDA171Fu,
ChannelService = 0xB732DB32u,
ChannelListener = 0xBF8C8094u,
ConnectionService = 0x65446991u,
FriendsService = 0xA3DDB1BDu,
FriendsListener = 0x6F259A13u,
GameUtilitiesService = 0x3FC1274Du,
PresenceService = 0xFA0796FFu,
ReportService = 0x7CAF61C9u,
ResourcesService = 0xECBE75BAu,
UserManagerService = 0x3E19268Au,
UserManagerListener = 0xBC872C22u
}
public enum NameHash : uint
{
AccountService = 0x1E4DC42Fu,
AccountListener = 0x7807483Cu,
AuthenticationListener = 0x4DA86228u,
AuthenticationService = 0xFF5A6AC3u,
ChallengeService = 0x71BB6833u,
ChallengeListener = 0xC6D90AB8u,
ChannelService = 0xA913A87Bu,
ChannelListener = 0xDA660990u,
ConnectionService = 0x2782094Bu,
FriendsService = 0xABDFED63u,
FriendsListener = 0xA6717548u,
GameUtilitiesService = 0x51923A28u,
PresenceService = 0xD8F94B3Bu,
ReportService = 0x724F5F47u,
ResourcesService = 0x4B104C53u,
UserManagerService = 0x8EE5694Eu,
UserManagerListener = 0xB3426BB3u
}
}
File diff suppressed because it is too large Load Diff
+364
View File
@@ -0,0 +1,364 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum SmartScriptType
{
Creature = 0,
GameObject = 1,
AreaTrigger = 2,
Event = 3,
Gossip = 4,
Quest = 5,
Spell = 6,
Transport = 7,
Instance = 8,
TimedActionlist = 9,
Scene = 10, // done
Max = 11
}
public struct SmartScriptTypeMaskId
{
public const uint Creature = 1;
public const uint Gameobject = 2;
public const uint Areatrigger = 4;
public const uint Event = 8;
public const uint Gossip = 16;
public const uint Quest = 32;
public const uint Spell = 64;
public const uint Transport = 128;
public const uint Instance = 256;
public const uint TimedActionlist = 512;
public const uint Scene = 1024;
}
public enum SmartPhase
{
ALWAYS = 0,
Phase1 = 1,
Phase2 = 2,
Phase3 = 3,
Phase4 = 4,
Phase5 = 5,
Phase6 = 6,
Max = 7,
All = (Phase1 | Phase2 | Phase3 | Phase4 | Phase5 | Phase6),
Count = 6
}
public enum SmartEventFlags
{
NotRepeatable = 0x01, //Event can not repeat
Difficulty0 = 0x02, //Event only occurs in instance difficulty 0
Difficulty1 = 0x04, //Event only occurs in instance difficulty 1
Difficulty2 = 0x08, //Event only occurs in instance difficulty 2
Difficulty3 = 0x10, //Event only occurs in instance difficulty 3
Reserved5 = 0x20,
Reserved6 = 0x40,
DebugOnly = 0x80, //Event only occurs in debug build
DontReset = 0x100, //Event will not reset in SmartScript.OnReset()
WhileCharmed = 0x200, //Event occurs even if AI owner is charmed
DifficultyAll = (Difficulty0 | Difficulty1 | Difficulty2 | Difficulty3),
All = (NotRepeatable | DifficultyAll | Reserved5 | Reserved6 | DebugOnly | DontReset | WhileCharmed)
}
public enum SmartRespawnCondition
{
None = 0,
Map = 1,
Area = 2,
End = 3
}
public enum SmartAITemplate
{
Basic = 0, //nothing is preset
Caster = 1, //spellid, repeatMin, repeatMax, range, manaPCT +JOIN: target_param1 as castFlag
Turret = 2, //spellid, repeatMin, repeatMax +JOIN: target_param1 as castFlag
Passive = 3,
CagedGOPart = 4, //creatureID, give credit at point end?,
CagedNPCPart = 5, //gameObjectID, despawntime, run?, dist, TextGroupID
End = 6
}
public enum SmartCastFlags
{
InterruptPrevious = 0x01, //Interrupt any spell casting
Triggered = 0x02, //Triggered (this makes spell cost zero mana and have no cast time)
//CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
//CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
//CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
AuraNotPresent = 0x20, //Only casts the spell if the target does not have an aura from the spell
CombatMove = 0x40 //Prevents combat movement if cast successful. Allows movement on range, OOM, LOS
}
public enum SmartEvents
{
UpdateIc = 0, // Initialmin, Initialmax, Repeatmin, Repeatmax
UpdateOoc = 1, // Initialmin, Initialmax, Repeatmin, Repeatmax
HealtPct = 2, // Hpmin%, Hpmax%, Repeatmin, Repeatmax
ManaPct = 3, // Manamin%, Manamax%, Repeatmin, Repeatmax
Aggro = 4, // None
Kill = 5, // Cooldownmin0, Cooldownmax1, Playeronly2, Else Creature Entry3
Death = 6, // None
Evade = 7, // None
SpellHit = 8, // Spellid, School, Cooldownmin, Cooldownmax
Range = 9, // Mindist, Maxdist, Repeatmin, Repeatmax
OocLos = 10, // Nohostile, Maxrnage, Cooldownmin, Cooldownmax
Respawn = 11, // Type, Mapid, Zoneid
TargetHealthPct = 12, // Hpmin%, Hpmax%, Repeatmin, Repeatmax
VictimCasting = 13, // Repeatmin, Repeatmax
FriendlyHealth = 14, // Hpdeficit, Radius, Repeatmin, Repeatmax
FriendlyIsCc = 15, // Radius, Repeatmin, Repeatmax
FriendlyMissingBuff = 16, // Spellid, Radius, Repeatmin, Repeatmax
SummonedUnit = 17, // Creatureid(0 All), Cooldownmin, Cooldownmax
TargetManaPct = 18, // Manamin%, Manamax%, Repeatmin, Repeatmax
AcceptedQuest = 19, // Questid(0any)
RewardQuest = 20, // Questid(0any)
ReachedHome = 21, // None
ReceiveEmote = 22, // Emoteid, Cooldownmin, Cooldownmax, Condition, Val1, Val2, Val3
HasAura = 23, // Param1 = Spellid, Param2 = Stack Amount, Param3/4 Repeatmin, Repeatmax
TargetBuffed = 24, // Param1 = Spellid, Param2 = Stack Amount, Param3/4 Repeatmin, Repeatmax
Reset = 25, // Called After Combat, When The Creature Respawn And Spawn.
IcLos = 26, // Nohostile, Maxrnage, Cooldownmin, Cooldownmax
PassengerBoarded = 27, // Cooldownmin, Cooldownmax
PassengerRemoved = 28, // Cooldownmin, Cooldownmax
Charmed = 29, // onRemove (0 - on apply, 1 - on remove)
CharmedTarget = 30, // None
SpellhitTarget = 31, // Spellid, School, Cooldownmin, Cooldownmax
Damaged = 32, // Mindmg, Maxdmg, Cooldownmin, Cooldownmax
DamagedTarget = 33, // Mindmg, Maxdmg, Cooldownmin, Cooldownmax
Movementinform = 34, // Movementtype(Any), Pointid
SummonDespawned = 35, // Entry, Cooldownmin, Cooldownmax
CorpseRemoved = 36, // None
AiInit = 37, // None
DataSet = 38, // Id, Value, Cooldownmin, Cooldownmax
WaypointStart = 39, // Pointid(0any), Pathid(0any)
WaypointReached = 40, // Pointid(0any), Pathid(0any)
TransportAddplayer = 41, // None
TransportAddcreature = 42, // Entry (0 Any)
TransportRemovePlayer = 43, // None
TransportRelocate = 44, // Pointid
InstancePlayerEnter = 45, // Team (0 Any), Cooldownmin, Cooldownmax
AreatriggerOntrigger = 46, // Triggerid(0 Any)
QuestAccepted = 47, // None
QuestObjCompletion = 48, // None
QuestCompletion = 49, // None
QuestRewarded = 50, // None
QuestFail = 51, // None
TextOver = 52, // Groupid From CreatureText, Creature Entry Who Talks (0 Any)
ReceiveHeal = 53, // Minheal, Maxheal, Cooldownmin, Cooldownmax
JustSummoned = 54, // None
WaypointPaused = 55, // Pointid(0any), Pathid(0any)
WaypointResumed = 56, // Pointid(0any), Pathid(0any)
WaypointStopped = 57, // Pointid(0any), Pathid(0any)
WaypointEnded = 58, // Pointid(0any), Pathid(0any)
TimedEventTriggered = 59, // Id
Update = 60, // Initialmin, Initialmax, Repeatmin, Repeatmax
Link = 61, // Internal Usage, No Params, Used To Link Together Multiple Events, Does Not Use Any Extra Resources To Iterate Event Lists Needlessly
GossipSelect = 62, // Menuid, Actionid
JustCreated = 63, // None
GossipHello = 64, // None
FollowCompleted = 65, // None
DummyEffect = 66, // Spellid, Effectindex
IsBehindTarget = 67, // Cooldownmin, Cooldownmax
GameEventStart = 68, // GameEvent.Entry
GameEventEnd = 69, // GameEvent.Entry
GoStateChanged = 70, // Go State
GoEventInform = 71, // Eventid
ActionDone = 72, // Eventid (Shareddefines.Eventid)
OnSpellclick = 73, // Clicker (Unit)
FriendlyHealthPCT = 74,// minHpPct, maxHpPct, repeatMin, repeatMax
DistanceCreature = 75, // guid, entry, distance, repeat
DistanceGameobject = 76, // guid, entry, distance, repeat
CounterSet = 77, // id, value, cooldownMin, cooldownMax
SceneStart = 78, // none
SceneTrigger = 79, // param_string : triggerName
SceneCancel = 80, // none
SceneComplete = 81, // none
End = 82
}
public enum SmartActions
{
None = 0, // No Action
Talk = 1, // Groupid From CreatureText, Duration To Wait Before TextOver Event Is Triggered, useTalkTarget (0/1) - use target as talk target
SetFaction = 2, // Factionid (Or 0 For Default)
MorphToEntryOrModel = 3, // CreatureTemplate Entry(Param1) Or Modelid (Param2) (Or 0 For Both To Demorph)
Sound = 4, // Soundid, Textrange
PlayEmote = 5, // Emoteid
FailQuest = 6, // Questid
OfferQuest = 7, // Questid, directAdd
SetReactState = 8, // State
ActivateGobject = 9, //
RandomEmote = 10, // Emoteid1, Emoteid2, Emoteid3...
Cast = 11, // Spellid, Castflags, TriggeredFlags
SummonCreature = 12, // Creatureid, Summontype, Duration In Ms, Storageid, Attackinvoker,
ThreatSinglePct = 13, // Threat%
ThreatAllPct = 14, // Threat%
CallAreaexploredoreventhappens = 15, // Questid
SetIngamePhaseGroup = 16, // phaseGroupId, apply
SetEmoteState = 17, // Emoteid
SetUnitFlag = 18, // Flags (May Be More Than One Field Or'D Together), Target
RemoveUnitFlag = 19, // Flags (May Be More Than One Field Or'D Together), Target
AutoAttack = 20, // Allowattackstate (0 = Stop Attack, Anything Else Means Continue Attacking)
AllowCombatMovement = 21, // Allowcombatmovement (0 = Stop Combat Based Movement, Anything Else Continue Attacking)
SetEventPhase = 22, // Phase
IncEventPhase = 23, // Value (May Be Negative To Decrement Phase, Should Not Be 0)
Evade = 24, // No Params
FleeForAssist = 25, // With Emote
CallGroupeventhappens = 26, // Questid
CombatStop = 27, //
Removeaurasfromspell = 28, // Spellid, 0 Removes All Auras
Follow = 29, // Distance (0 = Default), Angle (0 = Default), Endcreatureentry, Credit, Credittype (0monsterkill, 1event)
RandomPhase = 30, // Phaseid1, Phaseid2, Phaseid3...
RandomPhaseRange = 31, // Phasemin, Phasemax
ResetGobject = 32, //
CallKilledmonster = 33, // Creatureid,
SetInstData = 34, // Field, Data, Type (0 = SetData, 1 = SetBossState)
SetInstData64 = 35, // Field,
UpdateTemplate = 36, // Entry
Die = 37, // No Params
SetInCombatWithZone = 38, // No Params
CallForHelp = 39, // Radius, With Emote
SetSheath = 40, // Sheath (0-Unarmed, 1-Melee, 2-Ranged)
ForceDespawn = 41, // Timer
SetInvincibilityHpLevel = 42, // Minhpvalue(+Pct, -Flat)
MountToEntryOrModel = 43, // CreatureTemplate Entry(Param1) Or Modelid (Param2) (Or 0 For Both To Dismount)
SetIngamePhaseId = 44, // Id
SetData = 45, // Field, Data (Only Creature Todo)
//46 Unused
SetVisibility = 47, // On/Off
SetActive = 48, // No Params
AttackStart = 49, //
SummonGo = 50, // Gameobjectid, Despawntime In Ms,
KillUnit = 51, //
ActivateTaxi = 52, // Taxiid
WpStart = 53, // Run/Walk, Pathid, Canrepeat, Quest, Despawntime, Reactstate
WpPause = 54, // Time
WpStop = 55, // Despawntime, Quest, Fail?
AddItem = 56, // Itemid, Count
RemoveItem = 57, // Itemid, Count
InstallAiTemplate = 58, // Aitemplateid
SetRun = 59, // 0/1
SetFly = 60, // 0/1
SetSwim = 61, // 0/1
Teleport = 62, // Mapid,
SetCounter = 63, // id, value, reset (0/1)
StoreTargetList = 64, // Varid,
WpResume = 65, // None
SetOrientation = 66, //
CreateTimedEvent = 67, // Id, Initialmin, Initialmax, Repeatmin(Only If It Repeats), Repeatmax(Only If It Repeats), Chance
Playmovie = 68, // Entry
MoveToPos = 69, // PointId, transport, disablePathfinding
RespawnTarget = 70, //
Equip = 71, // Entry, Slotmask Slot1, Slot2, Slot3 , Only Slots With Mask Set Will Be Sent To Client, Bits Are 1, 2, 4, Leaving Mask 0 Is Defaulted To Mask 7 (Send All), Slots1-3 Are Only Used If No Entry Is Set
CloseGossip = 72, // None
TriggerTimedEvent = 73, // Id(>1)
RemoveTimedEvent = 74, // Id(>1)
AddAura = 75, // Spellid, Targets
OverrideScriptBaseObject = 76, // Warning: Can Crash Core, Do Not Use If You Dont Know What You Are Doing
ResetScriptBaseObject = 77, // None
CallScriptReset = 78, // None
SetRangedMovement = 79, // Distance, Angle
CallTimedActionlist = 80, // Id (Overwrites Already Running Actionlist), Stop After Combat?(0/1), Timer Update Type(0-Ooc, 1-Ic, 2-Always)
SetNpcFlag = 81, // Flags
AddNpcFlag = 82, // Flags
RemoveNpcFlag = 83, // Flags
SimpleTalk = 84, // Groupid, Can Be Used To Make Players Say Groupid, TextOver Event Is Not Triggered, Whisper Can Not Be Used (Target Units Will Say The Text)
InvokerCast = 85, // Spellid, Castflags, If Avaliable, Last Used Invoker Will Cast Spellid With Castflags On Targets
CrossCast = 86, // Spellid, Castflags, Castertargettype, Castertarget Param1, Castertarget Param2, Castertarget Param3, ( + The Origonal Target Fields As Destination Target), Castertargets Will Cast Spellid On All Targets (Use With Caution If Targeting Multiple * Multiple Units)
CallRandomTimedActionlist = 87, // Script9 Ids 1-9
CallRandomRangeTimedActionlist = 88, // Script9 Id Min, Max
RandomMove = 89, // Maxdist
SetUnitFieldBytes1 = 90, // Bytes, Target
RemoveUnitFieldBytes1 = 91, // Bytes, Target
InterruptSpell = 92,
SendGoCustomAnim = 93, // Anim Id
SetDynamicFlag = 94, // Flags
AddDynamicFlag = 95, // Flags
RemoveDynamicFlag = 96, // Flags
JumpToPos = 97, // Speedxy, Speedz, Targetx, Targety, Targetz
SendGossipMenu = 98, // Menuid, Optionid
GoSetLootState = 99, // State
SendTargetToTarget = 100, // Id
SetHomePos = 101, // None
SetHealthRegen = 102, // 0/1
SetRoot = 103, // Off/On
SetGoFlag = 104, // Flags
AddGoFlag = 105, // Flags
RemoveGoFlag = 106, // Flags
SummonCreatureGroup = 107, // Group, Attackinvoker
SetPower = 108, // PowerType, newPower
AddPower = 109, // PowerType, newPower
RemovePower = 110, // PowerType, newPower
GameEventStop = 111, // GameEventId
GameEventStart = 112, // GameEventId
StartClosestWaypoint = 113, // wp1, wp2, wp3, wp4, wp5, wp6, wp7
MoveOffset = 114,
RandomSound = 115, // SoundId1, SoundId2, SoundId3, SoundId4, SoundId5, onlySelf
SetCorpseDelay = 116, // timer
DisableEvade = 117, // 0/1 (1 = disabled, 0 = enabled)
// 118 - 127 : 3.3.5 reserved
PlayAnimkit = 128,
ScenePlay = 129, // sceneId
SceneCancel = 130, // sceneId
End = 131
}
public enum SmartTargets
{
None = 0, // None, Defaulting To Invoket
Self = 1, // Self Cast
Victim = 2, // Our Current Target (Ie: Highest Aggro)
HostileSecondAggro = 3, // Second Highest Aggro
HostileLastAggro = 4, // Dead Last On Aggro
HostileRandom = 5, // Just Any Random Target On Our Threat List
HostileRandomNotTop = 6, // Any Random Target Except Top Threat
ActionInvoker = 7, // Unit Who Caused This Event To Occur
Position = 8, // Use Xyz From Event Params
CreatureRange = 9, // Creatureentry(0any), Mindist, Maxdist
CreatureGuid = 10, // Guid, Entry
CreatureDistance = 11, // Creatureentry(0any), Maxdist
Stored = 12, // Id, Uses Pre-Stored Target(List)
GameobjectRange = 13, // Entry(0any), Min, Max
GameobjectGuid = 14, // Guid, Entry
GameobjectDistance = 15, // Entry(0any), Maxdist
InvokerParty = 16, // Invoker'S Party Members
PlayerRange = 17, // Min, Max
PlayerDistance = 18, // Maxdist
ClosestCreature = 19, // Creatureentry(0any), Maxdist, Dead?
ClosestGameobject = 20, // Entry(0any), Maxdist
ClosestPlayer = 21, // Maxdist
ActionInvokerVehicle = 22, // Unit'S Vehicle Who Caused This Event To Occur
OwnerOrSummoner = 23, // Unit'S Owner Or Summoner
ThreatList = 24, // All Units On Creature'S Threat List
ClosestEnemy = 25, // maxDist, playerOnly
ClosestFriendly = 26, // maxDist, playerOnly
LootRecipients = 27, // all players that have tagged this creature (for kill credit)
Farthest = 28, // maxDist, playerOnly, isInLos
VehicleAccessory = 29, // seat number (vehicle can target it's own accessory)
End = 30
}
}
+246
View File
@@ -0,0 +1,246 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public struct SkillConst
{
public const int MaxPlayerSkills = 128;
public const uint MaxSkillStep = 15;
}
public enum SkillType
{
None = 0,
Swords = 43,
Axes = 44,
Bows = 45,
Guns = 46,
Maces = 54,
TwoHandedSwords = 55,
Defense = 95,
LangCommon = 98,
RacialDwarf = 101,
LangOrcish = 109,
LangDwarven = 111,
LangDarnassian = 113,
LangTaurahe = 115,
DualWield = 118,
RacialTauren = 124,
RacialOrc = 125,
RacialNightElf = 126,
FirstAid = 129,
Staves = 136,
LangThalassian = 137,
LangDraconic = 138,
LangDemonTongue = 139,
LangTitan = 140,
LangOldTongue = 141,
Survival = 142,
HorseRiding = 148,
WolfRiding = 149,
TigerRiding = 150,
RamRiding = 152,
Swimming = 155,
TwoHandedMaces = 160,
Unarmed = 162,
Blacksmithing = 164,
Leatherworking = 165,
Alchemy = 171,
TwoHandedAxes = 172,
Daggers = 173,
Herbalism = 182,
GenericDnd = 183,
Cooking = 185,
Mining = 186,
PetImp = 188,
PetFelhunter = 189,
Tailoring = 197,
Engineering = 202,
PetSpider = 203,
PetVoidwalker = 204,
PetSuccubus = 205,
PetInfernal = 206,
PetDoomguard = 207,
PetWolf = 208,
PetCat = 209,
PetBear = 210,
PetBoar = 211,
PetCrocolisk = 212,
PetCarrionBird = 213,
PetCrab = 214,
PetGorilla = 215,
PetRaptor = 217,
PetTallstrider = 218,
RacialUndead = 220,
Crossbows = 226,
Wands = 228,
Polearms = 229,
PetScorpid = 236,
PetTurtle = 251,
PetGenericHunter = 270,
PlateMail = 293,
LangGnomish = 313,
LangTroll = 315,
Enchanting = 333,
Fishing = 356,
Skinning = 393,
Mail = 413,
Leather = 414,
Cloth = 415,
Shield = 433,
FistWeapons = 473,
RaptorRiding = 533,
MechanostriderPiloting = 553,
UndeadHorsemanship = 554,
PetBat = 653,
PetHyena = 654,
PetBirdOfPrey = 655,
PetWindSerpent = 656,
LangForsaken = 673,
KodoRiding = 713,
RacialTroll = 733,
RacialGnome = 753,
RacialHuman = 754,
Jewelcrafting = 755,
RacialBloodElf = 756,
PetEventRemoteControl = 758,
LangDraenei = 759,
RacialDraenei = 760,
PetFelguard = 761,
Riding = 762,
PetDragonhawk = 763,
PetNetherRay = 764,
PetSporebat = 765,
PetWarpStalker = 766,
PetRavager = 767,
PetSerpent = 768,
Internal = 769,
Inscription = 773,
PetMoth = 775,
Mounts = 777,
Companions = 778,
PetExoticChimaera = 780,
PetExoticDevilsaur = 781,
PetGhoul = 782,
PetExoticSilithid = 783,
PetExoticWorm = 784,
PetWasp = 785,
PetExoticClefthoof = 786,
PetExoticCoreHound = 787,
PetExoticSpiritBeast = 788,
RacialWorgen = 789,
RacialGoblin = 790,
LangGilnean = 791,
LangGoblin = 792,
Archaeology = 794,
Hunter = 795,
DeathKnight = 796,
Druid = 798,
Paladin = 800,
Priest = 804,
PetWaterElemental = 805,
PetFox = 808,
AllGlyphs = 810,
PetDog = 811,
PetMonkey = 815,
PetShaleSpider = 817,
Beetle = 818,
AllGuildPerks = 821,
PetHydra = 824,
Monk = 829,
Warrior = 840,
Warlock = 849,
RacialPandaren = 899,
Mage = 904,
LangPandarenNeutral = 905,
LangPandarenAlliance = 906,
LangPandarenHorde = 907,
Rogue = 921,
Shaman = 924,
FelImp = 927,
Voidlord = 928,
Shivarra = 929,
Observer = 930,
Wrathguard = 931,
AllSpecializations = 934,
Runeforging = 960,
PetPrimalFireElemental = 962,
PetPrimalEarthElemental = 963,
WayOfTheGrill = 975,
WayOfTheWok = 976,
WayOfThePot = 977,
WayOfTheSteamer = 978,
WayOfTheOven = 979,
WayOfTheBrew = 980,
ApprenticeCooking = 981,
JourneymanCookbook = 982,
Porcupine = 983,
Crane = 984,
WaterStrider = 985,
PetExoticQuilen = 986,
PetGoat = 987,
Basilisk = 988,
NoPlayers = 999,
Direhorn = 1305,
PetPrimalStormElemental = 1748,
PetWaterElementalMinorTalentVersion = 1777,
PetExoticRylak = 1818,
PetRiverbeast = 1819,
Unused = 1830,
DemonHunter = 1848,
Logging = 1945,
PetTerrorguard = 1981,
PetAbyssal = 1982,
PetStag = 1993,
TradingPost = 2000,
Warglaives = 2152,
PetMechanical = 2189,
PetAbomination = 2216,
}
public enum SkillState
{
Unchanged = 0,
Changed = 1,
New = 2,
Deleted = 3
}
public enum SkillCategory : byte
{
Unk = 0,
Attributes = 5,
Weapon = 6,
Class = 7,
Armor = 8,
Secondary = 9,
Languages = 10,
Profession = 11,
Generic = 12
}
public enum SkillRangeType
{
Language, // 300..300
Level, // 1..max skill for level
Mono, // 1..1, grey monolite bar
Rank, // 1..skill for known rank
None // 0..0 always
}
}
@@ -0,0 +1,565 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum AuraType
{
Any = -1,
None = 0,
BindSight = 1,
ModPossess = 2,
PeriodicDamage = 3,
Dummy = 4,
ModConfuse = 5,
ModCharm = 6,
ModFear = 7,
PeriodicHeal = 8,
ModAttackspeed = 9,
ModThreat = 10,
ModTaunt = 11,
ModStun = 12,
ModDamageDone = 13,
ModDamageTaken = 14,
DamageShield = 15,
ModStealth = 16,
ModStealthDetect = 17,
ModInvisibility = 18,
ModInvisibilityDetect = 19,
ObsModHealth = 20, // 20, 21 Unofficial
ObsModPower = 21,
ModResistance = 22,
PeriodicTriggerSpell = 23,
PeriodicEnergize = 24,
ModPacify = 25,
ModRoot = 26,
ModSilence = 27,
ReflectSpells = 28,
ModStat = 29,
ModSkill = 30,
ModIncreaseSpeed = 31,
ModIncreaseMountedSpeed = 32,
ModDecreaseSpeed = 33,
ModIncreaseHealth = 34,
ModIncreaseEnergy = 35,
ModShapeshift = 36,
EffectImmunity = 37,
StateImmunity = 38,
SchoolImmunity = 39,
DamageImmunity = 40,
DispelImmunity = 41,
ProcTriggerSpell = 42,
ProcTriggerDamage = 43,
TrackCreatures = 44,
TrackResources = 45,
Unk46 = 46, // Ignore All Gear Test Spells
ModParryPercent = 47,
Unk48 = 48, // One Periodic Spell
ModDodgePercent = 49,
ModCriticalHealingAmount = 50,
ModBlockPercent = 51,
ModWeaponCritPercent = 52,
PeriodicLeech = 53,
ModHitChance = 54,
ModSpellHitChance = 55,
Transform = 56,
ModSpellCritChance = 57,
ModIncreaseSwimSpeed = 58,
ModDamageDoneCreature = 59,
ModPacifySilence = 60,
ModScale = 61,
PeriodicHealthFunnel = 62,
ModAdditionalPowerCost = 63, // NYI
PeriodicManaLeech = 64,
ModCastingSpeedNotStack = 65,
FeignDeath = 66,
ModDisarm = 67,
ModStalked = 68,
SchoolAbsorb = 69,
ExtraAttacks = 70,
Unk71 = 71,
ModPowerCostSchoolPct = 72,
ModPowerCostSchool = 73,
ReflectSpellsSchool = 74,
ModLanguage = 75,
FarSight = 76,
MechanicImmunity = 77,
Mounted = 78,
ModDamagePercentDone = 79,
ModPercentStat = 80,
SplitDamagePct = 81,
WaterBreathing = 82,
ModBaseResistance = 83,
ModRegen = 84,
ModPowerRegen = 85,
ChannelDeathItem = 86,
ModDamagePercentTaken = 87,
ModHealthRegenPercent = 88,
PeriodicDamagePercent = 89,
Unk90 = 90, // Old ModResistChance
ModDetectRange = 91,
PreventsFleeing = 92,
ModUnattackable = 93,
InterruptRegen = 94,
Ghost = 95,
SpellMagnet = 96,
ManaShield = 97,
ModSkillTalent = 98,
ModAttackPower = 99,
AurasVisible = 100,
ModResistancePct = 101,
ModMeleeAttackPowerVersus = 102,
ModTotalThreat = 103,
WaterWalk = 104,
FeatherFall = 105,
Hover = 106,
AddFlatModifier = 107,
AddPctModifier = 108,
AddTargetTrigger = 109,
ModPowerRegenPercent = 110,
AddCasterHitTrigger = 111,
OverrideClassScripts = 112,
ModRangedDamageTaken = 113,
ModRangedDamageTakenPct = 114,
ModHealing = 115,
ModRegenDuringCombat = 116,
ModMechanicResistance = 117,
ModHealingPct = 118,
Unk119 = 119, // Old SharePetTracking
Untrackable = 120,
Empathy = 121,
ModOffhandDamagePct = 122,
ModTargetResistance = 123,
ModRangedAttackPower = 124,
ModMeleeDamageTaken = 125,
ModMeleeDamageTakenPct = 126,
RangedAttackPowerAttackerBonus = 127,
ModPossessPet = 128,
ModSpeedAlways = 129,
ModMountedSpeedAlways = 130,
ModRangedAttackPowerVersus = 131,
ModIncreaseEnergyPercent = 132,
ModIncreaseHealthPercent = 133,
ModManaRegenInterrupt = 134,
ModHealingDone = 135,
ModHealingDonePercent = 136,
ModTotalStatPercentage = 137,
ModMeleeHaste = 138,
ForceReaction = 139,
ModRangedHaste = 140,
Unk141 = 141, // Old ModRangedAmmoHaste, Unused Now
ModBaseResistancePct = 142,
ModRecoveryRate = 143, // NYI
SafeFall = 144,
ModPetTalentPoints = 145,
AllowTamePetType = 146,
MechanicImmunityMask = 147,
RetainComboPoints = 148,
ReducePushback = 149, // Reduce Pushback
ModShieldBlockvaluePct = 150,
TrackStealthed = 151, // Track Stealthed
ModDetectedRange = 152, // Mod Detected Range
Unk153 = 153, // Old SplitDamageFlat. Unused 4.3.4
ModStealthLevel = 154, // Stealth Level Modifier
ModWaterBreathing = 155, // Mod Water Breathing
ModReputationGain = 156, // Mod Reputation Gain
PetDamageMulti = 157, // Mod Pet Damage
ModShieldBlockvalue = 158,
NoPvpCredit = 159,
Unk160 = 160, // Old ModAoeAvoidance. Unused 4.3.4
ModHealthRegenInCombat = 161,
PowerBurn = 162,
ModCritDamageBonus = 163,
Unk164 = 164,
MeleeAttackPowerAttackerBonus = 165,
ModAttackPowerPct = 166,
ModRangedAttackPowerPct = 167,
ModDamageDoneVersus = 168,
Unk169 = 169, // Old ModCritPercentVersus. Unused 4.3.4
DetectAmore = 170,
ModSpeedNotStack = 171,
ModMountedSpeedNotStack = 172,
ModRecoveryRate2 = 173, // NYI
ModSpellDamageOfStatPercent = 174, // By Defeult Intelect, Dependent From ModSpellHealingOfStatPercent
ModSpellHealingOfStatPercent = 175,
SpiritOfRedemption = 176,
AoeCharm = 177,
ModMaxPowerPct = 178, // NYI
ModPowerDisplay = 179,
ModFlatSpellDamageVersus = 180,
Unk181 = 181, // Old ModFlatSpellCritDamageVersus - Possible Flat Spell Crit Damage Versus
ModResistanceOfStatPercent = 182,
ModCriticalThreat = 183,
ModAttackerMeleeHitChance = 184,
ModAttackerRangedHitChance = 185,
ModAttackerSpellHitChance = 186,
ModAttackerMeleeCritChance = 187,
ModAttackerRangedCritChance = 188,
ModRating = 189,
ModFactionReputationGain = 190,
UseNormalMovementSpeed = 191,
ModMeleeRangedHaste = 192,
MeleeSlow = 193,
ModTargetAbsorbSchool = 194,
ModTargetAbilityAbsorbSchool = 195,
ModCooldown = 196, // Only 24818 Noxious Breath
ModAttackerSpellAndWeaponCritChance = 197,
Unk198 = 198, // Old ModAllWeaponSkills
Unk199 = 199, // Old ModIncreasesSpellPctToHit. Unused 4.3.4
ModXpPct = 200,
Fly = 201,
IgnoreCombatResult = 202,
ModAttackerMeleeCritDamage = 203,
ModAttackerRangedCritDamage = 204,
ModChargeCooldown = 205, // NYI
ModIncreaseVehicleFlightSpeed = 206,
ModIncreaseMountedFlightSpeed = 207,
ModIncreaseFlightSpeed = 208,
ModMountedFlightSpeedAlways = 209,
ModVehicleSpeedAlways = 210,
ModFlightSpeedNotStack = 211,
ModHonorGainPct = 212,
ModRageFromDamageDealt = 213,
Unk214 = 214,
ArenaPreparation = 215,
HasteSpells = 216,
ModMeleeHaste2 = 217,
Unk218 = 218, // old SPELL_AURA_HASTE_RANGED
ModManaRegenFromStat = 219,
ModRatingFromStat = 220,
ModDetaunt = 221,
Unk222 = 222,
RaidProcFromCharge = 223,
Unk224 = 224,
RaidProcFromChargeWithValue = 225,
PeriodicDummy = 226,
PeriodicTriggerSpellWithValue = 227,
DetectStealth = 228,
ModAoeDamageAvoidance = 229,
ModMaxHealth = 230,
ProcTriggerSpellWithValue = 231,
MechanicDurationMod = 232,
ChangeModelForAllHumanoids = 233, // Client-Side Only
MechanicDurationModNotStack = 234,
ModDispelResist = 235,
ControlVehicle = 236,
ModSpellDamageOfAttackPower = 237,
ModSpellHealingOfAttackPower = 238,
ModScale2 = 239,
ModExpertise = 240,
ForceMoveForward = 241,
ModSpellDamageFromHealing = 242,
ModFaction = 243,
ComprehendLanguage = 244,
ModAuraDurationByDispel = 245,
ModAuraDurationByDispelNotStack = 246,
CloneCaster = 247,
ModCombatResultChance = 248,
ConvertRune = 249,
ModIncreaseHealth2 = 250,
ModEnemyDodge = 251,
ModSpeedSlowAll = 252,
ModBlockCritChance = 253,
ModDisarmOffhand = 254,
ModMechanicDamageTakenPercent = 255,
NoReagentUse = 256,
ModTargetResistBySpellClass = 257,
OverrideSummonedObject = 258,
Unk259 = 259, // Old ModHotPct, Unused 4.3.4
ScreenEffect = 260,
Phase = 261,
AbilityIgnoreAurastate = 262,
AllowOnlyAbility = 263,
Unk264 = 264,
Unk265 = 265,
Unk266 = 266,
ModImmuneAuraApplySchool = 267,
Unk268 = 268, // Old ModAttackPowerOfStatPercent. Unused 4.3.4
ModIgnoreTargetResist = 269,
ModSchoolMaskDamageFromCaster = 270, // NYI
ModSpellDamageFromCaster = 271,
IgnoreMeleeReset = 272,
XRay = 273,
Unk274 = 274, // Old AbilityConsumeNoAmmo, Unused 4.3.4
ModIgnoreShapeshift = 275,
ModDamageDoneForMechanic = 276,
Unk277 = 277, // Old ModMaxAffectedTargets. Unused 4.3.4
ModDisarmRanged = 278,
InitializeImages = 279,
Unk280 = 280, // Old ModArmorPenetrationPct Unused 4.3.4
ModGuildReputationGainPct = 281, // NYI
ModBaseHealthPct = 282,
ModHealingReceived = 283, // Possibly Only For Some Spell Family Class Spells
Linked = 284,
ModAttackPowerOfArmor = 285,
AbilityPeriodicCrit = 286,
DeflectSpells = 287,
IgnoreHitDirection = 288,
PreventDurabilityLoss = 289,
ModCritPct = 290,
ModXpQuestPct = 291,
OpenStable = 292,
OverrideSpells = 293,
PreventRegeneratePower = 294,
Unk295 = 295,
SetVehicleId = 296,
BlockSpellFamily = 297,
Strangulate = 298,
Unk299 = 299,
ShareDamagePct = 300,
SchoolHealAbsorb = 301,
Unk302 = 302,
ModDamageDoneVersusAurastate = 303,
ModFakeInebriate = 304,
ModMinimumSpeed = 305,
Unk306 = 306,
HealAbsorbTest = 307,
ModCritChanceForCaster = 308,
ModResilience = 309, // NYI
ModCreatureAoeDamageAvoidance = 310,
Unk311 = 311,
AnimReplacementSet = 312,
Unk313 = 313, // Not Used In 4.3.4 - Related To Mounts
PreventResurrection = 314,
UnderwaterWalking = 315,
PeriodicHaste = 316, // Not Used In 4.3.4 (Name From 3.3.5a)
ModSpellPowerPct = 317,
Mastery = 318,
ModMeleeHaste3 = 319,
ModRangedHaste2 = 320,
ModNoActions = 321,
InterfereTargetting = 322,
Unk323 = 323, // Not Used In 4.3.4
Unk324 = 324, // Spell Critical Chance (Probably By School Mask)
Unk325 = 325, // Not Used In 4.3.4
PhaseGroup = 326, // Phase Related
Unk327 = 327, // Not Used In 4.3.4
ProcOnPowerAmount = 328,
ModPowerGainPct = 329, // Nyi
CastWhileWalking = 330,
ForceWeather = 331,
OverrideActionbarSpells = 332,
OverrideActionbarSpellsTriggered = 333, // Spells cast with this override have no cast time or power cost
ModBlind = 334, // Nyi
Unk335 = 335,
ModFlyingRestrictions = 336, // Nyi
ModVendorItemsPrices = 337,
ModDurabilityLoss = 338,
IncreaseSkillGainChance = 339, // Nyi
ModResurrectedHealthByGuildMember = 340, // Increases Health Gained When Resurrected By A Guild Member By X
ModSpellCategoryCooldown = 341,
ModMeleeRangedHaste2 = 342,
ModMeleeDamageFromCaster = 343,
ModAutoattackDamage = 344,
BypassArmorForCaster = 345,
EnableAltPower = 346, // Nyi
ModSpellCooldownByHaste = 347,
DepositBonusMoneyInGuildBankOnLoot = 348, // Nyi
ModCurrencyGain = 349,
ModGatheringItemsGainedPercent = 350, // Nyi
Unk351 = 351,
Unk352 = 352,
ModCamouflage = 353, // Nyi
Unk354 = 354, // Restoration Shaman Mastery - Mod Healing Based On Target'S Health (Less = More Healing)
ModCastingSpeed = 355, // NYI
Unk356 = 356, // Arcane Mage Mastery - Mod Damage Based On Current Mana
EnableBoss1UnitFrame = 357,
WorgenAlteredForm = 358,
Unk359 = 359,
ProcTriggerSpellCopy = 360, // Procs The Same Spell That Caused This Proc (Dragonwrath, Tarecgosa'S Rest)
OverrideAutoattackWithMeleeSpell = 361, // NYI
Unk362 = 362, // Not Used In 4.3.4
ModNextSpell = 363, // Used By 101601 Throw Totem - Causes The Client To Initialize Spell Cast With Specified Spell
Unk364 = 364, // Not Used In 4.3.4
MaxFarClipPlane = 365, // Overrides Client'S View Distance Setting To Max("Fair", CurrentSetting) And Turns Off Terrain Display
OverrideSpellPowerByApPct = 366, // Sets Spellpower Equal To % Of Attack Power, Discarding All Other Bonuses (From Gear And Buffs)
OverrideAutoattackWithRangedSpell = 367, // NYI
Unk368 = 368, // Not Used In 4.3.4
EnablePowerBarTimer = 369,
SetFairFarClip = 370, // Overrides Client'S View Distance Setting To Max("Fair", CurrentSetting)
Unk371 = 371,
Unk372 = 372,
ModSpeedNoControl = 373, // NYI
ModifyFallDamagePct = 374,
Unk375 = 375,
ModCurrencyGainFromSource = 376, // NYI
CastWhileWalking2 = 377, // NYI
Unk378 = 378,
Unk379 = 379,
ModGlobalCooldownByHaste = 380, // Allows melee abilities to benefit from haste GCD reduction
Unk381 = 381,
ModPetStatPct = 382, // NYI
IgnoreSpellCooldown = 383,
Unk384 = 384,
ChanceOverrideAutoattackWithSpellOnSelf = 385,// NYI (with triggered spell cast by the initial caster?)
Unk386 = 386,
Unk387 = 387,
ModTaxiFlightSpeed = 388,
Unk389 = 389,
Unk390 = 390,
Unk391 = 391,
Unk392 = 392,
Unk393 = 393,
ShowConfirmationPrompt = 394,
AreaTrigger = 395, // NYI
ProcOnPowerAmount2 = 396,
Unk397 = 397,
Unk398 = 398,
Unk399 = 399,
ModSkill2 = 400,
Unk401 = 401,
ModOverridePowerDisplay = 402,
OverrideSpellVisual = 403,
OverrideAttackPowerBySpPct = 404,
ModRatingPct = 405, // NYI
KeyboundOverride = 406, // NYI
ModFear2 = 407,
Unk408 = 408,
CanTurnWhileFalling = 409,
Unk410 = 410,
ModMaxCharges = 411,
Unk412 = 412,
Unk413 = 413,
Unk414 = 414,
Unk415 = 415,
ModCooldownByHasteRegen = 416,
ModGlobalCooldownByHasteRegen = 417,
ModMaxPower = 418, // NYI
ModBaseManaPct = 419,
ModBattlePetXpPct = 420,
ModAbsorbEffectsAmountPct = 421, // NYI
Unk422 = 422,
Unk423 = 423,
Unk424 = 424,
Unk425 = 425,
Unk426 = 426,
ScalePlayerLevel = 427, // NYI
Unk428 = 428,
Unk429 = 429,
PlayScene = 430,
ModOverrideZonePvpType = 431, // NYI
Unk432 = 432,
Unk433 = 433,
Unk434 = 434,
Unk435 = 435,
ModEnvironmentalDamageTaken = 436, // NYI
ModMinimumSpeedRate = 437,
PreloadPhase = 438, // NYI
Unk439 = 439,
ModMultistrikeDamage = 440, // NYI
ModMultistrikeChance = 441, // NYI
ModReadiness = 442, // NYI
ModLeech = 443, // NYI
Unk444 = 444,
Unk445 = 445,
Unk446 = 446,
ModXpFromCreatureType = 447,
Unk448 = 448,
Unk449 = 449,
Unk450 = 450,
OverridePetSpecs = 451,
Unk452 = 452,
ChargeRecoveryMod = 453,
ChargeRecoveryMultiplier = 454,
ModRoot2 = 455,
ChargeRecoveryAffectedByHaste = 456,
ChargeRecoveryAffectedByHasteRegen = 457,
IgnoreDualWieldHitPenalty = 458,
IgnoreMovementForces = 459,
ResetCooldownsOnDuelStart = 460,
Unk461 = 461,
ModHealingAndAbsorbFromCaster = 462, // NYI
ConvertCritRatingPctToParryRating = 463, // NYI
ModAttackPowerOfBonusArmor = 464, // NYI
ModBonusArmor = 465, // NYI
ModBonusArmorPct = 466,
ModStatBonusPct = 467,
TriggerSpellOnHealthBelowPct = 468,
ShowConfirmationPromptWithDifficulty = 469,
Unk470 = 470,
ModVersatility = 471, // NYI
Unk472 = 472,
PreventDurabilityLossFromCombat = 473,
Unk474 = 474,
AllowUsingGameobjectsWhileMounted = 475,
ModCurrencyGainLooted = 476,
Unk477 = 477,
Unk478 = 478,
Unk479 = 479,
Unk480 = 480,
ConvertConsumedRune = 481,
Unk482 = 482,
SuppressTransforms = 483, // NYI
Unk484 = 484,
Unk485 = 485,
Unk486 = 486,
Unk487 = 487,
Unk488 = 488,
Unk489 = 489,
Unk490 = 490,
Unk491 = 491,
Total = 492
}
public enum AuraEffectHandleModes
{
Default = 0x0,
Real = 0x01, // Handler Applies/Removes Effect From Unit
SendForClient = 0x02, // Handler Sends Apply/Remove Packet To Unit
ChangeAmount = 0x04, // Handler Updates Effect On Target After Effect Amount Change
Reapply = 0x08, // Handler Updates Effect On Target After Aura Is Reapplied On Target
Stat = 0x10, // Handler Updates Effect On Target When Stat Removal/Apply Is Needed For Calculations By Core
Skill = 0x20, // Handler Updates Effect On Target When Skill Removal/Apply Is Needed For Calculations By Core
SendForClientMask = (SendForClient | Real), // Any Case Handler Need To Send Packet
ChangeAmountMask = (ChangeAmount | Real), // Any Case Handler Applies Effect Depending On Amount
ChangeAmountSendForClientMask = (ChangeAmountMask | SendForClientMask),
RealOrReapplyMask = (Reapply | Real)
}
// Diminishing Returns Types
public enum DiminishingReturnsType
{
None = 0, // this spell is not diminished, but may have its duration limited
Player = 1, // this spell is diminished only when applied on players
All = 2 // this spell is diminished in every case
}
// Diminishing Return Groups
public enum DiminishingGroup
{
None = 0,
Root = 1,
Stun = 2,
Incapacitate = 3,
Disorient = 4,
Silence = 5,
AOEKnockback = 6,
Taunt = 7,
LimitOnly = 8,
}
public enum DiminishingLevels
{
Level1 = 0,
Level2 = 1,
Level3 = 2,
Immune = 3,
Level4 = 3,
TauntImmune = 4
}
}
File diff suppressed because it is too large Load Diff
+42
View File
@@ -0,0 +1,42 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum GMTicketSystemStatus
{
Disabled = 0,
Enabled = 1
}
public enum GMSupportComplaintType
{
None = 0,
Language = 2,
PlayerName = 4,
Cheat = 15,
GuildName = 23,
Spamming = 24
}
public enum SupportSpamType
{
Mail = 0,
Chat = 1,
Calendar = 2
}
}
+577
View File
@@ -0,0 +1,577 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum VehicleSeatFlags : uint
{
HasLowerAnimForEnter = 0x01,
HasLowerAnimForRide = 0x02,
Unk3 = 0x04,
ShouldUseVehSeatExitAnimOnVoluntaryExit = 0x08,
Unk5 = 0x10,
Unk6 = 0x20,
Unk7 = 0x40,
Unk8 = 0x80,
Unk9 = 0x100,
HidePassenger = 0x200, // Passenger Is Hidden
AllowTurning = 0x400, // Needed For CgcameraSyncfreelookfacing
CanControl = 0x800, // LuaUnitinvehiclecontrolseat
CanCastMountSpell = 0x1000, // Can Cast Spells With SpellAuraMounted From Seat (Possibly 4.X Only, 0 Seats On 3.3.5a)
Uncontrolled = 0x2000, // Can Override !& CanEnterOrExit
CanAttack = 0x4000, // Can Attack, Cast Spells And Use Items From Vehicle
ShouldUseVehSeatExitAnimOnForcedExit = 0x8000,
Unk17 = 0x10000,
Unk18 = 0x20000, // Needs Research And Support (28 Vehicles): Allow Entering Vehicles While Keeping Specific Permanent(?) Auras That Impose Visuals (States Like Beeing Under Freeze/Stun Mechanic, Emote State Animations).
HasVehExitAnimVoluntaryExit = 0x40000,
HasVehExitAnimForcedExit = 0x80000,
PassengerNotSelectable = 0x100000,
Unk22 = 0x200000,
RecHasVehicleEnterAnim = 0x400000,
IsUsingVehicleControls = 0x800000, // LuaIsusingvehiclecontrols
EnableVehicleZoom = 0x1000000,
CanEnterOrExit = 0x2000000, // LuaCanexitvehicle - Can Enter And Exit At Free Will
CanSwitch = 0x4000000, // LuaCanswitchvehicleseats
HasStartWaritingForVehTransitionAnimEnter = 0x8000000,
HasStartWaritingForVehTransitionAnimExit = 0x10000000,
CanCast = 0x20000000, // LuaUnithasvehicleui
Unk2 = 0x40000000, // Checked In Conjunction With 0x800 In Castspell2
AllowsInteraction = 0x80000000
}
public enum VehicleSeatFlagsB : uint
{
None = 0x00,
UsableForced = 0x02,
TargetsInRaidUi = 0x08, // Lua_Unittargetsvehicleinraidui
Ejectable = 0x20, // Ejectable
UsableForced2 = 0x40,
UsableForced3 = 0x100,
KeepPet = 0x20000,
UsableForced4 = 0x02000000,
CanSwitch = 0x4000000,
VehiclePlayerframeUi = 0x80000000 // Lua_Unithasvehicleplayerframeui - Actually Checked For Flagsb &~ 0x80000000
}
public enum SpellClickCastFlags
{
CasterClicker = 0x01,
TargetClicker = 0x02,
OrigCasterOwner = 0x04
}
public enum SummonSlot
{
Pet = 0,
Totem = 1,
MiniPet = 5,
Quest = 6,
}
public enum PlayerTotemType
{
Fire = 63,
Earth = 81,
Water = 82,
Air = 83
}
public enum BaseModType
{
FlatMod,
PCTmod,
End
}
//To all Immune system, if target has immunes,
//some spell that related to ImmuneToDispel or ImmuneToSchool or ImmuneToDamage type can't cast to it,
//some spell_effects that related to ImmuneToEffect<effect>(only this effect in the spell) can't cast to it,
//some aura(related to Mechanics or ImmuneToState<aura>) can't apply to it.
public enum SpellImmunity
{
Effect = 0, // enum SpellEffects
State = 1, // enum AuraType
School = 2, // enum SpellSchoolMask
Damage = 3, // enum SpellSchoolMask
Dispel = 4, // enum DispelType
Mechanic = 5, // enum Mechanics
Id = 6,
Max = 7
}
public enum BaseModGroup
{
CritPercentage,
RangedCritPercentage,
OffhandCritPercentage,
ShieldBlockValue,
End
}
public enum DamageEffectType
{
Direct = 0, // used for normal weapon damage (not for class abilities or spells)
SpellDirect = 1, // spell/class abilities damage
DOT = 2,
Heal = 3,
NoDamage = 4, // used also in case when damage applied to health but not applied to spell channelInterruptFlags/etc
Self = 5
}
public enum WeaponDamageRange
{
MinDamage,
MaxDamage
}
public enum UnitMods
{
StatStrength, // STAT_STRENGTH..UNIT_MOD_STAT_INTELLECT must be in existed order, it's accessed by index values of Stats enum.
StatAgility,
StatStamina,
StatIntellect,
Health,
Mana, // MANA..RUNIC_POWER must be in existed order, it's accessed by index values of Powers enum.
Rage,
Focus,
Energy,
Unused, // Old HAPPINESS
Rune,
RunicPower,
SoulShards,
Eclipse,
HolyPower,
Alternative,
Maelstrom,
Chi,
Insanity,
BurningEmbers,
DemonicFury,
ArcaneCharges,
Fury,
Pain,
Armor, // ARMOR..RESISTANCE_ARCANE must be in existed order, it's accessed by index values of SpellSchools enum.
ResistanceHoly,
ResistanceFire,
ResistanceNature,
ResistanceFrost,
ResistanceShadow,
ResistanceArcane,
AttackPower,
AttackPowerRanged,
DamageMainHand,
DamageOffHand,
DamageRanged,
End,
// synonyms
StatStart = StatStrength,
StatEnd = StatIntellect + 1,
ResistanceStart = Armor,
ResistanceEnd = ResistanceArcane + 1,
PowerStart = Mana,
PowerEnd = Pain + 1
}
public enum UnitModifierType
{
BaseValue = 0,
BasePCTExcludeCreate = 1, // percent modifier affecting all stat values from auras and gear but not player base for level
BasePCT = 2,
TotalValue = 3,
TotalPCT = 4,
End = 5
}
public enum VictimState
{
Intact = 0, // set when attacker misses
Hit = 1, // victim got clear/blocked hit
Dodge = 2,
Parry = 3,
Imterrupt = 4,
Blocks = 5, // unused? not set when blocked, even on full block
Evades = 6,
Immune = 7,
Deflects = 8
}
public enum HitInfo
{
NormalSwing = 0x0,
Unk1 = 0x01, // req correct packet structure
AffectsVictim = 0x02,
OffHand = 0x04,
Unk2 = 0x08,
Miss = 0x10,
FullAbsorb = 0x20,
PartialAbsorb = 0x40,
FullResist = 0x80,
PartialResist = 0x100,
CriticalHit = 0x200, // critical hit
Unk10 = 0x400,
Unk11 = 0x800,
Unk12 = 0x1000,
Block = 0x2000, // blocked damage
Unk14 = 0x4000, // set only if meleespellid is present// no world text when victim is hit for 0 dmg(HideWorldTextForNoDamage?)
Unk15 = 0x8000, // player victim?// something related to blod sprut visual (BloodSpurtInBack?)
Glancing = 0x10000,
Crushing = 0x20000,
NoAnimation = 0x40000,
Unk19 = 0x80000,
Unk20 = 0x100000,
SwingNoHitSound = 0x200000, // unused?
Unk22 = 0x00400000,
RageGain = 0x800000,
FakeDamage = 0x1000000 // enables damage animation even if no damage done, set only if no damage
}
public enum ReactStates
{
Passive = 0,
Defensive = 1,
Aggressive = 2,
Assist = 3
}
/// <summary>
/// UnitStandStateType
/// </summary>
public enum UnitStandStateType
{
Stand = 0,
Sit = 1,
SitChair = 2,
Sleep = 3,
SitLowChair = 4,
SitMediumChair = 5,
SitHighChair = 6,
Dead = 7,
Kneel = 8,
Submerged = 9
}
public struct UnitBytes0Offsets
{
public const byte Race = 0;
public const byte Class = 1;
public const byte PlayerClass = 2;
public const byte Gender = 3;
}
public struct UnitBytes1Offsets
{
public const byte StandState = 0;
public const byte PetTalents = 1; // unused
public const byte VisFlag = 2;
public const byte AnimTier = 3;
}
public enum UnitStandFlags
{
Unk1 = 0x01,
Creep = 0x02,
Untrackable = 0x04,
Unk4 = 0x08,
Unk5 = 0x10,
All = 0xFF
}
public enum UnitBytes1Flags
{
AlwaysStand = 0x01,
Hover = 0x02,
Unk3 = 0x04,
All = 0xFF
}
public struct UnitBytes2Offsets
{
public const byte SheathState = 0;
public const byte PvpFlag = 1;
public const byte PetFlags = 2;
public const byte ShapeshiftForm = 3;
}
public enum UnitBytes2Flags
{
PvP = 0x01,
Unk1 = 0x02,
FFAPvp = 0x04,
Sanctuary = 0x08,
Unk4 = 0x10,
Unk5 = 0x20,
Unk6 = 0x40,
Unk7 = 0x80,
}
public enum UnitPetFlags
{
CanBeRenamed = 0x01,
CanBeAbandoned = 0x02
}
/// <summary>
/// UnitFields.Bytes2, 3
/// </summary>
public enum ShapeShiftForm
{
None = 0,
CatForm = 1,
TreeOfLife = 2,
TravelForm = 3,
AquaticForm = 4,
BearForm = 5,
Ambient = 6,
Ghoul = 7,
DireBearForm = 8,
CraneStance = 9,
TharonjaSkeleton = 10,
DarkmoonTestOfStrength = 11,
BlbPlayer = 12,
ShadowDance = 13,
CreatureBear = 14,
CreatureCat = 15,
GhostWolf = 16,
BattleStance = 17,
DefensiveStance = 18,
BerserkerStance = 19,
SerpentStance = 20,
Zombie = 21,
Metamorphosis = 22,
OxStance = 23,
TigerStance = 24,
Undead = 25,
Frenzy = 26,
FlightFormEpic = 27,
Shadowform = 28,
FlightForm = 29,
Stealth = 30,
MoonkinForm = 31,
SpiritOfRedemption = 32,
GladiatorStance = 33
}
public enum ReactiveType
{
Defense = 0,
HunterParry = 1,
OverPower = 2,
Max = 3
}
public enum SpellValueMod
{
BasePoint0,
BasePoint1,
BasePoint2,
BasePoint3,
BasePoint4,
BasePoint5,
BasePoint6,
BasePoint7,
BasePoint8,
BasePoint9,
BasePoint10,
BasePoint11,
BasePoint12,
BasePoint13,
BasePoint14,
BasePoint15,
BasePoint16,
BasePoint17,
BasePoint18,
BasePoint19,
BasePoint20,
BasePoint21,
BasePoint22,
BasePoint23,
BasePoint24,
BasePoint25,
BasePoint26,
BasePoint27,
BasePoint28,
BasePoint29,
BasePoint30,
BasePoint31,
End,
RadiusMod,
MaxTargets,
AuraStack
}
public enum CombatRating
{
Amplify = 0,
DefenseSkill = 1,
Dodge = 2,
Parry = 3,
Block = 4,
HitMelee = 5,
HitRanged = 6,
HitSpell = 7,
CritMelee = 8,
CritRanged = 9,
CritSpell = 10,
Multistrike = 11,
Readiness = 12,
Speed = 13,
ResilienceCritTaken = 14,
ResiliencePlayerDamage = 15,
Lifesteal = 16,
HasteMelee = 17,
HasteRanged = 18,
HasteSpell = 19,
Avoidance = 20,
Studiness = 21,
Unused7 = 22,
Expertise = 23,
ArmorPenetration = 24,
Mastery = 25,
PvpPower = 26,
Cleave = 27,
VersatilityDamageDone = 28,
VersatilityHealingDone = 29,
VersatilityDamageTaken = 30,
Unused12 = 31,
Max = 32
}
public enum DeathState
{
Alive = 0,
JustDied = 1,
Corpse = 2,
Dead = 3,
JustRespawned = 4
}
public enum UnitState : uint
{
Died = 0x01, // Player Has Fake Death Aura
MeleeAttacking = 0x02, // Player Is Melee Attacking Someone
//Melee_Attack_By = 0x04, // Player Is Melee Attack By Someone
Stunned = 0x08,
Roaming = 0x10,
Chase = 0x20,
//Searching = 0x40,
Fleeing = 0x80,
InFlight = 0x100, // Player Is In Flight Mode
Follow = 0x200,
Root = 0x400,
Confused = 0x800,
Distracted = 0x1000,
Isolated = 0x2000, // Area Auras Do Not Affect Other Players
AttackPlayer = 0x4000,
Casting = 0x8000,
Possessed = 0x10000,
Charging = 0x20000,
Jumping = 0x40000,
//Onvehicle = 0x80000,
Move = 0x100000,
Rotating = 0x200000,
Evade = 0x400000,
RoamingMove = 0x800000,
ConfusedMove = 0x1000000,
FleeingMove = 0x2000000,
ChaseMove = 0x4000000,
FollowMove = 0x8000000,
IgnorePathfinding = 0x10000000,
Unattackable = InFlight,
// For Real Move Using Movegen Check And Stop (Except Unstoppable Flight)
Moving = RoamingMove | ConfusedMove | FleeingMove | ChaseMove | FollowMove,
Controlled = (Confused | Stunned | Fleeing),
LostControl = (Controlled | Jumping | Charging),
Sightless = (LostControl | Evade),
CannotAutoattack = (LostControl | Casting),
CannotTurn = (LostControl | Rotating),
// Stay By Different Reasons
NotMove = Root | Stunned | Died | Distracted,
AllState = 0xffffffff //(Stopped | Moving | In_Combat | In_Flight)
}
public enum UnitMoveType
{
Walk = 0,
Run = 1,
RunBack = 2,
Swim = 3,
SwimBack = 4,
TurnRate = 5,
Flight = 6,
FlightBack = 7,
PitchRate = 8,
Max = 9
}
public enum WeaponAttackType
{
BaseAttack = 0,
OffAttack = 1,
RangedAttack = 2,
Max
}
public enum UnitTypeMask
{
None = 0x0,
Summon = 0x01,
Minion = 0x02,
Guardian = 0x04,
Totem = 0x08,
Pet = 0x10,
Vehicle = 0x20,
Puppet = 0x40,
HunterPet = 0x80,
ControlableGuardian = 0x100,
Accessory = 0x200
}
public enum CurrentSpellTypes
{
Melee = 0,
Generic = 1,
Channeled = 2,
AutoRepeat = 3,
Max = 4
}
public enum SheathState
{
Unarmed = 0, // non prepared weapon
Melee = 1, // prepared melee weapon
Ranged = 2, // prepared ranged weapon
Max = 3
}
public enum MeleeHitOutcome
{
Evade,
Miss,
Dodge,
Block,
Parry,
Glancing,
Crit,
Crushing,
Normal
}
public enum UnitDynFlags
{
None = 0x00,
HideModel = 0x02, // Object model is not shown with this flag
Lootable = 0x04,
TrackUnit = 0x08,
Tapped = 0x10, // Lua_UnitIsTapped
SpecialInfo = 0x20,
Dead = 0x40,
ReferAFriend = 0x80
}
}
File diff suppressed because it is too large Load Diff
+411
View File
@@ -0,0 +1,411 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum ObjectFields
{
Guid = 0x000, // Size: 4, Flags: Public
Data = 0x004, // Size: 4, Flags: Public
Type = 0x008, // Size: 1, Flags: Public
Entry = 0x009, // Size: 1, Flags: Dynamic
DynamicFlags = 0x00a, // Size: 1, Flags: Dynamic, Urgent
ScaleX = 0x00b, // Size: 1, Flags: Public
End = 0x00c,
}
public enum ItemFields
{
Owner = ObjectFields.End + 0x000, // Size: 4, Flags: Public
Contained = ObjectFields.End + 0x004, // Size: 4, Flags: Public
Creator = ObjectFields.End + 0x008, // Size: 4, Flags: Public
GiftCreator = ObjectFields.End + 0x00c, // Size: 4, Flags: Public
StackCount = ObjectFields.End + 0x010, // Size: 1, Flags: Owner
Duration = ObjectFields.End + 0x011, // Size: 1, Flags: Owner
SpellCharges = ObjectFields.End + 0x012, // Size: 5, Flags: Owner
Flags = ObjectFields.End + 0x017, // Size: 1, Flags: Public
Enchantment = ObjectFields.End + 0x018, // Size: 39, Flags: Public
PropertySeed = ObjectFields.End + 0x03f, // Size: 1, Flags: Public
RandomPropertiesId = ObjectFields.End + 0x040, // Size: 1, Flags: Public
Durability = ObjectFields.End + 0x041, // Size: 1, Flags: Owner
MaxDurability = ObjectFields.End + 0x042, // Size: 1, Flags: Owner
CreatePlayedTime = ObjectFields.End + 0x043, // Size: 1, Flags: Public
ModifiersMask = ObjectFields.End + 0x044, // Size: 1, Flags: Owner
Context = ObjectFields.End + 0x045, // Size: 1, Flags: Public
ArtifactXp = ObjectFields.End + 0x046, // Size: 2, Flags: OWNER
AppearanceModId = ObjectFields.End + 0x048, // Size: 1, Flags: OWNER
End = ObjectFields.End + 0x049,
}
public enum ItemDynamicFields
{
Modifiers = 0x000, // Flags: Owner
BonusListIds = 0x001, // Flags: Owner, 0x100
ArtifactPowers = 0x002, // Flags: OWNER
Gems = 0x003, // Flags: OWNER
End = 0x004,
}
public enum ContainerFields
{
Slot1 = ItemFields.End + 0x000, // Size: 144, Flags: Public
NumSlots = ItemFields.End + 0x090, // Size: 1, Flags: Public
End = ItemFields.End + 0x091,
}
public enum UnitFields
{
Charm = ObjectFields.End + 0x000, // Size: 4, Flags: Public
Summon = ObjectFields.End + 0x004, // Size: 4, Flags: Public
Critter = ObjectFields.End + 0x008, // Size: 4, Flags: Private
CharmedBy = ObjectFields.End + 0x00c, // Size: 4, Flags: Public
SummonedBy = ObjectFields.End + 0x010, // Size: 4, Flags: Public
CreatedBy = ObjectFields.End + 0x014, // Size: 4, Flags: Public
DemonCreator = ObjectFields.End + 0x018, // Size: 4, Flags: Public
Target = ObjectFields.End + 0x01c, // Size: 4, Flags: Public
BattlePetCompanionGuid = ObjectFields.End + 0x020, // Size: 4, Flags: Public
BattlePetDbId = ObjectFields.End + 0x024, // Size: 2, Flags: Public
ChannelSpell = ObjectFields.End + 0x026, // Size: 1, Flags: Public, Urgent
ChannelSpellXSpellVisual = ObjectFields.End + 0x027, // Size: 1, Flags: Public, Urgent
SummonedByHomeRealm = ObjectFields.End + 0x028, // Size: 1, Flags: Public
Bytes0 = ObjectFields.End + 0x029, // Size: 1, Flags: Public
DisplayPower = ObjectFields.End + 0x02a, // Size: 1, Flags: Public
OverrideDisplayPowerId = ObjectFields.End + 0x02b, // Size: 1, Flags: Public
Health = ObjectFields.End + 0x02c, // Size: 2, Flags: Public
Power = ObjectFields.End + 0x02e, // Size: 6, Flags: Public, UrgentSelfOnly
MaxHealth = ObjectFields.End + 0x034, // Size: 2, Flags: Public
MaxPower = ObjectFields.End + 0x036, // Size: 6, Flags: Public
PowerRegenFlatModifier = ObjectFields.End + 0x03c, // Size: 6, Flags: Private, Owner, UnitAll
PowerRegenInterruptedFlatModifier = ObjectFields.End + 0x042, // Size: 6, Flags: Private, Owner, UnitAll
Level = ObjectFields.End + 0x048, // Size: 1, Flags: Public
EffectiveLevel = ObjectFields.End + 0x049, // Size: 1, Flags: Public
ScalingLevelMin = ObjectFields.End + 0x04a, // Size: 1, Flags: Public
ScalingLevelMax = ObjectFields.End + 0x04b, // Size: 1, Flags: Public
ScalingLevelDelta = ObjectFields.End + 0x04c, // Size: 1, Flags: Public
FactionTemplate = ObjectFields.End + 0x04d, // Size: 1, Flags: Public
VirtualItemSlotId = ObjectFields.End + 0x04e, // Size: 6, Flags: Public
Flags = ObjectFields.End + 0x054, // Size: 1, Flags: Public, Urgent
Flags2 = ObjectFields.End + 0x055, // Size: 1, Flags: Public, Urgent
Flags3 = ObjectFields.End + 0x056, // Size: 1, Flags: Public, Urgent
AuraState = ObjectFields.End + 0x057, // Size: 1, Flags: Public
BaseAttackTime = ObjectFields.End + 0x058, // Size: 2, Flags: Public
RangedAttackTime = ObjectFields.End + 0x05a, // Size: 1, Flags: Private
BoundingRadius = ObjectFields.End + 0x05b, // Size: 1, Flags: Public
CombatReach = ObjectFields.End + 0x05c, // Size: 1, Flags: Public
DisplayId = ObjectFields.End + 0x05d, // Size: 1, Flags: Dynamic, Urgent
NativeDisplayId = ObjectFields.End + 0x05e, // Size: 1, Flags: Public, Urgent
MountDisplayId = ObjectFields.End + 0x05f, // Size: 1, Flags: Public, Urgent
MinDamage = ObjectFields.End + 0x060, // Size: 1, Flags: Private, Owner, SpecialInfo
MaxDamage = ObjectFields.End + 0x061, // Size: 1, Flags: Private, Owner, SpecialInfo
MinOffHandDamage = ObjectFields.End + 0x062, // Size: 1, Flags: Private, Owner, SpecialInfo
MaxOffHandDamage = ObjectFields.End + 0x063, // Size: 1, Flags: Private, Owner, SpecialInfo
Bytes1 = ObjectFields.End + 0x064, // Size: 1, Flags: Public
PetNumber = ObjectFields.End + 0x065, // Size: 1, Flags: Public
PetNameTimestamp = ObjectFields.End + 0x066, // Size: 1, Flags: Public
PetExperience = ObjectFields.End + 0x067, // Size: 1, Flags: Owner
PetNextLevelExp = ObjectFields.End + 0x068, // Size: 1, Flags: Owner
ModCastSpeed = ObjectFields.End + 0x069, // Size: 1, Flags: Public
ModCastHaste = ObjectFields.End + 0x06a, // Size: 1, Flags: Public
ModHaste = ObjectFields.End + 0x06b, // Size: 1, Flags: Public
ModRangedHaste = ObjectFields.End + 0x06c, // Size: 1, Flags: Public
ModHasteRegen = ObjectFields.End + 0x06d, // Size: 1, Flags: Public
ModTimeRate = ObjectFields.End + 0x06e, // Size: 1, Flags: Public
CreatedBySpell = ObjectFields.End + 0x06f, // Size: 1, Flags: Public
NpcFlags = ObjectFields.End + 0x070, // Size: 2, Flags: Public, Dynamic
NpcEmotestate = ObjectFields.End + 0x072, // Size: 1, Flags: Public
Stat = ObjectFields.End + 0x073, // Size: 4, Flags: Private, Owner
PosStat = ObjectFields.End + 0x077, // Size: 4, Flags: Private, Owner
NegStat = ObjectFields.End + 0x07b, // Size: 4, Flags: Private, Owner
Resistances = ObjectFields.End + 0x07f, // Size: 7, Flags: Private, Owner, SpecialInfo
ResistanceBuffModsPositive = ObjectFields.End + 0x086, // Size: 7, Flags: Private, Owner
ResistanceBuffModsNegative = ObjectFields.End + 0x08d, // Size: 7, Flags: Private, Owner
ModBonusArmor = ObjectFields.End + 0x094, // Size: 1, Flags: Private, Owner
BaseMana = ObjectFields.End + 0x095, // Size: 1, Flags: Public
BaseHealth = ObjectFields.End + 0x096, // Size: 1, Flags: Private, Owner
Bytes2 = ObjectFields.End + 0x097, // Size: 1, Flags: Public
AttackPower = ObjectFields.End + 0x098, // Size: 1, Flags: Private, Owner
AttackPowerModPos = ObjectFields.End + 0x099, // Size: 1, Flags: Private, Owner
AttackPowerModNeg = ObjectFields.End + 0x09a, // Size: 1, Flags: Private, Owner
AttackPowerMultiplier = ObjectFields.End + 0x09b, // Size: 1, Flags: Private, Owner
RangedAttackPower = ObjectFields.End + 0x09c, // Size: 1, Flags: Private, Owner
RangedAttackPowerModPos = ObjectFields.End + 0x09d, // Size: 1, Flags: Private, Owner
RangedAttackPowerModNeg = ObjectFields.End + 0x09e, // Size: 1, Flags: Private, Owner
RangedAttackPowerMultiplier = ObjectFields.End + 0x09f, // Size: 1, Flags: Private, Owner
AttackSpeedAura = ObjectFields.End + 0x0a0, // Size: 1, Flags: Private, Owner
MinRangedDamage = ObjectFields.End + 0x0a1, // Size: 1, Flags: Private, Owner
MaxRangedDamage = ObjectFields.End + 0x0a2, // Size: 1, Flags: Private, Owner
PowerCostModifier = ObjectFields.End + 0x0a3, // Size: 7, Flags: Private, Owner
PowerCostMultiplier = ObjectFields.End + 0x0aa, // Size: 7, Flags: Private, Owner
Maxhealthmodifier = ObjectFields.End + 0x0b1, // Size: 1, Flags: Private, Owner
HoverHeight = ObjectFields.End + 0x0b2, // Size: 1, Flags: Public
MinItemLevelCutoff = ObjectFields.End + 0x0b3, // Size: 1, Flags: Public
MinItemLevel = ObjectFields.End + 0x0b4, // Size: 1, Flags: Public
Maxitemlevel = ObjectFields.End + 0x0b5, // Size: 1, Flags: Public
WildBattlepetLevel = ObjectFields.End + 0x0b6, // Size: 1, Flags: Public
BattlepetCompanionNameTimestamp = ObjectFields.End + 0x0b7, // Size: 1, Flags: Public
InteractSpellid = ObjectFields.End + 0x0b8, // Size: 1, Flags: Public
StateSpellVisualId = ObjectFields.End + 0x0b9, // Size: 1, Flags: Dynamic, Urgent
StateAnimId = ObjectFields.End + 0x0ba, // Size: 1, Flags: Dynamic, Urgent
StateAnimKitId = ObjectFields.End + 0x0bb, // Size: 1, Flags: Dynamic, Urgent
StateWorldEffectId = ObjectFields.End + 0x0bc, // Size: 4, Flags: Dynamic, Urgent
ScaleDuration = ObjectFields.End + 0x0c0, // Size: 1, Flags: Public
LooksLikeMountId = ObjectFields.End + 0x0c1, // Size: 1, Flags: Public
LooksLikeCreatureId = ObjectFields.End + 0x0c2, // Size: 1, Flags: Public
LookAtControllerId = ObjectFields.End + 0x0c3, // Size: 1, Flags: Public
LookAtControllerTarget = ObjectFields.End + 0x0c4, // Size: 4, Flags: Public
End = ObjectFields.End + 0x0c8,
}
public enum UnitDynamicFields
{
PassiveSpells = 0x000, // Flags: Public, Urgent
WorldEffects = 0x001, // Flags: Public, Urgent
ChannelObjects = 0x002, // Flags: PUBLIC, URGENT
End = 0x003,
}
public enum PlayerFields
{
DuelArbiter = UnitFields.End + 0x000, // Size: 4, Flags: Public
WowAccount = UnitFields.End + 0x004, // Size: 4, Flags: Public
LootTargetGuid = UnitFields.End + 0x008, // Size: 4, Flags: Public
Flags = UnitFields.End + 0x00c, // Size: 1, Flags: Public
FlagsEx = UnitFields.End + 0x00d, // Size: 1, Flags: Public
GuildRank = UnitFields.End + 0x00e, // Size: 1, Flags: Public
GuildDeleteDate = UnitFields.End + 0x00f, // Size: 1, Flags: Public
GuildLevel = UnitFields.End + 0x010, // Size: 1, Flags: Public
Bytes = UnitFields.End + 0x011, // Size: 1, Flags: Public
Bytes2 = UnitFields.End + 0x012, // Size: 1, Flags: Public
Bytes3 = UnitFields.End + 0x013, // Size: 1, Flags: Public
Bytes4 = UnitFields.End + 0x014, // Size: 1, Flags: Public
DuelTeam = UnitFields.End + 0x015, // Size: 1, Flags: Public
GuildTimestamp = UnitFields.End + 0x016, // Size: 1, Flags: Public
QuestLog = UnitFields.End + 0x017, // Size: 800, Flags: PartyMember
VisibleItem = UnitFields.End + 0x337, // Size: 38, Flags: Public
ChosenTitle = UnitFields.End + 0x35d, // Size: 1, Flags: Public
FakeInebriation = UnitFields.End + 0x35e, // Size: 1, Flags: Public
VirtualRealm = UnitFields.End + 0x35f, // Size: 1, Flags: Public
CurrentSpecId = UnitFields.End + 0x360, // Size: 1, Flags: Public
TaxiMountAnimKitId = UnitFields.End + 0x361, // Size: 1, Flags: Public
AvgItemLevel = UnitFields.End + 0x362, // Size: 4, Flags: Public
CurrentBattlePetBreedQuality = UnitFields.End + 0x366, // Size: 1, Flags: Public
Prestige = UnitFields.End + 0x367, // Size: 1, Flags: Public
HonorLevel = UnitFields.End + 0x368, // Size: 1, Flags: Public
InvSlotHead = UnitFields.End + 0x369, // Size: 748, Flags: Private
EndNotSelf = UnitFields.End + 0x369,
Farsight = UnitFields.End + 0x655, // Size: 4, Flags: Private
SummonedBattlePetId = UnitFields.End + 0x659, // Size: 4, Flags: Private
KnownTitles = UnitFields.End + 0x65d, // Size: 12, Flags: Private
Coinage = UnitFields.End + 0x669, // Size: 2, Flags: Private
Xp = UnitFields.End + 0x66b, // Size: 1, Flags: Private
NextLevelXp = UnitFields.End + 0x66c, // Size: 1, Flags: Private
SkillLineId = UnitFields.End + 0x66d, // Size: 448, Flags: Private
SkillLineStep = UnitFields.End + 0x6AD,
SkillLineRank = UnitFields.End + 0x6ED,
SkillLineSubStartRank = UnitFields.End + 0x72D,
SkillLineMaxRank = UnitFields.End + 0x76D,
SkillLineTempBonus = UnitFields.End + 0x7AD,
SkillLinePermBonus = UnitFields.End + 0x7ED,
CharacterPoints = UnitFields.End + 0x82d, // Size: 1, Flags: Private
MaxTalentTiers = UnitFields.End + 0x82e, // Size: 1, Flags: Private
TrackCreatures = UnitFields.End + 0x82f, // Size: 1, Flags: Private
TrackResources = UnitFields.End + 0x830, // Size: 1, Flags: Private
Expertise = UnitFields.End + 0x831, // Size: 1, Flags: Private
OffhandExpertise = UnitFields.End + 0x832, // Size: 1, Flags: Private
RangedExpertise = UnitFields.End + 0x833, // Size: 1, Flags: Private
CombatRatingExpertise = UnitFields.End + 0x834, // Size: 1, Flags: Private
BlockPercentage = UnitFields.End + 0x835, // Size: 1, Flags: Private
DodgePercentage = UnitFields.End + 0x836, // Size: 1, Flags: Private
DodgePercentageFromAttribute = UnitFields.End + 0x837, // Size: 1, Flags: Private
ParryPercentage = UnitFields.End + 0x838, // Size: 1, Flags: Private
ParryPercentageFromAttribute = UnitFields.End + 0x839, // Size: 1, Flags: Private
CritPercentage = UnitFields.End + 0x83a, // Size: 1, Flags: Private
RangedCritPercentage = UnitFields.End + 0x83b, // Size: 1, Flags: Private
OffhandCritPercentage = UnitFields.End + 0x83c, // Size: 1, Flags: Private
SpellCritPercentage1 = UnitFields.End + 0x83d, // Size: 1, Flags: Private
ShieldBlock = UnitFields.End + 0x83e, // Size: 1, Flags: Private
ShieldBlockCritPercentage = UnitFields.End + 0x83f, // Size: 1, Flags: Private
Mastery = UnitFields.End + 0x840, // Size: 1, Flags: Private
Speed = UnitFields.End + 0x841, // Size: 1, Flags: Private
Lifesteal = UnitFields.End + 0x842, // Size: 1, Flags: Private
Avoidance = UnitFields.End + 0x843, // Size: 1, Flags: Private
Sturdiness = UnitFields.End + 0x844, // Size: 1, Flags: Private
Versatility = UnitFields.End + 0x845, // Size: 1, Flags: Private
VersatilityBonus = UnitFields.End + 0x846, // Size: 1, Flags: Private
FieldPvpPowerDamage = UnitFields.End + 0x847, // Size: 1, Flags: Private
FieldPvpPowerHealing = UnitFields.End + 0x848, // Size: 1, Flags: Private
ExploredZones1 = UnitFields.End + 0x849, // Size: 256, Flags: Private
RestInfo = UnitFields.End + 0x949, // Size: 4, Flags: Private
ModDamageDonePos = UnitFields.End + 0x94d, // Size: 7, Flags: Private
ModDamageDoneNeg = UnitFields.End + 0x954, // Size: 7, Flags: Private
ModDamageDonePct = UnitFields.End + 0x95b, // Size: 7, Flags: Private
ModHealingDonePos = UnitFields.End + 0x962, // Size: 1, Flags: Private
ModHealingPct = UnitFields.End + 0x963, // Size: 1, Flags: Private
ModHealingDonePct = UnitFields.End + 0x964, // Size: 1, Flags: Private
ModPeriodicHealingDonePercent = UnitFields.End + 0x965, // Size: 1, Flags: Private
WeaponDmgMultipliers = UnitFields.End + 0x966, // Size: 3, Flags: Private
WeaponAtkSpeedMultipliers = UnitFields.End + 0x969, // Size: 3, Flags: Private
ModSpellPowerPct = UnitFields.End + 0x96c, // Size: 1, Flags: Private
ModResiliencePercent = UnitFields.End + 0x96d, // Size: 1, Flags: Private
OverrideSpellPowerByApPct = UnitFields.End + 0x96e, // Size: 1, Flags: Private
OverrideApBySpellPowerPercent = UnitFields.End + 0x96f, // Size: 1, Flags: Private
ModTargetResistance = UnitFields.End + 0x970, // Size: 1, Flags: Private
ModTargetPhysicalResistance = UnitFields.End + 0x971, // Size: 1, Flags: Private
LocalFlags = UnitFields.End + 0x972, // Size: 1, Flags: Private
FieldBytes = UnitFields.End + 0x973, // Size: 1, Flags: Private
SelfResSpell = UnitFields.End + 0x974, // Size: 1, Flags: Private
PvpMedals = UnitFields.End + 0x975, // Size: 1, Flags: Private
BuyBackPrice1 = UnitFields.End + 0x976, // Size: 12, Flags: Private
BuyBackTimestamp1 = UnitFields.End + 0x982, // Size: 12, Flags: Private
Kills = UnitFields.End + 0x98e, // Size: 1, Flags: Private
LifetimeHonorableKills = UnitFields.End + 0x98f, // Size: 1, Flags: Private
WatchedFactionIndex = UnitFields.End + 0x990, // Size: 1, Flags: Private
CombatRating1 = UnitFields.End + 0x991, // Size: 32, Flags: Private
ArenaTeamInfo11 = UnitFields.End + 0x9b1, // Size: 42, Flags: Private
MaxLevel = UnitFields.End + 0x9db, // Size: 1, Flags: Private
ScalingLevelDelta = UnitFields.End + 0x9dc, // Size: 1, Flags: Private
MaxCreatureScalingLevel = UnitFields.End + 0x9dd, // Size: 1, Flags: Private
NoReagentCost1 = UnitFields.End + 0x9de, // Size: 4, Flags: Private
PetSpellPower = UnitFields.End + 0x9e2, // Size: 1, Flags: Private
Researching1 = UnitFields.End + 0x9e3, // Size: 10, Flags: Private
ProfessionSkillLine1 = UnitFields.End + 0x9ed, // Size: 2, Flags: Private
UiHitModifier = UnitFields.End + 0x9ef, // Size: 1, Flags: Private
UiSpellHitModifier = UnitFields.End + 0x9f0, // Size: 1, Flags: Private
HomeRealmTimeOffset = UnitFields.End + 0x9f1, // Size: 1, Flags: Private
ModPetHaste = UnitFields.End + 0x9f2, // Size: 1, Flags: Private
FieldBytes2 = UnitFields.End + 0x9f3, // Size: 1, Flags: Private
FieldBytes3 = UnitFields.End + 0x9f4, // Size: 1, Flags: Private, UrgentSelfOnly
LfgBonusFactionId = UnitFields.End + 0x9f5, // Size: 1, Flags: Private
LootSpecId = UnitFields.End + 0x9f6, // Size: 1, Flags: Private
OverrideZonePvpType = UnitFields.End + 0x9f7, // Size: 1, Flags: Private, UrgentSelfOnly
BagSlotFlags = UnitFields.End + 0x9f8, // Size: 4, Flags: Private
BankBagSlotFlags = UnitFields.End + 0x9fc, // Size: 7, Flags: Private
InsertItemsLeftToRight = UnitFields.End + 0xa03, // Size: 1, Flags: Private
QuestCompleted = UnitFields.End + 0xa04, // Size: 1750, Flags: Private
Honor = UnitFields.End + 0x10DA, // Size: 1, Flags: Private
HonorNextLevel = UnitFields.End + 0x10DB, // Size: 1, Flags: Private
End = UnitFields.End + 0x10DC,
}
public enum PlayerDynamicFields
{
ReserachSite = UnitDynamicFields.End + 0x000, // Flags: Private
ResearchSiteProgress = UnitDynamicFields.End + 0x001, // Flags: Private
DailyQuests = UnitDynamicFields.End + 0x002, // Flags: Private
AvailableQuestLineXQuestId = UnitDynamicFields.End + 0x003, // Flags: Private
Heirlooms = UnitDynamicFields.End + 0x004, // Flags: Private
HeirloomsFlags = UnitDynamicFields.End + 0x005, // Flags: PRIVATE
Toys = UnitDynamicFields.End + 0x006, // Flags: Private
Transmog = UnitDynamicFields.End + 0x007, // Flags: PRIVATE
ConditionalTransmog = UnitDynamicFields.End + 0x008, // Flags: PRIVATE
CharacterRestrictions = UnitDynamicFields.End + 0x009, // Flags: PRIVATE
SpellPctModByLabel = UnitDynamicFields.End + 0x00A, // Flags: PRIVATE
SpellFlatModByLabel = UnitDynamicFields.End + 0x00B, // Flags: PRIVATE
ArenaCooldowns = UnitDynamicFields.End + 0x00C, // Flags: PUBLIC
End = UnitDynamicFields.End + 0x00D,
}
public enum GameObjectFields
{
CreatedBy = ObjectFields.End + 0x000, // Size: 4, Flags: Public
DisplayId = ObjectFields.End + 0x004, // Size: 1, Flags: Dynamic, Urgent
Flags = ObjectFields.End + 0x005, // Size: 1, Flags: Public, Urgent
ParentRotation = ObjectFields.End + 0x006, // Size: 4, Flags: Public
Faction = ObjectFields.End + 0x00a, // Size: 1, Flags: Public
Level = ObjectFields.End + 0x00b, // Size: 1, Flags: Public
Bytes1 = ObjectFields.End + 0x00c, // Size: 1, Flags: Public, Urgent
SpellVisualId = ObjectFields.End + 0x00d, // Size: 1, Flags: Public, Dynamic, Urgent
StateSpellVisualId = ObjectFields.End + 0x00e, // Size: 1, Flags: Dynamic, Urgent
StateAnumId = ObjectFields.End + 0x00f, // Size: 1, Flags: Dynamic, Urgent
StateAnimKitId = ObjectFields.End + 0x010, // Size: 1, Flags: Dynamic, Urgent
StateWorldEffectId = ObjectFields.End + 0x011, // Size: 4, Flags: Dynamic, Urgent
End = ObjectFields.End + 0x015,
}
public enum GameObjectDynamicFields
{
EnableDoodadSets = 0x000, // Flags: PUBLIC
End = 0x001,
}
public enum DynamicObjectFields
{
Caster = ObjectFields.End + 0x000, // Size: 4, Flags: Public
Type = ObjectFields.End + 0x004, // Size: 1, Flags: Public
SpellXSpellVisualId = ObjectFields.End + 0x005, // Size: 1, Flags: Public
SpellId = ObjectFields.End + 0x006, // Size: 1, Flags: Public
Radius = ObjectFields.End + 0x007, // Size: 1, Flags: Public
CastTime = ObjectFields.End + 0x008, // Size: 1, Flags: Public
End = ObjectFields.End + 0x009,
}
public enum CorpseFields
{
Owner = ObjectFields.End + 0x000, // Size: 4, Flags: Public
Party = ObjectFields.End + 0x004, // Size: 4, Flags: Public
DisplayId = ObjectFields.End + 0x008, // Size: 1, Flags: Public
Item = ObjectFields.End + 0x009, // Size: 19, Flags: Public
Bytes1 = ObjectFields.End + 0x01c, // Size: 1, Flags: Public
Bytes2 = ObjectFields.End + 0x01d, // Size: 1, Flags: Public
Flags = ObjectFields.End + 0x01e, // Size: 1, Flags: Public
DynamicFlags = ObjectFields.End + 0x01f, // Size: 1, Flags: Dynamic
FactionTemplate = ObjectFields.End + 0x020, // Size: 1, Flags: Public
CustomDisplayOption = ObjectFields.End + 0x021, // Size: 1, Flags: PUBLIC
End = ObjectFields.End + 0x022,
}
public enum AreaTriggerFields
{
OverrideScaleCurve = ObjectFields.End + 0x000, // Size: 7, Flags: Public, Urgent
ExtraScaleCurve = ObjectFields.End + 0x007, // Size: 7, Flags: Public, Urgent
Caster = ObjectFields.End + 0x00e, // Size: 4, Flags: Public
Duration = ObjectFields.End + 0x012, // Size: 1, Flags: Public
TimeToTarget = ObjectFields.End + 0x013, // Size: 1, Flags: Public, Urgent
TimeToTargetScale = ObjectFields.End + 0x014, // Size: 1, Flags: Public, Urgent
TimeToTargetExtraScale = ObjectFields.End + 0x015, // Size: 1, Flags: Public, Urgent
SpellId = ObjectFields.End + 0x016, // Size: 1, Flags: Public
SpellForVisuals = ObjectFields.End + 0x017, // Size: 1, Flags: PUBLIC
SpellXSpellVisualId = ObjectFields.End + 0x018, // Size: 1, Flags: Dynamic
BoundsRadius2d = ObjectFields.End + 0x019, // Size: 1, Flags: Dynamic, Urgent
DecalPropertiesId = ObjectFields.End + 0x01A, // Size: 1, Flags: Public
CreatingEffectGuid = ObjectFields.End + 0x01B, // Size: 4, Flags: PUBLIC
End = ObjectFields.End + 0x01F,
}
public enum SceneObjectFields
{
ScriptPackageId = ObjectFields.End + 0x000, // Size: 1, Flags: Public
RndSeedVal = ObjectFields.End + 0x001, // Size: 1, Flags: Public
Createdby = ObjectFields.End + 0x002, // Size: 4, Flags: Public
SceneType = ObjectFields.End + 0x006, // Size: 1, Flags: Public
End = ObjectFields.End + 0x007,
}
public enum ConversationFields
{
LastLineEndTime = ObjectFields.End + 0x000, // Size: 1, Flags: DYNAMIC
End = ObjectFields.End + 0x001,
}
public enum ConversationDynamicFields
{
Actors = 0x000, // Flags: Public
Lines = 0x001, // Flags: 0x100
End = 0x002,
}
}
+45
View File
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
namespace Framework.Constants
{
[Flags]
public enum UpdateFlag
{
None = 0x0,
Self = 0x1,
Transport = 0x2,
HasTarget = 0x4,
Living = 0x8,
StationaryPosition = 0x10,
Vehicle = 0x20,
TransportPosition = 0x40,
Rotation = 0x80,
AnimKits = 0x100,
Areatrigger = 0x0200,
//UPDATEFLAG_GAMEOBJECT = 0x0400,
//UPDATEFLAG_REPLACE_ACTIVE = 0x0800,
//UPDATEFLAG_NO_BIRTH_ANIM = 0x1000,
//UPDATEFLAG_ENABLE_PORTALS = 0x2000,
//UPDATEFLAG_PLAY_HOVER_ANIM = 0x4000,
//UPDATEFLAG_IS_SUPPRESSING_GREETINGS = 0x8000
//UPDATEFLAG_SCENEOBJECT = 0x10000,
//UPDATEFLAG_SCENE_PENDING_INSTANCE = 0x20000
}
}
+27
View File
@@ -0,0 +1,27 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum UpdateType
{
Values = 0,
CreateObject = 1,
CreateObject2 = 2,
OutOfRangeObjects = 3,
}
}
+64
View File
@@ -0,0 +1,64 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Constants
{
public enum VehiclePowerType
{
Steam = 61,
Pyrite = 41,
Heat = 101,
Ooze = 121,
Blood = 141,
Wrath = 142,
ArcaneEnergy = 143,
LifeEnergy = 144,
SunEnergy = 145,
SwingVelocity = 146,
ShadowflameEnergy = 147,
BluePower = 148,
PurplePower = 149,
GreenPower = 150,
OrangePower = 151,
Energy2 = 153,
Arcaneenergy = 161,
Wind1 = 162,
Wind2 = 163,
Wind3 = 164,
Fuel = 165,
SunPower = 166,
TwilightEnergy = 169,
Venom = 174,
Orange2 = 176,
ConsumingFlame = 177,
PyroclasticFrenzy = 178,
Flashfire = 179,
}
public enum VehicleFlags
{
NoStrafe = 0x01, // Sets Moveflag2NoStrafe
NoJumping = 0x02, // Sets Moveflag2NoJumping
Fullspeedturning = 0x04, // Sets Moveflag2Fullspeedturning
AllowPitching = 0x10, // Sets Moveflag2AllowPitching
Fullspeedpitching = 0x20, // Sets Moveflag2Fullspeedpitching
CustomPitch = 0x40, // If Set Use Pitchmin And Pitchmax From Dbc, Otherwise Pitchmin = -Pi/2, Pitchmax = Pi/2
AdjustAimAngle = 0x400, // LuaIsvehicleaimangleadjustable
AdjustAimPower = 0x800, // LuaIsvehicleaimpoweradjustable
FixedPosition = 0x200000 // Used for cannons, when they should be rooted
}
}
+101
View File
@@ -0,0 +1,101 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Security.Cryptography;
namespace Framework.Cryptography
{
public sealed class WorldCrypt : IDisposable
{
static readonly byte[] ServerEncryptionKey = { 0x08, 0xF1, 0x95, 0x9F, 0x47, 0xE5, 0xD2, 0xDB, 0xA1, 0x3D, 0x77, 0x8F, 0x3F, 0x3E, 0xE7, 0x00 };
static readonly byte[] ServerDecryptionKey = { 0x40, 0xAA, 0xD3, 0x92, 0x26, 0x71, 0x43, 0x47, 0x3A, 0x31, 0x08, 0xA6, 0xE7, 0xDC, 0x98, 0x2A };
public void Initialize(byte[] sessionKey)
{
if (IsInitialized)
throw new InvalidOperationException("PacketCrypt already initialized!");
SARC4Encrypt = new SARC4();
SARC4Decrypt = new SARC4();
var encryptSHA1 = new HMACSHA1(ServerEncryptionKey);
var decryptSHA1 = new HMACSHA1(ServerDecryptionKey);
SARC4Encrypt.PrepareKey(encryptSHA1.ComputeHash(sessionKey));
SARC4Decrypt.PrepareKey(decryptSHA1.ComputeHash(sessionKey));
var PacketEncryptionDummy = new byte[0x400];
var PacketDecryptionDummy = new byte[0x400];
SARC4Encrypt.ProcessBuffer(PacketEncryptionDummy, PacketEncryptionDummy.Length);
SARC4Decrypt.ProcessBuffer(PacketDecryptionDummy, PacketDecryptionDummy.Length);
IsInitialized = true;
}
public void Initialize(byte[] sessionKey, byte[] serverSeed, byte[] clientSeed)
{
IsInitialized = false;
if (IsInitialized)
throw new InvalidOperationException("PacketCrypt already initialized!");
SARC4Encrypt = new SARC4();
SARC4Decrypt = new SARC4();
var encryptSHA1 = new HMACSHA1(serverSeed);
var decryptSHA1 = new HMACSHA1(clientSeed);
SARC4Encrypt.PrepareKey(encryptSHA1.ComputeHash(sessionKey));
SARC4Decrypt.PrepareKey(decryptSHA1.ComputeHash(sessionKey));
var PacketEncryptionDummy = new byte[0x400];
var PacketDecryptionDummy = new byte[0x400];
SARC4Encrypt.ProcessBuffer(PacketEncryptionDummy, PacketEncryptionDummy.Length);
SARC4Decrypt.ProcessBuffer(PacketDecryptionDummy, PacketDecryptionDummy.Length);
IsInitialized = true;
}
public void Encrypt(byte[] data, int count)
{
if (!IsInitialized)
throw new InvalidOperationException("PacketCrypt not initialized!");
SARC4Encrypt.ProcessBuffer(data, count);
}
public void Decrypt(byte[] data, int count)
{
if (!IsInitialized)
throw new InvalidOperationException("PacketCrypt not initialized!");
SARC4Decrypt.ProcessBuffer(data, count);
}
public void Dispose()
{
IsInitialized = false;
}
public bool IsInitialized { get; set; }
SARC4 SARC4Encrypt;
SARC4 SARC4Decrypt;
}
}
+117
View File
@@ -0,0 +1,117 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Numerics;
namespace Framework.Cryptography
{
public class RsaCrypt : IDisposable
{
public RsaCrypt()
{
Dispose();
}
public void InitializeEncryption<T>(T p, T q, T dp, T dq, T iq, bool isBigEndian = false)
{
this._p = p.ToBigInteger(isBigEndian);
this._q = q.ToBigInteger(isBigEndian);
this._dp = dp.ToBigInteger(isBigEndian);
this._dq = dq.ToBigInteger(isBigEndian);
this._iq = iq.ToBigInteger(isBigEndian);
if (this._p.IsZero && this._q.IsZero)
throw new InvalidOperationException("'0' isn't allowed for p or q");
else
_isEncryptionInitialized = true;
}
public void InitializeDecryption<T>(T e, T n, bool reverseBytes = false)
{
this._e = e.ToBigInteger(reverseBytes);
this._n = n.ToBigInteger(reverseBytes);
_isDecryptionInitialized = true;
}
public byte[] Encrypt<T>(T data, bool isBigEndian = false)
{
if (!_isEncryptionInitialized)
throw new InvalidOperationException("Encryption not initialized");
var bData = data.ToBigInteger(isBigEndian);
var m1 = BigInteger.ModPow(bData % _p, _dp, _p);
var m2 = BigInteger.ModPow(bData % _q, _dq, _q);
var h = (_iq * (m1 - m2)) % _p;
// Be sure to use the positive remainder
if (h.Sign == -1)
h = _p + h;
var m = m2 + h * _q;
return m.ToByteArray();
}
public byte[] Decrypt<T>(T data, bool isBigEndian = false)
{
if (!_isDecryptionInitialized)
throw new InvalidOperationException("Encryption not initialized");
var c = data.ToBigInteger(isBigEndian);
return BigInteger.ModPow(c, _e, _n).ToByteArray();
}
public void Dispose()
{
this._e = 0;
this._n = 0;
this._p = 0;
this._q = 0;
this._dp = 0;
this._dq = 0;
this._iq = 0;
_isEncryptionInitialized = false;
_isDecryptionInitialized = false;
}
BigInteger _e;
BigInteger _n;
BigInteger _p;
BigInteger _q;
BigInteger _dp;
BigInteger _dq;
BigInteger _iq;
bool _isEncryptionInitialized;
bool _isDecryptionInitialized;
}
public class RsaStore
{
public static byte[] DP = { 0xE1, 0xA6, 0x22, 0xAB, 0xFF, 0x57, 0x83, 0x45, 0x3F, 0x93, 0x76, 0xC8, 0xFA, 0xD9, 0x17, 0xE1, 0x49, 0x73, 0xC2, 0x13, 0x28, 0x0B, 0x1F, 0xE2, 0x9A, 0xF4, 0x7F, 0x7C, 0x37, 0x56, 0xA1, 0xDF, 0x51, 0x97, 0x2F, 0x15, 0x10, 0x97, 0xCD, 0x2A, 0x40, 0x09, 0xFC, 0x0A, 0xC3, 0x3F, 0x88, 0x86, 0xA9, 0x51, 0x13, 0xE1, 0x76, 0xCF, 0xA8, 0x37, 0x9A, 0x91, 0x3B, 0xD0, 0x70, 0xA1, 0xD7, 0x03, 0x71, 0x59, 0x6C, 0xB3, 0x41, 0xB8, 0x32, 0x68, 0x56, 0xC8, 0xB8, 0xD1, 0xF9, 0x1D, 0x04, 0xC5, 0x13, 0xB5, 0x8E, 0x57, 0x73, 0x02, 0x97, 0x7B, 0x33, 0x60, 0x68, 0xA9, 0xC2, 0x40, 0x96, 0x3C, 0x57, 0x4E, 0x4F, 0xC0, 0xAB, 0x21, 0x5C, 0xBA, 0x7D, 0x65, 0xAA, 0x1B, 0xD6, 0x43, 0x06, 0xCE, 0x3E, 0x0C, 0xB9, 0xB2, 0x82, 0xB0, 0xC9, 0x54, 0x59, 0x32, 0xC5, 0x88, 0x08, 0x9C, 0x9B, 0xBF };
public static byte[] DQ = { 0xE3, 0xB1, 0xED, 0x52, 0xEF, 0xE6, 0x88, 0x40, 0x50, 0x89, 0x4C, 0x99, 0xE5, 0xF7, 0xED, 0x03, 0x1C, 0x54, 0x11, 0x24, 0x2F, 0x9D, 0xE8, 0xE6, 0x39, 0xFA, 0x19, 0xF4, 0x06, 0x55, 0x0B, 0x8B, 0x95, 0xC8, 0xB1, 0xE2, 0x7C, 0x75, 0x3B, 0x2A, 0x40, 0xC3, 0xE7, 0xE0, 0x25, 0x18, 0xBF, 0xB5, 0x03, 0x1B, 0x5A, 0x57, 0x92, 0x3C, 0x85, 0x7D, 0x7F, 0x43, 0x56, 0x1F, 0x1E, 0x80, 0xC3, 0xBA, 0xF0, 0x53, 0xD7, 0x6A, 0xD0, 0xF2, 0xDD, 0x9C, 0xC6, 0x53, 0xE7, 0xB4, 0xD3, 0x9D, 0xAB, 0xBF, 0xE0, 0x97, 0x50, 0x92, 0x23, 0xB9, 0xB7, 0xDC, 0xAA, 0xC4, 0x20, 0x93, 0x5A, 0xF5, 0xDE, 0x76, 0x28, 0x93, 0x91, 0x44, 0x1E, 0x4C, 0x15, 0x2F, 0x7F, 0x45, 0x3C, 0x3B, 0x7D, 0x36, 0x3B, 0x24, 0xC7, 0x8C, 0x65, 0x43, 0xAE, 0x65, 0x84, 0xBC, 0xF9, 0x76, 0x4E, 0x3C, 0x44, 0x05, 0xBC, 0xFA };
public static byte[] InverseQ = { 0x63, 0xC1, 0x14, 0x2B, 0x57, 0x0B, 0x8A, 0x3C, 0x27, 0xDB, 0x96, 0x82, 0x27, 0xEB, 0xF6, 0x45, 0x6D, 0x07, 0x50, 0xE8, 0x4A, 0xD4, 0xB6, 0x7A, 0x3C, 0x8B, 0x4D, 0x65, 0xF0, 0x50, 0x70, 0x84, 0x71, 0x2B, 0xC6, 0x6D, 0x28, 0x2D, 0x76, 0x38, 0x73, 0x93, 0xDB, 0x44, 0xD7, 0xC0, 0x7F, 0xD9, 0x57, 0x18, 0x28, 0x57, 0xF1, 0x13, 0x38, 0xA4, 0x91, 0x67, 0x1E, 0x13, 0x73, 0x55, 0xFC, 0x7B, 0xAF, 0x50, 0xFA, 0xFD, 0x16, 0x12, 0x6F, 0xA4, 0x95, 0x15, 0x9C, 0x07, 0x18, 0xA6, 0x46, 0xFD, 0xB3, 0xCF, 0xA5, 0x0E, 0x05, 0x30, 0xEC, 0x2C, 0xCD, 0x62, 0xDD, 0x6F, 0xB1, 0xFE, 0x6C, 0x05, 0x2F, 0x11, 0xA6, 0xA0, 0x98, 0xAC, 0x9B, 0x15, 0xF0, 0x04, 0xC4, 0x7B, 0x79, 0xAA, 0x51, 0x25, 0x2A, 0x84, 0x73, 0xE6, 0x77, 0x47, 0xA3, 0xEB, 0xCF, 0x6D, 0xC8, 0x96, 0x3A, 0x1B, 0x02, 0x52 };
public static byte[] P = { 0x7D, 0xBD, 0xB9, 0xE1, 0x2D, 0xAE, 0x42, 0x56, 0x6E, 0x2B, 0xE2, 0x89, 0xD9, 0xBB, 0x0C, 0x1F, 0x67, 0x28, 0xC1, 0x4D, 0x91, 0x3C, 0xAD, 0x5F, 0xF0, 0x43, 0x86, 0x5C, 0x27, 0xDC, 0x58, 0xB3, 0x0E, 0x75, 0x77, 0x78, 0x49, 0x35, 0xE7, 0xE7, 0xDF, 0xFD, 0x74, 0xAB, 0x4E, 0xFE, 0xD3, 0xAB, 0x6B, 0x96, 0xF7, 0x89, 0xB2, 0x5A, 0x6A, 0x25, 0x03, 0x5A, 0x92, 0x1A, 0xF1, 0xFC, 0x05, 0x4E, 0xCE, 0xDD, 0x37, 0xA4, 0x02, 0x53, 0x76, 0xCB, 0xC2, 0xD9, 0x63, 0xCB, 0x51, 0x94, 0xEC, 0x5C, 0x39, 0xCC, 0xB2, 0x17, 0x0C, 0xA3, 0x43, 0x9A, 0xD0, 0x83, 0x27, 0x67, 0x52, 0x64, 0x37, 0x0E, 0x38, 0xB7, 0x9B, 0xF4, 0x2D, 0xB8, 0x0F, 0x30, 0x72, 0xD3, 0x15, 0xF3, 0x2C, 0x39, 0x55, 0x72, 0x2C, 0x55, 0x80, 0x63, 0xA0, 0xA1, 0x6F, 0x28, 0xF3, 0xF3, 0x5A, 0x6F, 0x68, 0x59, 0xB3, 0xF3 };
public static byte[] Q = { 0x0B, 0x1A, 0x13, 0x07, 0x12, 0xEF, 0xDD, 0x97, 0x01, 0x9A, 0x21, 0x7D, 0xFA, 0xA3, 0xB7, 0xE2, 0x39, 0x2E, 0x04, 0x92, 0x96, 0x45, 0x2A, 0xEB, 0x57, 0x03, 0xAC, 0xB1, 0x83, 0xCD, 0x25, 0x4F, 0x2C, 0xA9, 0xA1, 0x54, 0x26, 0x54, 0xCF, 0xE6, 0x1B, 0x53, 0x51, 0x3A, 0xC1, 0x15, 0xF4, 0x17, 0xBB, 0x17, 0x1F, 0x37, 0x66, 0x36, 0x1A, 0xD4, 0xB1, 0x5B, 0x49, 0xA8, 0xF1, 0x02, 0xB0, 0x42, 0xA9, 0x66, 0xA0, 0xE2, 0x52, 0x2C, 0x8C, 0x89, 0xA2, 0xDD, 0xA6, 0xF1, 0xA3, 0xDF, 0xB6, 0x80, 0x63, 0xB8, 0x10, 0xDA, 0xDE, 0x84, 0x56, 0xFA, 0xFB, 0x72, 0x65, 0x5E, 0xA3, 0x9C, 0x78, 0x65, 0xD0, 0x73, 0x07, 0x34, 0x1D, 0xE1, 0x4D, 0x77, 0xE8, 0x00, 0x0F, 0x80, 0x1C, 0x5A, 0x21, 0x55, 0x0A, 0x8C, 0xF4, 0x93, 0xF5, 0xF8, 0x40, 0xF2, 0x40, 0xEA, 0x52, 0x12, 0x40, 0xF0, 0xBF, 0xFA };
public static byte[] WherePacketHmac = { 0x2C, 0x1F, 0x1D, 0x80, 0xC3, 0x8C, 0x23, 0x64, 0xDA, 0x90, 0xCA, 0x8E, 0x2C, 0xFC, 0x0C, 0xCE, 0x09, 0xD3, 0x62, 0xF9, 0xF3, 0x8B, 0xBE, 0x9F, 0x19, 0xEF, 0x58, 0xA1, 0x1C, 0x34, 0x14, 0x41, 0x3F, 0x23, 0xFD, 0xD3, 0xE8, 0x14, 0xEC, 0x2A, 0xFD, 0x4F, 0x95, 0xBA, 0x30, 0x7E, 0x56, 0x5D, 0x83, 0x95, 0x81, 0x69, 0xB0, 0x5A, 0xB4, 0x9D, 0xA8, 0x55, 0xFF, 0xFC, 0xEE, 0x58, 0x0A, 0x2F };
}
}
+68
View File
@@ -0,0 +1,68 @@
/*
* Copyright (C) 2012-2014 Arctium Emulation<http://arctium.org>
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Cryptography
{
//Thx Fabian over at Arctium.
public sealed class SARC4
{
public SARC4()
{
_s = new byte[0x100];
_tmp = 0;
_tmp2 = 0;
}
public void PrepareKey(byte[] key)
{
for (int i = 0; i < 0x100; i++)
_s[i] = (byte)i;
var j = 0;
for (int i = 0; i < 0x100; i++)
{
j = (byte)((j + key[i % key.Length] + _s[i]) & 255);
var tempS = _s[i];
_s[i] = _s[j];
_s[j] = tempS;
}
}
public void ProcessBuffer(byte[] data, int length)
{
for (int i = 0; i < length; i++)
{
_tmp = (byte)((_tmp + 1) % 0x100);
_tmp2 = (byte)((_tmp2 + _s[_tmp]) % 0x100);
var sTemp = _s[_tmp];
_s[_tmp] = _s[_tmp2];
_s[_tmp2] = sTemp;
data[i] = (byte)(_s[(_s[_tmp] + _s[_tmp2]) % 0x100] ^ data[i]);
}
}
byte[] _s;
byte _tmp;
byte _tmp2;
}
}
@@ -0,0 +1,68 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Security.Cryptography;
namespace Framework.Cryptography
{
public class SessionKeyGenerator
{
public SessionKeyGenerator(byte[] buff, int size)
{
int halfSize = size / 2;
sh = SHA256.Create();
sh.TransformFinalBlock(buff, 0, halfSize);
o1 = sh.Hash;
sh.Initialize();
sh.TransformFinalBlock(buff, halfSize, size - halfSize);
o2 = sh.Hash;
FillUp();
}
public void Generate(byte[] buf, uint sz)
{
for (uint i = 0; i < sz; ++i)
{
if (taken == 32)
FillUp();
buf[i] = o0[taken];
taken++;
}
}
void FillUp()
{
sh.Initialize();
sh.TransformBlock(o1, 0, 32, o1, 0);
sh.TransformBlock(o0, 0, 32, o0, 0);
sh.TransformFinalBlock(o2, 0, 32);
o0 = sh.Hash;
taken = 0;
}
SHA256 sh;
uint taken;
byte[] o0 = new byte[32];
byte[] o1 = new byte[32];
byte[] o2 = new byte[32];
}
}
+153
View File
@@ -0,0 +1,153 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
* Copyright (C) 2012-2014 Arctium Emulation <http://arctium.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Security.Cryptography;
using System.Text;
namespace Framework.Cryptography
{
public class Sha256 : SHA256Managed
{
public byte[] Digest { get; private set; }
public Sha256()
{
Initialize();
}
public void Process(byte[] data, int length)
{
TransformBlock(data, 0, length, data, 0);
}
public void Process(uint data)
{
var bytes = BitConverter.GetBytes(data);
TransformBlock(bytes, 0, 4, bytes, 0);
}
public void Process(string data)
{
var bytes = Encoding.UTF8.GetBytes(data);
TransformBlock(bytes, 0, bytes.Length, bytes, 0);
}
public void Finish(byte[] data, int length)
{
TransformFinalBlock(data, 0, data.Length);
Digest = base.Hash;
}
public void Finish(byte[] data, int offset, int length)
{
TransformFinalBlock(data, offset, length);
Digest = base.Hash;
}
}
public class HmacHash : HMACSHA1
{
public byte[] Digest { get; private set; }
public HmacHash(byte[] key) : base(key, true)
{
Initialize();
}
public void Process(byte[] data, int length)
{
TransformBlock(data, 0, length, data, 0);
}
public void Process(uint data)
{
var bytes = BitConverter.GetBytes(data);
TransformBlock(bytes, 0, bytes.Length, bytes, 0);
}
public void Process(string data)
{
var bytes = Encoding.ASCII.GetBytes(data);
TransformBlock(bytes, 0, bytes.Length, bytes, 0);
}
public void Finish(byte[] data, int length)
{
TransformFinalBlock(data, 0, length);
Digest = Hash;
}
public void Finish(string data)
{
var bytes = Encoding.ASCII.GetBytes(data);
TransformFinalBlock(bytes, 0, bytes.Length);
Digest = Hash;
}
}
public class HmacSha256 : HMACSHA256
{
public HmacSha256() : base()
{
Initialize();
}
public HmacSha256(byte[] key) : base(key)
{
Initialize();
}
public void Process(byte[] data, int length)
{
TransformBlock(data, 0, length, data, 0);
}
public void Process(uint data)
{
var bytes = BitConverter.GetBytes(data);
TransformBlock(bytes, 0, bytes.Length, bytes, 0);
}
public void Process(string data)
{
var bytes = Encoding.ASCII.GetBytes(data);
TransformBlock(bytes, 0, bytes.Length, bytes, 0);
}
public void Finish(byte[] data, int length)
{
TransformFinalBlock(data, 0, length);
Digest = Hash;
}
public byte[] Digest { get; private set; }
}
}
+27
View File
@@ -0,0 +1,27 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Database
{
public static class DB
{
public static LoginDatabase Login = new LoginDatabase();
public static CharacterDatabase Characters = new CharacterDatabase();
public static WorldDatabase World = new WorldDatabase();
public static HotfixDatabase Hotfix = new HotfixDatabase();
}
}
+181
View File
@@ -0,0 +1,181 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Configuration;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
namespace Framework.Database
{
public class DatabaseLoader
{
public DatabaseLoader(DatabaseTypeFlags defaultUpdateMask)
{
_autoSetup = ConfigMgr.GetDefaultValue("Updates.AutoSetup", true);
_updateFlags = ConfigMgr.GetDefaultValue("Updates.EnableDatabases", defaultUpdateMask);
}
public void AddDatabase<T>(MySqlBase<T> database, string name)
{
bool updatesEnabled = database.IsAutoUpdateEnabled(_updateFlags);
_open.Add(() =>
{
string dbString = ConfigMgr.GetDefaultValue(name + "DatabaseInfo", "");
if (string.IsNullOrEmpty(dbString))
{
Log.outError(LogFilter.ServerLoading, "Database {0} not specified in configuration file!", name);
return false;
}
var error = database.Initialize(dbString);
if (error != MySqlErrorCode.None)
{
// Database does not exist
if (error == MySqlErrorCode.UnknownDatabase && updatesEnabled && _autoSetup)
{
Log.outInfo(LogFilter.ServerLoading, "Database \"{0}\" does not exist, do you want to create it? [yes (default) / no]: ", name);
string answer = Console.ReadLine();
if (string.IsNullOrEmpty(answer) && answer[0] != 'y')
return false;
Log.outInfo(LogFilter.ServerLoading, "Creating database \"{0}\"...", name);
string sqlString = string.Format("CREATE DATABASE `{0}` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci", name);
// Try to create the database and connect again if auto setup is enabled
if (database.Apply(sqlString) && database.Initialize(dbString) == MySqlErrorCode.None)
error = MySqlErrorCode.None;
}
// If the error wasn't handled quit
if (error != MySqlErrorCode.None)
{
Log.outError(LogFilter.ServerLoading, "\nDatabase {0} NOT opened. There were errors opening the MySQL connections. Check your SQLErrors for specific errors.", name);
return false;
}
Log.outInfo(LogFilter.ServerLoading, "Done.");
}
return true;
});
if (updatesEnabled)
{
// Populate and update only if updates are enabled for this pool
_populate.Add(() =>
{
//Hack used to allow big querys
database.Apply("SET GLOBAL max_allowed_packet=1073741824;");
if (!database.GetUpdater().Populate())
{
Log.outError(LogFilter.ServerLoading, "Could not populate the {0} database, see log for details.", name);
return false;
}
return true;
});
_update.Add(() =>
{
if (!database.GetUpdater().Update())
{
Log.outError(LogFilter.ServerLoading, "Could not update the {0} database, see log for details.", name);
return false;
}
return true;
});
}
_prepare.Add(() =>
{
database.LoadPreparedStatements();
return true;
});
}
public bool Load()
{
if (_updateFlags == 0)
Log.outInfo(LogFilter.SqlUpdates, "Automatic database updates are disabled for all databases!");
if (!OpenDatabases())
return false;
if (!PopulateDatabases())
return false;
if (!UpdateDatabases())
return false;
if (!PrepareStatements())
return false;
return true;
}
bool OpenDatabases()
{
return Process(_open);
}
// Processes the elements of the given stack until a predicate returned false.
bool Process(List<Func<bool>> list)
{
while (!list.Empty())
{
if (!list[0].Invoke())
return false;
list.RemoveAt(0);
}
return true;
}
bool PopulateDatabases()
{
return Process(_populate);
}
bool UpdateDatabases()
{
return Process(_update);
}
bool PrepareStatements()
{
return Process(_prepare);
}
bool _autoSetup;
DatabaseTypeFlags _updateFlags;
List<Func<bool>> _open = new List<Func<bool>>();
List<Func<bool>> _populate = new List<Func<bool>>();
List<Func<bool>> _update = new List<Func<bool>>();
List<Func<bool>> _prepare = new List<Func<bool>>();
}
public enum DatabaseTypeFlags
{
None = 0,
Login = 1,
Character = 2,
World = 4,
Hotfix = 8,
All = Login | Character | World | Hotfix
}
}
+466
View File
@@ -0,0 +1,466 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Configuration;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace Framework.Database
{
public class DatabaseUpdater<T>
{
public DatabaseUpdater(MySqlBase<T> database)
{
_database = database;
}
public bool Populate()
{
SQLResult result = _database.Query("SHOW TABLES");
if (!result.IsEmpty() && result.GetRowCount() > 0)
return true;
Log.outInfo(LogFilter.SqlUpdates, "Database {0} is empty, auto populating it...", _database.GetDatabaseName());
string path = GetSourceDirectory();
string fileName = "Unknown";
switch (_database.GetType().Name)
{
case "LoginDatabase":
fileName = @"\sql\base\auth_database.sql";
break;
case "CharacterDatabase":
fileName = @"\sql\base\characters_database.sql";
break;
case "WorldDatabase":
fileName = @"\sql\base\TDB_world_703.00_2016_10_17.sql";
break;
case "HotfixDatabase":
fileName = @"\sql\base\TDB_hotfixes_703.00_2016_10_17.sql";
break;
}
if (!File.Exists(path + fileName))
{
Log.outError(LogFilter.SqlUpdates, "File \"{0}\" is missing, download it from \"http://www.trinitycore.org/f/files/category/1-database/\"" +
" and place it in your worldserver directory.", fileName);
return false;
}
// Update database
Log.outInfo(LogFilter.SqlUpdates, "Applying \'{0}\'...", fileName);
_database.ApplyFile(path + fileName);
Log.outInfo(LogFilter.SqlUpdates, "Done Applying \'{0}\'", fileName);
return true;
}
public bool Update()
{
Log.outInfo(LogFilter.SqlUpdates, "Updating {0} database...", _database.GetDatabaseName());
string sourceDirectory = GetSourceDirectory();
if (!Directory.Exists(sourceDirectory))
{
Log.outError(LogFilter.SqlUpdates, "DBUpdater: Given source directory {0} does not exist, skipped!", sourceDirectory);
return false;
}
var availableFiles = GetFileList();
var appliedFiles = ReceiveAppliedFiles();
bool redundancyChecks = ConfigMgr.GetDefaultValue("Updates.Redundancy", true);
bool archivedRedundancy = ConfigMgr.GetDefaultValue("Updates.Redundancy", true);
UpdateResult result = new UpdateResult();
// Count updates
foreach (var entry in appliedFiles)
{
if (entry.Value.State == State.RELEASED)
++result.recent;
else
++result.archived;
}
foreach (var availableQuery in availableFiles)
{
Log.outDebug(LogFilter.SqlUpdates, "Checking update \"{0}\"...", availableQuery.GetFileName());
var applied = appliedFiles.LookupByKey(availableQuery.GetFileName());
if (applied != null)
{
// If redundancy is disabled skip it since the update is already applied.
if (!redundancyChecks)
{
Log.outDebug(LogFilter.SqlUpdates, "Update is already applied, skipping redundancy checks.");
appliedFiles.Remove(availableQuery.GetFileName());
continue;
}
// If the update is in an archived directory and is marked as archived in our database skip redundancy checks (archived updates never change).
if (!archivedRedundancy && (applied.State == State.ARCHIVED) && (availableQuery.state == State.ARCHIVED))
{
Log.outDebug(LogFilter.SqlUpdates, "Update is archived and marked as archived in database, skipping redundancy checks.");
appliedFiles.Remove(availableQuery.GetFileName());
continue;
}
}
// Calculate hash
string hash = CalculateHash(availableQuery.path);
UpdateMode mode = UpdateMode.Apply;
// Update is not in our applied list
if (applied == null)
{
// Catch renames (different filename but same hash)
var hashIter = appliedFiles.Values.FirstOrDefault(p => p.Hash == hash);
if (hashIter != null)
{
// Check if the original file was removed if not we've got a problem.
var renameFile = availableFiles.Find(p => p.GetFileName() == hashIter.Name);
if (renameFile != null)
{
Log.outWarn(LogFilter.SqlUpdates, "Seems like update \"{0}\" \'{1}\' was renamed, but the old file is still there! " +
"Trade it as a new file! (Probably its an unmodified copy of file \"{2}\")",
availableQuery.GetFileName(), hash.Substring(0, 7), renameFile.GetFileName());
}
// Its save to trade the file as renamed here
else
{
Log.outInfo(LogFilter.SqlUpdates, "Renaming update \"{0}\" to \"{1}\" \'{2}\'.",
hashIter.Name, availableQuery.GetFileName(), hash.Substring(0, 7));
RenameEntry(hashIter.Name, availableQuery.GetFileName());
appliedFiles.Remove(hashIter.Name);
continue;
}
}
// Apply the update if it was never seen before.
else
{
Log.outInfo(LogFilter.SqlUpdates, "Applying update \"{0}\" \'{1}\'...", availableQuery.GetFileName(), hash.Substring(0, 7));
}
}
// Rehash the update entry if it is contained in our database but with an empty hash.
else if (ConfigMgr.GetDefaultValue("Updates.AllowRehash", true) && string.IsNullOrEmpty(applied.Hash))
{
mode = UpdateMode.Rehash;
Log.outInfo(LogFilter.SqlUpdates, "Re-hashing update \"{0}\" \'{1}\'...", availableQuery.GetFileName(), hash.Substring(0, 7));
}
else
{
// If the hash of the files differs from the one stored in our database reapply the update (because it was changed).
if (applied.Hash != hash)
{
Log.outInfo(LogFilter.SqlUpdates, "Reapplying update \"{0}\" \'{1}\' . \'{2}\' (it changed)...", availableQuery.GetFileName(),
applied.Hash.Substring(0, 7), hash.Substring(0, 7));
}
else
{
// If the file wasn't changed and just moved update its state if necessary.
if (applied.State != availableQuery.state)
{
Log.outDebug(LogFilter.SqlUpdates, "Updating state of \"{0}\" to \'{1}\'...", availableQuery.GetFileName(), availableQuery.state);
UpdateState(availableQuery.GetFileName(), availableQuery.state);
}
Log.outDebug(LogFilter.SqlUpdates, "Update is already applied and is matching hash \'{0}\'.", hash.Substring(0, 7));
appliedFiles.Remove(applied.Name);
continue;
}
}
uint speed = 0;
AppliedFileEntry file = new AppliedFileEntry(availableQuery.GetFileName(), hash, availableQuery.state, 0);
switch (mode)
{
case UpdateMode.Apply:
speed = ApplyTimedFile(availableQuery.path);
goto case UpdateMode.Rehash;
case UpdateMode.Rehash:
UpdateEntry(file, speed);
break;
}
if (applied != null)
appliedFiles.Remove(applied.Name);
if (mode == UpdateMode.Apply)
++result.updated;
}
// Cleanup up orphaned entries if enabled
if (!appliedFiles.Empty())
{
int cleanDeadReferencesMaxCount = ConfigMgr.GetDefaultValue("Updates.CleanDeadRefMaxCount", 3);
bool doCleanup = (cleanDeadReferencesMaxCount < 0) || (appliedFiles.Count <= cleanDeadReferencesMaxCount);
foreach (var entry in appliedFiles)
{
Log.outWarn(LogFilter.SqlUpdates, "File \'{0}\' was applied to the database but is missing in your update directory now!", entry.Key);
if (doCleanup)
Log.outInfo(LogFilter.SqlUpdates, "Deleting orphaned entry \'{0}\'...", entry.Key);
}
if (doCleanup)
CleanUp(appliedFiles);
else
{
Log.outError(LogFilter.SqlUpdates, "Cleanup is disabled! There are {0} dirty files that were applied to your database but are now missing in your source directory!", appliedFiles.Count);
}
}
string info = string.Format("Containing {0} new and {1} archived updates.", result.recent, result.archived);
if (result.updated == 0)
Log.outInfo(LogFilter.SqlUpdates, "{0} database is up-to-date! {1}", _database.GetDatabaseName(), info);
else
Log.outInfo(LogFilter.SqlUpdates, "Applied {0} {1}. {2}", result.updated, result.updated == 1 ? "query" : "queries", info);
return true;
}
string GetSourceDirectory()
{
string entry = ConfigMgr.GetDefaultValue("Updates.SourcePath", Environment.CurrentDirectory);
if (!string.IsNullOrEmpty(entry))
return entry;
else
return Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName;
}
uint ApplyTimedFile(string path)
{
// Benchmark query speed
uint oldMSTime = Time.GetMSTime();
// Update database
_database.ApplyFile(path);
// Return time the query took to apply
return Time.GetMSTimeDiffToNow(oldMSTime);
}
void UpdateEntry(AppliedFileEntry entry, uint speed)
{
string update = "REPLACE INTO `updates` (`name`, `hash`, `state`, `speed`) VALUES (\"" +
entry.Name + "\", \"" + entry.Hash + "\", \'" + entry.State + "\', " + speed + ")";
// Update database
_database.Execute(update);
}
void RenameEntry(string from, string to)
{
// Delete target if it exists
{
string update = "DELETE FROM `updates` WHERE `name`=\"" + to + "\"";
// Update database
_database.Execute(update);
}
// Rename
{
string update = "UPDATE `updates` SET `name`=\"" + to + "\" WHERE `name`=\"" + from + "\"";
// Update database
_database.Execute(update);
}
}
void CleanUp(Dictionary<string, AppliedFileEntry> storage)
{
if (storage.Empty())
return;
int remaining = storage.Count;
string update = "DELETE FROM `updates` WHERE `name` IN(";
foreach (var entry in storage)
{
update += "\"" + entry.Key + "\"";
if ((--remaining) > 0)
update += ", ";
}
update += ")";
// Update database
_database.Execute(update);
}
void UpdateState(string name, State state)
{
string update = "UPDATE `updates` SET `state`=\'" + state + "\' WHERE `name`=\"" + name + "\"";
// Update database
_database.Execute(update);
}
public List<FileEntry> GetFileList()
{
List<FileEntry> fileList = new List<FileEntry>();
SQLResult result = _database.Query("SELECT `path`, `state` FROM `updates_include`");
if (result.IsEmpty())
return fileList;
do
{
string path = result.Read<string>(0);
if (path[0] == '$')
path = GetSourceDirectory() + path.Substring(1);
if (!Directory.Exists(path))
{
Log.outWarn(LogFilter.SqlUpdates, "DBUpdater: Given update include directory \"{0}\" isn't existing, skipped!", path);
continue;
}
State state = result.Read<string>(1).ToEnum<State>();
fileList.AddRange(GetFilesFromDirectory(path, state));
Log.outDebug(LogFilter.SqlUpdates, "Added applied file \"{0}\" from remote.", path);
} while (result.NextRow());
return fileList;
}
public Dictionary<string, AppliedFileEntry> ReceiveAppliedFiles()
{
Dictionary<string, AppliedFileEntry> map = new Dictionary<string, AppliedFileEntry>();
SQLResult result = _database.Query("SELECT `name`, `hash`, `state`, UNIX_TIMESTAMP(`timestamp`) FROM `updates` ORDER BY `name` ASC");
if (result.IsEmpty())
return map;
do
{
AppliedFileEntry entry = new AppliedFileEntry(result.Read<string>(0), result.Read<string>(1), result.Read<string>(2).ToEnum<State>(), result.Read<ulong>(3));
map.Add(entry.Name, entry);
}
while (result.NextRow());
return map;
}
IEnumerable<FileEntry> GetFilesFromDirectory(string directory, State state)
{
Queue<string> queue = new Queue<string>();
queue.Enqueue(directory);
while (queue.Count > 0)
{
directory = queue.Dequeue();
try
{
foreach (string subDir in Directory.GetDirectories(directory))
{
queue.Enqueue(subDir);
}
}
catch (Exception ex)
{
Console.Error.WriteLine(ex);
}
string[] files = Directory.GetFiles(directory, "*.sql");
for (int i = 0; i < files.Length; i++)
{
yield return new FileEntry(files[i], state);
}
}
}
string CalculateHash(string fileName)
{
using (SHA1 sha1 = new SHA1Managed())
{
string text = File.ReadAllText(fileName).Replace("\r", "");
return sha1.ComputeHash(Encoding.UTF8.GetBytes(text)).ToHexString();
}
}
protected MySqlBase<T> _database;
}
public class AppliedFileEntry
{
public AppliedFileEntry(string name, string hash, State state, ulong timestamp)
{
Name = name;
Hash = hash;
State = state;
Timestamp = timestamp;
}
public string Name;
public string Hash;
public State State;
public ulong Timestamp;
}
public class FileEntry
{
public FileEntry(string _path, State _state)
{
path = _path;
state = _state;
}
public string GetFileName()
{
return Path.GetFileName(path);
}
public string path;
public State state;
}
struct UpdateResult
{
public int updated;
public int recent;
public int archived;
}
public enum State
{
RELEASED,
ARCHIVED
}
enum UpdateMode
{
Apply,
Rehash
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,320 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Database
{
public class LoginDatabase : MySqlBase<LoginStatements>
{
public override void PreparedStatements()
{
const string BnetAccountInfo = "ba.id, ba.email, ba.locked, ba.lock_country, ba.last_ip, ba.failed_logins, bab.unbandate > UNIX_TIMESTAMP() OR bab.unbandate = bab.bandate, bab.unbandate = bab.bandate";
const string BnetGameAccountInfo = "a.id, a.username, ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate, ab.unbandate = ab.bandate, aa.gmlevel";
PrepareStatement(LoginStatements.SEL_REALMLIST, "SELECT id, name, address, localAddress, localSubnetMask, port, icon, flag, timezone, allowedSecurityLevel, population, gamebuild, Region, Battlegroup FROM realmlist WHERE flag <> 3 ORDER BY name");
PrepareStatement(LoginStatements.DEL_EXPIRED_IP_BANS, "DELETE FROM ip_banned WHERE unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()");
PrepareStatement(LoginStatements.UPD_EXPIRED_ACCOUNT_BANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()");
PrepareStatement(LoginStatements.SEL_IP_INFO, "(SELECT unbandate > UNIX_TIMESTAMP() OR unbandate = bandate AS banned, NULL as country FROM ip_banned WHERE ip = ?) " +
"UNION (SELECT NULL AS banned, country FROM ip2nation WHERE INET_NTOA(ip) = ?)");
PrepareStatement(LoginStatements.INS_IP_AUTO_BANNED, "INSERT INTO ip_banned (ip, bandate, unbandate, bannedby, banreason) VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Cypher Auth', 'Failed login autoban')");
PrepareStatement(LoginStatements.SEL_IP_BANNED_ALL, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) ORDER BY unbandate");
PrepareStatement(LoginStatements.SEL_IP_BANNED_BY_IP, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) AND ip LIKE CONCAT('%%', ?, '%%') ORDER BY unbandate");
PrepareStatement(LoginStatements.SEL_ACCOUNT_BANNED_ALL, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 GROUP BY account.id");
PrepareStatement(LoginStatements.SEL_ACCOUNT_BANNED_BY_USERNAME, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 AND username LIKE CONCAT('%%', ?, '%%') GROUP BY account.id");
PrepareStatement(LoginStatements.DEL_ACCOUNT_BANNED, "DELETE FROM account_banned WHERE id = ?");
PrepareStatement(LoginStatements.UPD_ACCOUNT_INFO_CONTINUED_SESSION, "UPDATE account SET sessionkey = ? WHERE id = ?");
PrepareStatement(LoginStatements.SEL_ACCOUNT_INFO_CONTINUED_SESSION, "SELECT username, sessionkey FROM account WHERE id = ?");
PrepareStatement(LoginStatements.UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?");
PrepareStatement(LoginStatements.SEL_LOGON_COUNTRY, "SELECT country FROM ip2nation WHERE ip < ? ORDER BY ip DESC LIMIT 0,1");
PrepareStatement(LoginStatements.SEL_ACCOUNT_ID_BY_NAME, "SELECT id FROM account WHERE username = ?");
PrepareStatement(LoginStatements.SEL_ACCOUNT_LIST_BY_NAME, "SELECT id, username FROM account WHERE username = ?");
PrepareStatement(LoginStatements.SEL_ACCOUNT_INFO_BY_NAME, "SELECT a.id, a.sessionkey, ba.last_ip, ba.locked, ba.lock_country, a.expansion, a.mutetime, ba.locale, a.recruiter, a.os, ba.id, aa.gmLevel, " +
"bab.unbandate > UNIX_TIMESTAMP() OR bab.unbandate = bab.bandate, ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate, r.id " +
"FROM account a LEFT JOIN account r ON a.id = r.recruiter LEFT JOIN battlenet_accounts ba ON a.battlenet_account = ba.id " +
"LEFT JOIN account_access aa ON a.id = aa.id AND aa.RealmID IN (-1, ?) LEFT JOIN battlenet_account_bans bab ON ba.id = bab.id LEFT JOIN account_banned ab ON a.id = ab.id AND ab.active = 1 " +
"WHERE a.username = ? ORDER BY aa.RealmID DESC LIMIT 1");
PrepareStatement(LoginStatements.SEL_ACCOUNT_LIST_BY_EMAIL, "SELECT id, username FROM account WHERE email = ?");
PrepareStatement(LoginStatements.SEL_ACCOUNT_BY_IP, "SELECT id, username FROM account WHERE last_ip = ?");
PrepareStatement(LoginStatements.SEL_ACCOUNT_BY_ID, "SELECT 1 FROM account WHERE id = ?");
PrepareStatement(LoginStatements.INS_IP_BANNED, "INSERT INTO ip_banned (ip, bandate, unbandate, bannedby, banreason) VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?)");
PrepareStatement(LoginStatements.DEL_IP_NOT_BANNED, "DELETE FROM ip_banned WHERE ip = ?");
PrepareStatement(LoginStatements.INS_ACCOUNT_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)");
PrepareStatement(LoginStatements.UPD_ACCOUNT_NOT_BANNED, "UPDATE account_banned SET active = 0 WHERE id = ? AND active != 0");
PrepareStatement(LoginStatements.DEL_REALM_CHARACTERS_BY_REALM, "DELETE FROM realmcharacters WHERE acctid = ? AND realmid = ?");
PrepareStatement(LoginStatements.DEL_REALM_CHARACTERS, "DELETE FROM realmcharacters WHERE acctid = ?");
PrepareStatement(LoginStatements.INS_REALM_CHARACTERS, "INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (?, ?, ?)");
PrepareStatement(LoginStatements.SEL_SUM_REALM_CHARACTERS, "SELECT SUM(numchars) FROM realmcharacters WHERE acctid = ?");
PrepareStatement(LoginStatements.INS_ACCOUNT, "INSERT INTO account(username, sha_pass_hash, reg_mail, email, joindate, battlenet_account, battlenet_index) VALUES(?, ?, ?, ?, NOW(), ?, ?)");
PrepareStatement(LoginStatements.INS_REALM_CHARACTERS_INIT, "INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL");
PrepareStatement(LoginStatements.UPD_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_ACCOUNT_LOCK_CONTRY, "UPDATE account SET lock_country = ? WHERE id = ?");
PrepareStatement(LoginStatements.INS_LOG, "INSERT INTO logs (time, realm, type, level, string) VALUES (?, ?, ?, ?, ?)");
PrepareStatement(LoginStatements.UPD_USERNAME, "UPDATE account SET v = 0, s = 0, username = ?, sha_pass_hash = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_PASSWORD, "UPDATE account SET v = 0, s = 0, sha_pass_hash = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_EMAIL, "UPDATE account SET email = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_REG_EMAIL, "UPDATE account SET reg_mail = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_MUTE_TIME, "UPDATE account SET mutetime = ? , mutereason = ? , muteby = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_MUTE_TIME_LOGIN, "UPDATE account SET mutetime = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_LAST_IP, "UPDATE account SET last_ip = ? WHERE username = ?");
PrepareStatement(LoginStatements.UPD_LAST_ATTEMPT_IP, "UPDATE account SET last_attempt_ip = ? WHERE username = ?");
PrepareStatement(LoginStatements.UPD_ACCOUNT_ONLINE, "UPDATE account SET online = 1 WHERE id = ?");
PrepareStatement(LoginStatements.UPD_UPTIME_PLAYERS, "UPDATE uptime SET uptime = ?, maxplayers = ? WHERE realmid = ? AND starttime = ?");
PrepareStatement(LoginStatements.DEL_OLD_LOGS, "DELETE FROM logs WHERE (time + ?) < ? AND realm = ?");
PrepareStatement(LoginStatements.DEL_ACCOUNT_ACCESS, "DELETE FROM account_access WHERE id = ?");
PrepareStatement(LoginStatements.DEL_ACCOUNT_ACCESS_BY_REALM, "DELETE FROM account_access WHERE id = ? AND (RealmID = ? OR RealmID = -1)");
PrepareStatement(LoginStatements.INS_ACCOUNT_ACCESS, "INSERT INTO account_access (id,gmlevel,RealmID) VALUES (?, ?, ?)");
PrepareStatement(LoginStatements.GET_ACCOUNT_ID_BY_USERNAME, "SELECT id FROM account WHERE username = ?");
PrepareStatement(LoginStatements.GET_ACCOUNT_ACCESS_GMLEVEL, "SELECT gmlevel FROM account_access WHERE id = ?");
PrepareStatement(LoginStatements.GET_GMLEVEL_BY_REALMID, "SELECT gmlevel FROM account_access WHERE id = ? AND (RealmID = ? OR RealmID = -1)");
PrepareStatement(LoginStatements.GET_USERNAME_BY_ID, "SELECT username FROM account WHERE id = ?");
PrepareStatement(LoginStatements.SEL_CHECK_PASSWORD, "SELECT 1 FROM account WHERE id = ? AND sha_pass_hash = ?");
PrepareStatement(LoginStatements.SEL_CHECK_PASSWORD_BY_NAME, "SELECT 1 FROM account WHERE username = ? AND sha_pass_hash = ?");
PrepareStatement(LoginStatements.SEL_PINFO, "SELECT a.username, aa.gmlevel, a.email, a.reg_mail, a.last_ip, DATE_FORMAT(a.last_login, '%Y-%m-%d %T'), a.mutetime, a.mutereason, a.muteby, a.failed_logins, a.locked, a.OS FROM account a LEFT JOIN account_access aa ON (a.id = aa.id AND (aa.RealmID = ? OR aa.RealmID = -1)) WHERE a.id = ?");
PrepareStatement(LoginStatements.SEL_PINFO_BANS, "SELECT unbandate, bandate = unbandate, bannedby, banreason FROM account_banned WHERE id = ? AND active ORDER BY bandate ASC LIMIT 1");
PrepareStatement(LoginStatements.SEL_GM_ACCOUNTS, "SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= ? AND (aa.realmid = -1 OR aa.realmid = ?)");
PrepareStatement(LoginStatements.SEL_ACCOUNT_INFO, "SELECT a.username, a.last_ip, aa.gmlevel, a.expansion FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.id = ?");
PrepareStatement(LoginStatements.SEL_ACCOUNT_ACCESS_GMLEVEL_TEST, "SELECT 1 FROM account_access WHERE id = ? AND gmlevel > ?");
PrepareStatement(LoginStatements.SEL_ACCOUNT_ACCESS, "SELECT a.id, aa.gmlevel, aa.RealmID FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?");
PrepareStatement(LoginStatements.SEL_ACCOUNT_WHOIS, "SELECT username, email, last_ip FROM account WHERE id = ?");
PrepareStatement(LoginStatements.SEL_LAST_ATTEMPT_IP, "SELECT last_attempt_ip FROM account WHERE id = ?");
PrepareStatement(LoginStatements.SEL_LAST_IP, "SELECT last_ip FROM account WHERE id = ?");
PrepareStatement(LoginStatements.SEL_REALMLIST_SECURITY_LEVEL, "SELECT allowedSecurityLevel from realmlist WHERE id = ?");
PrepareStatement(LoginStatements.DEL_ACCOUNT, "DELETE FROM account WHERE id = ?");
PrepareStatement(LoginStatements.SEL_IP2NATION_COUNTRY, "SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE i.ip < ? AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1");
PrepareStatement(LoginStatements.SEL_AUTOBROADCAST, "SELECT id, weight, text FROM autobroadcast WHERE realmid = ? OR realmid = -1");
PrepareStatement(LoginStatements.GET_EMAIL_BY_ID, "SELECT email FROM account WHERE id = ?");
// 0: uint32, 1: uint32, 2: uint8, 3: uint32, 4: string // Complete name: "Login_Insert_AccountLoginDeLete_IP_Logging"
PrepareStatement(LoginStatements.INS_ALDL_IP_LOGGING, "INSERT INTO logs_ip_actions (account_id,character_guid,type,ip,systemnote,unixtime,time) VALUES (?, ?, ?, (SELECT last_ip FROM account WHERE id = ?), ?, unix_timestamp(NOW()), NOW())");
// 0: uint32, 1: uint32, 2: uint8, 3: uint32, 4: string // Complete name: "Login_Insert_FailedAccountLogin_IP_Logging"
PrepareStatement(LoginStatements.INS_FACL_IP_LOGGING, "INSERT INTO logs_ip_actions (account_id,character_guid,type,ip,systemnote,unixtime,time) VALUES (?, ?, ?, (SELECT last_attempt_ip FROM account WHERE id = ?), ?, unix_timestamp(NOW()), NOW())");
// 0: uint32, 1: uint32, 2: uint8, 3: string, 4: string // Complete name: "Login_Insert_CharacterDelete_IP_Logging"
PrepareStatement(LoginStatements.INS_CHAR_IP_LOGGING, "INSERT INTO logs_ip_actions (account_id,character_guid,type,ip,systemnote,unixtime,time) VALUES (?, ?, ?, ?, ?, unix_timestamp(NOW()), NOW())");
// 0: string, 1: string, 2: string // Complete name: "Login_Insert_Failed_Account_Login_due_password_IP_Logging"
PrepareStatement(LoginStatements.INS_FALP_IP_LOGGING, "INSERT INTO logs_ip_actions (account_id,character_guid,type,ip,systemnote,unixtime,time) VALUES (?, 0, 1, ?, ?, unix_timestamp(NOW()), NOW())");
PrepareStatement(LoginStatements.SEL_ACCOUNT_ACCESS_BY_ID, "SELECT gmlevel, RealmID FROM account_access WHERE id = ? and (RealmID = ? OR RealmID = -1) ORDER BY gmlevel desc");
PrepareStatement(LoginStatements.SEL_RBAC_ACCOUNT_PERMISSIONS, "SELECT permissionId, granted FROM rbac_account_permissions WHERE accountId = ? AND (realmId = ? OR realmId = -1) ORDER BY permissionId, realmId");
PrepareStatement(LoginStatements.INS_RBAC_ACCOUNT_PERMISSION, "INSERT INTO rbac_account_permissions (accountId, permissionId, granted, realmId) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE granted = VALUES(granted)");
PrepareStatement(LoginStatements.DEL_RBAC_ACCOUNT_PERMISSION, "DELETE FROM rbac_account_permissions WHERE accountId = ? AND permissionId = ? AND (realmId = ? OR realmId = -1)");
PrepareStatement(LoginStatements.INS_ACCOUNT_MUTE, "INSERT INTO account_muted VALUES (?, UNIX_TIMESTAMP(), ?, ?, ?)");
PrepareStatement(LoginStatements.SEL_ACCOUNT_MUTE_INFO, "SELECT mutedate, mutetime, mutereason, mutedby FROM account_muted WHERE guid = ? ORDER BY mutedate ASC");
PrepareStatement(LoginStatements.DEL_ACCOUNT_MUTED, "DELETE FROM account_muted WHERE guid = ?");
PrepareStatement(LoginStatements.SEL_BNET_ACCOUNT_INFO, "SELECT " + BnetAccountInfo + ", " + BnetGameAccountInfo + ", ba.sha_pass_hash" +
" FROM battlenet_accounts ba LEFT JOIN battlenet_account_bans bab ON ba.id = bab.id LEFT JOIN account a ON ba.id = a.battlenet_account" +
" LEFT JOIN account_banned ab ON a.id = ab.id AND ab.active = 1 LEFT JOIN account_access aa ON a.id = aa.id AND aa.RealmID = -1 WHERE ba.email = ? ORDER BY a.id");
PrepareStatement(LoginStatements.UPD_BNET_LAST_LOGIN_INFO, "UPDATE battlenet_accounts SET last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_BNET_GAME_ACCOUNT_LOGIN_INFO, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ? WHERE username = ?");
PrepareStatement(LoginStatements.SEL_BNET_CHARACTER_COUNTS_BY_ACCOUNT_ID, "SELECT rc.acctid, rc.numchars, r.id, r.Region, r.Battlegroup FROM realmcharacters rc INNER JOIN realmlist r ON rc.realmid = r.id WHERE rc.acctid = ?");
PrepareStatement(LoginStatements.SEL_BNET_CHARACTER_COUNTS_BY_BNET_ID, "SELECT rc.acctid, rc.numchars, r.id, r.Region, r.Battlegroup FROM realmcharacters rc INNER JOIN realmlist r ON rc.realmid = r.id LEFT JOIN account a ON rc.acctid = a.id WHERE a.battlenet_account = ?");
PrepareStatement(LoginStatements.SEL_BNET_LAST_PLAYER_CHARACTERS, "SELECT lpc.accountId, lpc.region, lpc.battlegroup, lpc.realmId, lpc.characterName, lpc.characterGUID, lpc.lastPlayedTime FROM account_last_played_character lpc LEFT JOIN account a ON lpc.accountId = a.id WHERE a.battlenet_account = ?");
PrepareStatement(LoginStatements.DEL_BNET_LAST_PLAYER_CHARACTERS, "DELETE FROM account_last_played_character WHERE accountId = ? AND region = ? AND battlegroup = ?");
PrepareStatement(LoginStatements.INS_BNET_LAST_PLAYER_CHARACTERS, "INSERT INTO account_last_played_character (accountId, region, battlegroup, realmId, characterName, characterGUID, lastPlayedTime) VALUES (?,?,?,?,?,?,?)");
PrepareStatement(LoginStatements.INS_BNET_ACCOUNT, "INSERT INTO battlenet_accounts (`email`,`sha_pass_hash`) VALUES (?, ?)");
PrepareStatement(LoginStatements.SEL_BNET_ACCOUNT_EMAIL_BY_ID, "SELECT email FROM battlenet_accounts WHERE id = ?");
PrepareStatement(LoginStatements.SEL_BNET_ACCOUNT_ID_BY_EMAIL, "SELECT id FROM battlenet_accounts WHERE email = ?");
PrepareStatement(LoginStatements.UPD_BNET_PASSWORD, "UPDATE battlenet_accounts SET sha_pass_hash = ? WHERE id = ?");
PrepareStatement(LoginStatements.SEL_BNET_CHECK_PASSWORD, "SELECT 1 FROM battlenet_accounts WHERE id = ? AND sha_pass_hash = ?");
PrepareStatement(LoginStatements.UPD_BNET_ACCOUNT_LOCK, "UPDATE battlenet_accounts SET locked = ? WHERE id = ?");
PrepareStatement(LoginStatements.UPD_BNET_ACCOUNT_LOCK_CONTRY, "UPDATE battlenet_accounts SET lock_country = ? WHERE id = ?");
PrepareStatement(LoginStatements.SEL_BNET_ACCOUNT_ID_BY_GAME_ACCOUNT, "SELECT battlenet_account FROM account WHERE id = ?");
PrepareStatement(LoginStatements.UPD_BNET_GAME_ACCOUNT_LINK, "UPDATE account SET battlenet_account = ?, battlenet_index = ? WHERE id = ?");
PrepareStatement(LoginStatements.SEL_BNET_MAX_ACCOUNT_INDEX, "SELECT MAX(battlenet_index) FROM account WHERE battlenet_account = ?");
PrepareStatement(LoginStatements.SEL_BNET_GAME_ACCOUNT_LIST, "SELECT a.id, a.username FROM account a LEFT JOIN battlenet_accounts ba ON a.battlenet_account = ba.id WHERE ba.email = ?");
PrepareStatement(LoginStatements.UPD_BNET_FAILED_LOGINS, "UPDATE battlenet_accounts SET failed_logins = failed_logins + 1 WHERE id = ?");
PrepareStatement(LoginStatements.INS_BNET_ACCOUNT_AUTO_BANNED, "INSERT INTO battlenet_account_bans(id, bandate, unbandate, bannedby, banreason) VALUES(?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity Auth', 'Failed login autoban')");
PrepareStatement(LoginStatements.DEL_BNET_EXPIRED_ACCOUNT_BANNED, "DELETE FROM battlenet_account_bans WHERE unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()");
PrepareStatement(LoginStatements.UPD_BNET_RESET_FAILED_LOGINS, "UPDATE battlenet_accounts SET failed_logins = 0 WHERE id = ?");
PrepareStatement(LoginStatements.SEL_LAST_CHAR_UNDELETE, "SELECT LastCharacterUndelete FROM battlenet_accounts WHERE Id = ?");
PrepareStatement(LoginStatements.UPD_LAST_CHAR_UNDELETE, "UPDATE battlenet_accounts SET LastCharacterUndelete = UNIX_TIMESTAMP() WHERE Id = ?");
// Account wide toys
PrepareStatement(LoginStatements.SEL_ACCOUNT_TOYS, "SELECT itemId, isFavourite FROM battlenet_account_toys WHERE accountId = ?");
PrepareStatement(LoginStatements.REP_ACCOUNT_TOYS, "REPLACE INTO battlenet_account_toys (accountId, itemId, isFavourite) VALUES (?, ?, ?)");
// Battle Pets
PrepareStatement(LoginStatements.SEL_BATTLE_PETS, "SELECT guid, species, breed, level, exp, health, quality, flags, name FROM battle_pets WHERE battlenetAccountId = ?");
PrepareStatement(LoginStatements.INS_BATTLE_PETS, "INSERT INTO battle_pets (guid, battlenetAccountId, species, breed, level, exp, health, quality, flags, name) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
PrepareStatement(LoginStatements.DEL_BATTLE_PETS, "DELETE FROM battle_pets WHERE battlenetAccountId = ? AND guid = ?");
PrepareStatement(LoginStatements.UPD_BATTLE_PETS, "UPDATE battle_pets SET level = ?, exp = ?, health = ?, quality = ?, flags = ?, name = ? WHERE battlenetAccountId = ? AND guid = ?");
PrepareStatement(LoginStatements.SEL_BATTLE_PET_SLOTS, "SELECT id, battlePetGuid, locked FROM battle_pet_slots WHERE battlenetAccountId = ?");
PrepareStatement(LoginStatements.INS_BATTLE_PET_SLOTS, "INSERT INTO battle_pet_slots (id, battlenetAccountId, battlePetGuid, locked) VALUES (?, ?, ?, ?)");
PrepareStatement(LoginStatements.DEL_BATTLE_PET_SLOTS, "DELETE FROM battle_pet_slots WHERE battlenetAccountId = ?");
PrepareStatement(LoginStatements.SEL_ACCOUNT_HEIRLOOMS, "SELECT itemId, flags FROM battlenet_account_heirlooms WHERE accountId = ?");
PrepareStatement(LoginStatements.REP_ACCOUNT_HEIRLOOMS, "REPLACE INTO battlenet_account_heirlooms (accountId, itemId, flags) VALUES (?, ?, ?)");
// Account wide mounts
PrepareStatement(LoginStatements.SEL_ACCOUNT_MOUNTS, "SELECT mountSpellId, flags FROM battlenet_account_mounts WHERE battlenetAccountId = ?");
PrepareStatement(LoginStatements.REP_ACCOUNT_MOUNTS, "REPLACE INTO battlenet_account_mounts (battlenetAccountId, mountSpellId, flags) VALUES (?, ?, ?)");
// Transmog collection
PrepareStatement(LoginStatements.SEL_BNET_ITEM_APPEARANCES, "SELECT blobIndex, appearanceMask FROM battlenet_item_appearances WHERE battlenetAccountId = ? ORDER BY blobIndex DESC");
PrepareStatement(LoginStatements.INS_BNET_ITEM_APPEARANCES, "INSERT INTO battlenet_item_appearances (battlenetAccountId, blobIndex, appearanceMask) VALUES (?, ?, ?) " +
"ON DUPLICATE KEY UPDATE appearanceMask = appearanceMask | VALUES(appearanceMask)");
PrepareStatement(LoginStatements.SEL_BNET_ITEM_FAVORITE_APPEARANCES, "SELECT itemModifiedAppearanceId FROM battlenet_item_favorite_appearances WHERE battlenetAccountId = ?");
PrepareStatement(LoginStatements.INS_BNET_ITEM_FAVORITE_APPEARANCE, "INSERT INTO battlenet_item_favorite_appearances (battlenetAccountId, itemModifiedAppearanceId) VALUES (?, ?)");
PrepareStatement(LoginStatements.DEL_BNET_ITEM_FAVORITE_APPEARANCE, "DELETE FROM battlenet_item_favorite_appearances WHERE battlenetAccountId = ? AND itemModifiedAppearanceId = ?");
}
}
public enum LoginStatements
{
SEL_REALMLIST,
DEL_EXPIRED_IP_BANS,
UPD_EXPIRED_ACCOUNT_BANS,
SEL_IP_INFO,
INS_IP_AUTO_BANNED,
SEL_ACCOUNT_BANNED_ALL,
SEL_ACCOUNT_BANNED_BY_USERNAME,
DEL_ACCOUNT_BANNED,
UPD_ACCOUNT_INFO_CONTINUED_SESSION,
SEL_ACCOUNT_INFO_CONTINUED_SESSION,
UPD_VS,
SEL_LOGON_COUNTRY,
SEL_ACCOUNT_ID_BY_NAME,
SEL_ACCOUNT_LIST_BY_NAME,
SEL_ACCOUNT_INFO_BY_NAME,
SEL_ACCOUNT_LIST_BY_EMAIL,
SEL_ACCOUNT_BY_IP,
INS_IP_BANNED,
DEL_IP_NOT_BANNED,
SEL_IP_BANNED_ALL,
SEL_IP_BANNED_BY_IP,
SEL_ACCOUNT_BY_ID,
INS_ACCOUNT_BANNED,
UPD_ACCOUNT_NOT_BANNED,
DEL_REALM_CHARACTERS_BY_REALM,
DEL_REALM_CHARACTERS,
INS_REALM_CHARACTERS,
SEL_SUM_REALM_CHARACTERS,
INS_ACCOUNT,
INS_REALM_CHARACTERS_INIT,
UPD_EXPANSION,
UPD_ACCOUNT_LOCK,
UPD_ACCOUNT_LOCK_CONTRY,
INS_LOG,
UPD_USERNAME,
UPD_PASSWORD,
UPD_EMAIL,
UPD_REG_EMAIL,
UPD_MUTE_TIME,
UPD_MUTE_TIME_LOGIN,
UPD_LAST_IP,
UPD_LAST_ATTEMPT_IP,
UPD_ACCOUNT_ONLINE,
UPD_UPTIME_PLAYERS,
DEL_OLD_LOGS,
DEL_ACCOUNT_ACCESS,
DEL_ACCOUNT_ACCESS_BY_REALM,
INS_ACCOUNT_ACCESS,
GET_ACCOUNT_ID_BY_USERNAME,
GET_ACCOUNT_ACCESS_GMLEVEL,
GET_GMLEVEL_BY_REALMID,
GET_USERNAME_BY_ID,
SEL_CHECK_PASSWORD,
SEL_CHECK_PASSWORD_BY_NAME,
SEL_PINFO,
SEL_PINFO_BANS,
SEL_GM_ACCOUNTS,
SEL_ACCOUNT_INFO,
SEL_ACCOUNT_ACCESS_GMLEVEL_TEST,
SEL_ACCOUNT_ACCESS,
SEL_ACCOUNT_RECRUITER,
SEL_BANS,
SEL_ACCOUNT_WHOIS,
SEL_REALMLIST_SECURITY_LEVEL,
DEL_ACCOUNT,
SEL_IP2NATION_COUNTRY,
SEL_AUTOBROADCAST,
SEL_LAST_ATTEMPT_IP,
SEL_LAST_IP,
GET_EMAIL_BY_ID,
INS_ALDL_IP_LOGGING,
INS_FACL_IP_LOGGING,
INS_CHAR_IP_LOGGING,
INS_FALP_IP_LOGGING,
SEL_ACCOUNT_ACCESS_BY_ID,
SEL_RBAC_ACCOUNT_PERMISSIONS,
INS_RBAC_ACCOUNT_PERMISSION,
DEL_RBAC_ACCOUNT_PERMISSION,
INS_ACCOUNT_MUTE,
SEL_ACCOUNT_MUTE_INFO,
DEL_ACCOUNT_MUTED,
SEL_BNET_ACCOUNT_INFO,
UPD_BNET_LAST_LOGIN_INFO,
UPD_BNET_GAME_ACCOUNT_LOGIN_INFO,
SEL_BNET_CHARACTER_COUNTS_BY_ACCOUNT_ID,
SEL_BNET_CHARACTER_COUNTS_BY_BNET_ID,
SEL_BNET_LAST_PLAYER_CHARACTERS,
DEL_BNET_LAST_PLAYER_CHARACTERS,
INS_BNET_LAST_PLAYER_CHARACTERS,
INS_BNET_ACCOUNT,
SEL_BNET_ACCOUNT_EMAIL_BY_ID,
SEL_BNET_ACCOUNT_ID_BY_EMAIL,
UPD_BNET_PASSWORD,
SEL_BNET_ACCOUNT_SALT_BY_ID,
SEL_BNET_CHECK_PASSWORD,
UPD_BNET_ACCOUNT_LOCK,
UPD_BNET_ACCOUNT_LOCK_CONTRY,
SEL_BNET_ACCOUNT_ID_BY_GAME_ACCOUNT,
UPD_BNET_GAME_ACCOUNT_LINK,
SEL_BNET_MAX_ACCOUNT_INDEX,
SEL_BNET_GAME_ACCOUNT_LIST,
UPD_BNET_FAILED_LOGINS,
INS_BNET_ACCOUNT_AUTO_BANNED,
DEL_BNET_EXPIRED_ACCOUNT_BANNED,
UPD_BNET_RESET_FAILED_LOGINS,
SEL_LAST_CHAR_UNDELETE,
UPD_LAST_CHAR_UNDELETE,
SEL_ACCOUNT_TOYS,
REP_ACCOUNT_TOYS,
SEL_BATTLE_PETS,
INS_BATTLE_PETS,
DEL_BATTLE_PETS,
UPD_BATTLE_PETS,
SEL_BATTLE_PET_SLOTS,
INS_BATTLE_PET_SLOTS,
DEL_BATTLE_PET_SLOTS,
SEL_ACCOUNT_HEIRLOOMS,
REP_ACCOUNT_HEIRLOOMS,
SEL_ACCOUNT_MOUNTS,
REP_ACCOUNT_MOUNTS,
SEL_BNET_ITEM_APPEARANCES,
INS_BNET_ITEM_APPEARANCES,
SEL_BNET_ITEM_FAVORITE_APPEARANCES,
INS_BNET_ITEM_FAVORITE_APPEARANCE,
DEL_BNET_ITEM_FAVORITE_APPEARANCE,
MAX_LOGINDATABASE_STATEMENTS
}
}
@@ -0,0 +1,171 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Framework.Database
{
public class WorldDatabase : MySqlBase<WorldStatements>
{
public override void PreparedStatements()
{
PrepareStatement(WorldStatements.SEL_QUEST_POOLS, "SELECT entry, pool_entry FROM pool_quest");
PrepareStatement(WorldStatements.DEL_CRELINKED_RESPAWN, "DELETE FROM linked_respawn WHERE guid = ?");
PrepareStatement(WorldStatements.REP_CREATURE_LINKED_RESPAWN, "REPLACE INTO linked_respawn (guid, linkedGuid) VALUES (?, ?)");
PrepareStatement(WorldStatements.SEL_CREATURE_TEXT, "SELECT entry, groupid, id, text, type, language, probability, emote, duration, sound, BroadcastTextID, TextRange FROM creature_text");
PrepareStatement(WorldStatements.SEL_SMART_SCRIPTS, "SELECT entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, event_param_string, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o FROM smart_scripts ORDER BY entryorguid, source_type, id, link");
PrepareStatement(WorldStatements.SEL_SMARTAI_WP, "SELECT entry, pointid, position_x, position_y, position_z FROM waypoints ORDER BY entry, pointid");
PrepareStatement(WorldStatements.DEL_GAMEOBJECT, "DELETE FROM gameobject WHERE guid = ?");
PrepareStatement(WorldStatements.DEL_EVENT_GAMEOBJECT, "DELETE FROM game_event_gameobject WHERE guid = ?");
PrepareStatement(WorldStatements.INS_GRAVEYARD_ZONE, "INSERT INTO graveyard_zone (ID, GhostZone, faction) VALUES (?, ?, ?)");
PrepareStatement(WorldStatements.DEL_GRAVEYARD_ZONE, "DELETE FROM graveyard_zone WHERE ID = ? AND GhostZone = ? AND faction = ?");
PrepareStatement(WorldStatements.INS_GAME_TELE, "INSERT INTO game_tele (id, position_x, position_y, position_z, orientation, map, name) VALUES (?, ?, ?, ?, ?, ?, ?)");
PrepareStatement(WorldStatements.DEL_GAME_TELE, "DELETE FROM game_tele WHERE name = ?");
PrepareStatement(WorldStatements.INS_NPC_VENDOR, "INSERT INTO npc_vendor (entry, item, maxcount, incrtime, extendedcost, type) VALUES(?, ?, ?, ?, ?, ?)");
PrepareStatement(WorldStatements.DEL_NPC_VENDOR, "DELETE FROM npc_vendor WHERE entry = ? AND item = ? AND type = ?");
PrepareStatement(WorldStatements.SEL_NPC_VENDOR_REF, "SELECT item, maxcount, incrtime, ExtendedCost, type FROM npc_vendor WHERE entry = ? AND type = ? ORDER BY slot ASC");
PrepareStatement(WorldStatements.UPD_CREATURE_MOVEMENT_TYPE, "UPDATE creature SET MovementType = ? WHERE guid = ?");
PrepareStatement(WorldStatements.UPD_CREATURE_FACTION, "UPDATE creature_template SET faction = ? WHERE entry = ?");
PrepareStatement(WorldStatements.UPD_CREATURE_NPCFLAG, "UPDATE creature_template SET npcflag = ? WHERE entry = ?");
PrepareStatement(WorldStatements.UPD_CREATURE_POSITION, "UPDATE creature SET position_x = ?, position_y = ?, position_z = ?, orientation = ? WHERE guid = ?");
PrepareStatement(WorldStatements.UPD_CREATURE_SPAWN_DISTANCE, "UPDATE creature SET spawndist = ?, MovementType = ? WHERE guid = ?");
PrepareStatement(WorldStatements.UPD_CREATURE_SPAWN_TIME_SECS, "UPDATE creature SET spawntimesecs = ? WHERE guid = ?");
PrepareStatement(WorldStatements.INS_CREATURE_FORMATION, "INSERT INTO creature_formations (leaderGUID, memberGUID, dist, angle, groupAI) VALUES (?, ?, ?, ?, ?)");
PrepareStatement(WorldStatements.INS_WAYPOINT_DATA, "INSERT INTO waypoint_data (id, point, position_x, position_y, position_z) VALUES (?, ?, ?, ?, ?)");
PrepareStatement(WorldStatements.DEL_WAYPOINT_DATA, "DELETE FROM waypoint_data WHERE id = ? AND point = ?");
PrepareStatement(WorldStatements.UPD_WAYPOINT_DATA_POINT, "UPDATE waypoint_data SET point = point - 1 WHERE id = ? AND point > ?");
PrepareStatement(WorldStatements.UPD_WAYPOINT_DATA_POSITION, "UPDATE waypoint_data SET position_x = ?, position_y = ?, position_z = ? where id = ? AND point = ?");
PrepareStatement(WorldStatements.UPD_WAYPOINT_DATA_WPGUID, "UPDATE waypoint_data SET wpguid = ? WHERE id = ? and point = ?");
PrepareStatement(WorldStatements.SEL_WAYPOINT_DATA_MAX_ID, "SELECT MAX(id) FROM waypoint_data");
PrepareStatement(WorldStatements.SEL_WAYPOINT_DATA_MAX_POINT, "SELECT MAX(point) FROM waypoint_data WHERE id = ?");
PrepareStatement(WorldStatements.SEL_WAYPOINT_DATA_BY_ID, "SELECT point, position_x, position_y, position_z, orientation, move_type, delay, action, action_chance FROM waypoint_data WHERE id = ? ORDER BY point");
PrepareStatement(WorldStatements.SEL_WAYPOINT_DATA_POS_BY_ID, "SELECT point, position_x, position_y, position_z FROM waypoint_data WHERE id = ?");
PrepareStatement(WorldStatements.SEL_WAYPOINT_DATA_POS_FIRST_BY_ID, "SELECT position_x, position_y, position_z FROM waypoint_data WHERE point = 1 AND id = ?");
PrepareStatement(WorldStatements.SEL_WAYPOINT_DATA_POS_LAST_BY_ID, "SELECT position_x, position_y, position_z, orientation FROM waypoint_data WHERE id = ? ORDER BY point DESC LIMIT 1");
PrepareStatement(WorldStatements.SEL_WAYPOINT_DATA_BY_WPGUID, "SELECT id, point FROM waypoint_data WHERE wpguid = ?");
PrepareStatement(WorldStatements.SEL_WAYPOINT_DATA_ALL_BY_WPGUID, "SELECT id, point, delay, move_type, action, action_chance FROM waypoint_data WHERE wpguid = ?");
PrepareStatement(WorldStatements.UPD_WAYPOINT_DATA_ALL_WPGUID, "UPDATE waypoint_data SET wpguid = 0");
PrepareStatement(WorldStatements.SEL_WAYPOINT_DATA_BY_POS, "SELECT id, point FROM waypoint_data WHERE (abs(position_x - ?) <= ?) and (abs(position_y - ?) <= ?) and (abs(position_z - ?) <= ?)");
PrepareStatement(WorldStatements.SEL_WAYPOINT_DATA_WPGUID_BY_ID, "SELECT wpguid FROM waypoint_data WHERE id = ? and wpguid <> 0");
PrepareStatement(WorldStatements.SEL_WAYPOINT_DATA_ACTION, "SELECT DISTINCT action FROM waypoint_data");
PrepareStatement(WorldStatements.SEL_WAYPOINT_SCRIPTS_MAX_ID, "SELECT MAX(guid) FROM waypoint_scripts");
PrepareStatement(WorldStatements.INS_CREATURE_ADDON, "INSERT INTO creature_addon(guid, path_id) VALUES (?, ?)");
PrepareStatement(WorldStatements.UPD_CREATURE_ADDON_PATH, "UPDATE creature_addon SET path_id = ? WHERE guid = ?");
PrepareStatement(WorldStatements.DEL_CREATURE_ADDON, "DELETE FROM creature_addon WHERE guid = ?");
PrepareStatement(WorldStatements.SEL_CREATURE_ADDON_BY_GUID, "SELECT guid FROM creature_addon WHERE guid = ?");
PrepareStatement(WorldStatements.INS_WAYPOINT_SCRIPT, "INSERT INTO waypoint_scripts (guid) VALUES (?)");
PrepareStatement(WorldStatements.DEL_WAYPOINT_SCRIPT, "DELETE FROM waypoint_scripts WHERE guid = ?");
PrepareStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_ID, "UPDATE waypoint_scripts SET id = ? WHERE guid = ?");
PrepareStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_X, "UPDATE waypoint_scripts SET x = ? WHERE guid = ?");
PrepareStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_Y, "UPDATE waypoint_scripts SET y = ? WHERE guid = ?");
PrepareStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_Z, "UPDATE waypoint_scripts SET z = ? WHERE guid = ?");
PrepareStatement(WorldStatements.UPD_WAYPOINT_SCRIPT_O, "UPDATE waypoint_scripts SET o = ? WHERE guid = ?");
PrepareStatement(WorldStatements.SEL_WAYPOINT_SCRIPT_ID_BY_GUID, "SELECT id FROM waypoint_scripts WHERE guid = ?");
PrepareStatement(WorldStatements.DEL_CREATURE, "DELETE FROM creature WHERE guid = ?");
PrepareStatement(WorldStatements.SEL_COMMANDS, "SELECT name, permission, help FROM command");
PrepareStatement(WorldStatements.SEL_CREATURE_TEMPLATE, "SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, femaleName, subname, IconName, gossip_menu_id, minlevel, maxlevel, HealthScalingExpansion, RequiredExpansion, VignetteID, faction, npcflag, speed_walk, speed_run, scale, rank, dmgschool, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, unit_class, unit_flags, unit_flags2, unit_flags3, dynamicflags, family, trainer_type, trainer_class, trainer_race, type, type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, HealthModifier, HealthModifierExtra, ManaModifier, ManaModifierExtra, ArmorModifier, DamageModifier, ExperienceModifier, RacialLeader, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?");
PrepareStatement(WorldStatements.SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?");
PrepareStatement(WorldStatements.SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?");
PrepareStatement(WorldStatements.SEL_GAMEOBJECT_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM gameobject WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_");
PrepareStatement(WorldStatements.SEL_CREATURE_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM creature WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_");
PrepareStatement(WorldStatements.INS_CREATURE, "INSERT INTO creature (guid, id , map, spawnMask, PhaseId, PhaseGroup, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint, curhealth, curmana, MovementType, npcflag, unit_flags, unit_flags2, unit_flags3, dynamicflags) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
PrepareStatement(WorldStatements.DEL_GAME_EVENT_CREATURE, "DELETE FROM game_event_creature WHERE guid = ?");
PrepareStatement(WorldStatements.DEL_GAME_EVENT_MODEL_EQUIP, "DELETE FROM game_event_model_equip WHERE guid = ?");
PrepareStatement(WorldStatements.INS_GAMEOBJECT, "INSERT INTO gameobject (guid, id, map, spawnMask, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
PrepareStatement(WorldStatements.INS_DISABLES, "INSERT INTO disables (entry, sourceType, flags, comment) VALUES (?, ?, ?, ?)");
PrepareStatement(WorldStatements.SEL_DISABLES, "SELECT entry FROM disables WHERE entry = ? AND sourceType = ?");
PrepareStatement(WorldStatements.DEL_DISABLES, "DELETE FROM disables WHERE entry = ? AND sourceType = ?");
PrepareStatement(WorldStatements.UPD_CREATURE_ZONE_AREA_DATA, "UPDATE creature SET zoneId = ?, areaId = ? WHERE guid = ?");
PrepareStatement(WorldStatements.UPD_GAMEOBJECT_ZONE_AREA_DATA, "UPDATE gameobject SET zoneId = ?, areaId = ? WHERE guid = ?");
PrepareStatement(WorldStatements.SEL_GUILD_REWARDS_REQ_ACHIEVEMENTS, "SELECT AchievementRequired FROM guild_rewards_req_achievements WHERE ItemID = ?");
}
}
public enum WorldStatements
{
SEL_QUEST_POOLS,
DEL_CRELINKED_RESPAWN,
REP_CREATURE_LINKED_RESPAWN,
SEL_CREATURE_TEXT,
SEL_SMART_SCRIPTS,
SEL_SMARTAI_WP,
DEL_GAMEOBJECT,
DEL_EVENT_GAMEOBJECT,
INS_GRAVEYARD_ZONE,
DEL_GRAVEYARD_ZONE,
INS_GAME_TELE,
DEL_GAME_TELE,
INS_NPC_VENDOR,
DEL_NPC_VENDOR,
SEL_NPC_VENDOR_REF,
UPD_CREATURE_MOVEMENT_TYPE,
UPD_CREATURE_FACTION,
UPD_CREATURE_NPCFLAG,
UPD_CREATURE_POSITION,
UPD_CREATURE_SPAWN_DISTANCE,
UPD_CREATURE_SPAWN_TIME_SECS,
INS_CREATURE_FORMATION,
INS_WAYPOINT_DATA,
DEL_WAYPOINT_DATA,
UPD_WAYPOINT_DATA_POINT,
UPD_WAYPOINT_DATA_POSITION,
UPD_WAYPOINT_DATA_WPGUID,
UPD_WAYPOINT_DATA_ALL_WPGUID,
SEL_WAYPOINT_DATA_MAX_ID,
SEL_WAYPOINT_DATA_BY_ID,
SEL_WAYPOINT_DATA_POS_BY_ID,
SEL_WAYPOINT_DATA_POS_FIRST_BY_ID,
SEL_WAYPOINT_DATA_POS_LAST_BY_ID,
SEL_WAYPOINT_DATA_BY_WPGUID,
SEL_WAYPOINT_DATA_ALL_BY_WPGUID,
SEL_WAYPOINT_DATA_MAX_POINT,
SEL_WAYPOINT_DATA_BY_POS,
SEL_WAYPOINT_DATA_WPGUID_BY_ID,
SEL_WAYPOINT_DATA_ACTION,
SEL_WAYPOINT_SCRIPTS_MAX_ID,
UPD_CREATURE_ADDON_PATH,
INS_CREATURE_ADDON,
DEL_CREATURE_ADDON,
SEL_CREATURE_ADDON_BY_GUID,
INS_WAYPOINT_SCRIPT,
DEL_WAYPOINT_SCRIPT,
UPD_WAYPOINT_SCRIPT_ID,
UPD_WAYPOINT_SCRIPT_X,
UPD_WAYPOINT_SCRIPT_Y,
UPD_WAYPOINT_SCRIPT_Z,
UPD_WAYPOINT_SCRIPT_O,
SEL_WAYPOINT_SCRIPT_ID_BY_GUID,
DEL_CREATURE,
SEL_COMMANDS,
SEL_CREATURE_TEMPLATE,
SEL_WAYPOINT_SCRIPT_BY_ID,
SEL_CREATURE_BY_ID,
SEL_GAMEOBJECT_NEAREST,
SEL_CREATURE_NEAREST,
SEL_GAMEOBJECT_TARGET,
INS_CREATURE,
DEL_GAME_EVENT_CREATURE,
DEL_GAME_EVENT_MODEL_EQUIP,
INS_GAMEOBJECT,
SEL_DISABLES,
INS_DISABLES,
DEL_DISABLES,
UPD_CREATURE_ZONE_AREA_DATA,
UPD_GAMEOBJECT_ZONE_AREA_DATA,
SEL_GUILD_REWARDS_REQ_ACHIEVEMENTS,
MAX_WORLDDATABASE_STATEMENTS
}
}
+422
View File
@@ -0,0 +1,422 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Collections;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Transactions;
namespace Framework.Database
{
public class MySqlConnectionInfo
{
public MySqlConnectionInfo(string info, int poolSize = 10)
{
var lines = new StringArray(info, ';');
Host = lines[0];
Port = lines[1];
Username = lines[2];
Password = lines[3];
Database = lines[4];
Poolsize = poolSize;
}
public MySqlConnection GetConnection()
{
return new MySqlConnection(string.Format("Server={0};Port={1};User Id={2};Password={3};Database={4};Allow Zero Datetime=True;Allow User Variables=True;Pooling=true;MaximumPoolSize={5};",
Host, Port, Username, Password, Database, Poolsize));
}
public MySqlConnection GetConnectionNoDatabase()
{
return new MySqlConnection(string.Format("Server={0};Port={1};User Id={2};Password={3};Allow Zero Datetime=True;Allow User Variables=True;Pooling=true;MaximumPoolSize={4};",
Host, Port, Username, Password, Poolsize));
}
public string Host;
public string Port;
public string Username;
public string Password;
public string Database;
public int Poolsize;
}
public abstract class MySqlBase<T>
{
public MySqlErrorCode Initialize(string infoString)
{
_connectionInfo = new MySqlConnectionInfo(infoString);
_updater = new DatabaseUpdater<T>(this);
using (var connection = _connectionInfo.GetConnection())
{
try
{
connection.Open();
Log.outInfo(LogFilter.SqlDriver, "Connected to MySQL(ver: {0}) Database: {1}", connection.ServerVersion, _connectionInfo.Database);
return MySqlErrorCode.None;
}
catch (MySqlException ex)
{
return (MySqlErrorCode)((MySqlException)ex.InnerException).Number;
}
}
}
public void Execute(string sql, params object[] args)
{
Execute(new PreparedStatement(string.Format(sql, args)));
}
public void Execute(PreparedStatement stmt)
{
using (var Connection = _connectionInfo.GetConnection())
{
Connection.Open();
using (MySqlCommand cmd = Connection.CreateCommand())
{
try
{
cmd.CommandText = stmt.CommandText;
foreach (var parameter in stmt.Parameters)
cmd.Parameters.AddWithValue("@" + parameter.Key, parameter.Value);
cmd.ExecuteNonQuery();
}
catch (MySqlException ex)
{
HandleMySQLException(ex, stmt.CommandText);
}
}
}
}
public void ExecuteOrAppend(SQLTransaction trans, PreparedStatement stmt)
{
if (trans == null)
Execute(stmt);
else
trans.Append(stmt);
}
public SQLResult Query(string sql, params object[] args)
{
return Query(new PreparedStatement(string.Format(sql, args)));
}
public SQLResult Query(PreparedStatement stmt)
{
List<object[]> rows = new List<object[]>();
using (var Connection = _connectionInfo.GetConnection())
{
Connection.Open();
using (MySqlCommand cmd = Connection.CreateCommand())
{
try
{
cmd.CommandText = stmt.CommandText;
foreach (var parameter in stmt.Parameters)
cmd.Parameters.AddWithValue("@" + parameter.Key, parameter.Value);
using (var reader = cmd.ExecuteReader())
{
if (reader.Read() && reader.HasRows)
{
do
{
var row = new object[reader.FieldCount];
reader.GetValues(row);
rows.Add(row);
}
while (reader.Read());
}
}
}
catch (MySqlException ex)
{
HandleMySQLException(ex, stmt.CommandText);
}
}
}
return new SQLResult(rows);
}
public QueryCallback AsyncQuery(string sql, params object[] args)
{
return AsyncQuery(new PreparedStatement(string.Format(sql, args)));
}
public QueryCallback AsyncQuery(PreparedStatement stmt)
{
return new QueryCallback(_AsyncQuery(stmt));
}
async Task<SQLResult> _AsyncQuery(PreparedStatement stmt)
{
List<object[]> rows = new List<object[]>();
try
{
using (var Connection = _connectionInfo.GetConnection())
{
Connection.Open();
using (MySqlCommand cmd = Connection.CreateCommand())
{
cmd.CommandText = stmt.CommandText;
foreach (var parameter in stmt.Parameters)
cmd.Parameters.AddWithValue("@" + parameter.Key, parameter.Value);
using (var reader = await cmd.ExecuteReaderAsync())
{
if (reader.Read() && reader.HasRows)
{
do
{
var row = new object[reader.FieldCount];
reader.GetValues(row);
rows.Add(row);
}
while (reader.Read());
}
}
}
}
}
catch (MySqlException ex)
{
HandleMySQLException(ex, stmt.CommandText);
}
return new SQLResult(rows);
}
public async Task<SQLQueryHolder<R>> DelayQueryHolder<R>(SQLQueryHolder<R> holder)
{
return await Task.Run(async () =>
{
string query = "";
try
{
using (var Connection = _connectionInfo.GetConnection())
{
Connection.Open();
foreach (var pair in holder.m_queries)
{
List<object[]> rows = new List<object[]>();
using (MySqlCommand cmd = Connection.CreateCommand())
{
cmd.CommandText = pair.Value.stmt.CommandText;
foreach (var parameter in pair.Value.stmt.Parameters)
cmd.Parameters.AddWithValue("@" + parameter.Key, parameter.Value);
query = cmd.CommandText;
using (var reader = await cmd.ExecuteReaderAsync())
{
if (reader.Read() && reader.HasRows)
{
do
{
var row = new object[reader.FieldCount];
reader.GetValues(row);
rows.Add(row);
}
while (reader.Read());
}
}
}
holder.SetResult(pair.Key, new SQLResult(rows));
}
}
return holder;
}
catch (MySqlException ex)
{
HandleMySQLException(ex, query);
return holder;
}
});
}
public void LoadPreparedStatements()
{
PreparedStatements();
}
public void PrepareStatement(T statement, string sql)
{
StringBuilder sb = new StringBuilder();
int index = 0;
for (var i = 0; i < sql.Length; i++)
{
if (sql[i].Equals('?'))
sb.Append("@" + index++);
else
sb.Append(sql[i]);
}
_queries[statement] = sb.ToString();
}
public PreparedStatement GetPreparedStatement(T statement)
{
return new PreparedStatement(_queries[statement]);
}
public bool Apply(string sql)
{
using (var Connection = _connectionInfo.GetConnectionNoDatabase())
{
using (MySqlCommand cmd = Connection.CreateCommand())
{
try
{
Connection.Open();
cmd.CommandText = sql;
return cmd.ExecuteNonQuery() > 0;
}
catch (MySqlException ex)
{
HandleMySQLException(ex, sql);
return false;
}
}
}
}
public bool ApplyFile(string path)
{
using (var connection = _connectionInfo.GetConnection())
{
using (MySqlCommand cmd = connection.CreateCommand())
{
try
{
connection.Open();
cmd.CommandText = File.ReadAllText(path);
return cmd.ExecuteNonQuery() > 0;
}
catch (MySqlException ex)
{
HandleMySQLException(ex, path);
return false;
}
}
}
}
public void EscapeString(ref string str)
{
str = MySqlHelper.EscapeString(str);
}
public void CommitTransaction(SQLTransaction transaction)
{
using (var Connection = _connectionInfo.GetConnection())
{
string query = "";
Connection.Open();
using (MySqlTransaction trans = Connection.BeginTransaction())
{
try
{
using (var scope = new TransactionScope())
{
foreach (var cmd in transaction.commands)
{
cmd.Transaction = trans;
cmd.Connection = Connection;
cmd.ExecuteNonQuery();
query = cmd.CommandText;
}
trans.Commit();
scope.Complete();
}
}
catch (MySqlException ex) //error occurred
{
HandleMySQLException(ex, query);
trans.Rollback();
}
}
}
}
void HandleMySQLException(MySqlException ex, string query)
{
int code = ex.Number;
if (ex.InnerException != null)
code = ((MySqlException)ex.InnerException).Number;
switch ((MySqlErrorCode)code)
{
case MySqlErrorCode.BadFieldError:
case MySqlErrorCode.NoSuchTable:
Log.outError(LogFilter.Sql, "Your database structure is not up to date. Please make sure you've executed all queries in the sql/updates folders.");
break;
case MySqlErrorCode.ParseError:
Log.outError(LogFilter.Sql, "Error while parsing SQL. Core fix required.");
break;
}
Log.outError(LogFilter.Sql, "SqlException: {0} SqlQuery: {1}", ex.Message, query);
}
public DatabaseUpdater<T> GetUpdater()
{
return _updater;
}
public bool IsAutoUpdateEnabled(DatabaseTypeFlags updateMask)
{
switch (GetType().Name)
{
case "LoginDatabase":
return updateMask.HasAnyFlag(DatabaseTypeFlags.Login);
case "CharacterDatabase":
return updateMask.HasAnyFlag(DatabaseTypeFlags.Character);
case "WorldDatabase":
return updateMask.HasAnyFlag(DatabaseTypeFlags.World);
case "HotfixDatabase":
return updateMask.HasAnyFlag(DatabaseTypeFlags.Hotfix);
}
return false;
}
public string GetDatabaseName()
{
return _connectionInfo.Database;
}
public abstract void PreparedStatements();
Dictionary<T, string> _queries = new Dictionary<T, string>();
MySqlConnectionInfo _connectionInfo;
DatabaseUpdater<T> _updater;
}
}
+42
View File
@@ -0,0 +1,42 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Collections.Generic;
namespace Framework.Database
{
public class PreparedStatement
{
public PreparedStatement(string commandText)
{
CommandText = commandText;
}
public void AddValue(int index, object value)
{
Parameters.Add(index, value);
}
public void Clear()
{
Parameters.Clear();
}
public string CommandText;
public Dictionary<int, object> Parameters = new Dictionary<int, object>();
}
}
+109
View File
@@ -0,0 +1,109 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Threading.Tasks;
namespace Framework.Database
{
public class QueryCallback
{
public QueryCallback(Task<SQLResult> result)
{
_result = result;
}
public QueryCallback WithCallback(Action<SQLResult> callback)
{
return WithChainingCallback((queryCallback, result) => callback(result));
}
public QueryCallback WithCallback<T>(Action<T, SQLResult> callback, T obj)
{
return WithChainingCallback((queryCallback, result) => callback(obj, result));
}
public QueryCallback WithChainingCallback(Action<QueryCallback, SQLResult> callback)
{
_callbacks.Add(new QueryCallbackData(callback));
return this;
}
public void SetNextQuery(QueryCallback next)
{
_result = next._result;
}
public QueryCallbackStatus InvokeIfReady()
{
QueryCallbackData callback = _callbacks.First();
if (_result.IsCompleted)
{
Task<SQLResult> f = _result;
Action<QueryCallback, SQLResult> cb = callback._result;
_result = null;
callback.Clear();
cb(this, f.Result);
_callbacks.RemoveAt(0);
bool hasNext = _result != null;
if (_callbacks.Empty())
{
Contract.Assert(!hasNext);
return QueryCallbackStatus.Completed;
}
// abort chain
if (!hasNext)
return QueryCallbackStatus.Completed;
return QueryCallbackStatus.NextStep;
}
return QueryCallbackStatus.NotReady;
}
Task<SQLResult> _result;
List<QueryCallbackData> _callbacks = new List<QueryCallbackData>();
}
struct QueryCallbackData
{
public QueryCallbackData(Action<QueryCallback, SQLResult> callback)
{
_result = callback;
}
public void Clear()
{
_result = null;
}
public Action<QueryCallback, SQLResult> _result;
}
public enum QueryCallbackStatus
{
NotReady,
NextStep,
Completed
}
}
@@ -0,0 +1,42 @@
/*
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Collections.Generic;
namespace Framework.Database
{
public class QueryCallbackProcessor
{
public void AddQuery(QueryCallback query)
{
_callbacks.Add(query);
}
public void ProcessReadyQueries()
{
if (_callbacks.Empty())
return;
_callbacks.RemoveAll(callback =>
{
return callback.InvokeIfReady() == QueryCallbackStatus.Completed;
});
}
List<QueryCallback> _callbacks = new List<QueryCallback>();
}
}

Some files were not shown because too many files have changed in this diff Show More