123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <title>UAS2: E:/uas2/Server/Allegiance.h Source File</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <link href="doxygen.css" rel="stylesheet" type="text/css"/>
- </head>
- <body>
- <!-- Generated by Doxygen 1.6.2 -->
- <div class="navigation" id="top">
- <div class="tabs">
- <ul>
- <li><a href="main.html"><span>Main Page</span></a></li>
- <li><a href="annotated.html"><span>Classes</span></a></li>
- <li class="current"><a href="files.html"><span>Files</span></a></li>
- </ul>
- </div>
- <div class="tabs">
- <ul>
- <li><a href="files.html"><span>File List</span></a></li>
- <li><a href="globals.html"><span>File Members</span></a></li>
- </ul>
- </div>
- <h1>E:/uas2/Server/Allegiance.h</h1><a href="_allegiance_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
- <a name="l00002"></a>00002 <span class="comment">* This file is part of UAS2.</span>
- <a name="l00003"></a>00003 <span class="comment">*</span>
- <a name="l00004"></a>00004 <span class="comment">* UAS2 is free software; you can redistribute it and/or modify</span>
- <a name="l00005"></a>00005 <span class="comment">* it under the terms of the GNU General Public License as published by</span>
- <a name="l00006"></a>00006 <span class="comment">* the Free Software Foundation; either version 2 of the License, or</span>
- <a name="l00007"></a>00007 <span class="comment">* (at your option) any later version.</span>
- <a name="l00008"></a>00008 <span class="comment">*</span>
- <a name="l00009"></a>00009 <span class="comment">* UAS2 is distributed in the hope that it will be useful,</span>
- <a name="l00010"></a>00010 <span class="comment">* but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
- <a name="l00011"></a>00011 <span class="comment">* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
- <a name="l00012"></a>00012 <span class="comment">* GNU General Public License for more details.</span>
- <a name="l00013"></a>00013 <span class="comment"></span>
- <a name="l00014"></a>00014 <span class="comment">* You should have received a copy of the GNU General Public License</span>
- <a name="l00015"></a>00015 <span class="comment">* along with UASv1; if not, write to the Free Software</span>
- <a name="l00016"></a>00016 <span class="comment">* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
- <a name="l00017"></a>00017 <span class="comment">*/</span>
- <a name="l00018"></a>00018
- <a name="l00023"></a>00023 <span class="preprocessor">#ifndef __ALLEGIANCES_H</span>
- <a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __ALLEGIANCES_H</span>
- <a name="l00025"></a>00025 <span class="preprocessor"></span>
- <a name="l00026"></a>00026 <span class="preprocessor">#pragma warning(disable:4786) //warning: identifier was truncated to '255' characters in the browser information</span>
- <a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#include <map></span>
- <a name="l00028"></a>00028 <span class="comment">//#include <vector></span>
- <a name="l00029"></a>00029
- <a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="_avatar_8h.html">Avatar.h</a>"</span>
- <a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="_shared_8h.html">Shared.h</a>"</span>
- <a name="l00032"></a>00032
- <a name="l00033"></a><a class="code" href="struct_member.html">00033</a> <span class="keyword">struct </span><a class="code" href="struct_member.html">Member</a>
- <a name="l00034"></a>00034 {
- <a name="l00035"></a>00035 <span class="comment">// allegiance table</span>
- <a name="l00036"></a>00036 DWORD m_dwGUID;
- <a name="l00037"></a>00037 std::string m_szName;
- <a name="l00038"></a>00038 <span class="keywordtype">bool</span> m_online;
- <a name="l00039"></a>00039 BYTE m_bGender;
- <a name="l00040"></a>00040 BYTE m_bRace;
- <a name="l00041"></a>00041 BYTE m_bRank;
- <a name="l00042"></a>00042 WORD m_wLeadership;
- <a name="l00043"></a>00043 WORD m_wLoyalty;
- <a name="l00044"></a>00044 DWORD m_dwPatron;
- <a name="l00045"></a>00045 DWORD m_dwVassals[MAX_VASSALS]; <span class="comment">// vassals determined at run-time</span>
- <a name="l00046"></a>00046 DWORD m_dwFollowers; <span class="comment">// number of personal followers</span>
- <a name="l00047"></a>00047 <span class="keywordtype">float</span> m_avgIGSworn; <span class="comment">// average in-game sworn time of vassals</span>
- <a name="l00048"></a>00048 <span class="keywordtype">float</span> m_avgRTSworn; <span class="comment">// average real-time sworn time of vassals</span>
- <a name="l00049"></a>00049 DWORD m_passupXP; <span class="comment">// experience generated</span>
- <a name="l00050"></a>00050 DWORD m_pendingXP; <span class="comment">// experience pending since previous login</span>
- <a name="l00051"></a>00051
- <a name="l00052"></a>00052 <span class="comment">// avatar table</span>
- <a name="l00053"></a>00053 DWORD m_dwLevel;
- <a name="l00054"></a>00054 ULONG m_timeBirth;
- <a name="l00055"></a>00055 ULONG m_timeRLSwear; <span class="comment">// sworn time, real-life</span>
- <a name="l00056"></a>00056 ULONG m_timeIGTotal; <span class="comment">// total time in-game (character age)</span>
- <a name="l00057"></a>00057 ULONG m_timeIGSwear; <span class="comment">// sworn time, in-game (character age)</span>
- <a name="l00058"></a>00058 };
- <a name="l00059"></a>00059
- <a name="l00060"></a><a class="code" href="classc_allegiance.html">00060</a> <span class="keyword">class </span><a class="code" href="classc_allegiance.html">cAllegiance</a>
- <a name="l00061"></a>00061 {
- <a name="l00062"></a>00062 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classc_master_server.html">cMasterServer</a>;
- <a name="l00063"></a>00063
- <a name="l00064"></a>00064 <span class="keyword">public</span>:
- <a name="l00065"></a>00065 <a class="code" href="classc_allegiance.html">cAllegiance</a>();
- <a name="l00066"></a>00066 ~<a class="code" href="classc_allegiance.html">cAllegiance</a>();
- <a name="l00067"></a>00067
- <a name="l00068"></a>00068 <span class="keywordtype">void</span> LoadAllegiance (DWORD ID, DWORD leaderGUID, <span class="keywordtype">char</span> name[40], <span class="keywordtype">char</span> MOTD[255]);
- <a name="l00069"></a>00069 <span class="keywordtype">void</span> CreateAllegiance ( DWORD leaderGUID );
- <a name="l00070"></a>00070 <span class="keywordtype">void</span> Disband ( );
- <a name="l00071"></a>00071
- <a name="l00072"></a>00072 <span class="keyword">typedef</span> std::map<DWORD, Member> MemberList;
- <a name="l00073"></a>00073
- <a name="l00074"></a>00074 <a class="code" href="struct_member.html">Member</a>* FindMember ( DWORD memberGUID ) { <span class="keywordflow">return</span> &this->members.find(memberGUID)->second; }
- <a name="l00075"></a>00075
- <a name="l00076"></a>00076 <span class="keyword">static</span> <a class="code" href="classc_allegiance.html">cAllegiance</a>* GetAllegianceByID ( DWORD AllegianceID );
- <a name="l00077"></a>00077 DWORD GetID() { <span class="keywordflow">return</span> m_ID; }
- <a name="l00078"></a>00078 DWORD GetLeader() { <span class="keywordflow">return</span> m_LeaderGUID; }
- <a name="l00079"></a>00079 DWORD GetSize() { <span class="keywordflow">return</span> m_Size; }
- <a name="l00080"></a>00080 std::string GetName() { <span class="keywordflow">return</span> m_Name.c_str(); }
- <a name="l00081"></a>00081 std::string GetMOTD() { <span class="keywordflow">return</span> m_MOTD.c_str(); }
- <a name="l00082"></a>00082
- <a name="l00083"></a>00083 <span class="keyword">static</span> <span class="keywordtype">void</span> SetLeader ( DWORD allegianceID, DWORD leaderGUID );
- <a name="l00084"></a>00084 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classc_allegiance.html#a2cb872113459746d173326a5203a89de">AddNewMember</a> ( DWORD dwAvatarGUID, DWORD dwPatronGUID, DWORD oldAllegianceID, DWORD newAllegianceID );
- <a name="l00085"></a>00085 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classc_allegiance.html#a3b5f61a7addf7830fb170d60b0dd2c0f">AddRemMember</a> ( <a class="code" href="struct_member.html">Member</a>* member, DWORD oldAllegianceID, DWORD newAllegianceID );
- <a name="l00086"></a>00086 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classc_allegiance.html#a8489189443fed532b70de13eb33d707e">RemMember</a> ( DWORD dwRemMemberGUID, DWORD oldAllegianceID, <span class="keywordtype">bool</span> isDisbanding=<span class="keyword">false</span> );
- <a name="l00087"></a>00087 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classc_allegiance.html#a9d7c20d2b5893388299105fee780fd8b">SwitchMonarchAndVassals</a> ( <a class="code" href="struct_member.html">Member</a>* member, DWORD oldAllegianceID, DWORD newAllegianceID );
- <a name="l00088"></a>00088 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classc_allegiance.html#a9bfd51a6a51aef286986a4946b981064">SwitchNonMonarchVassals</a> ( <a class="code" href="struct_member.html">Member</a>* member, DWORD oldAllegianceID, DWORD newAllegianceID );
- <a name="l00089"></a>00089
- <a name="l00090"></a>00090 <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#ad38bc8d0a79a3e1b45cfb6435ded503f">InsertMember</a> ( <a class="code" href="struct_member.html">Member</a> member, DWORD dwPatronGUID );
- <a name="l00091"></a>00091 <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#af9d9708943372baea909d5c848b74d92">EraseMember</a> ( <a class="code" href="struct_member.html">Member</a>* member );
- <a name="l00092"></a>00092 <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#af9d9708943372baea909d5c848b74d92">EraseMember</a> ( DWORD dwMemberGUID );
- <a name="l00093"></a>00093
- <a name="l00094"></a>00094 <span class="keywordtype">bool</span> <a class="code" href="classc_allegiance.html#a0ac0e517e7671fc9c222d7592dced02f">AddDirectVassal</a> ( <a class="code" href="struct_member.html">Member</a>* memPatron, <a class="code" href="struct_member.html">Member</a>* memVassal );
- <a name="l00095"></a>00095 <span class="keywordtype">bool</span> <a class="code" href="classc_allegiance.html#a0ac0e517e7671fc9c222d7592dced02f">AddDirectVassal</a> ( DWORD dwPatronGUID, DWORD dwVassalGUID );
- <a name="l00096"></a>00096 <span class="keywordtype">bool</span> <a class="code" href="classc_allegiance.html#a515878e8da9990f854d1b75fb8cf8aec">RemDirectVassal</a> ( <a class="code" href="struct_member.html">Member</a>* memVassal );
- <a name="l00097"></a>00097 <span class="keywordtype">bool</span> <a class="code" href="classc_allegiance.html#a515878e8da9990f854d1b75fb8cf8aec">RemDirectVassal</a> ( DWORD dwVassalGUID );
- <a name="l00098"></a>00098
- <a name="l00099"></a>00099 <span class="keywordtype">void</span> SetMOTD ( std::string motd );
- <a name="l00100"></a>00100
- <a name="l00101"></a>00101 std::string GetMemberName ( <a class="code" href="struct_member.html">Member</a>* member ) { <span class="keywordflow">return</span> member->m_szName.c_str(); }
- <a name="l00102"></a>00102 std::string GetMemberName ( DWORD dwMemberGUID ) { <a class="code" href="struct_member.html">Member</a>* member = FindMember(dwMemberGUID); <span class="keywordflow">return</span> member->m_szName.c_str(); }
- <a name="l00103"></a>00103
- <a name="l00104"></a>00104 <span class="keywordtype">int</span> <a class="code" href="classc_allegiance.html#aa1f552a312586083d46862ab5ae348c5">GetVassalCount</a> ( <a class="code" href="struct_member.html">Member</a>* member );
- <a name="l00105"></a>00105 <span class="keywordtype">int</span> <a class="code" href="classc_allegiance.html#aa1f552a312586083d46862ab5ae348c5">GetVassalCount</a> ( DWORD dwMemberGUID );
- <a name="l00106"></a>00106 <span class="keywordtype">int</span> <a class="code" href="classc_allegiance.html#ae91a3fc567aa4d543ee3ec5eccf70662">GetFollowerCount</a> ( <a class="code" href="struct_member.html">Member</a>* member );
- <a name="l00107"></a>00107 <span class="keywordtype">int</span> <a class="code" href="classc_allegiance.html#ae91a3fc567aa4d543ee3ec5eccf70662">GetFollowerCount</a> ( DWORD dwMemberGUID );
- <a name="l00108"></a>00108
- <a name="l00109"></a>00109 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#a464ff146a68f29047907873bb60fd6f2">UpdatePlayerAllegID</a> ( <a class="code" href="struct_member.html">Member</a>* member, DWORD newAllegianceID );
- <a name="l00110"></a>00110 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#a464ff146a68f29047907873bb60fd6f2">UpdatePlayerAllegID</a> ( DWORD dwPlayerGUID, DWORD newAllegianceID );
- <a name="l00111"></a>00111 <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#adb2e82a95c03112dc265e31e16802569">UpdateFollowers</a> ( <a class="code" href="struct_member.html">Member</a>* member, <span class="keywordtype">int</span> numFollowers );
- <a name="l00112"></a>00112 <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#adb2e82a95c03112dc265e31e16802569">UpdateFollowers</a> ( DWORD dwMemberGUID, <span class="keywordtype">int</span> numFollowers );
- <a name="l00113"></a>00113 <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#aef6b45d7d05edcb6e4d531a26c383750">UpdateRank</a> ( <a class="code" href="struct_member.html">Member</a>* member );
- <a name="l00114"></a>00114 <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#aef6b45d7d05edcb6e4d531a26c383750">UpdateRank</a> ( DWORD dwMemberGUID );
- <a name="l00115"></a>00115
- <a name="l00116"></a>00116 <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#adc5e09f86bcb46ab8949226a9795de93">VassalPassupXP</a> ( <a class="code" href="struct_member.html">Member</a>* memVassal, UINT64 experience, <span class="keywordtype">bool</span> isGrandVassal=<span class="keyword">false</span> );
- <a name="l00117"></a>00117 <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#a2564663e0b24199cb65551181b7d6575">UpdateGeneratedXP</a> ( <a class="code" href="struct_member.html">Member</a>* member, UINT64 experience );
- <a name="l00118"></a>00118 <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#a9202665caa0f6ed1eab35b5da35697c1">UpdateEarnedXP</a> ( <a class="code" href="struct_member.html">Member</a>* member, UINT64 experience );
- <a name="l00119"></a>00119 UINT64 <a class="code" href="classc_allegiance.html#a3e7f8a4e98ad8114e20fee9e5bc37354">CalcVassalGeneratedXP</a> ( <a class="code" href="struct_member.html">Member</a>* memVassal, UINT64 experience, <span class="keywordtype">bool</span> isGrandPatron=<span class="keyword">false</span> );
- <a name="l00120"></a>00120 UINT64 <a class="code" href="classc_allegiance.html#aa846e330d70f8ca236857c724d23a5c7">CalcPatronReceivedXP</a> ( <a class="code" href="struct_member.html">Member</a>* memPatron, UINT64 experience, <span class="keywordtype">bool</span> isGrandPatron=<span class="keyword">false</span> );
- <a name="l00121"></a>00121 <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#a2ae364d6dd15cbcc0403a9693b94c531">UpdateAverageSwornTimeOfVassals</a> ( <a class="code" href="struct_member.html">Member</a>* memPatron );
- <a name="l00122"></a>00122 <span class="keywordtype">float</span> <a class="code" href="classc_allegiance.html#a31788ce94c200be83b839fefc955e629">CalcVassalFactor</a> ( <span class="keywordtype">int</span> numVassals );
- <a name="l00123"></a>00123
- <a name="l00124"></a>00124 <a class="code" href="classc_message.html">cMessage</a> GetAllegianceInfo ( DWORD avatarGUID );
- <a name="l00125"></a>00125
- <a name="l00126"></a>00126 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classc_allegiance.html#ad3b5d3b767597234cfddd541f28a2dfe">LoadMembersFromDB</a> ( <a class="code" href="classc_allegiance.html">cAllegiance</a>* aAllegiance );
- <a name="l00127"></a>00127
- <a name="l00128"></a>00128 <span class="keyword">static</span> <span class="keywordtype">void</span> UpdateAvatarAllegIDDB ( DWORD dwGUID, DWORD allegianceID );
- <a name="l00129"></a>00129 <span class="keyword">static</span> <span class="keywordtype">void</span> UpdateMemberAllegIDDB ( DWORD dwGUID, DWORD allegianceID );
- <a name="l00130"></a>00130 <span class="keyword">static</span> <span class="keywordtype">void</span> UpdateAvatarRecordDB ( DWORD dwAvatarGUID );
- <a name="l00131"></a>00131 <span class="keyword">static</span> <span class="keywordtype">void</span> AddMemberRecordDB ( DWORD allegianceID, DWORD dwAvatarGUID, DWORD dwPatronGUID );
- <a name="l00132"></a>00132 <span class="keyword">static</span> <span class="keywordtype">void</span> DeleteMemberRecordDB ( DWORD allegianceID, DWORD dwMemberGUID );
- <a name="l00133"></a>00133 <span class="keyword">static</span> <span class="keywordtype">void</span> UpdateMemberRecordDB ( <a class="code" href="struct_member.html">Member</a>* member );
- <a name="l00134"></a>00134 <span class="keyword">static</span> <span class="keywordtype">void</span> UpdateMemberXPPassupDB ( DWORD memberGUID, UINT64 passedXP );
- <a name="l00135"></a>00135 <span class="keyword">static</span> <span class="keywordtype">void</span> UpdateMemberXPPendingDB ( DWORD memberGUID, UINT64 pendingXP );
- <a name="l00136"></a>00136 <span class="keyword">static</span> <span class="keywordtype">void</span> UpdateMemberFollowersDB ( DWORD memberGUID, <span class="keywordtype">int</span> numFollowers );
- <a name="l00137"></a>00137 <span class="keyword">static</span> <span class="keywordtype">void</span> UpdateMemberRankDB ( DWORD memberGUID, <span class="keywordtype">int</span> rank );
- <a name="l00138"></a>00138 <span class="keyword">static</span> <span class="keywordtype">void</span> UpdateMemberPatronDB ( DWORD memberGUID, DWORD patronGUID );
- <a name="l00139"></a>00139
- <a name="l00140"></a>00140 MemberList members;
- <a name="l00141"></a>00141
- <a name="l00142"></a>00142 <span class="keyword">protected</span>:
- <a name="l00143"></a>00143 DWORD m_ID;
- <a name="l00144"></a>00144 std::string m_Name;
- <a name="l00145"></a>00145 DWORD m_LeaderGUID;
- <a name="l00146"></a>00146 std::string m_MOTD;
- <a name="l00147"></a>00147 <span class="keywordtype">int</span> m_Size; <span class="comment">// calculated at run-time</span>
- <a name="l00148"></a>00148 ULONG m_CreationTime;
- <a name="l00149"></a>00149 };
- <a name="l00150"></a>00150
- <a name="l00151"></a>00151 <span class="preprocessor">#endif // #ifndef __ALLEGIANCES_H</span>
- </pre></div></div>
- <hr size="1"/><address style="text-align: right;"><small>Generated by
- <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
- </body>
- </html>
|