1 #ifndef __LOBBY_2_MESSAGE_H 2 #define __LOBBY_2_MESSAGE_H 3 4 #include "BitStream.h" 5 #include "Lobby2ResultCode.h" 6 #include "RakString.h" 7 #include "RakAssert.h" 8 #include "RakNetSmartPtr.h" 9 #include "SimpleMutex.h" 10 #include "Lobby2Presence.h" 11 12 13 14 15 16 #pragma once 17 18 namespace RakNet 19 { 20 21 struct Lobby2Callbacks; 22 class Lobby2Client; 23 class Lobby2Server; 24 struct BinaryDataBlock; 25 struct Lobby2ServerCommand; 26 27 const unsigned int L2_MAX_BINARY_DATA_LENGTH=1000000; 28 29 30 // --------------------------------------------- Enumeration list of all message IDs -------------------------------------------- 31 32 /// All enumerations for Lobby2Message. Each Lobby2Message has one enumeration 33 /// \ingroup LOBBY_2_COMMANDS 34 enum Lobby2MessageID 35 { 36 L2MID_Platform_Startup, 37 L2MID_Platform_Shutdown, 38 L2MID_System_CreateDatabase, 39 L2MID_System_DestroyDatabase, 40 L2MID_System_CreateTitle, 41 L2MID_System_DestroyTitle, 42 L2MID_System_GetTitleRequiredAge, 43 L2MID_System_GetTitleBinaryData, 44 L2MID_System_RegisterProfanity, 45 L2MID_System_BanUser, 46 L2MID_System_UnbanUser, 47 L2MID_CDKey_Add, 48 L2MID_CDKey_GetStatus, 49 L2MID_CDKey_Use, 50 L2MID_CDKey_FlagStolen, 51 L2MID_Client_Login, 52 L2MID_Client_Logoff, 53 L2MID_Client_RegisterAccount, 54 L2MID_System_SetEmailAddressValidated, 55 L2MID_Client_ValidateHandle, 56 L2MID_System_DeleteAccount, 57 L2MID_System_PruneAccounts, 58 L2MID_Client_GetEmailAddress, 59 L2MID_Client_GetPasswordRecoveryQuestionByHandle, 60 L2MID_Client_GetPasswordByPasswordRecoveryAnswer, 61 L2MID_Client_ChangeHandle, 62 L2MID_Client_UpdateAccount, 63 L2MID_Client_GetAccountDetails, 64 L2MID_Client_StartIgnore, 65 L2MID_Client_StopIgnore, 66 L2MID_Client_GetIgnoreList, 67 L2MID_Client_PerTitleIntegerStorage, 68 L2MID_Client_PerTitleBinaryStorage, 69 L2MID_Client_SetPresence, 70 L2MID_Client_GetPresence, 71 L2MID_Friends_SendInvite, 72 L2MID_Friends_AcceptInvite, 73 L2MID_Friends_RejectInvite, 74 L2MID_Friends_GetInvites, 75 L2MID_Friends_GetFriends, 76 L2MID_Friends_Remove, 77 L2MID_BookmarkedUsers_Add, 78 L2MID_BookmarkedUsers_Remove, 79 L2MID_BookmarkedUsers_Get, 80 L2MID_Emails_Send, 81 L2MID_Emails_Get, 82 L2MID_Emails_Delete, 83 L2MID_Emails_SetStatus, 84 L2MID_Ranking_SubmitMatch, 85 L2MID_Ranking_GetMatches, 86 L2MID_Ranking_GetMatchBinaryData, 87 L2MID_Ranking_GetTotalScore, 88 L2MID_Ranking_WipeScoresForPlayer, 89 L2MID_Ranking_WipeMatches, 90 L2MID_Ranking_PruneMatches, 91 L2MID_Ranking_UpdateRating, 92 L2MID_Ranking_WipeRatings, 93 L2MID_Ranking_GetRating, 94 L2MID_Clans_Create, 95 L2MID_Clans_SetProperties, 96 L2MID_Clans_GetProperties, 97 L2MID_Clans_SetMyMemberProperties, 98 L2MID_Clans_GrantLeader, 99 L2MID_Clans_SetSubleaderStatus, 100 L2MID_Clans_SetMemberRank, 101 L2MID_Clans_GetMemberProperties, 102 L2MID_Clans_ChangeHandle, 103 L2MID_Clans_Leave, 104 L2MID_Clans_Get, 105 L2MID_Clans_SendJoinInvitation, 106 L2MID_Clans_WithdrawJoinInvitation, 107 L2MID_Clans_AcceptJoinInvitation, 108 L2MID_Clans_RejectJoinInvitation, 109 L2MID_Clans_DownloadInvitationList, 110 L2MID_Clans_SendJoinRequest, 111 L2MID_Clans_WithdrawJoinRequest, 112 L2MID_Clans_AcceptJoinRequest, 113 L2MID_Clans_RejectJoinRequest, 114 L2MID_Clans_DownloadRequestList, 115 L2MID_Clans_KickAndBlacklistUser, 116 L2MID_Clans_UnblacklistUser, 117 L2MID_Clans_GetBlacklist, 118 L2MID_Clans_GetMembers, 119 L2MID_Clans_GetList, 120 L2MID_Clans_CreateBoard, 121 L2MID_Clans_DestroyBoard, 122 L2MID_Clans_CreateNewTopic, 123 L2MID_Clans_ReplyToTopic, 124 L2MID_Clans_RemovePost, 125 L2MID_Clans_GetBoards, 126 L2MID_Clans_GetTopics, 127 L2MID_Clans_GetPosts, 128 L2MID_Console_GetServerStatus, 129 L2MID_Console_GetWorldListFromServer, 130 L2MID_Console_GetLobbyListFromWorld, 131 L2MID_Console_JoinLobby, 132 L2MID_Console_LeaveLobby, 133 L2MID_Console_SendLobbyChatMessage, 134 L2MID_Console_SearchRooms, 135 L2MID_Console_GetRoomDetails, 136 L2MID_Console_GetLobbyMemberData, 137 L2MID_Console_CreateRoom, 138 L2MID_Console_SetRoomSearchProperties, 139 L2MID_Console_UpdateRoomParameters, 140 L2MID_Console_JoinRoom, 141 L2MID_Console_LeaveRoom, 142 L2MID_Console_SendLobbyInvitationToRoom, 143 L2MID_Console_SendGUIInvitationToRoom, 144 L2MID_Console_SendDataMessageToUser, 145 L2MID_Console_SendRoomChatMessage, 146 L2MID_Notification_Client_RemoteLogin, 147 L2MID_Notification_Client_IgnoreStatus, 148 L2MID_Notification_Friends_StatusChange, 149 L2MID_Notification_Friends_PresenceUpdate, 150 L2MID_Notification_User_ChangedHandle, 151 L2MID_Notification_Friends_CreatedClan, 152 L2MID_Notification_Emails_Received, 153 L2MID_Notification_Clans_GrantLeader, 154 L2MID_Notification_Clans_SetSubleaderStatus, 155 L2MID_Notification_Clans_SetMemberRank, 156 L2MID_Notification_Clans_ChangeHandle, 157 L2MID_Notification_Clans_Leave, 158 L2MID_Notification_Clans_PendingJoinStatus, 159 L2MID_Notification_Clans_NewClanMember, 160 L2MID_Notification_Clans_KickAndBlacklistUser, 161 L2MID_Notification_Clans_UnblacklistUser, 162 L2MID_Notification_Clans_Destroyed, 163 L2MID_Notification_Console_CableDisconnected, 164 L2MID_Notification_Console_ContextError, 165 L2MID_Notification_Console_MemberJoinedLobby, 166 L2MID_Notification_Console_MemberLeftLobby, 167 L2MID_Notification_Console_LobbyDestroyed, 168 L2MID_Notification_Console_LobbyMemberDataUpdated, 169 L2MID_Notification_Console_LobbyGotChatMessage, 170 L2MID_Notification_Console_LobbyGotRoomInvitation, 171 L2MID_Notification_Console_MemberJoinedRoom, 172 L2MID_Notification_Console_MemberLeftRoom, 173 L2MID_Notification_Console_KickedOutOfRoom, 174 L2MID_Notification_Console_RoomWasDestroyed, 175 L2MID_Notification_Console_UpdateRoomParameters, 176 L2MID_Notification_Console_RoomOwnerChanged, 177 L2MID_Notification_Console_RoomChatMessage, 178 L2MID_Notification_Console_RoomMessage, 179 L2MID_Notification_Console_RoomMemberConnectivityUpdate, 180 L2MID_Notification_Console_ChatEvent, 181 L2MID_Notification_Console_MuteListChanged, 182 L2MID_Notification_Console_Local_Users_Changed, 183 L2MID_Notification_ReceivedDataMessageFromUser, 184 185 186 L2MID_COUNT, 187 }; 188 189 // Should match tab;e lobby2.clanMemberStates 190 /// \ingroup LOBBY_2_COMMANDS 191 enum ClanMemberState 192 { 193 CMD_UNDEFINED=0, 194 CMD_ACTIVE, 195 CMD_BANNED, 196 CMD_JOIN_INVITED, 197 CMD_JOIN_REQUESTED, 198 }; 199 // --------------------------------------------- Base class for all messages (functions and notifications -------------------------------------------- 200 201 /// \brief A Lobby2Message encapsulates a networked function call from the client. 202 /// \details The client should fill in the input parameters, call Lobby2Client::SendMsg(), and wait for the reply in the callback passed to Lobby2Client::SetCallbackInterface() 203 /// The input parameters are always serialized back from the server. 204 /// See resultCode for the result of the operation. L2RC_SUCCESS means success. Anything else means failure. 205 /// Any message may return between L2RC_NOT_LOGGED_IN and L2RC_EMAIL_ADDRESS_IS_INVALID, which indices formatting errors in the input. 206 /// All other return codes have the name of the message in the enumeration. 207 /// The system can be extended by deriving from Lobby2Message, adding your own input and output parameters, and deriving from Lobby2MessageFactory register your own class factory with RakNet::Lobby2Plugin::SetMessageFactory() 208 /// \ingroup LOBBY_2_COMMANDS 209 struct Lobby2Message 210 { 211 Lobby2Message(); ~Lobby2MessageLobby2Message212 virtual ~Lobby2Message() {} 213 214 /// Every message has an ID identifying it across the network 215 virtual Lobby2MessageID GetID(void) const=0; 216 217 /// Is this message something that should only be run by a system with admin privileges? 218 /// Set admin privileges with Lobby2Server::AddAdminAddress() 219 virtual bool RequiresAdmin(void) const=0; 220 221 /// Is this message something that should only be run by a system with ranking upload priviledges? 222 /// Set ranking privileges with Lobby2Server::AddRankingAddress() 223 virtual bool RequiresRankingPermission(void) const=0; 224 225 /// Should this message not be processed on the server if the requesting user disconnects before it completes? 226 /// This should be true for functions that only return data. False for functions that affect other users, or change the database 227 virtual bool CancelOnDisconnect(void) const=0; 228 229 /// Does this function require logging into the server before it can be executed? 230 /// If true, the user id and user handle will be automatically inferred by the last login by looking up the sender's system address. 231 /// If false, the message should include the username so the database query can lookup which user is performing this operation. 232 virtual bool RequiresLogin(void) const=0; 233 234 // Serialize data in this class. Currently just the resultCode 235 void SerializeBase(bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream); 236 237 /// Overridable serialization of the contents of this message. Defaults to SerializeBase() 238 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 239 240 /// If data members can be validated for correctness in the server's main thread, override this function and do those checks here. 241 /// \return True for input OK. False if the input is bad and does not need to be further processed in the database threads. 242 virtual bool PrevalidateInput(void); 243 244 /// Override to do any Lobby2Client functionality when the message is returned from the server (usually nothing). 245 /// \return True to call CallCallback immediately. False to defer for some reason (always true on the PC) 246 virtual bool ClientImpl( Lobby2Client *client); 247 248 /// This message has been processed by the server and has arrived back on the client. 249 /// Call the client informing the user of this event. 250 virtual void CallCallback(Lobby2Callbacks *cb)=0; 251 252 /// Do any Lobby2Server functionality when the message first arrives on the server, and after it has returned true from PrevalidateInput() 253 /// If it returns true, the message has been handled, and the result is sent to the client 254 /// If it returns false, the message continues to ServerDBImpl 255 virtual bool ServerPreDBMemoryImpl( Lobby2Server *server, RakString userHandle ); 256 257 /// Do any Lobby2Server functionality after the message has been processed by the database, in the server thread. 258 virtual void ServerPostDBMemoryImpl( Lobby2Server *server, RakString userHandle ); 259 260 /// Do any Lobby2Server functionality when the message is processed in a database thread on the server. 261 /// It is safe to do slow database calls in this function. 262 /// If it returns true, the message has been handled, and the result is sent to the client 263 /// If it returns false, that means ignore the message 264 virtual bool ServerDBImpl( Lobby2ServerCommand *command, void *databaseInterface ); 265 266 /// The only non-printable character is space 267 /// Cannot start with space 268 /// Cannot end with space 269 /// Cannot have two spaces in a row 270 bool ValidateHandle( RakNet::RakString *handle ); 271 272 /// Binary data cannot be longer than L2_MAX_BINARY_DATA_LENGTH 273 bool ValidateBinary( RakNetSmartPtr<BinaryDataBlock>binaryDataBlock); 274 275 /// Required text cannot be empty. 276 bool ValidateRequiredText( RakNet::RakString *text ); 277 278 /// Passwords must contain at least 5 characters 279 bool ValidatePassword( RakNet::RakString *text ); 280 281 /// Check email address format 282 bool ValidateEmailAddress( RakNet::RakString *text ); 283 284 /// Convert the enumeration representing this message to a string, and return it. Done automatically by macros. 285 virtual const char *GetName(void) const=0; 286 287 /// Write the result of this message to out(). Done automatically by macros. 288 virtual void DebugMsg(RakNet::RakString &out) const=0; 289 290 /// Print the result of DebugMsg DebugPrintfLobby2Message291 virtual void DebugPrintf(void) const 292 { 293 RakNet::RakString out; DebugMsg(out); printf(out.C_String()); 294 } 295 296 /// Result of the operation. L2RC_SUCCESS means the result completed. Anything else means an error 297 RakNet::Lobby2ResultCode resultCode; 298 299 /// Just a number, uniquely identifying each allocation of Lobby2Message. 300 /// Use it if you need to lookup queries on the callback reply 301 302 303 304 305 306 uint64_t requestId; 307 308 309 /// Just a number, representing which instance of Lobby2Callbacks should process the result of this operation 310 /// -1 means all 311 unsigned char callbackId; 312 313 /// Used for consoles 314 int extendedResultCode; 315 316 317 318 319 AddRefLobby2Message320 void AddRef(void) {refCountMutex.Lock(); refCount++; refCountMutex.Unlock(); } DerefLobby2Message321 void Deref(void) {refCountMutex.Lock(); refCount--; refCountMutex.Unlock();} GetRefCountLobby2Message322 int GetRefCount(void) {int r; refCountMutex.Lock(); r = refCount; refCountMutex.Unlock(); return r;} 323 324 private: 325 326 SimpleMutex refCountMutex; 327 /// Reference count 328 int refCount; 329 }; 330 331 // --------------------------------------------- Prototypes -------------------------------------------- 332 333 struct Platform_Startup; 334 struct Platform_Shutdown; 335 struct System_CreateDatabase; 336 struct System_DestroyDatabase; 337 struct System_CreateTitle; 338 struct System_DestroyTitle; 339 struct System_GetTitleRequiredAge; 340 struct System_GetTitleBinaryData; 341 struct System_RegisterProfanity; 342 struct System_BanUser; 343 struct System_UnbanUser; 344 struct CDKey_Add; 345 struct CDKey_GetStatus; 346 struct CDKey_Use; 347 struct CDKey_FlagStolen; 348 struct Client_Login; 349 struct Client_Logoff; 350 struct Client_RegisterAccount; 351 struct System_SetEmailAddressValidated; 352 struct Client_ValidateHandle; 353 struct System_DeleteAccount; 354 struct System_PruneAccounts; 355 struct Client_GetEmailAddress; 356 struct Client_GetPasswordRecoveryQuestionByHandle; 357 struct Client_GetPasswordByPasswordRecoveryAnswer; 358 struct Client_ChangeHandle; 359 struct Client_UpdateAccount; 360 struct Client_GetAccountDetails; 361 struct Client_StartIgnore; 362 struct Client_StopIgnore; 363 struct Client_GetIgnoreList; 364 struct Client_PerTitleIntegerStorage; 365 struct Client_PerTitleBinaryStorage; 366 struct Client_SetPresence; 367 struct Client_GetPresence; 368 struct Friends_SendInvite; 369 struct Friends_AcceptInvite; 370 struct Friends_RejectInvite; 371 struct Friends_GetInvites; 372 struct Friends_GetFriends; 373 struct Friends_Remove; 374 struct BookmarkedUsers_Add; 375 struct BookmarkedUsers_Remove; 376 struct BookmarkedUsers_Get; 377 struct Emails_Send; 378 struct Emails_Get; 379 struct Emails_Delete; 380 struct Emails_SetStatus; 381 struct Ranking_SubmitMatch; 382 struct Ranking_GetMatches; 383 struct Ranking_GetMatchBinaryData; 384 struct Ranking_GetTotalScore; 385 struct Ranking_WipeScoresForPlayer; 386 struct Ranking_WipeMatches; 387 struct Ranking_PruneMatches; 388 struct Ranking_UpdateRating; 389 struct Ranking_WipeRatings; 390 struct Ranking_GetRating; 391 struct Clans_Create; 392 struct Clans_SetProperties; 393 struct Clans_GetProperties; 394 struct Clans_SetMyMemberProperties; 395 struct Clans_GrantLeader; 396 struct Clans_SetSubleaderStatus; 397 struct Clans_SetMemberRank; 398 struct Clans_GetMemberProperties; 399 struct Clans_ChangeHandle; 400 struct Clans_Leave; 401 struct Clans_Get; 402 struct Clans_SendJoinInvitation; 403 struct Clans_WithdrawJoinInvitation; 404 struct Clans_AcceptJoinInvitation; 405 struct Clans_RejectJoinInvitation; 406 struct Clans_DownloadInvitationList; 407 struct Clans_SendJoinRequest; 408 struct Clans_WithdrawJoinRequest; 409 struct Clans_AcceptJoinRequest; 410 struct Clans_RejectJoinRequest; 411 struct Clans_DownloadRequestList; 412 struct Clans_KickAndBlacklistUser; 413 struct Clans_UnblacklistUser; 414 struct Clans_GetBlacklist; 415 struct Clans_GetMembers; 416 struct Clans_GetList; 417 struct Clans_CreateBoard; 418 struct Clans_DestroyBoard; 419 struct Clans_CreateNewTopic; 420 struct Clans_ReplyToTopic; 421 struct Clans_RemovePost; 422 struct Clans_GetBoards; 423 struct Clans_GetTopics; 424 struct Clans_GetPosts; 425 struct Console_GetServerStatus; 426 struct Console_GetWorldListFromServer; 427 struct Console_GetLobbyListFromWorld; 428 struct Console_JoinLobby; 429 struct Console_LeaveLobby; 430 struct Console_SendLobbyChatMessage; 431 struct Console_SearchRooms; 432 struct Console_GetRoomDetails; 433 struct Console_GetLobbyMemberData; 434 struct Console_CreateRoom; 435 struct Console_SetRoomSearchProperties; 436 struct Console_UpdateRoomParameters; 437 struct Console_JoinRoom; 438 struct Console_LeaveRoom; 439 struct Console_SendLobbyInvitationToRoom; 440 struct Console_SendGUIInvitationToRoom; 441 struct Console_SendDataMessageToUser; 442 struct Console_SendRoomChatMessage; 443 struct Notification_Client_RemoteLogin; 444 struct Notification_Client_IgnoreStatus; 445 struct Notification_Friends_StatusChange; 446 struct Notification_Friends_PresenceUpdate; 447 struct Notification_User_ChangedHandle; 448 struct Notification_Friends_CreatedClan; 449 struct Notification_Emails_Received; 450 struct Notification_Clans_GrantLeader; 451 struct Notification_Clans_SetSubleaderStatus; 452 struct Notification_Clans_SetMemberRank; 453 struct Notification_Clans_ChangeHandle; 454 struct Notification_Clans_Leave; 455 struct Notification_Clans_PendingJoinStatus; 456 struct Notification_Clans_NewClanMember; 457 struct Notification_Clans_KickAndBlacklistUser; 458 struct Notification_Clans_UnblacklistUser; 459 struct Notification_Clans_Destroyed; 460 struct Notification_Console_CableDisconnected; 461 struct Notification_Console_ContextError; 462 struct Notification_Console_MemberJoinedLobby; 463 struct Notification_Console_MemberLeftLobby; 464 struct Notification_Console_LobbyDestroyed; 465 struct Notification_Console_LobbyMemberDataUpdated; 466 struct Notification_Console_LobbyGotChatMessage; 467 struct Notification_Console_LobbyGotRoomInvitation; 468 struct Notification_Console_MemberJoinedRoom; 469 struct Notification_Console_MemberLeftRoom; 470 struct Notification_Console_KickedOutOfRoom; 471 struct Notification_Console_RoomWasDestroyed; 472 struct Notification_Console_UpdateRoomParameters; 473 struct Notification_Console_RoomOwnerChanged; 474 struct Notification_Console_RoomChatMessage; 475 struct Notification_Console_RoomMessage; 476 struct Notification_Console_RoomMemberConnectivityUpdate; 477 struct Notification_Console_ChatEvent; 478 struct Notification_Console_MuteListChanged; 479 struct Notification_Console_Local_Users_Changed; 480 struct Notification_ReceivedDataMessageFromUser; 481 482 // --------------------------------------------- Callback interface for all messages, notifies the user -------------------------------------------- 483 484 /// Every Lobby2Message processed with Lobby2Client::SendMsg() while connected will call the callback registered with Lobby2Client::SetCallbackInterface(). 485 /// \ingroup LOBBY_2_GROUP 486 struct Lobby2Callbacks 487 { Lobby2CallbacksLobby2Callbacks488 Lobby2Callbacks() {callbackId=nextCallbackId++;} ~Lobby2CallbacksLobby2Callbacks489 virtual ~Lobby2Callbacks() {} 490 virtual void MessageResult(Platform_Startup *message); 491 virtual void MessageResult(Platform_Shutdown *message); 492 virtual void MessageResult(System_CreateDatabase *message); 493 virtual void MessageResult(System_DestroyDatabase *message); 494 virtual void MessageResult(System_CreateTitle *message); 495 virtual void MessageResult(System_DestroyTitle *message); 496 virtual void MessageResult(System_GetTitleRequiredAge *message); 497 virtual void MessageResult(System_GetTitleBinaryData *message); 498 virtual void MessageResult(System_RegisterProfanity *message); 499 virtual void MessageResult(System_BanUser *message); 500 virtual void MessageResult(System_UnbanUser *message); 501 virtual void MessageResult(CDKey_Add *message); 502 virtual void MessageResult(CDKey_GetStatus *message); 503 virtual void MessageResult(CDKey_Use *message); 504 virtual void MessageResult(CDKey_FlagStolen *message); 505 virtual void MessageResult(Client_Login *message); 506 virtual void MessageResult(Client_Logoff *message); 507 virtual void MessageResult(Client_RegisterAccount *message); 508 virtual void MessageResult(System_SetEmailAddressValidated *message); 509 virtual void MessageResult(Client_ValidateHandle *message); 510 virtual void MessageResult(System_DeleteAccount *message); 511 virtual void MessageResult(System_PruneAccounts *message); 512 virtual void MessageResult(Client_GetEmailAddress *message); 513 virtual void MessageResult(Client_GetPasswordRecoveryQuestionByHandle *message); 514 virtual void MessageResult(Client_GetPasswordByPasswordRecoveryAnswer *message); 515 virtual void MessageResult(Client_ChangeHandle *message); 516 virtual void MessageResult(Client_UpdateAccount *message); 517 virtual void MessageResult(Client_GetAccountDetails *message); 518 virtual void MessageResult(Client_StartIgnore *message); 519 virtual void MessageResult(Client_StopIgnore *message); 520 virtual void MessageResult(Client_GetIgnoreList *message); 521 virtual void MessageResult(Client_PerTitleIntegerStorage *message); 522 virtual void MessageResult(Client_PerTitleBinaryStorage *message); 523 virtual void MessageResult(Client_SetPresence *message); 524 virtual void MessageResult(Client_GetPresence *message); 525 virtual void MessageResult(Friends_SendInvite *message); 526 virtual void MessageResult(Friends_AcceptInvite *message); 527 virtual void MessageResult(Friends_RejectInvite *message); 528 virtual void MessageResult(Friends_GetInvites *message); 529 virtual void MessageResult(Friends_GetFriends *message); 530 virtual void MessageResult(Friends_Remove *message); 531 virtual void MessageResult(BookmarkedUsers_Add *message); 532 virtual void MessageResult(BookmarkedUsers_Remove *message); 533 virtual void MessageResult(BookmarkedUsers_Get *message); 534 virtual void MessageResult(Emails_Send *message); 535 virtual void MessageResult(Emails_Get *message); 536 virtual void MessageResult(Emails_Delete *message); 537 virtual void MessageResult(Emails_SetStatus *message); 538 virtual void MessageResult(Ranking_SubmitMatch *message); 539 virtual void MessageResult(Ranking_GetMatches *message); 540 virtual void MessageResult(Ranking_GetMatchBinaryData *message); 541 virtual void MessageResult(Ranking_GetTotalScore *message); 542 virtual void MessageResult(Ranking_WipeScoresForPlayer *message); 543 virtual void MessageResult(Ranking_WipeMatches *message); 544 virtual void MessageResult(Ranking_PruneMatches *message); 545 virtual void MessageResult(Ranking_UpdateRating *message); 546 virtual void MessageResult(Ranking_WipeRatings *message); 547 virtual void MessageResult(Ranking_GetRating *message); 548 virtual void MessageResult(Clans_Create *message); 549 virtual void MessageResult(Clans_SetProperties *message); 550 virtual void MessageResult(Clans_GetProperties *message); 551 virtual void MessageResult(Clans_SetMyMemberProperties *message); 552 virtual void MessageResult(Clans_GrantLeader *message); 553 virtual void MessageResult(Clans_SetSubleaderStatus *message); 554 virtual void MessageResult(Clans_SetMemberRank *message); 555 virtual void MessageResult(Clans_GetMemberProperties *message); 556 virtual void MessageResult(Clans_ChangeHandle *message); 557 virtual void MessageResult(Clans_Leave *message); 558 virtual void MessageResult(Clans_Get *message); 559 virtual void MessageResult(Clans_SendJoinInvitation *message); 560 virtual void MessageResult(Clans_WithdrawJoinInvitation *message); 561 virtual void MessageResult(Clans_AcceptJoinInvitation *message); 562 virtual void MessageResult(Clans_RejectJoinInvitation *message); 563 virtual void MessageResult(Clans_DownloadInvitationList *message); 564 virtual void MessageResult(Clans_SendJoinRequest *message); 565 virtual void MessageResult(Clans_WithdrawJoinRequest *message); 566 virtual void MessageResult(Clans_AcceptJoinRequest *message); 567 virtual void MessageResult(Clans_RejectJoinRequest *message); 568 virtual void MessageResult(Clans_DownloadRequestList *message); 569 virtual void MessageResult(Clans_KickAndBlacklistUser *message); 570 virtual void MessageResult(Clans_UnblacklistUser *message); 571 virtual void MessageResult(Clans_GetBlacklist *message); 572 virtual void MessageResult(Clans_GetMembers *message); 573 virtual void MessageResult(Clans_GetList *message); 574 virtual void MessageResult(Clans_CreateBoard *message); 575 virtual void MessageResult(Clans_DestroyBoard *message); 576 virtual void MessageResult(Clans_CreateNewTopic *message); 577 virtual void MessageResult(Clans_ReplyToTopic *message); 578 virtual void MessageResult(Clans_RemovePost *message); 579 virtual void MessageResult(Clans_GetBoards *message); 580 virtual void MessageResult(Clans_GetTopics *message); 581 virtual void MessageResult(Clans_GetPosts *message); 582 virtual void MessageResult(Console_GetServerStatus *message); 583 virtual void MessageResult(Console_GetWorldListFromServer *message); 584 virtual void MessageResult(Console_GetLobbyListFromWorld *message); 585 virtual void MessageResult(Console_JoinLobby *message); 586 virtual void MessageResult(Console_LeaveLobby *message); 587 virtual void MessageResult(Console_SendLobbyChatMessage *message); 588 virtual void MessageResult(Console_SearchRooms *message); 589 virtual void MessageResult(Console_GetRoomDetails *message); 590 virtual void MessageResult(Console_GetLobbyMemberData *message); 591 virtual void MessageResult(Console_CreateRoom *message); 592 virtual void MessageResult(Console_SetRoomSearchProperties *message); 593 virtual void MessageResult(Console_UpdateRoomParameters *message); 594 virtual void MessageResult(Console_JoinRoom *message); 595 virtual void MessageResult(Console_LeaveRoom *message); 596 virtual void MessageResult(Console_SendLobbyInvitationToRoom *message); 597 virtual void MessageResult(Console_SendGUIInvitationToRoom *message); 598 virtual void MessageResult(Console_SendDataMessageToUser *message); 599 virtual void MessageResult(Console_SendRoomChatMessage *message); 600 virtual void MessageResult(Notification_Client_RemoteLogin *message); 601 virtual void MessageResult(Notification_Client_IgnoreStatus *message); 602 virtual void MessageResult(Notification_Friends_StatusChange *message); 603 virtual void MessageResult(Notification_Friends_PresenceUpdate *message); 604 virtual void MessageResult(Notification_User_ChangedHandle *message); 605 virtual void MessageResult(Notification_Friends_CreatedClan *message); 606 virtual void MessageResult(Notification_Emails_Received *message); 607 virtual void MessageResult(Notification_Clans_GrantLeader *message); 608 virtual void MessageResult(Notification_Clans_SetSubleaderStatus *message); 609 virtual void MessageResult(Notification_Clans_SetMemberRank *message); 610 virtual void MessageResult(Notification_Clans_ChangeHandle *message); 611 virtual void MessageResult(Notification_Clans_Leave *message); 612 virtual void MessageResult(Notification_Clans_PendingJoinStatus *message); 613 virtual void MessageResult(Notification_Clans_NewClanMember *message); 614 virtual void MessageResult(Notification_Clans_KickAndBlacklistUser *message); 615 virtual void MessageResult(Notification_Clans_UnblacklistUser *message); 616 virtual void MessageResult(Notification_Clans_Destroyed *message); 617 virtual void MessageResult(Notification_Console_CableDisconnected *message); 618 virtual void MessageResult(Notification_Console_ContextError *message); 619 virtual void MessageResult(Notification_Console_MemberJoinedLobby *message); 620 virtual void MessageResult(Notification_Console_MemberLeftLobby *message); 621 virtual void MessageResult(Notification_Console_LobbyDestroyed *message); 622 virtual void MessageResult(Notification_Console_LobbyMemberDataUpdated *message); 623 virtual void MessageResult(Notification_Console_LobbyGotChatMessage *message); 624 virtual void MessageResult(Notification_Console_LobbyGotRoomInvitation *message); 625 virtual void MessageResult(Notification_Console_MemberJoinedRoom *message); 626 virtual void MessageResult(Notification_Console_MemberLeftRoom *message); 627 virtual void MessageResult(Notification_Console_KickedOutOfRoom *message); 628 virtual void MessageResult(Notification_Console_RoomWasDestroyed *message); 629 virtual void MessageResult(Notification_Console_UpdateRoomParameters *message); 630 virtual void MessageResult(Notification_Console_RoomOwnerChanged *message); 631 virtual void MessageResult(Notification_Console_RoomChatMessage *message); 632 virtual void MessageResult(Notification_Console_RoomMessage *message); 633 virtual void MessageResult(Notification_Console_RoomMemberConnectivityUpdate *message); 634 virtual void MessageResult(Notification_Console_ChatEvent *message); 635 virtual void MessageResult(Notification_Console_MuteListChanged *message); 636 virtual void MessageResult(Notification_Console_Local_Users_Changed *message); 637 virtual void MessageResult(Notification_ReceivedDataMessageFromUser *message); 638 ExecuteDefaultResultLobby2Callbacks639 virtual void ExecuteDefaultResult(Lobby2Message *message) { (void)message; } 640 641 unsigned char callbackId; 642 static unsigned char nextCallbackId; 643 }; 644 645 /// Just print out the name of the message by default. This class is used in the sample. 646 /// \ingroup LOBBY_2_GROUP 647 struct Lobby2Printf : public Lobby2Callbacks 648 { ExecuteDefaultResultLobby2Printf649 virtual void ExecuteDefaultResult(Lobby2Message *message) {message->DebugPrintf();} 650 }; 651 652 // --------------------------------------------- Types -------------------------------------------- 653 654 struct BinaryDataBlock 655 { 656 char *binaryData; 657 unsigned int binaryDataLength; BinaryDataBlockBinaryDataBlock658 BinaryDataBlock() {binaryData=0; binaryDataLength=0;} ~BinaryDataBlockBinaryDataBlock659 ~BinaryDataBlock() { 660 if (binaryData) 661 rakFree_Ex(binaryData, __FILE__, __LINE__ ); 662 } 663 void Serialize(bool writeToBitstream, RakNet::BitStream *bitStream); 664 }; 665 struct CreateAccountParameters 666 { CreateAccountParametersCreateAccountParameters667 CreateAccountParameters() {ageInDays=0; binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~CreateAccountParametersCreateAccountParameters668 ~CreateAccountParameters() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 669 /// [in] Self-apparent 670 RakNet::RakString firstName; 671 /// [in] Self-apparent 672 RakNet::RakString middleName; 673 /// [in] Self-apparent 674 RakNet::RakString lastName; 675 /// [in] Self-apparent 676 RakNet::RakString race; 677 /// [in] Self-apparent 678 bool sex_male; 679 /// [in] Self-apparent 680 RakNet::RakString homeAddress1; 681 /// [in] Self-apparent 682 RakNet::RakString homeAddress2; 683 /// [in] Self-apparent 684 RakNet::RakString homeCity; 685 /// [in] Self-apparent 686 RakNet::RakString homeState; 687 /// [in] Self-apparent 688 RakNet::RakString homeCountry; 689 /// [in] Self-apparent 690 RakNet::RakString homeZipCode; 691 /// [in] Self-apparent 692 RakNet::RakString billingAddress1; 693 /// [in] Self-apparent 694 RakNet::RakString billingAddress2; 695 /// [in] Self-apparent 696 RakNet::RakString billingCity; 697 /// [in] Self-apparent 698 RakNet::RakString billingState; 699 /// [in] Self-apparent 700 RakNet::RakString billingCountry; 701 /// [in] Self-apparent 702 RakNet::RakString billingZipCode; 703 /// [in] Self-apparent 704 RakNet::RakString emailAddress; 705 /// [in] Self-apparent 706 RakNet::RakString password; 707 /// [in] If the user needs to retrieve their password; you could ask them this question. 708 RakNet::RakString passwordRecoveryQuestion; 709 /// [in] If the user needs to retrieve their password; you could use this for the answer. 710 RakNet::RakString passwordRecoveryAnswer; 711 /// [in] Lobbies often allow users to set a text description of their user in some fashion. 712 RakNet::RakString caption1; 713 /// [in] Lobbies often allow users to set a text description of their user in some fashion. 714 RakNet::RakString caption2; 715 /// [in] Self-apparent 716 unsigned int ageInDays; 717 /// [in] binary data 718 RakNetSmartPtr<BinaryDataBlock> binaryData; 719 720 721 void Serialize(bool writeToBitstream, RakNet::BitStream *bitStream); 722 }; 723 struct PendingInvite 724 { PendingInvitePendingInvite725 PendingInvite() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~PendingInvitePendingInvite726 ~PendingInvite() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 727 RakNet::RakString sender; 728 RakNet::RakString subject; 729 RakNet::RakString body; 730 RakNetSmartPtr<BinaryDataBlock> binaryData; 731 732 void Serialize(bool writeToBitstream, RakNet::BitStream *bitStream); 733 }; 734 struct UsernameAndOnlineStatus 735 { UsernameAndOnlineStatusUsernameAndOnlineStatus736 UsernameAndOnlineStatus() {isOnline=false;} ~UsernameAndOnlineStatusUsernameAndOnlineStatus737 ~UsernameAndOnlineStatus() {} 738 RakNet::RakString handle; 739 bool isOnline; 740 RakNet::Lobby2Presence presence; 741 742 void Serialize(bool writeToBitstream, RakNet::BitStream *bitStream); 743 }; 744 struct FriendInfo 745 { 746 UsernameAndOnlineStatus usernameAndStatus; SerializeFriendInfo747 void Serialize(bool writeToBitstream, RakNet::BitStream *bitStream) {usernameAndStatus.Serialize(writeToBitstream,bitStream);} 748 }; 749 struct EmailResult 750 { EmailResultEmailResult751 EmailResult() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~EmailResultEmailResult752 ~EmailResult() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 753 RakNet::RakString sender; 754 RakNet::RakString recipient; 755 RakNet::RakString subject; 756 RakNet::RakString body; 757 unsigned int status; 758 bool wasSendByMe; 759 bool wasReadByMe; 760 unsigned int emailID; // Unique ID for this email, used in Emails_Delete, etc. 761 RakNetSmartPtr<BinaryDataBlock> binaryData; 762 RakNet::RakString creationDate; 763 764 void Serialize(bool writeToBitstream, RakNet::BitStream *bitStream); 765 }; 766 struct MatchParticipant 767 { MatchParticipantMatchParticipant768 MatchParticipant() {} MatchParticipantMatchParticipant769 MatchParticipant(RakNet::RakString _handle, float _score) : handle(_handle), score(_score) {} 770 RakNet::RakString handle; 771 float score; 772 773 void Serialize(bool writeToBitstream, RakNet::BitStream *bitStream); 774 }; 775 struct SubmittedMatch 776 { SubmittedMatchSubmittedMatch777 SubmittedMatch() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~SubmittedMatchSubmittedMatch778 ~SubmittedMatch() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 779 DataStructures::List<MatchParticipant> matchParticipants; 780 RakNet::RakString matchNote; 781 RakNetSmartPtr<BinaryDataBlock> binaryData; 782 // Use EpochTimeToString to convert to a date 783 double whenSubmittedDate; 784 unsigned int matchID; // Unique key, Output parameter to Ranking_GetMatches 785 786 void Serialize(bool writeToBitstream, RakNet::BitStream *bitStream); 787 }; 788 struct ClanInfo 789 { ClanInfoClanInfo790 ClanInfo() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~ClanInfoClanInfo791 ~ClanInfo() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 792 RakNet::RakString clanName; 793 RakNet::RakString description; 794 RakNet::RakString clanLeader; 795 RakNetSmartPtr<BinaryDataBlock> binaryData; 796 DataStructures::List<RakNet::RakString> clanMembersOtherThanLeader; 797 798 void Serialize(bool writeToBitstream, RakNet::BitStream *bitStream); 799 }; 800 struct OpenInvite 801 { 802 RakNet::RakString clanHandle; 803 void Serialize(bool writeToBitstream, RakNet::BitStream *bitStream); 804 }; 805 struct ClanJoinRequest 806 { 807 RakNet::RakString targetClan; 808 RakNet::RakString dateSent; 809 RakNet::RakString joinRequestSender; 810 void Serialize(bool writeToBitstream, RakNet::BitStream *bitStream); 811 }; 812 struct ClanJoinInvite 813 { 814 RakNet::RakString sourceClan; 815 RakNet::RakString dateSent; 816 RakNet::RakString joinRequestTarget; 817 void Serialize(bool writeToBitstream, RakNet::BitStream *bitStream); 818 }; 819 struct BookmarkedUser 820 { 821 RakNet::RakString targetHandle; 822 int type; 823 RakNet::RakString description; 824 RakNet::RakString dateWhenAdded; 825 void Serialize(bool writeToBitstream, RakNet::BitStream *bitStream); 826 }; 827 828 // --------------------------------------------- Actual body of all messages, including DB specific implementation -------------------------------------------- 829 830 #define __L2_MSG_BASE_IMPL(__NAME__) \ 831 virtual void CallCallback(Lobby2Callbacks *cb) {cb->MessageResult(this);}; \ 832 virtual Lobby2MessageID GetID(void) const {return (Lobby2MessageID) L2MID_##__NAME__;} \ 833 virtual const char* GetName(void) const {return #__NAME__;} \ 834 virtual void DebugMsg(RakNet::RakString &out) const {out.Set(#__NAME__ " result=%s\n", Lobby2ResultCodeDescription::ToEnglish(resultCode));}; 835 836 /// \brief Platform specific startup. Unused on the PC 837 /// \ingroup LOBBY_2_COMMANDS 838 struct Platform_Startup : public Lobby2Message 839 { __L2_MSG_BASE_IMPLPlatform_Startup840 __L2_MSG_BASE_IMPL(Platform_Startup) 841 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionPlatform_Startup842 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectPlatform_Startup843 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginPlatform_Startup844 virtual bool RequiresLogin(void) const {return false;} PrevalidateInputPlatform_Startup845 virtual bool PrevalidateInput(void) {return true;} ServerPreDBMemoryImplPlatform_Startup846 virtual bool ServerPreDBMemoryImpl( Lobby2Server *server, RakString userHandle ) { (void)server; (void)userHandle; return true; } 847 }; 848 849 /// \brief Platform specific startup. Unused on the PC 850 /// \ingroup LOBBY_2_COMMANDS 851 struct Platform_Shutdown : public Lobby2Message 852 { __L2_MSG_BASE_IMPLPlatform_Shutdown853 __L2_MSG_BASE_IMPL(Platform_Shutdown) 854 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionPlatform_Shutdown855 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectPlatform_Shutdown856 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginPlatform_Shutdown857 virtual bool RequiresLogin(void) const {return false;} PrevalidateInputPlatform_Shutdown858 virtual bool PrevalidateInput(void) {return true;} ServerPreDBMemoryImplPlatform_Shutdown859 virtual bool ServerPreDBMemoryImpl( Lobby2Server *server, RakString userHandle ) { (void)server; (void)userHandle; return true; } 860 }; 861 862 /// \brief Create all tables and stored procedures on a system that does not already have them 863 /// \ingroup LOBBY_2_COMMANDS 864 struct System_CreateDatabase : public Lobby2Message 865 { __L2_MSG_BASE_IMPLSystem_CreateDatabase866 __L2_MSG_BASE_IMPL(System_CreateDatabase) 867 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionSystem_CreateDatabase868 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectSystem_CreateDatabase869 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginSystem_CreateDatabase870 virtual bool RequiresLogin(void) const {return false;} PrevalidateInputSystem_CreateDatabase871 virtual bool PrevalidateInput(void) {return true;} 872 }; 873 /// \brief Destroy all tables and stored procedures created with System_CreateDatabase 874 /// \ingroup LOBBY_2_COMMANDS 875 struct System_DestroyDatabase : public Lobby2Message 876 { __L2_MSG_BASE_IMPLSystem_DestroyDatabase877 __L2_MSG_BASE_IMPL(System_DestroyDatabase) 878 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionSystem_DestroyDatabase879 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectSystem_DestroyDatabase880 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginSystem_DestroyDatabase881 virtual bool RequiresLogin(void) const {return false;} PrevalidateInputSystem_DestroyDatabase882 virtual bool PrevalidateInput(void) {return true;} 883 }; 884 /// \brief Each title essentially corresponds to a game. For example, the same lobby system may be used for both asteroids and Pac-man. When logging in, and for some functions, it is necessary to specify which title you are logging in under. This way users playing asteroids do not interact with users playing pac-man, where such interations are game specific (such as ranking). 885 /// \ingroup LOBBY_2_COMMANDS 886 struct System_CreateTitle : public Lobby2Message 887 { System_CreateTitleSystem_CreateTitle888 System_CreateTitle() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~System_CreateTitleSystem_CreateTitle889 ~System_CreateTitle() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} __L2_MSG_BASE_IMPLSystem_CreateTitle890 __L2_MSG_BASE_IMPL(System_CreateTitle) 891 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionSystem_CreateTitle892 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectSystem_CreateTitle893 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginSystem_CreateTitle894 virtual bool RequiresLogin(void) const {return false;} 895 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 896 virtual bool PrevalidateInput(void); 897 898 // Input parameters 899 RakNet::RakString titleName; 900 RakNet::RakString titleSecretKey; 901 int requiredAge; 902 RakNetSmartPtr<BinaryDataBlock> binaryData; 903 }; 904 /// \brief Destroy a previously added title 905 /// \ingroup LOBBY_2_COMMANDS 906 struct System_DestroyTitle : public Lobby2Message 907 { __L2_MSG_BASE_IMPLSystem_DestroyTitle908 __L2_MSG_BASE_IMPL(System_DestroyTitle) 909 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionSystem_DestroyTitle910 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectSystem_DestroyTitle911 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginSystem_DestroyTitle912 virtual bool RequiresLogin(void) const {return false;} 913 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); PrevalidateInputSystem_DestroyTitle914 virtual bool PrevalidateInput(void) {return true;} 915 916 // Input parameters 917 RakNet::RakString titleName; 918 919 }; 920 /// \brief Get the required age set with System_CreateTitle 921 /// \ingroup LOBBY_2_COMMANDS 922 struct System_GetTitleRequiredAge : public Lobby2Message 923 { __L2_MSG_BASE_IMPLSystem_GetTitleRequiredAge924 __L2_MSG_BASE_IMPL(System_GetTitleRequiredAge) 925 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionSystem_GetTitleRequiredAge926 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectSystem_GetTitleRequiredAge927 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginSystem_GetTitleRequiredAge928 virtual bool RequiresLogin(void) const {return false;} 929 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); PrevalidateInputSystem_GetTitleRequiredAge930 virtual bool PrevalidateInput(void) {return true;} 931 932 // Input parameters 933 RakNet::RakString titleName; 934 935 // Output parameters 936 int requiredAge; 937 }; 938 /// \brief Get the binary data set with System_CreateTitle 939 /// \ingroup LOBBY_2_COMMANDS 940 struct System_GetTitleBinaryData : public Lobby2Message 941 { System_GetTitleBinaryDataSystem_GetTitleBinaryData942 System_GetTitleBinaryData() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~System_GetTitleBinaryDataSystem_GetTitleBinaryData943 ~System_GetTitleBinaryData() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} __L2_MSG_BASE_IMPLSystem_GetTitleBinaryData944 __L2_MSG_BASE_IMPL(System_GetTitleBinaryData) 945 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionSystem_GetTitleBinaryData946 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectSystem_GetTitleBinaryData947 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginSystem_GetTitleBinaryData948 virtual bool RequiresLogin(void) const {return false;} 949 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); PrevalidateInputSystem_GetTitleBinaryData950 virtual bool PrevalidateInput(void) {return true;} 951 952 // Input parameters 953 RakNet::RakString titleName; 954 955 // Output parameters 956 RakNetSmartPtr<BinaryDataBlock> binaryData; 957 }; 958 /// \brief Adds the input strings to a table of profanity. non-unique or empty strings can be ignored. This table will be used internally to ensure that handles and clan names do not contain profanity. Multiple calls add to the table. This table will be used for functions that take a user-defined string that is highly visible, such as clan and user names. It does not need to be checked for emails or message boards. 959 /// \ingroup LOBBY_2_COMMANDS 960 struct System_RegisterProfanity : public Lobby2Message 961 { __L2_MSG_BASE_IMPLSystem_RegisterProfanity962 __L2_MSG_BASE_IMPL(System_RegisterProfanity) 963 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionSystem_RegisterProfanity964 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectSystem_RegisterProfanity965 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginSystem_RegisterProfanity966 virtual bool RequiresLogin(void) const {return false;} 967 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); PrevalidateInputSystem_RegisterProfanity968 virtual bool PrevalidateInput(void) 969 { 970 for (unsigned int i=0; i < profanityWords.Size(); i++) 971 { 972 if (profanityWords[i].IsEmpty()) 973 { 974 resultCode=L2RC_System_RegisterProfanity_CANNOT_REGISTER_EMPTY_STRINGS; 975 return false; 976 } 977 } 978 return true; 979 } 980 981 // Input parameters 982 DataStructures::List<RakNet::RakString> profanityWords; 983 984 // Output parameters 985 }; 986 /// \brief Bans a specific user (will be most likely called by a moderator). Adds the user's primary key to a ban table, along with the name of the moderator, the reason for the ban. Banning is used to prevent the banned user from logging on for some specified duration. A date column should be present and automatically filled in. When bans are expired, the ban can be deleted from the database. However, a separate table should log bans, so that even expired bans can be looked up in case. 987 /// \ingroup LOBBY_2_COMMANDS 988 struct System_BanUser : public Lobby2Message 989 { __L2_MSG_BASE_IMPLSystem_BanUser990 __L2_MSG_BASE_IMPL(System_BanUser) 991 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionSystem_BanUser992 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectSystem_BanUser993 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginSystem_BanUser994 virtual bool RequiresLogin(void) const {return false;} 995 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 996 virtual bool PrevalidateInput(void); 997 998 // Input parameters 999 RakNet::RakString banReason; 1000 unsigned int durationHours; 1001 RakNet::RakString userName; 1002 1003 // Output parameters 1004 1005 1006 }; 1007 /// \brief Unban a user banned with System_BanUser 1008 /// \ingroup LOBBY_2_COMMANDS 1009 struct System_UnbanUser : public Lobby2Message 1010 { __L2_MSG_BASE_IMPLSystem_UnbanUser1011 __L2_MSG_BASE_IMPL(System_UnbanUser) 1012 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionSystem_UnbanUser1013 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectSystem_UnbanUser1014 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginSystem_UnbanUser1015 virtual bool RequiresLogin(void) const {return false;} 1016 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1017 1018 virtual bool PrevalidateInput(void); 1019 1020 // Input parameters 1021 RakNet::RakString reason; 1022 RakNet::RakString userName; 1023 }; 1024 /// \brief Adds CDKeys to the database. Duplicate CDKeys for a particular title are ignored. CDKeys can be identical for different titles. 1025 /// \ingroup LOBBY_2_COMMANDS 1026 struct CDKey_Add : public Lobby2Message 1027 { __L2_MSG_BASE_IMPLCDKey_Add1028 __L2_MSG_BASE_IMPL(CDKey_Add) 1029 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionCDKey_Add1030 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectCDKey_Add1031 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginCDKey_Add1032 virtual bool RequiresLogin(void) const {return false;} 1033 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1034 1035 virtual bool PrevalidateInput(void); 1036 1037 // Input parameters 1038 DataStructures::List<RakNet::RakString> cdKeys; 1039 RakNet::RakString titleName; 1040 1041 // Output parameters 1042 }; 1043 /// \brief Returns if a CD key was previously added with AddCDKey. 1044 /// \ingroup LOBBY_2_COMMANDS 1045 struct CDKey_GetStatus : public Lobby2Message 1046 { __L2_MSG_BASE_IMPLCDKey_GetStatus1047 __L2_MSG_BASE_IMPL(CDKey_GetStatus) 1048 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionCDKey_GetStatus1049 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectCDKey_GetStatus1050 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginCDKey_GetStatus1051 virtual bool RequiresLogin(void) const {return false;} 1052 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1053 1054 virtual bool PrevalidateInput(void); 1055 1056 // Input parameters 1057 RakNet::RakString cdKey; 1058 RakNet::RakString titleName; 1059 1060 // Output parameters 1061 bool usable; 1062 RakNet::RakString usedBy; 1063 RakNet::RakString activationDate; 1064 bool wasStolen; 1065 }; 1066 /// \brief Associates a cd key with a user, such that the cd key cannot be used again. If Client_Login() is called with check cd key as true, then this table will be checked to make sure UserCDKey() was previously called with this user and a valid key. If this user is already associated with a CD Key, add the new key, and use the most recent key. All CD Key usage should be logged in a separate table, including the date used and result. 1067 /// \ingroup LOBBY_2_COMMANDS 1068 struct CDKey_Use : public Lobby2Message 1069 { __L2_MSG_BASE_IMPLCDKey_Use1070 __L2_MSG_BASE_IMPL(CDKey_Use) 1071 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionCDKey_Use1072 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectCDKey_Use1073 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginCDKey_Use1074 virtual bool RequiresLogin(void) const {return false;} 1075 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1076 1077 virtual bool PrevalidateInput(void); 1078 1079 // Input parameters 1080 RakNet::RakString cdKey; 1081 RakNet::RakString titleName; 1082 RakNet::RakString userName; 1083 1084 // Output parameters 1085 }; 1086 1087 /// \brief Flags one or more CD keys as stolen. Stolen CD keys will prevent Client_Login() if check cd key is true. They will also prevent these cd keys from being used with CDKey_Use. If this key is already in use by certain users for this particular title, then log this similarly to how CDKey_Use does so. 1088 /// \ingroup LOBBY_2_COMMANDS 1089 struct CDKey_FlagStolen : public Lobby2Message 1090 { __L2_MSG_BASE_IMPLCDKey_FlagStolen1091 __L2_MSG_BASE_IMPL(CDKey_FlagStolen) 1092 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionCDKey_FlagStolen1093 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectCDKey_FlagStolen1094 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginCDKey_FlagStolen1095 virtual bool RequiresLogin(void) const {return false;} 1096 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1097 1098 virtual bool PrevalidateInput(void); 1099 1100 // Input parameters 1101 RakNet::RakString cdKey; 1102 RakNet::RakString titleName; 1103 bool wasStolen; 1104 1105 // Output parameters 1106 RakNet::RakString userUsingThisKey; 1107 }; 1108 /// \brief Logon with a previously registered account 1109 /// \details Once a client creates an account with Client_RegisterAccount, the client is able to logon. The login process will check 1110 /// <OL> 1111 /// <LI>The CDKey associated with this user (See CDKey_Use) if checkCDKey is true 1112 /// <LI>The userPassword passed to this function 1113 /// <LI>The titleName and titleSecretKey, to ensure this title was previously created with System_CreateTitle 1114 /// <LI>If allowLoginWithoutEmailAddressValidation==false for this user (See Client_RegisterAccount) and System_SetEmailAddressValidated was not called for that email address, fail. 1115 /// <LI>If this user was banned with a ban still in effect via System_BanUser 1116 /// </OL> 1117 /// If all checks pass, store in a logging table that the user has logged in at this time. No status flag needs be set, this will be done in C++. 1118 /// \param[in] userHandle 1119 /// \param[in] userPassword 1120 /// \param[in] titleName 1121 /// \param[in] titleSecretKey 1122 /// \param[in] checkCDKey 1123 /// \param[out] userPrimaryKey Only returned on success 1124 /// \param[out] bannedReason Only returned on banned 1125 /// \param[out] whenBanned Only returned on banned 1126 /// \param[out] banningModeratorID Only returned on banned 1127 /// \ingroup LOBBY_2_COMMANDS 1128 struct Client_Login : public Lobby2Message 1129 { 1130 __L2_MSG_BASE_IMPL(Client_Login) Client_LoginClient_Login1131 Client_Login() {allowMultipleLogins=false;} ~Client_LoginClient_Login1132 virtual ~Client_Login() {} RequiresAdminClient_Login1133 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_Login1134 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_Login1135 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginClient_Login1136 virtual bool RequiresLogin(void) const {return false;} 1137 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1138 1139 virtual bool PrevalidateInput(void); 1140 1141 // Input parameters 1142 RakNet::RakString userPassword; 1143 bool allowMultipleLogins; // PC only, allow login with the same username from multiple computers at once 1144 // Used if check 1145 RakNet::RakString titleName; 1146 RakNet::RakString titleSecretKey; 1147 RakNet::RakString userName; 1148 1149 // Output parameters 1150 RakNet::RakString bannedReason; 1151 RakNet::RakString whenBanned; 1152 RakNet::RakString bannedExpiration; 1153 }; 1154 /// \brief Logoff, after logging in 1155 /// \ingroup LOBBY_2_COMMANDS 1156 struct Client_Logoff : public Lobby2Message 1157 { __L2_MSG_BASE_IMPLClient_Logoff1158 __L2_MSG_BASE_IMPL(Client_Logoff) 1159 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_Logoff1160 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_Logoff1161 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClient_Logoff1162 virtual bool RequiresLogin(void) const {return true;} 1163 }; 1164 /// \brief This creates a new account in the database, which can be used in a subsequent call to Login. Most parameters are optional. handle is not optional, and must be unique using case-insensitive compare. emailAddress should be validated to have a sensible format, including an @ sign and a period with a 3 letter extension. allowLoginWithoutEmailAddressValidation is used in Client_Login to potentially disallow logon attempts with unverified email addresses. 1165 /// \ingroup LOBBY_2_COMMANDS 1166 struct Client_RegisterAccount : public Lobby2Message 1167 { __L2_MSG_BASE_IMPLClient_RegisterAccount1168 __L2_MSG_BASE_IMPL(Client_RegisterAccount) 1169 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_RegisterAccount1170 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_RegisterAccount1171 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClient_RegisterAccount1172 virtual bool RequiresLogin(void) const {return false;} 1173 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1174 1175 virtual bool PrevalidateInput(void); 1176 1177 // Input parameters 1178 CreateAccountParameters createAccountParameters; 1179 // Only used if registration requires a CD key 1180 RakNet::RakString cdKey; 1181 RakNet::RakString titleName; 1182 RakNet::RakString userName; 1183 1184 // Output parameters 1185 }; 1186 /// \brief For the client with the given handle, mark a column emailAddressValidated as true or false as appropriate. This is potentially used in Client_Login 1187 /// \ingroup LOBBY_2_COMMANDS 1188 struct System_SetEmailAddressValidated : public Lobby2Message 1189 { __L2_MSG_BASE_IMPLSystem_SetEmailAddressValidated1190 __L2_MSG_BASE_IMPL(System_SetEmailAddressValidated) 1191 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionSystem_SetEmailAddressValidated1192 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectSystem_SetEmailAddressValidated1193 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginSystem_SetEmailAddressValidated1194 virtual bool RequiresLogin(void) const {return false;} 1195 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1196 virtual bool PrevalidateInput(void); 1197 1198 // Input parameters 1199 bool validated; 1200 RakNet::RakString userName; 1201 1202 // Output parameters 1203 }; 1204 /// \brief Looks up in the database if this handle is already in use, subject to the usual constraints of handles. This will be used by the user to quickly check for available handles. 1205 /// \ingroup LOBBY_2_COMMANDS 1206 struct Client_ValidateHandle : public Lobby2Message 1207 { __L2_MSG_BASE_IMPLClient_ValidateHandle1208 __L2_MSG_BASE_IMPL(Client_ValidateHandle) 1209 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_ValidateHandle1210 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_ValidateHandle1211 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginClient_ValidateHandle1212 virtual bool RequiresLogin(void) const {return false;} 1213 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1214 virtual bool PrevalidateInput(void); 1215 1216 RakNet::RakString userName; 1217 }; 1218 /// \brief Flags as deleted an account registered with RegisterAccount. Accounts are not actually deleted, only tagged as deleted. 1219 /// \ingroup LOBBY_2_COMMANDS 1220 struct System_DeleteAccount : public Lobby2Message 1221 { __L2_MSG_BASE_IMPLSystem_DeleteAccount1222 __L2_MSG_BASE_IMPL(System_DeleteAccount) 1223 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionSystem_DeleteAccount1224 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectSystem_DeleteAccount1225 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginSystem_DeleteAccount1226 virtual bool RequiresLogin(void) const {return false;} 1227 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1228 1229 virtual bool PrevalidateInput(void); 1230 1231 // Input parameters 1232 RakNet::RakString userName; 1233 RakNet::RakString password; 1234 }; 1235 /// \brief Unused accounts are deleted. This is cascading, such that emails and other tables that reference this key are also deleted. unused accounts are defined as: 1236 /// \details 1237 /// <OL> 1238 /// <LI>Deleted accounts over deletedPruneTime seconds old 1239 /// <LI>Accounts which have not been logged into for over loggedInPruneTime seconds 1240 /// <\OL> 1241 /// \ingroup LOBBY_2_COMMANDS 1242 struct System_PruneAccounts : public Lobby2Message 1243 { __L2_MSG_BASE_IMPLSystem_PruneAccounts1244 __L2_MSG_BASE_IMPL(System_PruneAccounts) 1245 virtual bool RequiresAdmin(void) const {return true;} RequiresRankingPermissionSystem_PruneAccounts1246 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectSystem_PruneAccounts1247 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginSystem_PruneAccounts1248 virtual bool RequiresLogin(void) const {return false;} 1249 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1250 virtual bool PrevalidateInput(void); 1251 1252 // Input parameters 1253 unsigned int deleteAccountsNotLoggedInDays; 1254 1255 // Output parameters 1256 }; 1257 /// \brief Returns the email address associated with a specific handle, invalid handle. This is used for password recovery. 1258 /// \ingroup LOBBY_2_COMMANDS 1259 struct Client_GetEmailAddress : public Lobby2Message 1260 { __L2_MSG_BASE_IMPLClient_GetEmailAddress1261 __L2_MSG_BASE_IMPL(Client_GetEmailAddress) 1262 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_GetEmailAddress1263 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_GetEmailAddress1264 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginClient_GetEmailAddress1265 virtual bool RequiresLogin(void) const {return false;} 1266 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1267 virtual bool PrevalidateInput(void); 1268 1269 // Input parameters 1270 RakNet::RakString userName; 1271 1272 // Output parameters 1273 RakNet::RakString emailAddress; 1274 bool emailAddressValidated; 1275 1276 }; 1277 /// \brief Returns the passwordRecoveryQuestion associated with handle, invalid handle 1278 /// \ingroup LOBBY_2_COMMANDS 1279 struct Client_GetPasswordRecoveryQuestionByHandle : public Lobby2Message 1280 { __L2_MSG_BASE_IMPLClient_GetPasswordRecoveryQuestionByHandle1281 __L2_MSG_BASE_IMPL(Client_GetPasswordRecoveryQuestionByHandle) 1282 virtual bool RequiresAdmin(void) const {return false;}virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_GetPasswordRecoveryQuestionByHandle1283 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginClient_GetPasswordRecoveryQuestionByHandle1284 virtual bool RequiresLogin(void) const {return false;} 1285 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1286 virtual bool PrevalidateInput(void); 1287 1288 // Input/output parameters 1289 RakNet::RakString userName; 1290 1291 // Output parameters 1292 RakNet::RakString emailAddress; 1293 RakNet::RakString passwordRecoveryQuestion; 1294 }; 1295 /// \brief Returns the password associated with a handle, if the passwordRecoveryAnswer is correct 1296 /// \ingroup LOBBY_2_COMMANDS 1297 struct Client_GetPasswordByPasswordRecoveryAnswer : public Lobby2Message 1298 { __L2_MSG_BASE_IMPLClient_GetPasswordByPasswordRecoveryAnswer1299 __L2_MSG_BASE_IMPL(Client_GetPasswordByPasswordRecoveryAnswer) 1300 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_GetPasswordByPasswordRecoveryAnswer1301 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_GetPasswordByPasswordRecoveryAnswer1302 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginClient_GetPasswordByPasswordRecoveryAnswer1303 virtual bool RequiresLogin(void) const {return false;} 1304 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1305 virtual bool PrevalidateInput(void); 1306 1307 // Input parameters 1308 RakNet::RakString userName; 1309 RakNet::RakString passwordRecoveryAnswer; 1310 1311 // Output parameters 1312 RakNet::RakString password; 1313 }; 1314 /// \brief Changes the handle for a user. 1315 /// \ingroup LOBBY_2_COMMANDS 1316 struct Client_ChangeHandle : public Lobby2Message 1317 { 1318 __L2_MSG_BASE_IMPL(Client_ChangeHandle) Client_ChangeHandleClient_ChangeHandle1319 Client_ChangeHandle() {requiresPasswordToChangeHandle=false;} RequiresAdminClient_ChangeHandle1320 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_ChangeHandle1321 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_ChangeHandle1322 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClient_ChangeHandle1323 virtual bool RequiresLogin(void) const {return false;} 1324 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1325 1326 virtual bool PrevalidateInput(void); 1327 1328 // Input parameters 1329 RakNet::RakString userName; 1330 bool requiresPasswordToChangeHandle; 1331 RakNet::RakString password; 1332 RakNet::RakString newHandle; 1333 1334 // Output parameters 1335 }; 1336 1337 /// \brief Will update any or all of the inputs that were previously passed to Client_RegisterAccount, except handle. 1338 /// \details For input parameters, see Client_RegisterAccount() createAccountParameters 1339 /// \ingroup LOBBY_2_COMMANDS 1340 struct Client_UpdateAccount : public Lobby2Message 1341 { __L2_MSG_BASE_IMPLClient_UpdateAccount1342 __L2_MSG_BASE_IMPL(Client_UpdateAccount) 1343 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_UpdateAccount1344 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_UpdateAccount1345 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClient_UpdateAccount1346 virtual bool RequiresLogin(void) const {return true;} 1347 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1348 1349 virtual bool PrevalidateInput(void); 1350 1351 // Input parameters 1352 CreateAccountParameters createAccountParameters; 1353 1354 // Output parameters 1355 }; 1356 1357 /// \brief Get the parameters set with Client_RegisterAccount 1358 /// \ingroup LOBBY_2_COMMANDS 1359 struct Client_GetAccountDetails : public Lobby2Message 1360 { __L2_MSG_BASE_IMPLClient_GetAccountDetails1361 __L2_MSG_BASE_IMPL(Client_GetAccountDetails) 1362 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_GetAccountDetails1363 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_GetAccountDetails1364 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClient_GetAccountDetails1365 virtual bool RequiresLogin(void) const {return true;} 1366 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1367 1368 // Input parameters 1369 1370 // Output parameters 1371 CreateAccountParameters createAccountParameters; 1372 }; 1373 1374 /// \brief Adds the specified user to an ignore list for my user. Recommended to store the primary key of the remote user, both for speed and so if the other use changes their handle it still works. The ignore list is checked for friend invites, emails, and elsewhere where indicated. Ignoring is uni-directional, so if A ignores B, A will block messages from B where appropriate, but B will not immediately block messages from A. 1375 /// \ingroup LOBBY_2_COMMANDS 1376 struct Client_StartIgnore : public Lobby2Message 1377 { __L2_MSG_BASE_IMPLClient_StartIgnore1378 __L2_MSG_BASE_IMPL(Client_StartIgnore) 1379 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_StartIgnore1380 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_StartIgnore1381 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClient_StartIgnore1382 virtual bool RequiresLogin(void) const {return true;} 1383 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1384 1385 virtual bool PrevalidateInput(void); 1386 1387 virtual bool ClientImpl( Lobby2Client *client); 1388 1389 // Input parameters 1390 RakNet::RakString targetHandle; 1391 1392 // Output parameters 1393 }; 1394 1395 /// \brief Removes an entry in the database such that myHandle will no longer ignore theirHandle. 1396 /// \ingroup LOBBY_2_COMMANDS 1397 struct Client_StopIgnore : public Lobby2Message 1398 { __L2_MSG_BASE_IMPLClient_StopIgnore1399 __L2_MSG_BASE_IMPL(Client_StopIgnore) 1400 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_StopIgnore1401 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_StopIgnore1402 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClient_StopIgnore1403 virtual bool RequiresLogin(void) const {return true;} 1404 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1405 1406 virtual bool PrevalidateInput(void); 1407 1408 virtual bool ClientImpl( Lobby2Client *client); 1409 1410 // Input parameters 1411 RakNet::RakString targetHandle; 1412 1413 // Output parameters 1414 1415 }; 1416 /// \brief Returns all users I have ignored 1417 /// \ingroup LOBBY_2_COMMANDS 1418 struct Client_GetIgnoreList : public Lobby2Message 1419 { __L2_MSG_BASE_IMPLClient_GetIgnoreList1420 __L2_MSG_BASE_IMPL(Client_GetIgnoreList) 1421 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_GetIgnoreList1422 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_GetIgnoreList1423 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginClient_GetIgnoreList1424 virtual bool RequiresLogin(void) const {return true;} 1425 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1426 1427 virtual bool ClientImpl( Lobby2Client *client); 1428 1429 // Input parameters 1430 1431 // Output parameters 1432 DataStructures::List<RakNet::RakString> ignoredHandles; 1433 }; 1434 struct Client_PerTitleIntegerStorage : public Lobby2Message 1435 { __L2_MSG_BASE_IMPLClient_PerTitleIntegerStorage1436 __L2_MSG_BASE_IMPL(Client_PerTitleIntegerStorage) 1437 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_PerTitleIntegerStorage1438 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_PerTitleIntegerStorage1439 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClient_PerTitleIntegerStorage1440 virtual bool RequiresLogin(void) const {return true;} 1441 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1442 virtual bool PrevalidateInput(void); 1443 1444 /// [in] Name of a created title 1445 RakNet::RakString titleName; 1446 /// [in] Slot index can be any value, and just lets you store more than one 64 bit integer 1447 unsigned int slotIndex; 1448 /// [in] Compared against the current value 1449 double conditionValue; 1450 /// [in] How conditionValue is compared against the conditional value 1451 /// Used for PTISO_ADD only 1452 enum PTIS_Condition 1453 { 1454 PTISC_EQUAL, 1455 PTISC_NOT_EQUAL, 1456 PTISC_GREATER_THAN, 1457 PTISC_GREATER_OR_EQUAL, 1458 PTISC_LESS_THAN, 1459 PTISC_LESS_OR_EQUAL, 1460 } addConditionForOperation; 1461 /// [in] What value is written (used for PTISO_WRITE and PTISO_ADD only) 1462 double inputValue; 1463 /// [in] What to do. Write will overwrite the existing value with inputValue 1464 /// Read will return the existing value in outputValue 1465 /// Delete will delete the entry, if it exists 1466 /// Add will add inputValue to the current value. 1467 enum PTIS_Operation 1468 { 1469 PTISO_WRITE, 1470 PTISO_READ, 1471 PTISO_DELETE, 1472 PTISO_ADD, 1473 } operationToPerform; 1474 /// [out] On return, new value is returned in outputValue 1475 /// For write, it will be the same as inputValue 1476 /// For read, it will be the current value (or 0, if the row does not exist) 1477 /// For delete, it is undefined 1478 /// For add, it is inputValue plus the existing value. If no existing value, 0 is used as the existing value. 1479 double outputValue; 1480 }; 1481 1482 /// \brief For each combination of user and title, structures can be stored 1483 /// \ingroup LOBBY_2_COMMANDS 1484 struct Client_PerTitleBinaryStorage : public Lobby2Message 1485 { 1486 __L2_MSG_BASE_IMPL(Client_PerTitleBinaryStorage) Client_PerTitleBinaryStorageClient_PerTitleBinaryStorage1487 Client_PerTitleBinaryStorage() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Client_PerTitleBinaryStorageClient_PerTitleBinaryStorage1488 ~Client_PerTitleBinaryStorage() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} RequiresAdminClient_PerTitleBinaryStorage1489 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_PerTitleBinaryStorage1490 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_PerTitleBinaryStorage1491 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClient_PerTitleBinaryStorage1492 virtual bool RequiresLogin(void) const {return true;} 1493 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1494 virtual bool PrevalidateInput(void); 1495 1496 /// [in] Name of a created title 1497 RakNet::RakString titleName; 1498 /// [in] Slot index can be any value, and just lets you store more than one 64 bit integer 1499 unsigned int slotIndex; 1500 /// [in/out] Binary data. On Write, will be written to the row. On Read, will be filled in with the value of the row. Unused for delete 1501 /// Max length of binaryData is 256K 1502 RakNetSmartPtr<BinaryDataBlock> binaryData; 1503 /// [in] What to do. Write will overwrite the existing value with binaryData 1504 /// Read will return the existing value in binaryData 1505 enum PTIS_Operation 1506 { 1507 PTISO_WRITE, 1508 PTISO_READ, 1509 PTISO_DELETE, 1510 } operationToPerform; 1511 }; 1512 1513 /// \brief Sets in-memory information about your login state, such as which game you are playing, or if you are playing a game 1514 /// Online friends will be notified when you presence changes 1515 struct Client_SetPresence : public Lobby2Message 1516 { __L2_MSG_BASE_IMPLClient_SetPresence1517 __L2_MSG_BASE_IMPL(Client_SetPresence) 1518 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_SetPresence1519 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_SetPresence1520 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginClient_SetPresence1521 virtual bool RequiresLogin(void) const {return true;} 1522 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1523 // virtual bool ServerPreDBMemoryImpl( Lobby2Server *server, RakString userHandle ); 1524 1525 /// \param[in] Presence info to set. 1526 RakNet::Lobby2Presence presence; 1527 }; 1528 1529 /// \brief Gets in-memory information about a user's login state, such as which game they are playing, or if they are playing a game 1530 /// This can also be a quick way to query if a user is logged in or not. If they are not logged in, \a presence will be set to Lobby2Presence::NOT_ONLINE 1531 struct Client_GetPresence : public Lobby2Message 1532 { __L2_MSG_BASE_IMPLClient_GetPresence1533 __L2_MSG_BASE_IMPL(Client_GetPresence) 1534 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClient_GetPresence1535 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClient_GetPresence1536 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginClient_GetPresence1537 virtual bool RequiresLogin(void) const {return false;} 1538 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1539 // virtual bool ServerPreDBMemoryImpl( Lobby2Server *server, RakString userHandle ); 1540 1541 /// \param[in] Which user we are looking up ( can be ourselves ) 1542 RakNet::RakString userHandle; 1543 1544 /// \param[out] Presence info to set. 1545 RakNet::Lobby2Presence presence; 1546 }; 1547 1548 /// \brief Stores in the database an add friend invite from my handle to their handle. The combination of my handle and their handle must be unique, so you cannot send more than one add friend invite to a single user. Sends an email to their handle the subject, body, and binary data. Note: if myHandle is ignored by theirHandle, then the function fails. See Client_StartIgnore. 1549 /// \ingroup LOBBY_2_COMMANDS 1550 struct Friends_SendInvite : public Lobby2Message 1551 { Friends_SendInviteFriends_SendInvite1552 Friends_SendInvite() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Friends_SendInviteFriends_SendInvite1553 ~Friends_SendInvite() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} __L2_MSG_BASE_IMPLFriends_SendInvite1554 __L2_MSG_BASE_IMPL(Friends_SendInvite) 1555 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionFriends_SendInvite1556 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectFriends_SendInvite1557 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginFriends_SendInvite1558 virtual bool RequiresLogin(void) const {return true;} 1559 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1560 1561 virtual bool PrevalidateInput(void); 1562 1563 // Input parameters 1564 RakNet::RakString targetHandle; 1565 RakNet::RakString subject; 1566 RakNet::RakString body; 1567 int emailStatus; 1568 RakNetSmartPtr<BinaryDataBlock> binaryData; 1569 1570 // Output parameters 1571 }; 1572 1573 /// \brief Stores in the database that this user is now my friend. This is bidirectional, which is to say if someone accepts an add friend invite, they are my friend, and I am their friend. Recommended to store by primary key for speed and in case the friend's handle changes. Store in the emails table from my handle to their handle the subject, body, and binary data. Note: if myHandle is ignored by theirHandle, then the function fails. See AddToIgnoreList. 1574 /// \ingroup LOBBY_2_COMMANDS 1575 struct Friends_AcceptInvite : public Lobby2Message 1576 { 1577 Friends_AcceptInviteFriends_AcceptInvite1578 Friends_AcceptInvite() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Friends_AcceptInviteFriends_AcceptInvite1579 ~Friends_AcceptInvite() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} __L2_MSG_BASE_IMPLFriends_AcceptInvite1580 __L2_MSG_BASE_IMPL(Friends_AcceptInvite) 1581 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionFriends_AcceptInvite1582 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectFriends_AcceptInvite1583 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginFriends_AcceptInvite1584 virtual bool RequiresLogin(void) const {return true;} 1585 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1586 1587 virtual bool PrevalidateInput(void); 1588 1589 // Input parameters 1590 RakNet::RakString targetHandle; 1591 RakNet::RakString subject; 1592 RakNet::RakString body; 1593 int emailStatus; 1594 RakNetSmartPtr<BinaryDataBlock> binaryData; 1595 1596 // Output parameters 1597 // Your new buddy's presence status 1598 RakNet::Lobby2Presence presence; 1599 }; 1600 /// \brief Removes from the database the pending add friend invite. Operation completes even if ignored. Unless ignored, store in the emails table from my handle to their handle the subject, body, binary data, and procedure type flag. 1601 /// \ingroup LOBBY_2_COMMANDS 1602 struct Friends_RejectInvite : public Lobby2Message 1603 { 1604 __L2_MSG_BASE_IMPL(Friends_RejectInvite) 1605 Friends_RejectInviteFriends_RejectInvite1606 Friends_RejectInvite() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Friends_RejectInviteFriends_RejectInvite1607 ~Friends_RejectInvite() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} RequiresAdminFriends_RejectInvite1608 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionFriends_RejectInvite1609 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectFriends_RejectInvite1610 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginFriends_RejectInvite1611 virtual bool RequiresLogin(void) const {return true;} 1612 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1613 1614 virtual bool PrevalidateInput(void); 1615 1616 // Input parameters 1617 RakNet::RakString targetHandle; 1618 RakNet::RakString subject; 1619 RakNet::RakString body; 1620 int emailStatus; 1621 RakNetSmartPtr<BinaryDataBlock> binaryData; 1622 1623 // Output parameters 1624 }; 1625 /// \brief Returns all invites for this user 1626 /// \ingroup LOBBY_2_COMMANDS 1627 struct Friends_GetInvites : public Lobby2Message 1628 { __L2_MSG_BASE_IMPLFriends_GetInvites1629 __L2_MSG_BASE_IMPL(Friends_GetInvites) 1630 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionFriends_GetInvites1631 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectFriends_GetInvites1632 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginFriends_GetInvites1633 virtual bool RequiresLogin(void) const {return true;} 1634 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1635 1636 // Input parameters 1637 1638 // Output parameters 1639 /// Up to caller to deallocate binaryData if needed 1640 DataStructures::List<FriendInfo> invitesSent; 1641 DataStructures::List<FriendInfo> invitesReceived; 1642 }; 1643 /// \brief Gets all friends to this user 1644 /// \ingroup LOBBY_2_COMMANDS 1645 struct Friends_GetFriends : public Lobby2Message 1646 { __L2_MSG_BASE_IMPLFriends_GetFriends1647 __L2_MSG_BASE_IMPL(Friends_GetFriends) 1648 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionFriends_GetFriends1649 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectFriends_GetFriends1650 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginFriends_GetFriends1651 virtual bool RequiresLogin(void) const {return true;} 1652 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1653 // Input parameters 1654 1655 // Output parameters 1656 DataStructures::List<FriendInfo> myFriends; 1657 }; 1658 /// \brief Ends a friendship between two users. Remove from the database the friend entry between my handle and their handle. As with accept add friend invite, this is bidirectional. Either user can terminate the friendship. Store in the emails table from my handle to their handle the subject, body, and binary data, and procedure type flag. 1659 /// \ingroup LOBBY_2_COMMANDS 1660 struct Friends_Remove : public Lobby2Message 1661 { Friends_RemoveFriends_Remove1662 Friends_Remove() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Friends_RemoveFriends_Remove1663 ~Friends_Remove() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 1664 __L2_MSG_BASE_IMPLFriends_Remove1665 __L2_MSG_BASE_IMPL(Friends_Remove) 1666 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionFriends_Remove1667 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectFriends_Remove1668 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginFriends_Remove1669 virtual bool RequiresLogin(void) const {return true;} 1670 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1671 1672 virtual bool PrevalidateInput(void); 1673 1674 // Input parameters 1675 RakNet::RakString targetHandle; 1676 RakNet::RakString subject; 1677 RakNet::RakString body; 1678 int emailStatus; 1679 RakNetSmartPtr<BinaryDataBlock> binaryData; 1680 1681 // Output parameters 1682 }; 1683 /// \brief Remembers a user, with a type integer and description for you to use, if desired. 1684 /// \details Can be used for recent users or other types of lists 1685 /// The combination of targetHandle and type uniquely identifies a bookmarked user. 1686 /// If you want more than one list of bookmarked usrs, use a different value for type 1687 /// \ingroup LOBBY_2_COMMANDS 1688 struct BookmarkedUsers_Add : public Lobby2Message 1689 { __L2_MSG_BASE_IMPLBookmarkedUsers_Add1690 __L2_MSG_BASE_IMPL(BookmarkedUsers_Add) 1691 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionBookmarkedUsers_Add1692 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectBookmarkedUsers_Add1693 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginBookmarkedUsers_Add1694 virtual bool RequiresLogin(void) const {return true;} 1695 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1696 1697 virtual bool PrevalidateInput(void); 1698 1699 // Input parameters 1700 RakNet::RakString targetHandle; 1701 int type; 1702 RakNet::RakString description; 1703 1704 }; 1705 /// \brief Remove a user added with BookmarkedUsers_Add 1706 /// \ingroup LOBBY_2_COMMANDS 1707 struct BookmarkedUsers_Remove : public Lobby2Message 1708 { __L2_MSG_BASE_IMPLBookmarkedUsers_Remove1709 __L2_MSG_BASE_IMPL(BookmarkedUsers_Remove) 1710 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionBookmarkedUsers_Remove1711 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectBookmarkedUsers_Remove1712 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginBookmarkedUsers_Remove1713 virtual bool RequiresLogin(void) const {return true;} 1714 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1715 1716 virtual bool PrevalidateInput(void); 1717 1718 // Input parameters 1719 RakNet::RakString targetHandle; 1720 int type; 1721 }; 1722 /// \brief Returns all users added to BookmarkedUsers_Add 1723 /// \ingroup LOBBY_2_COMMANDS 1724 struct BookmarkedUsers_Get : public Lobby2Message 1725 { __L2_MSG_BASE_IMPLBookmarkedUsers_Get1726 __L2_MSG_BASE_IMPL(BookmarkedUsers_Get) 1727 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionBookmarkedUsers_Get1728 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectBookmarkedUsers_Get1729 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginBookmarkedUsers_Get1730 virtual bool RequiresLogin(void) const {return true;} 1731 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1732 1733 // Input parameters 1734 1735 // Output parameters 1736 /// \param[out] recentlyMetUsers Handles of recently met users, by BookmarkedUsers_Add, subject to expirationTimeSeconds 1737 DataStructures::List<BookmarkedUser> bookmarkedUsers; 1738 }; 1739 /// \brief Adds to an emails table from myHandle (store primary key) to recipient handles (store primary key) the specified subject, body, and binary data. Emails are persistent, therefore emails should be stored in a separate table and referenced by the user. Deleting the user does not delete previously send email. Emails should have an automatic timestamp to store when they were created. Email should be flagged as sent=true (boolean), markedRead=true (boolean), deletedBySender=false (boolean), deletedByReciever=false (boolean). 1740 /// \ingroup LOBBY_2_COMMANDS 1741 struct Emails_Send : public Lobby2Message 1742 { 1743 Emails_SendEmails_Send1744 Emails_Send() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Emails_SendEmails_Send1745 virtual ~Emails_Send() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 1746 __L2_MSG_BASE_IMPLEmails_Send1747 __L2_MSG_BASE_IMPL(Emails_Send) 1748 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionEmails_Send1749 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectEmails_Send1750 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginEmails_Send1751 virtual bool RequiresLogin(void) const {return true;} 1752 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1753 1754 virtual bool PrevalidateInput(void); 1755 1756 // Input parameters 1757 DataStructures::List<RakNet::RakString> recipients; 1758 RakNet::RakString subject; 1759 RakNet::RakString body; 1760 int status; 1761 RakNetSmartPtr<BinaryDataBlock> binaryData; 1762 1763 // Output parameters 1764 }; 1765 /// \brief Returns emails as noted. Emails which were marked deleted are not returned. 1766 /// \ingroup LOBBY_2_COMMANDS 1767 struct Emails_Get : public Lobby2Message 1768 { Emails_GetEmails_Get1769 Emails_Get() {unreadEmailsOnly=false; emailIdsOnly=false;} ~Emails_GetEmails_Get1770 virtual ~Emails_Get() {} 1771 __L2_MSG_BASE_IMPLEmails_Get1772 __L2_MSG_BASE_IMPL(Emails_Get) 1773 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionEmails_Get1774 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectEmails_Get1775 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginEmails_Get1776 virtual bool RequiresLogin(void) const {return true;} 1777 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1778 1779 // Input parameters 1780 bool unreadEmailsOnly; //If this is true then it will only return emails that have not been read by the user. 1781 bool emailIdsOnly; //When this is set only the emailIds are filled out and no data is returned. 1782 DataStructures::List<unsigned int> emailsToRetrieve; //If this has entries then it will only get the emails in the list, otherwise it will get all emails. 1783 1784 // Output parameters 1785 /// \param[out] emailResults Up to caller to deallocate binary data 1786 DataStructures::List<EmailResult> emailResults; 1787 }; 1788 /// \brief Deletes an email with a specified ID. This ID is returned in GetEmail and should uniquely identify an email (it's fine to use the primary key). Note: Emails are not actually deleted from the database in this function. This just sets the deletedBySender or deletedByReciever flags. Emails are actually stored in a log recording past emails and sender and receiver primary key. They are not truly destroyed until done so with System_PruneAccounts. 1789 /// \ingroup LOBBY_2_COMMANDS 1790 struct Emails_Delete : public Lobby2Message 1791 { __L2_MSG_BASE_IMPLEmails_Delete1792 __L2_MSG_BASE_IMPL(Emails_Delete) 1793 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionEmails_Delete1794 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectEmails_Delete1795 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginEmails_Delete1796 virtual bool RequiresLogin(void) const {return true;} 1797 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1798 1799 // Input parameters 1800 unsigned int emailId; 1801 1802 // Output parameters 1803 }; 1804 /// \brief Sets the status flag for an email. This is a property defined by and used by the user 1805 /// \ingroup LOBBY_2_COMMANDS 1806 struct Emails_SetStatus : public Lobby2Message 1807 { __L2_MSG_BASE_IMPLEmails_SetStatus1808 __L2_MSG_BASE_IMPL(Emails_SetStatus) 1809 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionEmails_SetStatus1810 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectEmails_SetStatus1811 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginEmails_SetStatus1812 virtual bool RequiresLogin(void) const {return true;} 1813 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1814 virtual bool PrevalidateInput(void); 1815 1816 // Input parameters 1817 unsigned int emailId; 1818 bool updateStatusFlag; 1819 bool updateMarkedRead; 1820 int newStatusFlag; 1821 bool isNowMarkedRead; 1822 1823 // Output parameters 1824 }; 1825 /// \brief Will record in the database the results of a match. This will store in the database the the match which is defined by the the match notes, match id, winner and loser participant primary keys, winner and loser participant scores, and binary data. 1826 /// \ingroup LOBBY_2_COMMANDS 1827 struct Ranking_SubmitMatch : public Lobby2Message 1828 { __L2_MSG_BASE_IMPLRanking_SubmitMatch1829 __L2_MSG_BASE_IMPL(Ranking_SubmitMatch) 1830 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionRanking_SubmitMatch1831 virtual bool RequiresRankingPermission(void) const {return true;} CancelOnDisconnectRanking_SubmitMatch1832 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginRanking_SubmitMatch1833 virtual bool RequiresLogin(void) const {return true;} 1834 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1835 1836 virtual bool PrevalidateInput(void); 1837 1838 // Input parameters 1839 RakNet::RakString titleName; 1840 RakNet::RakString gameType; 1841 SubmittedMatch submittedMatch; 1842 1843 // Output parameters 1844 }; 1845 /// \brief Gets matches recorded with Ranking_SubmitMatch ordered from most recent to least recent. Each returned match has all columns submitted to Ranking_SubmitMatch, except binary data, which can be retrieved with Ranking_GetMatchBinaryData. Additionally, each returned match returns the primary key of each match, to be passed to Ranking_GetMatchBinaryData 1846 /// \ingroup LOBBY_2_COMMANDS 1847 struct Ranking_GetMatches : public Lobby2Message 1848 { __L2_MSG_BASE_IMPLRanking_GetMatches1849 __L2_MSG_BASE_IMPL(Ranking_GetMatches) 1850 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionRanking_GetMatches1851 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectRanking_GetMatches1852 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginRanking_GetMatches1853 virtual bool RequiresLogin(void) const {return true;} 1854 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1855 1856 virtual bool PrevalidateInput(void); 1857 1858 // Input parameters 1859 RakNet::RakString titleName; 1860 RakNet::RakString gameType; 1861 1862 // Output parameters 1863 /// \param[out] submittedMatches (excluding binary data, up to caller to deallocate) 1864 DataStructures::List<SubmittedMatch> submittedMatches; 1865 }; 1866 /// \brief Because of the large amount of binary data potentially returned, this function is used to retrieve binary data for a particular match. 1867 /// \ingroup LOBBY_2_COMMANDS 1868 struct Ranking_GetMatchBinaryData : public Lobby2Message 1869 { 1870 Ranking_GetMatchBinaryDataRanking_GetMatchBinaryData1871 Ranking_GetMatchBinaryData() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Ranking_GetMatchBinaryDataRanking_GetMatchBinaryData1872 ~Ranking_GetMatchBinaryData() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 1873 __L2_MSG_BASE_IMPLRanking_GetMatchBinaryData1874 __L2_MSG_BASE_IMPL(Ranking_GetMatchBinaryData) 1875 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionRanking_GetMatchBinaryData1876 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectRanking_GetMatchBinaryData1877 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginRanking_GetMatchBinaryData1878 virtual bool RequiresLogin(void) const {return true;} 1879 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1880 1881 // Input parameters 1882 unsigned int matchID; 1883 1884 // Output parameters 1885 RakNetSmartPtr<BinaryDataBlock> binaryData; 1886 }; 1887 /// \brief When a match is submitted with Ranking_SubmitMatch, the total running score and number of matches played for each player for each game title and game mode combination should be recorded. Because matches can be pruned wth PruneMatches(), the total score sum and number of scores submitted should be stored, rather than summed up from prior submitted matches. 1888 /// \ingroup LOBBY_2_COMMANDS 1889 struct Ranking_GetTotalScore : public Lobby2Message 1890 { __L2_MSG_BASE_IMPLRanking_GetTotalScore1891 __L2_MSG_BASE_IMPL(Ranking_GetTotalScore) 1892 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionRanking_GetTotalScore1893 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectRanking_GetTotalScore1894 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginRanking_GetTotalScore1895 virtual bool RequiresLogin(void) const {return true;} 1896 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1897 1898 virtual bool PrevalidateInput(void); 1899 1900 // Input parameters 1901 RakNet::RakString titleName; 1902 RakNet::RakString gameType; 1903 RakNet::RakString targetHandle; 1904 1905 // Output parameters 1906 float scoreSum; 1907 unsigned int numScoresSubmitted; 1908 }; 1909 1910 /// \brief Resets the sum of all submitted scores to 0, the number of scores submitted to 0 1911 /// \ingroup LOBBY_2_COMMANDS 1912 struct Ranking_WipeScoresForPlayer : public Lobby2Message 1913 { __L2_MSG_BASE_IMPLRanking_WipeScoresForPlayer1914 __L2_MSG_BASE_IMPL(Ranking_WipeScoresForPlayer) 1915 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionRanking_WipeScoresForPlayer1916 virtual bool RequiresRankingPermission(void) const {return true;} CancelOnDisconnectRanking_WipeScoresForPlayer1917 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginRanking_WipeScoresForPlayer1918 virtual bool RequiresLogin(void) const {return true;} 1919 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1920 1921 virtual bool PrevalidateInput(void); 1922 1923 // Input parameters 1924 RakNet::RakString titleName; 1925 RakNet::RakString gameType; 1926 RakNet::RakString targetHandle; 1927 1928 // Output parameters 1929 }; 1930 /// \brief Deletes all matches submitted with submit match. Also deletes all scores for all players associated with this titleName and gameType (e.g. same thing that WipeScoresForPlayer does, but for all players). 1931 /// \ingroup LOBBY_2_COMMANDS 1932 struct Ranking_WipeMatches : public Lobby2Message 1933 { __L2_MSG_BASE_IMPLRanking_WipeMatches1934 __L2_MSG_BASE_IMPL(Ranking_WipeMatches) 1935 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionRanking_WipeMatches1936 virtual bool RequiresRankingPermission(void) const {return true;} CancelOnDisconnectRanking_WipeMatches1937 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginRanking_WipeMatches1938 virtual bool RequiresLogin(void) const {return true;} 1939 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1940 1941 virtual bool PrevalidateInput(void); 1942 1943 // Input parameters 1944 RakNet::RakString titleName; 1945 RakNet::RakString gameType; 1946 1947 // Output parameters 1948 }; 1949 /// \brief Will delete all matches submitted with SubmitMatch over PruneTime days old. Will also prune matches if the total storage space of all matches exceeds PruneSizeMB megabytes in the database. 1950 /// \ingroup LOBBY_2_COMMANDS 1951 struct Ranking_PruneMatches : public Lobby2Message 1952 { __L2_MSG_BASE_IMPLRanking_PruneMatches1953 __L2_MSG_BASE_IMPL(Ranking_PruneMatches) 1954 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionRanking_PruneMatches1955 virtual bool RequiresRankingPermission(void) const {return true;} CancelOnDisconnectRanking_PruneMatches1956 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginRanking_PruneMatches1957 virtual bool RequiresLogin(void) const {return true;} 1958 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1959 1960 // Input parameters 1961 unsigned int pruneTimeDays; 1962 1963 // Output parameters 1964 }; 1965 /// \brief Add or update a rating for a user, in a particular game and game mode 1966 /// \ingroup LOBBY_2_COMMANDS 1967 struct Ranking_UpdateRating : public Lobby2Message 1968 { __L2_MSG_BASE_IMPLRanking_UpdateRating1969 __L2_MSG_BASE_IMPL(Ranking_UpdateRating) 1970 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionRanking_UpdateRating1971 virtual bool RequiresRankingPermission(void) const {return true;} CancelOnDisconnectRanking_UpdateRating1972 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginRanking_UpdateRating1973 virtual bool RequiresLogin(void) const {return true;} 1974 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1975 1976 virtual bool PrevalidateInput(void); 1977 1978 // Input parameters 1979 RakNet::RakString titleName; 1980 RakNet::RakString gameType; 1981 RakNet::RakString targetHandle; 1982 float targetRating; 1983 1984 // Output parameters 1985 }; 1986 /// \brief Deletes all ratings for all players for this combination of titleName and gameType. 1987 /// \ingroup LOBBY_2_COMMANDS 1988 struct Ranking_WipeRatings : public Lobby2Message 1989 { __L2_MSG_BASE_IMPLRanking_WipeRatings1990 __L2_MSG_BASE_IMPL(Ranking_WipeRatings) 1991 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionRanking_WipeRatings1992 virtual bool RequiresRankingPermission(void) const {return true;} CancelOnDisconnectRanking_WipeRatings1993 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginRanking_WipeRatings1994 virtual bool RequiresLogin(void) const {return true;} 1995 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 1996 1997 virtual bool PrevalidateInput(void); 1998 1999 // Input parameters 2000 RakNet::RakString titleName; 2001 RakNet::RakString gameType; 2002 2003 // Output parameters 2004 }; 2005 /// \brief Get rating for a player 2006 /// \ingroup LOBBY_2_COMMANDS 2007 struct Ranking_GetRating : public Lobby2Message 2008 { __L2_MSG_BASE_IMPLRanking_GetRating2009 __L2_MSG_BASE_IMPL(Ranking_GetRating) 2010 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionRanking_GetRating2011 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectRanking_GetRating2012 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginRanking_GetRating2013 virtual bool RequiresLogin(void) const {return true;} 2014 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 2015 2016 virtual bool PrevalidateInput(void); 2017 2018 // Input parameters 2019 RakNet::RakString titleName; 2020 RakNet::RakString gameType; 2021 RakNet::RakString targetHandle; 2022 2023 // Output parameters 2024 /// \param[out] currentRating Defaults to 100 if no matches submitted yet 2025 float currentRating; 2026 }; 2027 2028 /// \brief userHandle updates the clanDescription and clanBinaryData of a clan with the specified clanHandle. userHandle must be the clan leader. 2029 /// \ingroup LOBBY_2_COMMANDS 2030 struct Clans_Create : public Lobby2Message 2031 { 2032 Clans_CreateClans_Create2033 Clans_Create() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Clans_CreateClans_Create2034 ~Clans_Create() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 2035 __L2_MSG_BASE_IMPLClans_Create2036 __L2_MSG_BASE_IMPL(Clans_Create) 2037 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClans_Create2038 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClans_Create2039 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClans_Create2040 virtual bool RequiresLogin(void) const {return true;} 2041 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 2042 2043 virtual bool PrevalidateInput(void); 2044 2045 // Input parameters 2046 RakNet::RakString clanHandle; 2047 bool failIfAlreadyInClan; 2048 bool requiresInvitationsToJoin; 2049 RakNet::RakString description; 2050 int emailStatus; 2051 RakNetSmartPtr<BinaryDataBlock> binaryData; 2052 2053 // Output parameters 2054 }; 2055 2056 /// \brief userHandle updates the clanDescription and clanBinaryData of a clan with the specified clanHandle. userHandle must be the clan leader. 2057 /// \ingroup LOBBY_2_COMMANDS 2058 struct Clans_SetProperties : public Lobby2Message 2059 { Clans_SetPropertiesClans_SetProperties2060 Clans_SetProperties() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Clans_SetPropertiesClans_SetProperties2061 ~Clans_SetProperties() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 2062 __L2_MSG_BASE_IMPLClans_SetProperties2063 __L2_MSG_BASE_IMPL(Clans_SetProperties) 2064 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClans_SetProperties2065 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClans_SetProperties2066 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClans_SetProperties2067 virtual bool RequiresLogin(void) const {return true;} 2068 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 2069 2070 virtual bool PrevalidateInput(void); 2071 2072 // Input parameters 2073 RakNet::RakString clanHandle; 2074 RakNet::RakString description; 2075 RakNetSmartPtr<BinaryDataBlock> binaryData; 2076 }; 2077 /// \brief Returns clanDescription and clanBinaryData for the given clan. 2078 /// \ingroup LOBBY_2_COMMANDS 2079 struct Clans_GetProperties : public Lobby2Message 2080 { Clans_GetPropertiesClans_GetProperties2081 Clans_GetProperties() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Clans_GetPropertiesClans_GetProperties2082 ~Clans_GetProperties() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 2083 __L2_MSG_BASE_IMPLClans_GetProperties2084 __L2_MSG_BASE_IMPL(Clans_GetProperties) 2085 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClans_GetProperties2086 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClans_GetProperties2087 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginClans_GetProperties2088 virtual bool RequiresLogin(void) const {return true;} 2089 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 2090 2091 virtual bool PrevalidateInput(void); 2092 2093 // Input parameters 2094 RakNet::RakString clanHandle; 2095 2096 // Output parameters 2097 RakNet::RakString description; 2098 RakNetSmartPtr<BinaryDataBlock> binaryData; 2099 }; 2100 2101 /// \brief Each member of each clan has the the properties clanMemberDescription and clanMemberBinaryData which default to empty. These properties can be set here, and retrieved via GetClanMemberProperties 2102 /// \ingroup LOBBY_2_COMMANDS 2103 struct Clans_SetMyMemberProperties : public Lobby2Message 2104 { 2105 Clans_SetMyMemberPropertiesClans_SetMyMemberProperties2106 Clans_SetMyMemberProperties() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Clans_SetMyMemberPropertiesClans_SetMyMemberProperties2107 ~Clans_SetMyMemberProperties() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 2108 __L2_MSG_BASE_IMPLClans_SetMyMemberProperties2109 __L2_MSG_BASE_IMPL(Clans_SetMyMemberProperties) 2110 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClans_SetMyMemberProperties2111 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClans_SetMyMemberProperties2112 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClans_SetMyMemberProperties2113 virtual bool RequiresLogin(void) const {return true;} 2114 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 2115 2116 virtual bool PrevalidateInput(void); 2117 2118 // Input parameters 2119 RakNet::RakString clanHandle; 2120 RakNet::RakString description; 2121 RakNetSmartPtr<BinaryDataBlock> binaryData; 2122 2123 // Output parameters 2124 }; 2125 /// \brief myPrimaryKey becomes a subleader. newLeaderHandle becomes the leader. An email is sent with Emails_Send() to all members with the specified subject and body 2126 /// \ingroup LOBBY_2_COMMANDS 2127 struct Clans_GrantLeader : public Lobby2Message 2128 { __L2_MSG_BASE_IMPLClans_GrantLeader2129 __L2_MSG_BASE_IMPL(Clans_GrantLeader) 2130 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClans_GrantLeader2131 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClans_GrantLeader2132 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClans_GrantLeader2133 virtual bool RequiresLogin(void) const {return true;} 2134 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 2135 2136 virtual bool PrevalidateInput(void); 2137 2138 // Input parameters 2139 RakNet::RakString clanHandle; 2140 RakNet::RakString targetHandle; 2141 }; 2142 /// \brief Promotes a clan member to a subleader, or demotes a subleader to a regular member. On promotion, email is sent to all members from myPrimary key with the specified subject and body. On demotion, email is sent to all leaders from myPrimary key with the specified subject and body. 2143 /// \ingroup LOBBY_2_COMMANDS 2144 struct Clans_SetSubleaderStatus : public Lobby2Message 2145 { __L2_MSG_BASE_IMPLClans_SetSubleaderStatus2146 __L2_MSG_BASE_IMPL(Clans_SetSubleaderStatus) 2147 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClans_SetSubleaderStatus2148 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClans_SetSubleaderStatus2149 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClans_SetSubleaderStatus2150 virtual bool RequiresLogin(void) const {return true;} 2151 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 2152 2153 virtual bool PrevalidateInput(void); 2154 2155 // Input parameters 2156 RakNet::RakString clanHandle; 2157 RakNet::RakString targetHandle; 2158 bool setToSubleader; 2159 }; 2160 2161 /// \brief Lets the clan leader set the rank property for a clan member 2162 /// \ingroup LOBBY_2_COMMANDS 2163 struct Clans_SetMemberRank : public Lobby2Message 2164 { __L2_MSG_BASE_IMPLClans_SetMemberRank2165 __L2_MSG_BASE_IMPL(Clans_SetMemberRank) 2166 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClans_SetMemberRank2167 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClans_SetMemberRank2168 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClans_SetMemberRank2169 virtual bool RequiresLogin(void) const {return true;} 2170 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 2171 2172 virtual bool PrevalidateInput(void); 2173 2174 // Input parameters 2175 RakNet::RakString clanHandle; 2176 RakNet::RakString targetHandle; 2177 unsigned int newRank; 2178 }; 2179 /// \brief Returns properties for a clan member of a given clan 2180 /// \ingroup LOBBY_2_COMMANDS 2181 struct Clans_GetMemberProperties : public Lobby2Message 2182 { Clans_GetMemberPropertiesClans_GetMemberProperties2183 Clans_GetMemberProperties() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Clans_GetMemberPropertiesClans_GetMemberProperties2184 ~Clans_GetMemberProperties() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 2185 __L2_MSG_BASE_IMPLClans_GetMemberProperties2186 __L2_MSG_BASE_IMPL(Clans_GetMemberProperties) 2187 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClans_GetMemberProperties2188 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClans_GetMemberProperties2189 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginClans_GetMemberProperties2190 virtual bool RequiresLogin(void) const {return true;} 2191 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 2192 2193 virtual bool PrevalidateInput(void); 2194 2195 // Input parameters 2196 RakNet::RakString clanHandle; 2197 RakNet::RakString targetHandle; 2198 2199 // Output parameters 2200 RakNet::RakString description; 2201 RakNetSmartPtr<BinaryDataBlock> binaryData; 2202 unsigned int rank; 2203 bool isSubleader; 2204 ClanMemberState clanMemberState; 2205 RakNet::RakString banReason; 2206 }; 2207 /// \brief Renames the clan. Note that this may be called asynchronously, in which case the stored procedure should account for this occuring at the same time as another function that uses the old clan handle. 2208 /// \ingroup LOBBY_2_COMMANDS 2209 struct Clans_ChangeHandle : public Lobby2Message 2210 { __L2_MSG_BASE_IMPLClans_ChangeHandle2211 __L2_MSG_BASE_IMPL(Clans_ChangeHandle) 2212 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClans_ChangeHandle2213 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClans_ChangeHandle2214 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClans_ChangeHandle2215 virtual bool RequiresLogin(void) const {return true;} 2216 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 2217 2218 virtual bool PrevalidateInput(void); 2219 2220 // Input parameters 2221 RakNet::RakString oldClanHandle; 2222 RakNet::RakString newClanHandle; 2223 2224 // Output parameters 2225 }; 2226 /// \brief Remove user identified by myPrimaryKey from clan identified by clanHandle. 2227 /// \details If this user is the leader of the clan, and dissolveIfClanLeader is true, then also destroy the clan and remove all members from the clan, as well as all data associated with the clan (clan boards, join requests, etc). If the clan is automatically destroyed in this way, use Emails_Send() to each clan member with clanDissolvedSubject and clanDissolvedBody. The sender of the email should be the clan leader. If the clan is not destroyed, then leadership passes to the oldest subleader. If no subleaders exist, leadership passes to the oldest member. If no other members exist, the clan is destroyed. 2228 /// \ingroup LOBBY_2_COMMANDS 2229 struct Clans_Leave : public Lobby2Message 2230 { Clans_LeaveClans_Leave2231 Clans_Leave() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Clans_LeaveClans_Leave2232 ~Clans_Leave() {/*RakNet::OP_DELETE(binaryData,__FILE__,__LINE__);*/} 2233 __L2_MSG_BASE_IMPLClans_Leave2234 __L2_MSG_BASE_IMPL(Clans_Leave) 2235 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClans_Leave2236 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClans_Leave2237 virtual bool CancelOnDisconnect(void) const {return false;} RequiresLoginClans_Leave2238 virtual bool RequiresLogin(void) const {return true;} 2239 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 2240 2241 virtual bool PrevalidateInput(void); 2242 2243 // Input parameters 2244 RakNet::RakString clanHandle; 2245 bool dissolveIfClanLeader; 2246 RakNet::RakString subject; 2247 RakNet::RakString body; 2248 int emailStatus; 2249 RakNetSmartPtr<BinaryDataBlock> binaryData; 2250 2251 // Output parameters 2252 bool wasDissolved; 2253 RakNet::RakString newClanLeader; // If not dissolved 2254 }; 2255 /// \brief Returns all clans that userHandle is a member of. Clans and clan members should be sorted by name, using ascending or descending sort as specified. 2256 /// \ingroup LOBBY_2_COMMANDS 2257 struct Clans_Get : public Lobby2Message 2258 { __L2_MSG_BASE_IMPLClans_Get2259 __L2_MSG_BASE_IMPL(Clans_Get) 2260 virtual bool RequiresAdmin(void) const {return false;} RequiresRankingPermissionClans_Get2261 virtual bool RequiresRankingPermission(void) const {return false;} CancelOnDisconnectClans_Get2262 virtual bool CancelOnDisconnect(void) const {return true;} RequiresLoginClans_Get2263 virtual bool RequiresLogin(void) const {return true;} 2264 virtual void Serialize( bool writeToBitstream, bool serializeOutput, RakNet::BitStream *bitStream ); 2265 2266 2267 // Input parameters 2268 2269 // Output parameters 2270 DataStructures::List<ClanInfo> clans; 2271 }; 2272 /// \brief if myPrimaryKey is a leader or subleader of clanHandle, and invitedUserHandle is a valid user not already invited to this clan, add this user to the invite table. The invite table contains the clan, who send the invite, and who the invite was sent to, and when it was sent. Invites expire after expiration time in seconds. Also, use Emails_Send() to send an email from myPrimaryKey to invitedUserHandle with the specified subject and body. 2273 /// \ingroup LOBBY_2_COMMANDS 2274 struct Clans_SendJoinInvitation : public Lobby2Message 2275 { 2276 Clans_SendJoinInvitationClans_SendJoinInvitation2277 Clans_SendJoinInvitation() {binaryData=RakNet::OP_NEW<BinaryDataBlock>(__FILE__,__LINE__);} ~Clans_SendJoinInvitationClans_SendJoinInvitation2278