Jump to content
  • Advertisement

tfinck

Member
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

100 Neutral

About tfinck

  • Rank
    Newbie
  1. tfinck

    Converting local to SQL

    Sorry about the code, all the functions are relevant, ban lists, adding players, removing players. I'll just isolate the section I would say is most important. I assume saving account information to a database, rather than a simple text file, is much safer. This is how the current source saves account information Click here for image I just want some better protection. I understand that I'd have to connect to the database in question Private Sub cmdConnectMySQL_Click() Dim cnMySql As New rdoConnection Dim rdoQry As New rdoQuery Dim rdoRS As rdoResultset cnMySql.CursorDriver = rdUseOdbc cnMySql.Connect = "uid=YourUserName;pwd=YourPassword; server=YourServerName;" & _ "driver={MySQL ODBC 3.51 Driver}; database=YourDataBase;dsn=;" cnMySql.EstablishConnection With rdoQry .Name = "selectUsers" .SQL = "select * from user" .RowsetSize = 1 Set .ActiveConnection = cnMySql Set rdoRS = .OpenResultset( rdOpenKeyset, rdConcurRowVer) End With ' loop through the record set ' processing the records and fields. Do Until rdoRS.EOF With rdoRS ' your code to process the fields rdoRS.MoveNext End With Loop ' close record set ' close connection to the database rdoRS.Close cnMySql.Close End Sub But what else needs to go into it?
  2. Hey there, so basically I'm working on converting a game server (written in VB6), that saves account information locally, to one that saves in through MySQL. I'd prefer not having to do this (as it seems like a lot of work), but if so, is there an efficient way to do this? Am I better off just leaving the server file as is? Here's the source for the game server Sub LoadPlayer(ByVal index As Long, ByVal Name As String) Dim filename As String Dim F As Long Call ClearPlayer(index) filename = App.Path & "\data\accounts\" & Trim(Name) & ".bin" F = FreeFile Open filename For Binary As #F Get #F, , Player(index) Close #F End Sub Any and all help/criticism/advice is welcome!
  3. tfinck

    SDL Help

    Hmm yeah, I see what you mean there, on top of that, it seems the benchmarks between SMFL and SDL are also OpenGL vs Software rendering. I'm sure a benchmark using OpenGL with SDL would warrant better results no? (As I believe SDL does support OpenGL)
  4. tfinck

    SDL Help

    I looked at SFML too, and yeah, it is a lot better. [color="#006600"][font="Courier,"]1/ Test : sprites SDL displayed 9 frames SFML displayed 303 frames --> SFML is 3366% faster than SDL 2/ Test : alpha-blended sprites SDL displayed 5 frames SFML displayed 216 frames --> SFML is 4320% faster than SDL 3/ Test : rotating sprites SDL displayed 3 frames SFML displayed 277 frames --> SFML is 9233% faster than SDL 4/ Test : static text SDL displayed 416 frames SFML displayed 6092 frames --> SFML is 1464% faster than SDL 5/ Test : dynamic text SDL displayed 363 frames SFML displayed 948 frames --> SFML is 261% faster than SDL[/font] [/quote] Seems much faster, but I thought I'd learn both anyways, just to broaden horizon a bit.
  5. tfinck

    SDL Help

    Yeah haha and I just noticed that too! Thanks for pointing that out, now I feel kind of silly
  6. tfinck

    SDL Help

    Yes, I did. And I actually managed to get rid of the majority of problems. (simply changed the load_image(std::string filename to load_image(char* filename) and removed the c_str as it was pointless. I think the tutorial I'm following is fairly old, and some of the functionality must be broken (not the first problem I've had with it). Thanks for the reply though!
  7. Hey there, I've been learning SDL lately, and trying to make a function to optimize images for output, but I'm having some problems. Firstly, this is the function that I have SDL_Surface *load_image(std::string filename) { //Temporary storage for the image that's loaded SDL_Surface* loadedImage = NULL; //The optimized image that will be used SDL_Surface* optimizedImage = NULL; //Load the image loadedImage = SDL_LoadBMP( filename.c_str() ); //If nothing went wrong in loading the image if( loadedImage != NULL ) { //Create an optimized image optimizedImage = SDL_DisplayFormat( loadedImage ); //Free the old image SDL_FreeSurface( loadedImage ); } //Return the optimized image return optimizedImage; Now this seems all good and whatnot, but I get these errors. C:\Documents and Settings\Home\Desktop\SDLg1\MiniSpriteGameSDL\main.c|17|error: syntax error before ':' token| C:\Documents and Settings\Home\Desktop\SDLg1\MiniSpriteGameSDL\main.c||In function `load_image':| C:\Documents and Settings\Home\Desktop\SDLg1\MiniSpriteGameSDL\main.c|26|error: `filename' undeclared (first use in this function)| C:\Documents and Settings\Home\Desktop\SDLg1\MiniSpriteGameSDL\main.c|26|error: (Each undeclared identifier is reported only once| C:\Documents and Settings\Home\Desktop\SDLg1\MiniSpriteGameSDL\main.c|26|error: for each function it appears in.)| ||=== Build finished: 4 errors, 0 warnings ===| I honestly have been scratching my head at it for a while :\
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!