Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

How to setup CM for Corsair

Newbie Spellweaver
Joined
Apr 8, 2009
Messages
97
Reaction score
63
Here i will quickly explain how to setup the Central Market System for your Corsair-Server.
I assume you already know how to install IIS with ASP.net or even have it installed properly as that is needed for the market that is a web application based system.

1. Setting up the folders and permissions.
On your maindrive, usually C: you should have a new folder called 'inetpub' that was created by the IIS install process. Thats where all the websites go. Now go into the folder and create three folders for the three websites we need:
api-trade, game, trade
Here is what i named them for my server:


Next is the permissions for the IIS user as it needs to run aka execute things for the central market. The Username of IIS is 'IIS_IUSRS' without quotes. Now rightclick the first of your three folders, properties, tab security.
Top half of the window, Edit, in the new window that pops up, add.
Another window will pop up there you type in the IIS username where it says Object Name


After that you hit 'Check Name', if you have no typo you will see that it gets underlined and your server name gets added to it which then looks like 'server name\IIS_IUSRS' after thats done you hit okay and in the window 'permissions for "folder name"' in the top half you can find the newly added IIS user, click it in the list and at the lower half of the window you can set the permissions for said user.
Tick the left boxes which should say 'Grant' or something similar in english for "read and execute", "list/view", "read"
Here is another picture of that window with the boxes ticked:


After that you hit apply and ok and do the same for the other window, if apply needs to be hit, click it before you click okay.
That permission step you now do for all three folders. It is exactly the same.

2. Creating the Websites in IIS
For this step we just assume the fake domain 'local-bdo.net' as probably many don't have a domain at all. You can change this to whatever you want, Just make sure you use URL safe characters and no funky stuff.
Open up your IIS and on the left hand side click through until you see the default site. You can leave it there, or delete it does not matter.
Rightclick on the sites folder and click 'Add Website/New Website' you will get a new window and we will start with 'api-trade'.
The sitename can be whatever you want but you should name it in a way that you know what it is. so i simply name it 'api-trade'.
The Application.Pool will take the name of your site automatically no need to change anything there.
Next set the physical path, thats where your website folder for 'api-trade' is located in my case it is 'C:\inetpub\bdo-api-trade'
For binding if you have no domain and certificate leave it at http put in your servers IP can be internal or external depending on what you need. Default http port is 80 and for hostname you now need to make up the sub domain so in my case its 'api-trade.local-bdo.net'
Here is a screenshot of what it looks like for local use in an internal network:


After that you just hit okay and do it two more times for 'game' and 'trade'

Screenshot for 'game':


Screenshot for 'trade':


Now you should have three websites running in IIS but there is nothing in it which we will fix in the next step.

3. What goes into which folder
Welcome to the chaos of how many 'zips' and 'rars' can you stuff into a folder to confuse users.
Basically the zipped stuff are other versions, sometimes just minor dll versions, sometimes major. Here is what i picked and worked for me.
When you get the server pack there are two 'market' folders in there, one is just 'Market' and the other is 'TradeMarketProcessWeb', we take the second one.
'api-trade':
Inside you will find a folder called 'GB.BlackDesert.Trade.Web.Process' everything that is in there goes into the folder of your 'api-trade' website. You can leave the zips/rars there or remove them, they don't hurt and are simply ignored by the web application.



'game':
The folder for the 'game' website is called 'GB.BlackDesert.Trade.Web.Game' and all contents of that folder go into your game website folder



'trade':
for the 'trade' website there are two folders that go into it, these are called 'GB.BlackDesert.Trade.Web' and 'GB.BlackDesert.Trade.Web.Contents'. The first folder goes all in the second just the folder ignore the version.txt and web.config in there. I have clicked all that goes in this screenshot so this should better show with what i mean:



When you have everything in place we are ready to go to the next step which is editing the 'web.config' files.

4. The 'web.config' configuration and the one XML
If you stuck with the subdomain names 'api-trade', 'game' and 'trade' this will probably really easy. You can open these files with almost any texteditor, my personal choices are either notepad++ or sublime.
go into your 'api-trade' website folder and open up the web.config in there. I will just give you my 'web.config' here you just need to replace IPs and domains with yours.
The IP you need to replace with yours is 192.168.255.130, don't worry it is an internal IP of a VMware machine, so no exposure to the outside world.
The domain name is 'local-bdo.net' you can keep that or replace with yours, but keep in mind it has to match with what you have setup in the IIS Website step as all three of those sites can and need to talk to each other, so if one does not find the other things will break.
you will see 'connectionString' in all three web.config files. Those lines define where your webserver finds the SQL-Server. The Databases are already linked up properly you just need to change the IP-Adresses to your SQL-Server and make a decission if you want to create the extra DB-User the web application uses or replace it with the default one the server uses. The extra user is 'CrimsonTradeReader' which uses the same password as the 'CrimsonDesert' user.
I have set the websites in 'live mode' and turned of 'debug mode' as i no longer needed it if you need it for any purposes search for
'<add key="isDebug" value="false" />' and set it to true for more logging.

