Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/02/2015 in all areas

  1. Hey, first of all it's nice to see someone as enthusiastic about helping out with the development part of this old but lovely game. As you guessed it, the ultima source is indeed based on tethealla with quite a bunch of tweaks and fixes. We're absolutely aware that the code is far from perfect and could use some polishing up, or even be recreated from scratch with a more OO approach (working slowly on that in C# in my scarce spare free time, but that's another story). So, moving on to your points : The login server allocates memory up front for the maximum possible client connections. Each connection is about 2Mb. That is far too much for what it's used for. The majority doesn't need to be held onto. In main()'s socket loop, each client has its own set of data buffers which are populated and later processed. Memory usage could be cut down by reusing a single buffer for all clients: populate the buffer and process the data immediately, then who cares about holding onto that buffered data? Just move on to the next connection. The setup and the processing are pointlessly disconnected from one another and wasting all that memory. The only benefit I see from this approach, is that this allows for a smoother debug, and making sure that one buffer doesn't interfere with another client. The buffer should be completely thread-safe to guarantee that no garbage data is being passed on from one client to another. But it's indeed more common nowadays to see one buffer doing the work for all clients. The login server has 46 unique MySQL queries in its source file. The queries are all for the most part formatted by sprintf() and directly executed. This method sends the query string to the server, which has to parse it every time. Prepared statements could help improve this situation, at the expense of some of the MySQL server's memory. Prepared statements are parsed by the MySQL server a single time, data is bound to placeholders in the query, and only the data itself needs to be transferred. This would benefit queries that are executed many times. Drawbacks would be setting up the prepared statements in the server code and the fact that the MySQL server has to store the statement handle. I fully agree that prepared statements are a safer and more efficient approach, together with a strong filtering system on passing on the arguments to it. Another option would be more stored procedures, but the drawback of those is that they need to be implemented on the actual SQL server and that it would slightly compromise the flexibillity to be able to use a different db type in the future. (for example Postgresql). But since the syntax has its 5% difference between several SQL db's, I guess it's not as flexible now anyways. (PDO ftw). But yes, prepared statements have great benefits in regards to SQL injections or even coding errors. MySQL transactions might worth using for certain database actions (they are not used in the Tethealla source I'm looking at). These can make a series of data changes atomic. Performing multiple steps like "remove an item from the player's bank" followed by "place the item in the player's inventory" would be guaranteed to never perform one action without the other; either both happen or neither happen. The item is properly moved or safely stays in the bank. Despite how it sounds, this is the least important of these things I'm bringing up. I made a post on pioneer2.net with a new proposal for the database architecture where I also aim for a more granular approach in saving data to the database. This allows again for more flexibility for the programmer, less network overheat and overall a cleaner way to store data. Problem is, the client expects one big blob of data anyway, so we would have to parse and re-assemble the blob in the server on the fly. (Which is not really a problem actually lol) Numerous chunks of code are copied and pasted in multiple places throughout the source files. This is a nightmare to maintain. Better be sure that if you update one, you update all the other instances of the same function! Help keep earth.c clean and recycle. There's no excuse for slapping multiple copies of the same code everywhere and pointlessly bulking up the source files. Also, there are many massive functions that should be broken down into several smaller functions. Hence I'm trying to remake it with an OO approach, so much easier to expand and maintain. But it takes time to work on it, time I don't really have with my fulltime job... Would be great to get help on this. If you're interested I could throw it in a GIT repository so we could work together on it. Was planning to make it opensource anyways, but it's still in a very early stage, so don't expect anything functional soon. Existing libraries could be used to cut down on the server's code. Two prime choices for removal are the MD5 and the Mersenne Twister implementations. MD5 can be done for a Windows platform through the Cryptography API or for linux through libgcrypt. The Mersenne Twister is available from <random> in C++11. Both the crypto and the twister libraries are available in Visual Studio 2012. Yeah, some libraries are outdated/obsolete with nowadays technology. Dusting those off would be a good idea. If using C++, the MySQL C++ connector library could be used in place of the C API. This would greatly simplify the MySQL interface, especially for prepared statements. I will always be pushing for C++ here. The STL would be hella sweet to be using: easier to manage containers of objects like the client connections, easier to parse the configuration files, easier to break peoples' spirit by using templates, etc. C++, awwwyissss. As a side note, fuzziqer's newserv is in "C++" but makes absolutely no use of anything C++ that I could see when browsing through that project. Kind of depressing. Personally I don't like C/C++ all that much, I would have chosen any other OO language over those. I know OO can be done with C++ but still, jsut not my cup of tea. Aside from the Tethealla source, I've been thinking about the PSO control panel, which can easily be done from the database viewpoint. Honestly, the only hard part would be the user interface. Exactly as chuk stated in that original thread about the panel, knowing if an account is online is the single most important part of this. And to be a complete jerk about it, I will tell you right now that I am keeping the specifics to myself to attempt to gain leverage for myself. When working on the mana client, I found a way to check if a player is online or not. Even better, it shows a list of all online players with some basic information. Just hasn't been a priority to fix the CPanel for now. I also began looking into the client's disassembly but am not yet in a position to report anything since I just started looking at a few functions of interest. So yeah, the whole point of this nonsense is to get the admins' attention and let them know I do mean business. If you say no to me, I will stop whining about wanting to do development stuff and just chill. I will be quite disappointed if I only get silence from the admins here, like at how it seems to be at pioneer2. If you say yes, I will try my best. On the contrary, you bring up some valid points that most of us already talked about but never really got motivated to fix. Ofcourse we won't just give you access to the server code rightaway, but if you can make a solid proof of concept with the tethalla source, we'd be glad to add fixes to our source. And if it all goes smooth, over time you might be able to work your way into the ultima developer ranks PS: I'd like to go deeper over some subjects, but I'm at work now, so can't really spend too much time on this now.
    2 points
  2. I just won't shut up about this stuff and go away! I've been looking more through the Tethealla source here and there since last weekend. Here are my thoughts on it. Does this all apply to Ultima's code at all? I don't know. At minimum, I'd like to show that I am serious about contributing my time. Anyway, here's what I've been poking through. The login server allocates memory up front for the maximum possible client connections. Each connection is about 2Mb. That is far too much for what it's used for. The majority doesn't need to be held onto. In main()'s socket loop, each client has its own set of data buffers which are populated and later processed. Memory usage could be cut down by reusing a single buffer for all clients: populate the buffer and process the data immediately, then who cares about holding onto that buffered data? Just move on to the next connection. The setup and the processing are pointlessly disconnected from one another and wasting all that memory. The login server has 46 unique MySQL queries in its source file. The queries are all for the most part formatted by sprintf() and directly executed. This method sends the query string to the server, which has to parse it every time. Prepared statements could help improve this situation, at the expense of some of the MySQL server's memory. Prepared statements are parsed by the MySQL server a single time, data is bound to placeholders in the query, and only the data itself needs to be transferred. This would benefit queries that are executed many times. Drawbacks would be setting up the prepared statements in the server code and the fact that the MySQL server has to store the statement handle. MySQL transactions might worth using for certain database actions (they are not used in the Tethealla source I'm looking at). These can make a series of data changes atomic. Performing multiple steps like "remove an item from the player's bank" followed by "place the item in the player's inventory" would be guaranteed to never perform one action without the other; either both happen or neither happen. The item is properly moved or safely stays in the bank. Despite how it sounds, this is the least important of these things I'm bringing up. Numerous chunks of code are copied and pasted in multiple places throughout the source files. This is a nightmare to maintain. Better be sure that if you update one, you update all the other instances of the same function! Help keep earth.c clean and recycle. There's no excuse for slapping multiple copies of the same code everywhere and pointlessly bulking up the source files. Also, there are many massive functions that should be broken down into several smaller functions. Existing libraries could be used to cut down on the server's code. Two prime choices for removal are the MD5 and the Mersenne Twister implementations. MD5 can be done for a Windows platform through the Cryptography API or for linux through libgcrypt. The Mersenne Twister is available from <random> in C++11. Both the crypto and the twister libraries are available in Visual Studio 2012. If using C++, the MySQL C++ connector library could be used in place of the C API. This would greatly simplify the MySQL interface, especially for prepared statements. I will always be pushing for C++ here. The STL would be hella sweet to be using: easier to manage containers of objects like the client connections, easier to parse the configuration files, easier to break peoples' spirit by using templates, etc. C++, awwwyissss. As a side note, fuzziqer's newserv is in "C++" but makes absolutely no use of anything C++ that I could see when browsing through that project. Kind of depressing. Aside from the Tethealla source, I've been thinking about the PSO control panel, which can easily be done from the database viewpoint. Honestly, the only hard part would be the user interface. Exactly as chuk stated in that original thread about the panel, knowing if an account is online is the single most important part of this. And to be a complete jerk about it, I will tell you right now that I am keeping the specifics to myself to attempt to gain leverage for myself. I also began looking into the client's disassembly but am not yet in a position to report anything since I just started looking at a few functions of interest. So yeah, the whole point of this nonsense is to get the admins' attention and let them know I do mean business. If you say no to me, I will stop whining about wanting to do development stuff and just chill. I will be quite disappointed if I only get silence from the admins here, like at how it seems to be at pioneer2. If you say yes, I will try my best.
    2 points
  3. Happy hours started!
    1 point
  4. Not really. Drill launcher is listed as a rifle, but it has like mechgun range. Only other non ranger rifles are holy ray(680 mst) and bringers rifle(ra/fo only). Asteron Striker has 60 base ata, so with no hit it would be equivalent to a 35 hit hell raygun. Hucast will probably need more than that, he'll sometimes struggle even with 50hit hell raygun. Asteron Striker has 380 atp, making it one of the strongest atp ranged weapons he can equip, on par with master raven and grinded red handgun, so it's ok atp for %s to scale on. Not many places where you need rifle range over handgun range though. Without hit they are fairly cheap, 10-15. With high hit they can command a very high price (150+ at least), since ones with hit are few and far between, and not sold often. All Rangers and Hunters except for Hunewearl can use it. 120 ata required. Also striker unit mag will make it have divine punishment on even 100 beats just like heaven punisher.
    1 point
  5. Drill launcher? xD (other rifle) Is it worth having an Asteron Striker without hit? 1 out of 8 how lucky do you feel Do other percentages matter for Asteron Striker? it's good for first hit -v502 is a must How much PDs would a Asteron Striker cost with or without hit? 8-15 i sold mine for 12 no hit with hit much more bought an 80 hit for 35 donation tickets Which classes can wield AS and how much ATA does it require? Hunters except hunewearl and rangers 120 ATA X_x
    1 point
  6. Godric (had been a while since he was mentioned in this topic)
    1 point
  7. I'm by no means an expert in programming.. but i like the points you stated from some of them Memory... i can't test with 70-100 clients at a time... as far as that goes i think memory is not really an issue (but is always good to keep everything in shape). Queries ... indeed... in my database manager i was using simple statements... later changed everything for prepared ones for security/simplicity/etc . Reusing code... i have been improving this in my projects a lot.. i don't like to have 2 or more things that do the same (i mean like irl or my pc) same goes for the code. SQL Connector.. i made my database manager in java and i use the connector for java... it would be awesome integrating this into the server. (I'm not admin... but i like it, hope larva looks at it )
    1 point
  8. 1 point
  9. Also, the new government quests for Blue Burst, accessible from the Principal's Office in Normal Mode (i.e. multiplayer), unlock each tier of the One Player Missions. You will have to do up to 2-1 to unlock Caves quests, 3-1 for Mines quests, and 4-1 for Ruins quests. Once you have 4-1 unlocked in multiplayer mode, you will be able to do those old missions in One Player mode. You can do the Government Quests on normal difficulty and they will unlock on all difficulties, as will the one player quests, but that also means that you can only obtain 1 Soul Eater per character from the on player quests now (doing multiple difficulties will not give you another soul eater on a character that already obtained one). Also, Soul Eater is a drop in the Christmas Event, so it is possible to obtain one with actual %s in December/January.
    1 point
×
×
  • Create New...