Пример #1
0
		/// <summary>
		/// Guarda um User com os seus dados na Base de Dados
		/// </summary>
		public override void saveUser( User user, string password ) {
			PostGreParam[] param = new PostGreParam[20];
			
			param[0] = new PostGreParam(user.UserId,NpgsqlDbType.Integer);

			if( password != string.Empty ) {
				param[1] = new PostGreParam(hashPassword(password),NpgsqlDbType.Varchar,40);
			}else {
				param[1] = new PostGreParam("",NpgsqlDbType.Varchar,40);
			}

			param[2] = new PostGreParam(user.RulerId,NpgsqlDbType.Integer);
			param[3] = new PostGreParam(user.Nick,NpgsqlDbType.Varchar,30);
			param[4] = new PostGreParam(user.Skin,NpgsqlDbType.Integer);
			param[5] = new PostGreParam(user.Lang,NpgsqlDbType.Varchar,5);
			param[6] = new PostGreParam(user.Website,NpgsqlDbType.Varchar,30);
			param[7] = new PostGreParam(user.Avatar,NpgsqlDbType.Varchar,250);
			param[8] = new PostGreParam(user.Msn,NpgsqlDbType.Varchar,30);
			param[9] = new PostGreParam(user.Icq,NpgsqlDbType.Varchar,30);
			param[10] = new PostGreParam(user.Jabber,NpgsqlDbType.Varchar,30);
			param[11] = new PostGreParam(user.Aim,NpgsqlDbType.Varchar,30);
			param[12] = new PostGreParam(user.Yahoo,NpgsqlDbType.Varchar,30);
			param[13] = new PostGreParam(user.Signature,NpgsqlDbType.Varchar,255);
			param[14] = new PostGreParam(user.ImagesDir,NpgsqlDbType.Varchar,100);
			param[15] = new PostGreParam(user.EloRanking,NpgsqlDbType.Integer);
			param[16] = new PostGreParam(user.AllianceId,NpgsqlDbType.Integer);
			param[17] = new PostGreParam(user.AllianceRank,NpgsqlDbType.Varchar,15);
			param[18] = new PostGreParam(user.Wins,NpgsqlDbType.Integer);
			param[19] = new PostGreParam(user.Losses,NpgsqlDbType.Integer);

			PostGreServerUtility.executeNonQuery2("OrionsBelt_UsersUpdateUser",param);
		}
Пример #2
0
        /// <summary>Regista uma nova notícia</summary>
        protected override void Register(Entry entry)
        {
            PostGre.PostGreParam [] param = new PostGreParam[3];
            param[0] = new PostGreParam(entry.Title, NpgsqlDbType.Varchar);
            param[1] = new PostGreParam(entry.Content, NpgsqlDbType.Varchar);
            param[2] = new PostGreParam(entry.Language, NpgsqlDbType.Varchar);

            PostGreServerUtility.executeNonQuery2("OrionsBelt_InsertNews", param);
        }
Пример #3
0
		/// <summary>
		/// Regista um User
		/// </summary>
		public override void registerUser( string nick, string mail, string pass ) {
			PostGreParam[] param = new PostGreParam[4];

			param[0] = new PostGreParam(mail,NpgsqlDbType.Varchar,30);
			param[1] = new PostGreParam(hashPassword(pass),NpgsqlDbType.Varchar,40);
			param[2] = new PostGreParam(nick,NpgsqlDbType.Varchar,30);
			param[3] = new PostGreParam(CultureModule.RequestLanguage,NpgsqlDbType.Varchar,5);
			
			PostGreServerUtility.executeNonQuery2("OrionsBelt_UsersRegisterUser", param);
		}
        /// <summary>
        /// Salva a informao da excepo
        /// </summary>
        /// <param name="exceptionInfo">objecto que encapsula a informao da excepo</param>
        public override void save(ExceptionInfo exceptionInfo)
        {
            PostGreParam[] parameters = new PostGreParam[4];
            parameters[0] = new PostGreParam(exceptionInfo.Name, NpgsqlDbType.Varchar, 100);
            parameters[1] = new PostGreParam(exceptionInfo.Message, NpgsqlDbType.Varchar, 3000);
            parameters[2] = new PostGreParam(exceptionInfo.StackTrace, NpgsqlDbType.Varchar, 3000);
            parameters[3] = new PostGreParam(exceptionInfo.Date, NpgsqlDbType.Timestamp);

            PostGreServerUtility.executeNonQuery2("OrionsBelt_ExceptionLogSave", parameters);
        }
Пример #5
0
        public override void Save(AllianceInfo info)
        {
            PostGre.PostGreParam [] param = new PostGreParam[6];
            param[0] = new PostGreParam(info.Name, NpgsqlDbType.Varchar, 150);
            param[1] = new PostGreParam(info.Tag, NpgsqlDbType.Varchar, 150);
            param[2] = new PostGreParam(info.Motto, NpgsqlDbType.Varchar, 150);
            param[3] = new PostGreParam(info.Ranking, NpgsqlDbType.Integer);
            param[4] = new PostGreParam(info.RankingBattles, NpgsqlDbType.Integer);
            param[5] = new PostGreParam(info.Id, NpgsqlDbType.Integer);

            PostGreServerUtility.executeNonQuery2("orionsbelt_alliancesavealliance", param);
        }
Пример #6
0
        /// <summary>Regista um scan</summary>
        public override void Register(Scan scan)
        {
            MemoryStream stream = new MemoryStream();

            formatter.Serialize(stream, scan);
            byte[] data = stream.ToArray();

            PostGre.PostGreParam [] parameters = new PostGreParam[2];
            parameters[0] = new PostGreParam(scan.SourcePlanetId, NpgsqlDbType.Integer);
            parameters[1] = new PostGreParam(data, NpgsqlDbType.Bytea);

            PostGreServerUtility.executeNonQuery2("OrionsBelt_InsertScans", parameters);
        }