Every time you edit and save one of the 'web.config' files IIS will then auto restart the website that belongs to that file.
The URLs are also set for 'HTTP'!

'api-trade':
Code:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ASP.NET 응용 프로그램을 구성하는 방법에 대한 자세한 내용은 다음을 참조하십시오.
  http://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  </configSections>
  <!-- Log4net -->
  <log4net degug="true">
    <appender name="COMMONLOGGER" type="log4net.Appender.RollingFileAppender, log4net">
      <file type="log4net.Util.PatternString" value="C:/Data/WebLog/GlobalTrade/PC/Process/%property{LOGPATHSTRING}/%date{yyyyMM}/%date{yyyyMMdd}.log" />
      <staticLogFileName value="false" />
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <maxSizeRollBackups value="10" />
      <maximumFileSize value="10KB" />
      <staticLogFileName value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="ALL" />
      <appender-ref ref="COMMONLOGGER" />
    </root>
  </log4net>
  
  
  <appSettings>
    <add key="isLive" value="true" />
    <add key="cookieDomain" value="local-bdo.net" />
    <add key="cdnDomain" value="http://local-bdo.net/test" />
    <add key="tradeXMLDomain" value="http://api-trade.local-bdo.net/Contents" />
    <add key="AllowIPList" value="127.0.0.1|192.168.255.130" />
    <add key="selfServerIP" value="192.168.255.130" />
	
	<add key="isTradeOpen" value="true" />
	
    <add key="allowIndex" value="0" />
        <add key="serviceProject" value="BDO" />
        <add key="serviceType" value="NA" />
        <add key="isPearlApp" value="true" />
        <add key="defaultCulture" value="en-US" />
        <add key="defaultLanguage" value="en" />
        <add key="branches" value="live" />
        <add key="platform" value="api-trade" />
        <add key="isDebug" value="false" />
  </appSettings>
  <connectionStrings>
    <add connectionString="metadata=res://*/DB.TradeWebDB.csdl|res://*/DB.TradeWebDB.ssdl|res://*/DB.TradeWebDB.msl;provider=System.Data.SqlClient;provider connection string="data source=192.168.255.130,1433;initial catalog=SA_BETA_TRADEDB_0002;user id=CrimsonDesert;password=BlackNo.1Game#^%;MultipleActiveResultSets=True;App=EntityFramework"" name="TradeWebDB" providerName="System.Data.EntityClient" />
    <add connectionString="metadata=res://*/DB.TradeLogDB.csdl|res://*/DB.TradeLogDB.ssdl|res://*/DB.TradeLogDB.msl;provider=System.Data.SqlClient;provider connection string="data source=192.168.255.130,1433;initial catalog=PF_BETA_LOGDB_0001;user id=CrimsonDesert;password=BlackNo.1Game#^%;MultipleActiveResultSets=True;App=EntityFramework"" name="TradeLogDB" providerName="System.Data.EntityClient" />
    <add connectionString="metadata=res://*/DB.TradeWorldDB.csdl|res://*/DB.TradeWorldDB.ssdl|res://*/DB.TradeWorldDB.msl;provider=System.Data.SqlClient;provider connection string="data source=192.168.255.130,1433;initial catalog=SA_BETA_WORLDDB_0002;persist security info=True;user id=CrimsonDesert;password=BlackNo.1Game#^%;MultipleActiveResultSets=True;application name=EntityFramework"" name="TradeWORLDDB" providerName="System.Data.EntityClient" />
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.5.2" />
    <!--2016.11.15 추가-->
    <httpRuntime targetFramework="4.5.2" enableVersionHeader="false" maxRequestLength="10485760" />
    <globalization culture="auto" uiCulture="auto" />
  </system.web>
  <system.webServer>
    <security>
      <requestFiltering allowDoubleEscaping="false">
        <requestLimits maxAllowedContentLength="1073741824" maxQueryString="1048567" />
        <verbs allowUnlisted="false">
          <add verb="GET" allowed="true" />
          <add verb="POST" allowed="true" />
        </verbs>
      </requestFiltering>
    </security>
    <httpErrors errorMode="Custom">
      <remove statusCode="404" />
      <error statusCode="404" path="/error" responseMode="ExecuteURL" />
    </httpErrors>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
    </compilers>
  </system.codedom>
  <system.webServer>
    <httpProtocol>
      <customHeaders>
        <remove name="Server" />
        <remove name="X-AspNetMvc-Version" />
        <remove name="X-AspNet-Version" />
        <remove name="X-Powered-By" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>
</configuration>

