Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

[ANY] DB++ (Optimized way to use queries)


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7177
  • Lokalizacja:AMXX.PL
Offline

Napisano 07.09.2016 11:24

<div>Hello! Want to release my new plugin, which will help you to optimize network oriented queries.<br /><br />Installation:<br />1. Put folder from `dbpp.zip` to root folder of game (Example: tf2/ csgo/).<br />2. Add in databases.cfg this one:<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #DD0000">"dbpp"<br /></span><span style="color: #007700">{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"driver"&nbsp;&nbsp;&nbsp;&nbsp;"mysql"<br />&nbsp;&nbsp;&nbsp;&nbsp;"host"&nbsp;&nbsp;&nbsp;&nbsp;"your_ip"<br />&nbsp;&nbsp;&nbsp;&nbsp;"database"&nbsp;&nbsp;&nbsp;&nbsp;"your_db"<br />&nbsp;&nbsp;&nbsp;&nbsp;"user"&nbsp;&nbsp;&nbsp;&nbsp;"your_user"<br />&nbsp;&nbsp;&nbsp;&nbsp;"pass"&nbsp;&nbsp;&nbsp;&nbsp;"your_password"<br /></span><span style="color: #007700">}&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div>3. Test and write your own plugins!<br /><br />How to use this API?<br />1. Analyze this example<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #FF8000">#include&nbsp;&lt;sourcemod&gt;<br />#include&nbsp;&lt;dbplusplus&gt;<br /><br />#pragma&nbsp;semicolon&nbsp;1<br />#pragma&nbsp;newdecls&nbsp;required<br /><br /></span><span style="color: #007700">public&nbsp;</span><span style="color: #0000BB">Plugin&nbsp;myinfo&nbsp;</span><span style="color: #007700">=&nbsp;<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"[DB++]&nbsp;Test&nbsp;Plugin"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">author&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"Jake"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">description&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"-"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">version&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"0.1&nbsp;beta"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">url&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"http://ezplay.pro/"<br /></span><span style="color: #007700">};<br /><br /></span><span style="color: #FF8000">/**<br />&nbsp;*&nbsp;We're&nbsp;creating&nbsp;datapack&nbsp;<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;identify&nbsp;query<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;send&nbsp;some&nbsp;data<br />&nbsp;**/<br /></span><span style="color: #0000BB">DataPack&nbsp;gDataPackConnections</span><span style="color: #007700">[</span><span style="color: #0000BB">MAXPLAYERS</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />public&nbsp;</span><span style="color: #0000BB">void&nbsp;OnPluginStart</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Create&nbsp;datapack&nbsp;for&nbsp;each&nbsp;player&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">for&nbsp;(</span><span style="color: #0000BB">int&nbsp;i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">i&nbsp;</span><span style="color: #007700">&lt;=&nbsp;</span><span style="color: #0000BB">MaxClients</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">i</span><span style="color: #007700">++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">gDataPackConnections</span><span style="color: #007700">[</span><span style="color: #0000BB">i</span><span style="color: #007700">]&nbsp;=&nbsp;new&nbsp;</span><span style="color: #0000BB">DataPack</span><span style="color: #007700">();<br />}<br /><br /></span><span style="color: #FF8000">/*&nbsp;Player&nbsp;has&nbsp;joined&nbsp;and&nbsp;transaction&nbsp;is&nbsp;ready&nbsp;*/<br /></span><span style="color: #007700">public&nbsp;</span><span style="color: #0000BB">void&nbsp;DBPP_PlayerJoin</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;iClient</span><span style="color: #007700">,&nbsp;const&nbsp;</span><span style="color: #0000BB">char</span><span style="color: #007700">[]&nbsp;</span><span style="color: #0000BB">sSteam</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Transaction&nbsp;hTransaction</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;We&nbsp;want&nbsp;to&nbsp;send&nbsp;nick,&nbsp;so&nbsp;let&nbsp;get&nbsp;it&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sNick</span><span style="color: #007700">[</span><span style="color: #0000BB">64</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">GetClientName</span><span style="color: #007700">(</span><span style="color: #0000BB">iClient</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sNick</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">64</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ReplaceString</span><span style="color: #007700">(</span><span style="color: #0000BB">sNick</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">64</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"`"</span><span style="color: #007700">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ReplaceString</span><span style="color: #007700">(</span><span style="color: #0000BB">sNick</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">64</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"'"</span><span style="color: #007700">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ReplaceString</span><span style="color: #007700">(</span><span style="color: #0000BB">sNick</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">64</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"""</span><span style="color: #007700">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Time&nbsp;of&nbsp;connection&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">int&nbsp;iTime&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">GetTime</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Formatting&nbsp;query&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sQuery</span><span style="color: #007700">[</span><span style="color: #0000BB">256</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Just&nbsp;insert&nbsp;data&nbsp;in&nbsp;MySQL&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;For&nbsp;Example:&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;INSERT&nbsp;INTO&nbsp;`table`&nbsp;(`field`)&nbsp;VALUES&nbsp;(`data`);&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">FormatEx</span><span style="color: #007700">(</span><span style="color: #0000BB">sQuery</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">256</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"INSERT&nbsp;INTO&nbsp;`connections`&nbsp;(`steam`,&nbsp;`nick`,&nbsp;`time`)&nbsp;VALUES&nbsp;('%s',&nbsp;'%s',&nbsp;'%d');"</span><span style="color: #007700">,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">sSteam</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sNick</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">iTime</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Clearing&nbsp;data&nbsp;from&nbsp;datapack&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">gDataPackConnections</span><span style="color: #007700">[</span><span style="color: #0000BB">iClient</span><span style="color: #007700">].</span><span style="color: #0000BB">Reset</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Writing&nbsp;new&nbsp;data&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">gDataPackConnections</span><span style="color: #007700">[</span><span style="color: #0000BB">iClient</span><span style="color: #007700">].</span><span style="color: #0000BB">WriteString</span><span style="color: #007700">(</span><span style="color: #0000BB">sNick</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">gDataPackConnections</span><span style="color: #007700">[</span><span style="color: #0000BB">iClient</span><span style="color: #007700">].</span><span style="color: #0000BB">WriteCell</span><span style="color: #007700">(</span><span style="color: #0000BB">iTime</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">gDataPackConnections</span><span style="color: #007700">[</span><span style="color: #0000BB">iClient</span><span style="color: #007700">].</span><span style="color: #0000BB">WriteString</span><span style="color: #007700">(</span><span style="color: #0000BB">sQuery</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Ok,&nbsp;we&nbsp;are&nbsp;ready&nbsp;to&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;add&nbsp;query&nbsp;in&nbsp;transaction&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;1st&nbsp;param&nbsp;-&nbsp;query&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;2nd&nbsp;param&nbsp;-&nbsp;datapack&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">hTransaction</span><span style="color: #007700">.</span><span style="color: #0000BB">AddQuery</span><span style="color: #007700">(</span><span style="color: #0000BB">sQuery</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">gDataPackConnections</span><span style="color: #007700">[</span><span style="color: #0000BB">iClient</span><span style="color: #007700">]);<br />}<br /><br /></span><span style="color: #FF8000">/*&nbsp;Ok,&nbsp;we&nbsp;have&nbsp;a&nbsp;result,&nbsp;so&nbsp;let's&nbsp;log&nbsp;it&nbsp;out&nbsp;*/<br /></span><span style="color: #007700">public&nbsp;</span><span style="color: #0000BB">void&nbsp;DBPP_PlayerJoin_Results</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;iClient</span><span style="color: #007700">,&nbsp;const&nbsp;</span><span style="color: #0000BB">char</span><span style="color: #007700">[]&nbsp;</span><span style="color: #0000BB">sSteam</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">int&nbsp;iQuery</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">DBResultSet&nbsp;hResultSet</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">DataPack&nbsp;dPack</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">LogConnection</span><span style="color: #007700">(</span><span style="color: #0000BB">iClient</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">dPack</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Don't&nbsp;forget:&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Result&nbsp;sets&nbsp;will&nbsp;be&nbsp;deleted&nbsp;automaticly&nbsp;*/<br /></span><span style="color: #007700">}<br /><br /></span><span style="color: #FF8000">/*&nbsp;Something&nbsp;goes&nbsp;wrong,&nbsp;but&nbsp;we&nbsp;still&nbsp;can&nbsp;log&nbsp;data&nbsp;*/<br /></span><span style="color: #007700">public&nbsp;</span><span style="color: #0000BB">void&nbsp;DBPP_PlayerJoin_Fail</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;iClient</span><span style="color: #007700">,&nbsp;const&nbsp;</span><span style="color: #0000BB">char</span><span style="color: #007700">[]&nbsp;</span><span style="color: #0000BB">sSteam</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">int&nbsp;iFailedQuery</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">DataPack&nbsp;dPack</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">LogConnection</span><span style="color: #007700">(</span><span style="color: #0000BB">iClient</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">dPack</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">void&nbsp;LogConnection</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;iClient</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">DataPack&nbsp;dPack</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">bool&nbsp;bFailure</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Checking&nbsp;for&nbsp;needed&nbsp;query&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;If&nbsp;false&nbsp;-&nbsp;it's&nbsp;not&nbsp;our&nbsp;query&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">dPack&nbsp;</span><span style="color: #007700">!=&nbsp;</span><span style="color: #0000BB">gDataPackConnections</span><span style="color: #007700">[</span><span style="color: #0000BB">iClient</span><span style="color: #007700">])<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Reset&nbsp;position&nbsp;in&nbsp;datapack&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">dPack</span><span style="color: #007700">.</span><span style="color: #0000BB">Reset</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Read&nbsp;data&nbsp;and&nbsp;log&nbsp;it.&nbsp;Simple.&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sNick</span><span style="color: #007700">[</span><span style="color: #0000BB">64</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">dPack</span><span style="color: #007700">.</span><span style="color: #0000BB">ReadString</span><span style="color: #007700">(</span><span style="color: #0000BB">sNick</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">64</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">int&nbsp;iTime&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">dPack</span><span style="color: #007700">.</span><span style="color: #0000BB">ReadCell</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sTime</span><span style="color: #007700">[</span><span style="color: #0000BB">32</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">FormatTime</span><span style="color: #007700">(</span><span style="color: #0000BB">sTime</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">32</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"%d/%m/%y&nbsp;%H:%M:%S"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">iTime</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">LogMessage</span><span style="color: #007700">(</span><span style="color: #DD0000">"[DB++]&nbsp;Player&nbsp;%s&nbsp;joined&nbsp;at&nbsp;%s"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sNick</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sTime</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Our&nbsp;query&nbsp;was&nbsp;failure&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">bFailure&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">char&nbsp;sQuery</span><span style="color: #007700">[</span><span style="color: #0000BB">256</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">dPack</span><span style="color: #007700">.</span><span style="color: #0000BB">ReadString</span><span style="color: #007700">(</span><span style="color: #0000BB">sQuery</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">256</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">LogMessage</span><span style="color: #007700">(</span><span style="color: #DD0000">"[DB++]&nbsp;Failed&nbsp;query:&nbsp;%s"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">sQuery</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div>2. Write your own (Tutorial will be later :D)<br /><br />You can change config source code of API<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #FF8000">//&nbsp;Config&nbsp;name&nbsp;in&nbsp;`databases.cfg`<br />#define&nbsp;CONFIG_NAME&nbsp;"dbpp"<br /><br />//&nbsp;Charset,&nbsp;which&nbsp;is&nbsp;used&nbsp;in&nbsp;database<br />//&nbsp;&nbsp;(be&nbsp;careful&nbsp;when&nbsp;you&nbsp;change&nbsp;it)<br />#define&nbsp;CONFIG_CHARSET&nbsp;"utf8"<br /><br />//&nbsp;Auth&nbsp;ID<br />//&nbsp;&nbsp;(change&nbsp;if&nbsp;you&nbsp;know&nbsp;what&nbsp;you&nbsp;do)<br />#define&nbsp;CONFIG_AUTHID&nbsp;AuthId_Steam2<br /><br />//&nbsp;Auth&nbsp;ID&nbsp;Length<br />//&nbsp;&nbsp;(not&nbsp;necessary&nbsp;to&nbsp;change&nbsp;it)<br />#define&nbsp;CONFIG_STEAMLENGTH&nbsp;32<br /><br />//&nbsp;Database&nbsp;Priorities<br />//&nbsp;&nbsp;&nbsp;(please&nbsp;don't&nbsp;set&nbsp;all&nbsp;to&nbsp;high&nbsp;if&nbsp;you&nbsp;don't&nbsp;need)<br />#define&nbsp;CONFIG_DBPRIO_JOIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DBPrio_Normal<br />#define&nbsp;CONFIG_DBPRIO_LEAVE&nbsp;DBPrio_Normal<br />#define&nbsp;CONFIG_DBPRIO_EVENT&nbsp;DBPrio_Low<br /><br />//&nbsp;Comment&nbsp;line&nbsp;below&nbsp;if&nbsp;loading&nbsp;of&nbsp;player&nbsp;data&nbsp;on&nbsp;plugin&nbsp;start&nbsp;is&nbsp;not&nbsp;needed<br />#define&nbsp;CONFIG_LOAD_PLAYERS_ON_INIT&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></div>


<br /> <div style="padding:6px">








<fieldset class="fieldset">
<legend>Attached Files</legend>
<table cellpadding="0" cellspacing="3" border="0">
<tr>
<td><img class="inlineimg" src="https://forums.allie...attach/zip.gif"alt="File Type: zip" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td>


<a href="https://forums.allie...8">dbpp.zip</a>(18.6 KB)


</td>
</tr>
</table>
</fieldset>


</div>

Wyświetl pełny artykuł




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych