59 Password = szPassword;
60 this->fRememberLogin = fRememberLogin;
65 NewAccount = szNewAccount;
70 NewPassword = szNewPassword;
149 if (Leagues[i] == szLeague)
157 if (Leagues[i] == szLeague)
165 if (Leagues[i] == szLeague)
166 return RankSymbols[i];
201 FBIDItem *pDel = pFirst;
202 pFirst = pDel->pNext;
210 if (!szAccount)
return false;
211 for (FBIDItem *pItem = pFirst; pItem; pItem = pItem->pNext)
212 if (pItem->Account == szAccount)
214 if (pFBIDOut) pFBIDOut->
Copy(pItem->FBID);
222 FBIDItem *pPrev =
nullptr, *pItem = pFirst;
226 if (pItem->Account == szAccount)
228 (pPrev ? pPrev->pNext : pFirst) = pItem->pNext;
233 pPrev = pItem; pItem = pItem->pNext;
240 assert(szFBID); assert(szAccount);
244 FBIDItem *pNewItem =
new FBIDItem();
245 pNewItem->FBID.Copy(szFBID);
246 pNewItem->Account.Copy(szAccount);
247 pNewItem->pNext = pFirst;
259 : rFBIDList(rFBIDList), rPlayerInfos(rPlayerInfos) {}
266 assert(!
"DisconnectData::CompileFunc not defined for compiler!");
277 pComp->
Name(
"Player");
303 StdStrBuf QueryText = DecompileToBuf<StdCompilerINIWrite>(
351 StdStrBuf QueryText = DecompileToBuf<StdCompilerINIWrite>(
369 if (pPlayerLeagueInfos)
381 StdStrBuf QueryText = DecompileToBuf<StdCompilerINIWrite>(
405 bool C4LeagueClient::Auth(
const C4PlayerInfo &PlrInfo,
const char *szAccount,
const char *szPassword,
const char *szNewAccount,
const char *szNewPassword,
bool fRememberLogin)
410 Head.
SetAuth(szAccount, szPassword, fRememberLogin);
416 StdStrBuf QueryText = DecompileToBuf<StdCompilerINIWrite>(
445 pMessage->
Ref(
LoadResStr(
"IDS_MSG_LEAGUESERVERREPLYWITHOUTA"));
462 StdStrBuf QueryText = DecompileToBuf<StdCompilerINIWrite>(
480 if (szLeague && pPlrInfo)
491 StdStrBuf QueryText = DecompileToBuf<StdCompilerINIWrite>(
515 C4LeagueSignupDialog::C4LeagueSignupDialog(
const char *szPlayerName,
const char *szLeagueName,
const char *szLeagueServerName,
const char *szAccountPref,
const char *szPassPref,
bool fWarnThirdParty,
bool fRegister,
bool fRememberLogin)
535 if (fRegister && (!szAccountPref || !szAccountPref[0]))
537 szAccountPref = szPlayerName;
539 bool fSideEdits=
true;
int iCtrlHeight;
547 const char *szChkPasswordCaption =
LoadResStr(
"IDS_CTL_LEAGUE_CHK_PLRPW");
554 const char *szEdtPassCaption =
LoadResStr(
"IDS_CTL_LEAGUE_PLRPW");
555 const char *szEdtPass2Caption =
LoadResStr(
"IDS_CTL_LEAGUE_PLRPW2");
568 pChkPassword =
nullptr;
570 const char *szEdtPassCaption =
LoadResStr(
"IDS_CTL_LEAGUE_PLRPW");
576 const char *szRememberPasswordCaption =
LoadResStr(
"IDS_CTL_LEAGUE_CHK_REMEMBERLOGIN");
607 Dialog::UserClose(
fOK);
612 const char *szAccount = pEdtAccount->
GetText();
613 if (!szAccount || !*szAccount)
630 if (
SLen(szAccount) < 3)
638 if (!pChkPassword || pChkPassword->
GetChecked())
641 const char *szPassword = pEdtPass->
GetText();
642 if (!szPassword || !*szPassword)
658 Dialog::UserClose(
fOK);
664 assert(psCUID); assert(psPass);
665 if (!psCUID || !psPass)
return false;
681 void C4LeagueSignupDialog::OnChkPassword()
683 if (!pChkPassword)
return;
695 pBtnOK->
SetPos(bnds.
x, bnds.
y + iEdtPassSpace);
697 pBtnAbort->
SetPos(bnds.
x, bnds.
y + iEdtPassSpace);
709 pBtnOK->
SetPos(bnds.
x, bnds.
y - iEdtPassSpace);
711 pBtnAbort->
SetPos(bnds.
x, bnds.
y - iEdtPassSpace);
C4GraphicsResource GraphicsResource
#define C4GUI_ButtonAreaHgt
#define C4GUI_DefDlgIndent
#define C4GUI_DefButton2Wdt
#define C4GUI_MessageFontClr
#define C4GUI_MessageDlgWdt
#define C4GUI_DefButton2HSpace
const char * LoadResStr(const char *id)
#define C4League_Name_Valid_Characters
const int32_t C4NetMaxLeagues
unsigned int SCharCountEx(const char *szString, const char *szCharList)
bool SEqual(const char *szStr1, const char *szStr2)
size_t SLen(const char *sptr)
StdInsertAdapt< T, I > mkInsertAdapt(T &&rObj, I &&rIns, bool fBefore=true)
StdDecompileAdapt< T > mkDecompileAdapt(const T &rValue)
StdArrayAdapt< T > mkArrayAdapt(T *pArray, int iSize)
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
StdNamingCountAdapt< int_t > mkNamingCountAdapt(int_t &iCount, const char *szName)
StdHexAdapt mkHexAdapt(void *pData, size_t iSize)
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
StdStrBuf FormatString(const char *szFmt,...)
C4PlayerInfo * GetPlayerInfo(int32_t iIndex) const
void SetOnChecked(BaseCallbackHandler *pCB)
static bool GetStandardCheckBoxSize(int *piWdt, int *piHgt, const char *szForCaptionText, CStdFont *pUseFont)
bool GetFromLeft(int32_t iWdt, int32_t iHgt, C4Rect &rcOut)
bool GetCentered(int32_t iWdt, int32_t iHgt, C4Rect &rcOut)
int32_t GetHeight() const
int32_t GetInnerWidth() const
bool GetFromRight(int32_t iWdt, int32_t iHgt, C4Rect &rcOut)
bool GetFromTop(int32_t iHgt, int32_t iWdt, C4Rect &rcOut)
void AddElement(Element *pChild)
void SetVisibility(bool fToValue) override
void SetFocus(Control *pCtrl, bool fByMouse)
void SetClientSize(int32_t iToWdt, int32_t iToHgt)
bool SetText(const char *szText, bool fUser)
void SetPasswordMask(char cNewPasswordMask)
void SetToolTip(const char *szNewTooltip, bool is_immediate=false)
static bool GetControlSize(int *piWdt, int *piHgt, const char *szForText, CStdFont *pForFont, bool fMultiline)
C4GUI::Edit * GetEdit() const
const char * GetText() const
bool ShowModalDlg(Dialog *pDlg, bool fDestruct=true)
bool ShowMessageModal(const char *szMessage, const char *szCaption, DWORD dwButtons, Icons icoIcon, int32_t *piConfigDontShowAgainSetting=nullptr)
void SetPos(int32_t iXPos, int32_t iYPos)
C4Rect & GetClientRect() override
bool Query(const StdBuf &Data, bool fBinary)
StdCopyStrBuf ResultString
bool Start(const C4Network2Reference &Ref)
bool GetAuthReply(StdStrBuf *pMessage, StdStrBuf *pAUID, StdStrBuf *pAccount, bool *pRegister, StdStrBuf *pLoginToken)
bool GetStartReply(StdStrBuf *pMessage, StdStrBuf *pLeague, StdStrBuf *pStreamingAddr, int32_t *pSeed, int32_t *pMaxPlayers)
bool GetReportDisconnectReply(StdStrBuf *pMessage)
bool GetAuthCheckReply(StdStrBuf *pMessage, const char *szLeague, class C4PlayerInfo *pPlrInfo)
bool ReportDisconnect(const C4ClientPlayerInfos &rSendPlayerFBIDs, C4LeagueDisconnectReason eReason)
bool Auth(const C4PlayerInfo &PlrInfo, const char *szAccount, const char *szPassword, const char *szNewAccount=nullptr, const char *szNewPassword=nullptr, bool fRememberLogin=false)
bool GetEndReply(StdStrBuf *pMessage, class C4RoundResultsPlayers *pRoundResults)
bool Update(const C4Network2Reference &Ref)
bool GetUpdateReply(StdStrBuf *pMessage, C4ClientPlayerInfos *pPlayerLeagueInfos)
bool AuthCheck(const C4PlayerInfo &PlrInfo)
bool End(const C4Network2Reference &Ref, const char *szRecordName, const BYTE *pRecordSHA)
void RemoveFBIDByAccount(const char *szAccount)
bool FindFBIDByAccount(const char *szAccount, StdStrBuf *pFBIDOut)
void AddFBID(const char *szFBID, const char *szAccount)
void CompileFunc(StdCompiler *pComp)
void CompileFunc(StdCompiler *pComp)
void SetNewPassword(const char *szNewPassword)
void CompileFunc(StdCompiler *pComp)
void SetAuth(const char *szAccount, const char *szPassword, bool fRememberLogin)
void SetNewAccount(const char *szNewAccount)
int32_t getRank(const char *szLeague) const
int32_t getRankSymbol(const char *szLeague) const
void CompileFunc(StdCompiler *pComp)
const char * getClanTag() const
int32_t getScore(const char *szLeague) const
const char * getProgressData(const char *szLeague) const
bool isStatusRegister() const
const char * getAUID() const
void CompileFunc(StdCompiler *pComp)
const char * getFBID() const
const char * getAccount() const
const char * getLoginToken() const
const char * getCSID() const
const char * getMessage() const
void CompileFunc(StdCompiler *pComp)
const char * getStreamingAddr() const
const char * getLeague() const
int32_t getMaxPlayers() const
const C4ClientPlayerInfos & GetPlrInfos() const
void CompileFunc(StdCompiler *pComp)
void UserClose(bool fOK) override
static bool ShowModal(const char *szPlayerName, const char *szLeagueName, const char *szLeagueServerName, StdStrBuf *psAccount, StdStrBuf *psPass, bool fWarnThirdParty, bool fRegister, bool *pfRememberLogin)
C4LeagueSignupDialog(const char *szPlayerName, const char *szLeagueName, const char *szLeagueServerName, const char *szAccountPref, const char *szPassPref, bool fWarnThirdParty, bool fRegister, bool fRememberLogin)
const char * GetAccount()
const char * getAuthID() const
void SetLeagueData(const char *szAccount, const char *szNewClanTag, int32_t iScore, int32_t iRank, int32_t iRankSymbol, const char *szProgressData)
const char * getLeagueAccount() const
std::tuple< std::string, int > BreakMessage(const char *szMsg, int iWdt, bool fCheckMarkup, float fZoom=1.0f)
DisconnectData(C4LeagueFBIDList &rFBIDList, const C4ClientPlayerInfos &rPlayerInfos)
void CompileFunc(StdCompiler *pComp)
void Value(const T &rStruct)
virtual void NameEnd(bool fBreak=false)
virtual bool isDeserializer()
virtual bool Name(const char *szName)
void Ref(const char *pnData)
const char * getData() const
void Format(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O