'game':
Code:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ASP.NET 응용 프로그램을 구성하는 방법에 대한 자세한 내용은 다음을 참조하십시오.
  http://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  </configSections>
  <!-- Log4net -->
  <log4net degug="true">
    <appender name="COMMONLOGGER" type="log4net.Appender.RollingFileAppender, log4net">
      <file type="log4net.Util.PatternString" value="C:/Data/WebLog/TW/GlobalTrade/Game/%property{LOGPATHSTRING}/%date{yyyyMM}/%date{yyyyMMdd}.log" />
      <staticLogFileName value="false" />
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <maxSizeRollBackups value="10" />
      <maximumFileSize value="10KB" />
      <staticLogFileName value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="ALL" />
      <appender-ref ref="COMMONLOGGER" />
    </root>
  </log4net>
  
  
  <appSettings>
    <add key="isLive" value="true" />
    <add key="cookieDomain" value=".local-bdo.net" />
    <add key="processDomain" value="http://api-trade.local-bdo.net/GameProcess" />
    <add key="AllowIPList" value="127.0.0.1|192.168.255.130" />
    <add key="serviceProject" value="BDO" />
    <add key="serviceType" value="NA" />
    <add key="isPearlApp" value="true" />
		
		    <!-- 인증관련 Config -->
    <add key="authCookie" value="TradeAuth_Cookie" />
    <add key="authenticationTimeOut" value="120" />
    <add key="cdnDomain" value="http://local-bdo.net/test" />
    <add key="defaultCulture" value="en-US" />
	<add key="defaultLanguage" value="en" />
	
	<add key="isTradeOpen" value="true" />
		
    <!-- UTC 시간 설정 config 시작-->
    <!-- 타임존 사용시 -->
    <add key="UtcTimeZoneID" value="UTC" />
    <!-- 서비스 지역별 UTC -->
    <add key="ServiceUtcTime" value="0" />
    <!-- 서버시간 사용유무 -->
    <add key="isServerTime" value="true" />
        <add key="branches" value="live" />
        <add key="platform" value="GameWeb" />
        <add key="isDebug" value="true" />
        <add key="otpAuthUrl" value="localhost" />
        <add key="allowBorswerList" value="chrome|" />
	
  </appSettings>
  <connectionStrings>
    <add name="TradeGameDB_12" connectionString="metadata=res://*/DB.TradeGameDB.csdl|res://*/DB.TradeGameDB.ssdl|res://*/DB.TradeGameDB.msl;provider=System.Data.SqlClient;provider connection string="data source=192.168.255.130,1433;initial catalog=SA_BETA_GAMEDB_0002;user id=CrimsonDesert;password=BlackNo.1Game#^%;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
    <add name="TradeWORLDDB" connectionString="metadata=res://*/DB.TradeWorldDB.csdl|res://*/DB.TradeWorldDB.ssdl|res://*/DB.TradeWorldDB.msl;provider=System.Data.SqlClient;provider connection string="data source=192.168.255.130,1433;initial catalog=SA_BETA_WORLDDB_0002;persist security info=True;user id=CrimsonDesert;password=BlackNo.1Game#^%;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
	<add name="TradeWebDB" connectionString="metadata=res://*/DB.TradeWebDB.csdl|res://*/DB.TradeWebDB.ssdl|res://*/DB.TradeWebDB.msl;provider=System.Data.SqlClient;provider connection string="data source=192.168.255.130,1433;initial catalog=SA_BETA_TRADEDB_0002;user id=CrimsonTradeReader;password=BlackNo.1Game#^%;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
    <add connectionString="metadata=res://*/DB.TradeLogDB.csdl|res://*/DB.TradeLogDB.ssdl|res://*/DB.TradeLogDB.msl;provider=System.Data.SqlClient;provider connection string="data source=192.168.255.130,1433;initial catalog=PF_BETA_LOGDB_0001;user id=CrimsonDesert;password=BlackNo.1Game#^%;MultipleActiveResultSets=True;App=EntityFramework"" name="TradeLogDB" />
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.5.2" />
    <httpRuntime targetFramework="4.5.2" enableVersionHeader="false" maxRequestLength="10485760" />
    <globalization culture="auto" uiCulture="auto" />
    <sessionState cookieName="TradeAuth_Session" mode="SQLServer" sqlConnectionString="data source=192.168.255.130,1433;uid=CrimsonWeb;pwd=BlackNo.1Game#^%" />
    <machineKey decryption="AES" decryptionKey="4D70FDC82D742312862F720BBF3805C65211BD765A84A1D1" validationKey="92243B9FC458265DBAE46C4D8B4D1ED00AAC9C1AACC3BE1F16002FE0A39553C8BC8999E4B8304230768D2DE74D6FB1E2DA02BA420733B85E8E08ABBAFDDDC93E" />
    <httpCookies domain="local-bdo.net" requireSSL="false" /> 
  </system.web>
  <system.webServer>
    <security>
      <requestFiltering allowDoubleEscaping="false">
        <requestLimits maxAllowedContentLength="1073741824" maxQueryString="1048567" />
        <verbs allowUnlisted="false">
          <add verb="GET" allowed="true" />
          <add verb="POST" allowed="true" />
        </verbs>
      </requestFiltering>
    </security>
    <httpErrors errorMode="Custom">
      <remove statusCode="404" />
      <error statusCode="404" path="/error" responseMode="ExecuteURL" />
    </httpErrors>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
    </compilers>
  </system.codedom>
  <system.webServer>
    <httpProtocol>
      <customHeaders>
        <add name="Access-Control-Allow-Origin" value="http://trade.local-bdo.net" />
        <add name="Access-Control-Allow-Credentials" value="true" />
        <remove name="Server" />
        <remove name="X-AspNetMvc-Version" />
        <remove name="X-AspNet-Version" />
        <remove name="X-Powered-By" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>
