Jump to content
SubSpace Forum Network

Recommended Posts

Posted (edited)

Attached is the latest version. It is a release candidate, therefore I am scraping the current version coding I was using, and calling it version 0.1.0 Previously released code will be collected at a later date and placed onto a webserver, and they will be reversioned as 0.0.1, 0.0.2, etc. Yes, it's revisionist history.

 

No major known problems exist with it yet, and it appears stable. There is, however, one that issue manifests itself as very similar to the lag coma of HS's yore. This only appears once in a while, I cannot induce it, and it is not a crash. I have been unable to isolate it, but it has only happened to me 3 times. I don't know if the program enters perpetual sleep, of if the server just stop sending, or if recv stops returning useful data. Backtracing after interrupting it after a hang says it's either asleep, or in recv(), which is a normal main idle loop.

 

Occasionally a very large packet appears, and it starts with several screens of lines all of which are null, contains some junk in the middle, and ends with more nulls. I think it's the map but nothing identified it, it just starts off with a bunch of zero value characters.

 

The arena change and crash bug has been solved. It was a deallocated but not dereferenced pointer to the chunk class message buffer. That's why it would only work 1 time. Therefore, !go is now functional.

 

The settings loader appears to behave properly. There are no more detected issues with that, except for a blank value on a key-value pair will cause a segfault. This should be an easy fix, but it's low priority, so just don't do it for the time being. Either remove the line, or put a value there.

 

There are no threads yet. I planned to stabilize a threadless version before adding them, and I appear to have done so. I will welcome feedback before attempting to introduce threads. A high priority fix is non-thread-safe code, excluding parts that will require mutex locks, they will be added.

 

One can search for marked areas of code that require work by searching for //FIXME:, //HACK:, and //TODO:. Eclipse will mark these for you if you add them as Task tags. These are the order of priority, and DEBUG doesn't actually require fixing, it's just debug code that will be removed.

 

There is no modular coding, yet. That will come after threads.

 

Many packets are handled, but simply ignored. This is what I intend to address over the next several releases. Player and flag information is a big issue and will take some time to get right, lots of packet processing. Reliables are still not handled properly, the bot merely pretends and just acks everything right away without logging it. This means data can be processed out of sequence. Nothing is sent reliably.

 

Bot ops are hard coded in bool auth(player *p) in command.cpp. Add yourself, it's case sensitive. Right now me, CRe, Dav1, LtNirvana, Dr Brain, JoWiE, and L Y N X are the ops. The only thing requiring op access is !die and !go.

 

It compiles clean with Eclipse using G++ (gcc) on OSX 10.4.11. There are depreciated headers and they will be removed. It is unix only, and should be fairly easy to compile on Linux.

 

Comments and feedback are encouraged.

explbot_0.1.0.zip

ExplBot_binary.zip

Edited by ExplodyThingy
  • 2 weeks later...
Posted

I have released version 0.2.0. Many versions in between existed but they suck and here is this one. Plugins work. Attached is the source to the bot, the binary of the bot, and the source / binary of a HelloWorld plugin that offers a !hello command.

 

Use !load and the relative path to the bot to load it. I need to use !load ../../hellworld/debug/libhelloworld.dylib. I will later release a tutorial on how to make a plugin. If you have Eclipse, create a new C++ project of type Share Library and use the three source files. Fix the one include to the relative path of the core bot.

 

Have fun. Make some plugins, like eightball or some sort of logger for player entering and exiting. The plugins right now can only react to a player enter, player exit, chat, and tick. It should be as feature complete as mervbot one day.

explbot_0.2.0.zip

ExplBot_binary.zip

helloworld.zip

  • 2 weeks later...
Posted

Attached is version 0.2.1

 

Reliables should be handled properly by next release, more handling has been added, more plugin support has been added, and lots more comments. Some framework for reliables is there but not really in use.

 

Two plugins with their sources are attached, helloworld and lagbot. You need to give !load a path tot he file. I use "!load ../../lagbot/debug/lagbot.dylib" so whatever you need to do, do.

 

LYNX got his to compile properly by using Eclipse. I can't find out why yet but eclipse just uses GCC. For some reason you will get iterator errors when running it otherwise. Not sure what thats about.\

 

I've moved all the settings for everything, even the plugins, into expl.conf You'll see, keep a naming convention so there are no conflicts later.

 

Have fun, bye.

explbot_0.2.1.zip

helloworld_c0.2.1.zip

lagbot_core0.2.1.zip

  • 3 weeks later...
  • 3 weeks later...
Posted
Not really. I did some stuff, I got really busy the past few weeks and I don't see it lightening up until Christmas time. I've fallen in love with Go in the past two days and may try that out, see what I can get going for it. Otherwise you should probably go ahead and do a bunch of stuff. The big issues I can think of are an undetected lagout, improper reliable handling, and not enough events sent to plugins. The latter should be the easiest, I just have to sit down and do it, and one day I will. The former the hardest, but not impossible. The reliable order handling is my priority, and I'm working on a priority queue for it, just as soon as I solve this referencing deallocated memory issue.
  • 8 months later...
Posted

I did more. 0.3.0

 

I realize I haven't updated this about 9 months, which is nearly long enough to create another human being, but instead I created a bot.

 

What have I done lately? Well, I lived a normal life for a while, but now I'm back to creating crap for this silly old game that just won't go away. Its like a puppy, constantly returning, looking for someone to love it. In terms of this nuance of the realm of ss, I scrapped the whole bot. By scrapped I mean I created a new project in Eclipse, and copied functions one at a time until I hit the problems, and solved those problems. I completely rebuilt the packet classes, and there are no more random errors in it. It seems to stay connected eternally, but won't attempt to reconnect. It runs each bot in its own thread, but I haven't tested more than 1 bot, nor have I tested spawning and immediately killing two bots. There is no proper thread reaping, so there is the potential for zombie threads. It stays connected and stable, as long as you don't put it in Public(0) for some reason, I'm working on that. The plugin loader still works as it did before. For some reason the cluster packet breaks quite often, that's something to do with calculating the next packet in the cluster, but it recovers gracefully. Player command authorization is still hardcoded in command.cpp, in isauth().

 

If you want to play with plugins, the previous version of lagbot works perfectly, and any plugin you've made should work. If you have done any personal development on this bot, send me code, and I will be sure to incorporate it. Not much serious has changed in terms of functionality.

 

Rock on, feedback much appreciated.

explbot_0.3.0.zip

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...