wwevo / 7dtd-chrani-server Goto Github PK
View Code? Open in Web Editor NEW7 Days to Die remote and chat management script (bot)
7 Days to Die remote and chat management script (bot)
So far, the routine man_where_is_my_pack does not check if the backpack has already been picked up by the player or emptied. Therefore a player could teleport to this position as long as he or she wants to or if a new backpack position has been set because of a new death. It should be added, that the command does only work, if the backpack still exists.
need a way to reinitialize the bot when the game-server restarts. at this time, the threads simply run in an infinite loop, but the telnet authentification will be gone and nothing useful is being done from that point on.
we need a working background thread to observe players and what they do- we want to kick people with certain names, teleport people out of certain regions for example, hight ping kicking, auto-kicking of idle players or players stuck in the lobby. those things
to get this thing viable for constantly full servers, we need a reserved slot feature to accomodate donators and mods and stuff
Chinese? Nope
Russians? Nope
Americans? Yes!
Germans? Maybe some.
Europeans in general? weeeeeell, okay
Not sure if a 'Typeable name' rule in the name-detector could be sufficient
I'd like to be able to pass certain parameters from the command-line to the script.
path to setup file, bot name and the namespace. that way i can easily test my bots on different servers without having to edit the original files :)
scan players for clipping through the world, kick them if they do
the regexp for chatlines seem to crash the bot under certain conditions
m = re.search(r"^(.+?) (.+?) INF Chat: '(.*)': /(.+)\r", response)
#group(1) = datetime, group(2) = stardate?, group(3) = player_name group(4) = bot command
m = re.search(r"^(.+?) (.+?) INF PlayerSpawnedInWorld (reason: (.+?), .* PlayerName='(.*)'\r", response)
#group(1) = datetime, group(2) = stardate?, group(3) = reason of respawn group(4) = player_name
take in these two expressions. I need the results to be ordered or accessible by name, so I can access the playername or any other field without having to know from which expression they come.
kick all players with a name you can't actually TYPE on a keyboard (hardest setting) or just some forbidden words (lowest setting)
we need to know which players are online. since we transparently access the database, we can't simply look who's in the player-array. so a regulary refreshed current player list seems to be needed. or some mechanism that set's a flag in the database. but i'd like to do this from active memory rather than a database setting that needs to be maintained
waiting for results in telnet chat can take quite some time, possibly even essentially stopping the script
I have removed all checks for now cause it halted the execution. these commands possibly have to be executed on their own thread or something, eventuall I DO want to have confirmation and i do not want o keep a log off all commands issued and check them later...
working on the lobby system, teleporting players back, i encountered the problem of the code being too fast, porting the player back twice or three times in a row. such functions concerning boundaries need to have a check when they were ran last, so this does not happen
telnet-scan needs to react to player died messages. note if they are authenticated, port them back to lobby after respawn if they are not
provide function to send pm's to players.
I'd like to internally work with steam id's as unique identificators
Writing shit in chat nigga? yo ass is banned yo! heil hitler!
in order to allow dynamic function use, i figure we need to be able to pass all required functions to the bots threads (TelnetObserver mainly). Can't have all methods wedged in that file :)
I've started making the methods independent of their class
can functions still depend on class variables after they were injected?
i would love to have something like this:
match_actions {
'r"^(.+?) (.+?) INF Chat: '(.)': /(.+)\r"' : actions {
"set up lobby" : set_up_lobby('how to get parameters in here?')
"take me home": take_me_home()
}
'r"^(.+?) (.+?) INF GMSG: Player '(.)' (.*)\r"' : actions {
"joined the game" : on_player_join()
}
}
telnet_observer_thread = TelnetObserver(telnet_observer_event, TelnetCommand(HOST, PORT, PASS), Player, Location, match_actions)
so in the actual TelnetObserver i could use
for match_group in match_actions:
for action in match_group
execute action!
I don't know python well enough, so I kinda need advice here
realize a ping-kicker that samples data over a few seconds (dunno, like what, ten? 15?) and kicks everyone with a too high average ping
to allow for several convenience features, I need a way to calculate in which chunk a given coordinates is
this will be required for automated LCB removal for example, since the chunk it's in has to be loaded. best way i can think of is waiting until any player is in there and then issue it
this will require a playerObserver thread
can't have exceptions stopping our mission! bot I mean!! nothing's gonna stop us nooooow ^^
function to send a message to the global chat
the telnet crashes the bot when it's not able to reach the server
have it store the current player-position as home-coordinates in the db
return a PM to the player, stating the success or failure
fields and values, fields and values!!
When disabling the player-poll, the timeout in the global loop stops working cause there's no activity on the games telnet (when the server is empty for example)
I've tried setting a timeout to the read-function, but that will break the loop if triggered for some reason. looks like i will need a debugging tool :)
get some neat regexp to sort out the playerdata, store it in a table for later use
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.