</configuration>

'trade':
Code:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ASP.NET 응용 프로그램을 구성하는 방법에 대한 자세한 내용은 다음을 참조하십시오.
  [url]http://go.microsoft.com/fwlink/?LinkId=301880[/url]
  -->
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  </configSections>
  <!-- Log4net -->
  <log4net degug="true">
    <appender name="COMMONLOGGER" type="log4net.Appender.RollingFileAppender, log4net">
      <file type="log4net.Util.PatternString" value="C:/Data/WebLog/TW/GlobalTrade/Web/%property{LOGPATHSTRING}/%date{yyyyMM}/%date{yyyyMMdd}.log" />
      <staticLogFileName value="false" />
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <maxSizeRollBackups value="10" />
      <maximumFileSize value="10KB" />
      <staticLogFileName value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="ALL" />
      <appender-ref ref="COMMONLOGGER" />
    </root>
  </log4net>

  <appSettings>
	<add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />											  
    <!-- Proxy 사용 여부-->
    <add key="isProxy" value="false" />
    <add key="webProxyUrl" value="" />
    <add key="webProxyPort" value="" />
    <!-- Proxy 사용 여부-->
    <add key="isLive" value="true" />
    <add key="defaultCulture" value="en-US" />
    <add key="cultureList" value="en-US" />
    <add key="cultureCookieName" value="lang" />											  
    <add key="cookieDomain" value=".local-bdo.net" />
    <add key="cdnDomain" value="http://local-bdo.net/test" />
    <add key="tradeXMLDomain" value="http://api-trade.local-bdo.net/Contents" />
    <add key="gameDomain" value="http://game.local-bdo.net/GameTradeMarket/" />
    <add key="processDomain" value="http://api-trade.local-bdo.net/GameProcess" />
    <add key="redirectDomain" value="http://www.local-bdo.net" />
    <add key="AllowIPList" value="127.0.0.1|192.168.255.130" />
	 
	<add key="isTradeOpen" value="true" />
    <add key="isTradeWebOpen" value="true" />
	<add key="serviceProject" value="BDO" />
    <add key="serviceType" value="NA" />
    <add key="defaultLanguage" value="en" />
    <add key="languageList" value="en" />
    <add key="useCookieProtect" value="true" />
    <add key="ServiceAuthCookieName" value="" />
    <add key="AllowBrowserList" value="chrome|" />
    <add key="publishServiceType" value="" />
 
    <!-- 인증관련 Config -->
    <add key="domainPrefix" value="" />
    <add key="authCookie" value="TradeAuth_Cookie" />
    <add key="authenticationTimeOut" value="120" />
    <add key="authRedirectDomain" value="http://account.local-bdo.net/Member/Login?_returnUrl=https%3A%2F%2Ftrade.local-bdo.net%2FauthCallback" />
    <add key="authCheckRequestUri" value="http://api-auth.local-bdo.net/api/TradeAuth?authToken=" />
    <add key="authRemoveUri" value="http://account.local-bdo.net/Member/LogOut?_returnUrl=https%3A%2F%2Flocal-account.local-bdo.net" />
    <!-- UTC 시간 설정 config 시작-->
    <!-- 타임존 사용시 -->
    <add key="UtcTimeZoneID" value="UTC" />
    <!-- 서비스 지역별 UTC -->
    <add key="ServiceUtcTime" value="0" />
    <!-- 서버시간 사용유무 -->
    <add key="isServerTime" value="true" />
        <add key="branches" value="live" />
        <add key="platform" value="TradeWeb" />
        <add key="isDebug" value="true" />
        <add key="isPAAccount" value="false" />
        <add key="serviceRegion" value="NA" />
        <add key="wwwDomain" value="account.local-bdo.net" />
	
  </appSettings>
  <connectionStrings>
    <add name="TradeWebDB" connectionString="metadata=res://*/DB.TradeWebDB.csdl|res://*/DB.TradeWebDB.ssdl|res://*/DB.TradeWebDB.msl;provider=System.Data.SqlClient;provider connection string="data source=192.168.255.130,1433;initial catalog=SA_BETA_TRADEDB_0002;user id=CrimsonTradeReader;password=BlackNo.1Game#^%;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
    <add connectionString="metadata=res://*/DB.TradeWorldDB.csdl|res://*/DB.TradeWorldDB.ssdl|res://*/DB.TradeWorldDB.msl;provider=System.Data.SqlClient;provider connection string="data source=192.168.255.130,1433;initial catalog=SA_BETA_WORLDDB_0002;persist security info=True;user id=CrimsonDesert;password=BlackNo.1Game#^%;MultipleActiveResultSets=True;App=EntityFramework"" name="TradeWORLDDB" providerName="System.Data.EntityClient" />
        <add connectionString="metadata=res://*/DB.TradeLogDB.csdl|res://*/DB.TradeLogDB.ssdl|res://*/DB.TradeLogDB.msl;provider=System.Data.SqlClient;provider connection string="data source=192.168.255.130,1433;initial catalog=PF_BETA_LOGDB_0001;user id=CrimsonDesert;password=BlackNo.1Game#^%;MultipleActiveResultSets=True;App=EntityFramework"" name="TradeLogDB" />
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.5.2" />
    <httpRuntime targetFramework="4.5.2" enableVersionHeader="false" maxRequestLength="10485760" />
    <globalization culture="auto" uiCulture="auto" />
    <sessionState cookieName="TradeAuth_Session" mode="SQLServer" sqlConnectionString="data source=192.168.255.130,1433;uid=CrimsonWeb;pwd=BlackNo.1Game#^%" />
    <machineKey decryption="AES" decryptionKey="4D70FDC82D742312862F720BBF3805C65211BD765A84A1D1" validationKey="92243B9FC458265DBAE46C4D8B4D1ED00AAC9C1AACC3BE1F16002FE0A39553C8BC8999E4B8304230768D2DE74D6FB1E2DA02BA420733B85E8E08ABBAFDDDC93E" />
    <httpCookies domain="local-bdo.net" requireSSL="false" /> 
  </system.web>
  <system.webServer>
    <security>
      <requestFiltering allowDoubleEscaping="false">
        <requestLimits maxAllowedContentLength="1073741824" maxQueryString="1048567" />
        <verbs allowUnlisted="false">
          <add verb="GET" allowed="true" />
          <add verb="POST" allowed="true" />
        </verbs>
      </requestFiltering>
    </security>
    <httpErrors errorMode="Custom">
      <remove statusCode="404" />
      <error statusCode="404" path="/error" responseMode="ExecuteURL" />
    </httpErrors>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
    </compilers>
  </system.codedom>
  <system.webServer>
    <httpProtocol>
      <customHeaders>
        <remove name="Server" />
        <remove name="X-AspNetMvc-Version" />
        <remove name="X-AspNet-Version" />
        <remove name="X-Powered-By" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>
