1. When making a thread, please tag your thread accordingly using the menu to the left of the textfield where you name your thread where applicable. Server Advertisements and Mod Releases should be contained to their respective subforums.

Server Discussion SharpStar - Proxy server with support for C#, Python, Javascript, and Lua plugins

Discussion in 'Multiplayer' started by Mitch528, Feb 8, 2014.

  1. ArchGaden

    ArchGaden Big Damn Hero

    Galaxy Citizen, #3 by 'most played' on the list. 17 players online as of this post and we're about 7-8 hours out from hitting prime time for us. I'm certainly not trying to brag or anything... and with all the crashing, world corruption, and grief issues we have, there isn't a whole lot to brag about. For the players that get through that though, there is a bustling rich RP community.
     
  2. Blaze9

    Blaze9 Subatomic Cosmonaut

    Numbers have always been declining for us (Aegis #7 on list) but mostly due to our own issues. Happily I have seen a rise since I updated and redid the entire server myself, but 15 players is a far cry from the 120 we used to have at prime time.

    Edit: When I said global bans I was joking, Mcbans didn't really work out for most servers.

    Edit2: I have no idea how to code C#, and my Java is pretty basic.
     
  3. ArchGaden

    ArchGaden Big Damn Hero

    Right now we're sitting at #1 most played with 51 online...crap... I really gotta make this stuff work out and fast! I'm making progress with packet throttling. My theory on how black damage was working is a bit off, but I'm getting the hang of things. 'Damage Tile Group' packet is unknown to SharpStar...and presumably everyone right now BUT I found that the size of the packet correlates to the destruction involved. 87 is the size of the packet when a diamond drill is involved...so easy to cap! Goodbye modded mining tools! Now I just need to handle insane black damage from weapons...

    Sadly, we weren't even a 'big' server back during Starbound's prime. The lack of server support has caused pretty much all the big servers to die out. There aren't many of us left.

    C# is pretty easy to pickup. Also Visual Studio Express is free and pretty swanky for being free.
     
  4. Blaze9

    Blaze9 Subatomic Cosmonaut

    I think I might have some form of Visual Studio from when I was trying to learn C++.

    That packet sounds like a great lead!

    While there is Boundstar and you. And everything else is pretty much whitelisted.
     
  5. Mitch528

    Mitch528 Big Damn Hero

    Version 0.2.5
    Now using SocketAsyncEventArgs (which theoretically should boost performance).
     
  6. ArchGaden

    ArchGaden Big Damn Hero

    I've mastered blocking large mining tools... now I have to handle explosive projectile damage. Unfortunately, there isn't any information I can find on deconstructing projectile/explosion information.

    Awesome!
     
  7. Mitch528

    Mitch528 Big Damn Hero

    The Entity Create Packet might be what you're looking for.

    -------------------------------------

    New Plugin (Web):
    - This plugin enables access to various information from a SharpStar server through the web in real-time via WebSockets. It can be found at the plugins page on the wiki.
     
  8. ArchGaden

    ArchGaden Big Damn Hero

    I saw that, but there isn't enough information decoded to make use of. I can tell if an entity is a projectile...and that's about it. I'm not blaming SharpStar or anything, I can see that you've implemented just about everything that is known about starbound's packet structures.

    As we know the entity create packet is

    uint8 Entity Type
    uint8[] Store Data
    sVLQ Entity ID

    I glanced at StarryPy to see what they're doing and it goes something like this

    uint8 Entity Type
    VLQ Length of string
    string Entity data (length described by previous VLQ)
    sVLQ Entity ID

    It looks like StarryPy has gone one step farther than what is widely known and presumably that string can be parsed to get some information about the projectile. I'll see if I can modify SharpStar to handle that and report back if I have any luck tonight.

    Effectively what I'm wanting to do is allow projectiles but block explosion damage. As far as I can tell, explosion damage from weapons is the result of information passed up to the server about the projectile/explosion config info, rather than actually triggering tile damage from the client. I'd have to actually parse that 'Store Data' information. StarryBound (before its implosion) implemented a projectile blacklist, so they were parsing that information to get a projectile string somehow. If I could get to that, it would be a viable solution... I could block any projectile that isn't in the server's known projectile's list. I'll try to dig into it again tonight.

    I still have to handle block damage/creation from placed activated objects as well... which is probably also projectile based but I haven't looked into it. Griefers have been known to place objects that explode when used. I've seen a planet buster variation...and a variation that fills a planet with poop blocks. Yep...griefers have evolved to become the undisputed kings of fecal matter creation. This is no doubt based on that matter compressor thing that makes dark matter blocks when used.

    Much work to be done!
     
  9. Mitch528

    Mitch528 Big Damn Hero

    Just pushed a commit that has information on projectiles. So, you can do something like:
    Code:
    foreach (var entity in packet.Entities)
    {
    
        if (entity.EntityType == EntityType.Projectile)
        {
    
            var pEntity = (ProjectileEntity)entity;
    
            string projectile = pEntity.Projectile;
    
            foreach (var kvp in pEntity.Information)
            {
                Console.WriteLine(kvp.Key + " " + kvp.Value.Value);
            }
    
        }
    
    }
    
     
  10. ArchGaden

    ArchGaden Big Damn Hero

    Excellent! I look forward to playing with that tonight.
     
  11. Underbalanced

    Underbalanced Phantasmal Quasar

    I know everyone is worried about greifers. Just wait it out, for the sync of mods. Or make plugins, But the core wrapper should be just a frame work for add ons, so that it remains the most efficeant possible with out being bogged down. With a good core framework, the apps well come, they say!
     
  12. ArchGaden

    ArchGaden Big Damn Hero

    100% agreed on having plugins handle the functionalty with the wrapper acting as framework. That is what brought me to SharpStar... no bulky built-in half functional 'solutions'.... just clean wrapper with the ability to add what I need.

    I've tried the 'wait it out' strategy though... and after months of that I've lost faith that the starbound devs care about the server software at all... I mean, we're getting monsters parts and upgradeable ships now instead of admin commands and the ability to block client mods...I think at this point, we pretty much have to handle the server software ourselves.
     
  13. Blaze9

    Blaze9 Subatomic Cosmonaut

    Sadly, yes. At this point it would be amazing if we could write a full custom server as opposed to a wrapper, that way we can actually control the basis of how servers work pertaining to the flow of information between clients as well as the server.
     
  14. ArchGaden

    ArchGaden Big Damn Hero

    I think there is one in the works actually. on http://starbound-dev.org/ , I noticed 'ROFLCopter64bit' seems to be a total server rewrite. As much as we don't know about the packet structures and internal workings of the server, I can't imagine the recode server works very well yet, but it has potential to get there. Both World of Warcraft and Ragnarok Online had fan-made server software created for them. Starbound is rather an easier target, so hopefully we'll get that eventually!

    SharpStart plenty of control for now. I just wish we knew more about packet structures...and on that note,

    So I dug into projectiles and found it is actually the 'effect' entity that does block damage, not the projectile entity.
     
  15. Blaze9

    Blaze9 Subatomic Cosmonaut

    Why is that a thing? I would expect effect to be applying an effect to what it hits, not explosion damage!
     
  16. ArchGaden

    ArchGaden Big Damn Hero

    We ran our first live test on the server Sunday and things didn't go quite well. We had some issues getting SharpStart to run at all. I was able to get the 4.0 .NET version running by manually including system.numerics and system.security. It doesn't seem to be part of mono 2.1 or mono 3.2. That method of including doesn't work for the 4.5 .NET version though.

    Missing was method System.Numerics.BigInteger.Parse and something else in System.Security.Cryptography

    Performance wise, things were pretty bad even compared to our usual and there were seemingly random client disconnects. It could be due to my plugins or some issue with mono. I want to try and get the 4.5 .NET version going and test with no plugins to see if we can get reasonable performance... it could be that our server is just too big for a wrapper in linux. I understand starbound actually performs better in windows (which is unusual) and all the wrappers seem to be aimed towards that. I think we're stuck on a linux box for the forseable future.

    I tested with two plugins both of my own make: A chat bypass plugin (to keep chat away from laggy starbound) and an access control plugin I created that handles most other functions... permission levels, player and admin commands, some throttling of projectiles/effects, and a half implementation of planet protection. I'm sure there are some bugs in the access control plugin.
     
    Blaze9 likes this.
  17. Mitch528

    Mitch528 Big Damn Hero


    Oh shoot. Forgot to include System.Numerics. I haven't encountered the error with System.Security.Cryptography though, odd. As for performance, it could be that I messed something up with the new socket implementation, so try this commit and see if that helps. Using the .NET 4.5 version probably won't help with performance. I included a .NET 4.5 version because Python plugins won't work without it on Mono. The plugins might be causing the random disconnects, as if there are any exceptions, it disconnects the client. I'll be changing that soon though. Also, if you could start SharStar through VS in debug mode and possibly see if there are any unusual Exceptions that would be a great help.
     
  18. ArchGaden

    ArchGaden Big Damn Hero

    Things work flawlessly in my home tests... on windows... with a handful of clients connected. I'm not surprised to hit trouble in linux on a server with a ton of players piling on as soon as it's up. The System.Security.Cryptography error only happened after the server was up and people started connecting.

    I do suspect the random disconencts are my fault with some work I did in the plugins. I did quite a lot of work rather quickly over the last week and I'm sure there are bugs because of it.

    See if this image attaches correctly for the cryptography error...

    [​IMG]

    To fix the crypto error, I had to manually include system.security, just as I had system.numerics. You might want to check that.

    Beyond those few errors, writing plugins in C# was a breeze after the setup. Once I get my chat bypass plugin cleaned up and commented, I'll post that. The custom access control goliath plugin is too specific to our server to much use to anyone in it's current form...and it needs a lot of work anyway. I'll probably post it eventually after much improvement.
     
  19. Mitch528

    Mitch528 Big Damn Hero

    How many players were connected on your home server vs on the linux one? Also, if you can, try that other commit and see if there are any differences in performance.

    Both System.Numerics.dll and System.Security.dll will be included in the next commit.

    Great! Can't wait to see the plugin :).
     
  20. ArchGaden

    ArchGaden Big Damn Hero

    I'll see about testing the other commit tonight if I can manage it. My home tests were mostly with 1-4 clients all on LAN...so no surprise things go well for that. The linux server had roughly 20-30 players trying to play at the time, which is pushing starbound's limit anyway. We're probably the worst case test scenario you're going to see.
     

Share This Page