public override void Parse() { base.Parse(); Password = PasswordEncoder.ProcessPassword(RequestKeyValues); if (!RequestKeyValues.ContainsKey("email")) { throw new GPParseException("email is missing."); } IsRequireUniqueNicks = true; if (RequestKeyValues.ContainsKey("pass")) { // Old games might send an error is unique nicknames are sent (like GSA 1.0) IsRequireUniqueNicks = false; } Email = RequestKeyValues["email"]; if (RequestKeyValues.ContainsKey("namespaceid")) { int namespaceID; if (!int.TryParse(RequestKeyValues["namespaceid"], out namespaceID)) { throw new GPParseException("namespaceid is incorrect."); } NamespaceID = namespaceID; } }
public override GPError Parse() { var flag = base.Parse(); if (flag != GPError.NoError) { return(flag); } string md5Password; if (!PasswordEncoder.ProcessPassword(_rawRequest, out md5Password)) { return(GPError.NewUserBadPasswords); } Password = md5Password; if (!_rawRequest.ContainsKey("nick") || !_rawRequest.ContainsKey("email") || Password == null) { return(GPError.Parse); } if (!GameSpyUtils.IsEmailFormatCorrect(_rawRequest["email"])) { return(GPError.CheckBadMail); } Nick = _rawRequest["nick"]; Email = _rawRequest["email"]; return(GPError.NoError); }
public override void Parse() { base.Parse(); Password = PasswordEncoder.ProcessPassword(RequestKeyValues); if (!RequestKeyValues.ContainsKey("nick")) { throw new GPParseException("nickname is missing."); } if (!RequestKeyValues.ContainsKey("email")) { throw new GPParseException("email is missing."); } if (!GameSpyUtils.IsEmailFormatCorrect(RequestKeyValues["email"])) { throw new GPParseException("email format is incorrect."); } Nick = RequestKeyValues["nick"]; Email = RequestKeyValues["email"]; if (RequestKeyValues.ContainsKey("uniquenick") && RequestKeyValues.ContainsKey("namespaceid")) { if (RequestKeyValues.ContainsKey("namespaceid")) { int namespaceID; if (!int.TryParse(RequestKeyValues["namespaceid"], out namespaceID)) { throw new GPParseException("namespaceid is incorrect."); } NamespaceID = namespaceID; } Uniquenick = RequestKeyValues["uniquenick"]; } ParseOtherInfo(); }
public override GPError Parse() { var flag = base.Parse(); if (flag != GPError.NoError) { return(flag); } string md5Password; if (!PasswordEncoder.ProcessPassword(_rawRequest, out md5Password)) { return(GPError.NewUserBadPasswords); } Password = md5Password; if (!_rawRequest.ContainsKey("email")) { return(GPError.Parse); } RequireUniqueNicks = true; if (_rawRequest.ContainsKey("pass")) { // Old games might send an error is unique nicknames are sent (like GSA 1.0) RequireUniqueNicks = false; } Email = _rawRequest["email"]; if (_rawRequest.ContainsKey("namespaceid")) { uint namespaceID; if (!uint.TryParse(_rawRequest["namespaceid"], out namespaceID)) { return(GPError.Parse); } NamespaceID = namespaceID; } return(GPError.NoError); }
public override GPError Parse() { var flag = base.Parse(); if (flag != GPError.NoError) { return(flag); } string md5Password; if (!PasswordEncoder.ProcessPassword(_rawRequest, out md5Password)) { return(GPError.NewUserBadPasswords); } Password = md5Password; if (!_rawRequest.ContainsKey("nick")) { return(GPError.Parse); } if (!_rawRequest.ContainsKey("email") || !GameSpyUtils.IsEmailFormatCorrect(_rawRequest["email"])) { return(GPError.Parse); } Nick = _rawRequest["nick"]; Email = _rawRequest["email"]; if (_rawRequest.ContainsKey("uniquenick") && _rawRequest.ContainsKey("namespaceid")) { if (_rawRequest.ContainsKey("namespaceid")) { uint namespaceID; if (!uint.TryParse(_rawRequest["namespaceid"], out namespaceID)) { return(GPError.Parse); } NamespaceID = namespaceID; } Uniquenick = _rawRequest["uniquenick"]; } return(ParseOtherInfo()); }
public override void Parse() { base.Parse(); Password = PasswordEncoder.ProcessPassword(RequestKeyValues); if (!RequestKeyValues.ContainsKey("nick") || !RequestKeyValues.ContainsKey("email") || Password is null) { throw new GPParseException("check request is incompelete."); } if (!GameSpyUtils.IsEmailFormatCorrect(RequestKeyValues["email"])) { throw new GPParseException("email format is incorrect"); } Nick = RequestKeyValues["nick"]; Email = RequestKeyValues["email"]; if (RequestKeyValues.ContainsKey("partnerid")) { PartnerId = int.Parse(RequestKeyValues["partnerid"]); } }