</configuration>

This is important don't forget this step or your server simply does not have a running market. In the 'api-trade' folder of your website there is this path 'C:\inetpub\bdo-api-trade\Contents\Common\xml\BDOWorldTradeMarketItemData\NA' and in there is all the extra configuration for the Central Market. It will run with everything default except one file. 'BDOWorldTradeMarketServerInfo' Open this and in there you need to change the IP to yours, here is my file:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>	
	<!-- 베타 -->
	<WorldMarketServerInfo ServerType="0" IsInitHistory="True" IsTimerSet="True" Ip="192.168.255.130" AllowMainGroupNo="1|5|10|15|20|25|30|35|40|45|50|55|60|65|70|75|80"/>
</root>
Don't forget this!

5. Add the Domain to your windows hosts file
For the fake domain to work you need to add it to the server's hosts file and the machine you run your client on. Every person has to do this that want's to connect to your server and use the central market of your server.
To quickly get to the file hit the Windows-Key and R at the same time, a new window will pop up.
There you put this one line in and hit enter '%windir%\system32\drivers\etc' without quotes. This will open up the folder where the hosts file is located. You can open the file with any text editor, but keep in mind that you usually need admin permissions to save the file in the same location again.
There you simply add three lines, a few lines should already be on the server side to block some stuff. On a client its usually just comments. Add the IP infront where the website is home, a tab and then the subdomain of your website
Code:
192.168.255.130		api-trade.local-bdo.net
192.168.255.130		game.local-bdo.net
192.168.255.130		trade.local-bdo.net

6. Telling your client where the market is
Now only your game client needs to know where to look at for the Central Market. Open up the service.ini of your client and under the 'NA' you need to add two lines so the full file looks like this:

Code:
[SERVICE]
TYPE=NA
RES=_EN_
nationType=1

[NA]
AUTHENTIC_DOMAIN=192.168.255.130
AUTHENTIC_PORT=8888

viewTradeMarketUrl=http://trade.local-bdo.net/
gameTradeMarketUrl=http://game.local-bdo.net/

With those lines you now should get market price information on your items and also be able to open up the market. The web applications need some time to boot up, you can edit them when your server is on or off does not matter, they are independent.
Just wait a moment after entering the game before trying it, you will always get, two or three errors when you are the first person trying to open the Central Market for the first time after a server boot. This will always happen and seems to be a normal part of the init process.

The websites will generate logfiles on drive C: usually. There should be a new folder whenever the websites do things or you try to access them from inside the game. The folder is called 'palog' and inside there you should find three more folders called 'api-trade', 'gameweb', 'tradeweb'. In there are Json logfiles that log every action the web does, from starting to logging errors when things do not work the way you want them to.

If you get an Auth-Error this probably means your client sends invaled auth information and maybe can not be used. I use the client from the pack and it works fine.
If you get the 'uspIsGameMaster' expects 'atNationCode', but it was not provided error let me know i have a fix for that.
I hope this now helps all to try and setup a running central market for their server.
 
Junior Spellweaver
Joined
Sep 5, 2022
Messages
119
Reaction score
34
Great job. It remains to close the dupe in Corsair CM and you can use it safely.
 
Newbie Spellweaver
Joined
Apr 8, 2009
Messages
97
Reaction score
63
The DataSheet_URL is only needed if you want to change the other URLs the client uses for example the link to the ingame webservices aka Dice Games/Guild Pages/Beauty Album/Photo Gallery. The Central Market URLs need to be in the service.ini.
 
Newbie Spellweaver
Joined
Jun 18, 2016
Messages
27
Reaction score
0
Hello, brother, can you release a video tutorial? Thank you!
 
Joined
Mar 29, 2019
Messages
1,049
Reaction score
1,223
Ok, i think this is almost complete

At least it brings me the market price

seramyu - How to setup CM for Corsair - RaGEZONE Forums


here's the log from "game"

[DB ERROR]uspIsGameMaster - (1) Exception=System.InvalidCastException: Object cannot be cast from DBNull to other types

Code:
{"EventTime":"2022-09-06T20:43:00.2157457-05:00","Severity":"ERROR","SourceName":"/LM/W3SVC/4/ROOT-1-133069885777782457","Logger":"JsonLogger","Thread":"8","NDC":"(null)","Message":{"HttpMethod":"POST","RequestUrl":"http://game.local-bdo.net/GameTradeMarket/CreateMyWallet","Headers":{"Content-Length":"68","Content-Type":"application/json","Host":"game.local-bdo.net","User-Agent":"BlackDesert"},"FormData":null,"Ip":"10.0.0.2","AuthInfo":null,"LogMessage":"[DB ERROR]uspIsGameMaster - (1) Exception=System.InvalidCastException: Object cannot be cast from DBNull to other types.\r\n   at System.DBNull.System.IConvertible.ToBoolean(IFormatProvider provider)\r\n   at GB.BlackDesert.Trade.Web.Lib.Common.TradeModule.isGameMaster(Int64 userNo)","LogException":null,"ProjectName":"game","ServiceType":"NA","Branches":"LIVE","PlatformIndex":"live-web-gameweb"},"Properties":{"log4net:UserName":"IIS APPPOOL\\game","log4net:Identity":"","log4net:HostName":"PANDORA"}}
 
Newbie Spellweaver
Joined
Apr 8, 2009
Messages
97
Reaction score
63
That is a different uspIsGameMaster Error. I think i saw that one but i am not sure. It happens because the stored procedure tries to fetch your userNo but it gets nothing and then the DLL tries to convert nothing from the stored procedure output to a boolean value which does not work. I have no real idea why that happens but you could check with the MSSQL Server Profiler if you know how that thing works. That lets you see which things are being executed on your SQL Server and which Values are given in and come back out. If you want i could re.pack my 'game' webfolder and you could try that.
 
Newbie Spellweaver
Joined
Apr 8, 2009
Messages
97
Reaction score
63
I never found the root cause of this issue, i will upload my working market setup. Just give me a moment.
okay here is the link to it:

You might get a different error with this.
the uspIsGameMaster expects a nationCode, serverNo, userNo and returns if the user is a GM or NOT but to really tell if some is or not your really only need the userNo in our case, so i have made a 'hacky' fix into the DB for both stored procedures.
if your error is this one
Code:
Procedure or function 'uspIsGameMaster' expects parameter '@nationCode', which was not supplied.
Then here is the fix.
ONLY do this when you really sure that you got the same error as above mentioned. If you feel insecure editing things in the DB you can also make a full backup of the DBs just in case.
You can do this while your server is on cause the procedures are mostly cached but in practice you should probably never do something like this in a live enviroment^^
Open up your MSSQL Management Studio and open up the DB section then open up the TradeDB and you find several folders there, one is called 'Programmability' and under there you will find another folder called 'Stored Procedures'
In the long list that expands search for 'PaGamePublic.uspIsGameMaster__XXX' rightlick it and select 'Edit/Change'
On the right half a new tab will pop up with alot of SQL instructions in it. Click into the window full of text, and hit CTRL + A to select it all and then copy it and paste it into a text editior of your choice and save it as a backup. Just put it as a txt on your desktop or wherever you are comfortable with and name it 'Trade-uspIsGameMaster' or whatever you like that you know its the GameMaster procedure from the Trade DB.
After you have made a backup of it you can replace it with mine. Here is the paste as you can not post SQL Instructions directly here for safety reasons:
Trade-uspIsGameMaster:
Just replace everything with my paste and then you need to hit Execute with the Play Button in the SQL Management Software. It should do its thing and say something like 'The querry has been completed successfull'
You can now close that tab and if it asks if you want to save it, you don't need as the stored procedure is already changed.

Now we have to do it again for the second procedure that has the same name without the XXX. Open up your WorldDB, same way 'Programmability', 'Stored Procedures'. In the long list that appears search for 'PaGamePublic.uspIsGameMaster' rightclick and 'Change/Edit' and do the same as with the first one, select all the text, copy it and paste it into a texteditor and save it as a backup with a name like 'World-uspIsGameMaster' so you know thats the other one. And replace it with this one:
World-uspIsGameMaster:
Hit the Execute button again and when it has completed the querry which also should return no errors, then you are good to go. When your web.configs are all correct and the one XML your market should upen up after a small boot time.

What does it do:
I quickly explain what i have changed so you don't blindly take it for granted.
First i commented out the old SQL Instructions, they are still in there but disabled, then i removed the need for the SQL structure to need a nationCode and a serverNo and replaced the value names with what the DLL seems to give to the stored procedure so it no longer spits out errors. Then i rewrote the SQL instruction for the Game Master Check so if the querry retunrs NULL it automatically assumes that you are NOT a GM and sets the return Value to 0 which then can be turned into a boolean value.
 
Last edited:
Experienced Elementalist
Joined
Dec 17, 2004
Messages
207
Reaction score
31
I never found the root cause of this issue, i will upload my working market setup. Just give me a moment.
okay here is the link to it:

You might get a different error with this.
the uspIsGameMaster expects a nationCode, serverNo, userNo and returns if the user is a GM or NOT but to really tell if some is or not your really only need the userNo in our case, so i have made a 'hacky' fix into the DB for both stored procedures.
if your error is this one
Code:
Procedure or function 'uspIsGameMaster' expects parameter '@nationCode', which was not supplied.
Then here is the fix.
ONLY do this when you really sure that you got the same error as above mentioned. If you feel insecure editing things in the DB you can also make a full backup of the DBs just in case.
You can do this while your server is on cause the procedures are mostly cached but in practice you should probably never do something like this in a live enviroment^^
Open up your MSSQL Management Studio and open up the DB section then open up the TradeDB and you find several folders there, one is called 'Programmability' and under there you will find another folder called 'Stored Procedures'
In the long list that expands search for 'PaGamePublic.uspIsGameMaster__XXX' rightlick it and select 'Edit/Change'
On the right half a new tab will pop up with alot of SQL instructions in it. Click into the window full of text, and hit CTRL + A to select it all and then copy it and paste it into a text editior of your choice and save it as a backup. Just put it as a txt on your desktop or wherever you are comfortable with and name it 'Trade-uspIsGameMaster' or whatever you like that you know its the GameMaster procedure from the Trade DB.
After you have made a backup of it you can replace it with mine. Here is the paste as you can not post SQL Instructions directly here for safety reasons:
Trade-uspIsGameMaster:
Just replace everything with my paste and then you need to hit Execute with the Play Button in the SQL Management Software. It should do its thing and say something like 'The querry has been completed successfull'
You can now close that tab and if it asks if you want to save it, you don't need as the stored procedure is already changed.

Now we have to do it again for the second procedure that has the same name without the XXX. Open up your WorldDB, same way 'Programmability', 'Stored Procedures'. In the long list that appears search for 'PaGamePublic.uspIsGameMaster' rightclick and 'Change/Edit' and do the same as with the first one, select all the text, copy it and paste it into a texteditor and save it as a backup with a name like 'World-uspIsGameMaster' so you know thats the other one. And replace it with this one:
World-uspIsGameMaster:
Hit the Execute button again and when it has completed the querry which also should return no errors, then you are good to go. When your web.configs are all correct and the one XML your market should upen up after a small boot time.

What does it do:
I quickly explain what i have changed so you don't blindly take it for granted.
First i commented out the old SQL Instructions, they are still in there but disabled, then i removed the need for the SQL structure to need a nationCode and a serverNo and replaced the value names with what the DLL seems to give to the stored procedure so it no longer spits out errors. Then i rewrote the SQL instruction for the Game Master Check so if the querry retunrs NULL it automatically assumes that you are NOT a GM and sets the return Value to 0 which then can be turned into a boolean value.

thank you for your help very helpful
 
Joined
Mar 29, 2019
Messages
1,049
Reaction score
1,223
I never found the root cause of this issue, i will upload my working market setup. Just give me a moment.
okay here is the link to it:

You might get a different error with this.
the uspIsGameMaster expects a nationCode, serverNo, userNo and returns if the user is a GM or NOT but to really tell if some is or not your really only need the userNo in our case, so i have made a 'hacky' fix into the DB for both stored procedures.
if your error is this one
Code:
Procedure or function 'uspIsGameMaster' expects parameter '@nationCode', which was not supplied.
Then here is the fix.
ONLY do this when you really sure that you got the same error as above mentioned. If you feel insecure editing things in the DB you can also make a full backup of the DBs just in case.
You can do this while your server is on cause the procedures are mostly cached but in practice you should probably never do something like this in a live enviroment^^
Open up your MSSQL Management Studio and open up the DB section then open up the TradeDB and you find several folders there, one is called 'Programmability' and under there you will find another folder called 'Stored Procedures'
In the long list that expands search for 'PaGamePublic.uspIsGameMaster__XXX' rightlick it and select 'Edit/Change'
On the right half a new tab will pop up with alot of SQL instructions in it. Click into the window full of text, and hit CTRL + A to select it all and then copy it and paste it into a text editior of your choice and save it as a backup. Just put it as a txt on your desktop or wherever you are comfortable with and name it 'Trade-uspIsGameMaster' or whatever you like that you know its the GameMaster procedure from the Trade DB.
After you have made a backup of it you can replace it with mine. Here is the paste as you can not post SQL Instructions directly here for safety reasons:
Trade-uspIsGameMaster:
Just replace everything with my paste and then you need to hit Execute with the Play Button in the SQL Management Software. It should do its thing and say something like 'The querry has been completed successfull'
You can now close that tab and if it asks if you want to save it, you don't need as the stored procedure is already changed.

Now we have to do it again for the second procedure that has the same name without the XXX. Open up your WorldDB, same way 'Programmability', 'Stored Procedures'. In the long list that appears search for 'PaGamePublic.uspIsGameMaster' rightclick and 'Change/Edit' and do the same as with the first one, select all the text, copy it and paste it into a texteditor and save it as a backup with a name like 'World-uspIsGameMaster' so you know thats the other one. And replace it with this one:
World-uspIsGameMaster:
Hit the Execute button again and when it has completed the querry which also should return no errors, then you are good to go. When your web.configs are all correct and the one XML your market should upen up after a small boot time.

What does it do:
I quickly explain what i have changed so you don't blindly take it for granted.
First i commented out the old SQL Instructions, they are still in there but disabled, then i removed the need for the SQL structure to need a nationCode and a serverNo and replaced the value names with what the DLL seems to give to the stored procedure so it no longer spits out errors. Then i rewrote the SQL instruction for the Game Master Check so if the querry retunrs NULL it automatically assumes that you are NOT a GM and sets the return Value to 0 which then can be turned into a boolean value.

This (procedures) solved my issue even if it not was the same error

seramyu - How to setup CM for Corsair - RaGEZONE Forums


Tyvm! You're the best
 
Last edited:
Experienced Elementalist
Joined
Apr 25, 2014
Messages
230
Reaction score
7
is this CM must have DOMAINs to work?



If I am going to change my port to 87,,

Should I modify Web.config this file like this,,,api-trade.local-bdo.net:87?
 
Newbie Spellweaver
Joined
Apr 8, 2009
Messages
97
Reaction score
63
No you don't need to have a real domain, but you need to put it in every hosts file so its a hard "DNS-Link" where windows will lookup what the IP Adress is for the domain name.

For the port thing, i have not tested this but i think you just need to change the port in IIS and then add those lines in all web.configs that use a different port.
Code:
    <add key="isProxy" value="true" />
    <add key="webProxyUrl" value="" />
    <add key="webProxyPort" value="87" />
This goes into the 'appsettings' group of the file. Again, not tested as i am using port 80 so its not needed. If this does not work you can still try the usual method of just 'domain:port'
Example here to where to place it:
Code:
<appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />	

    <add key="isProxy" value="false" />
    <add key="webProxyUrl" value="" />
    <add key="webProxyPort" value="" />
    .
    .
    .
</appSettings>
 
Experienced Elementalist
Joined
Apr 25, 2014
Messages
230
Reaction score
7
my domain is xxxx.tpddns.cn

it's a free domain from my routor...

it cannot make sub-domain either.....

so,what can i do for now??
 
Back
Top