Files

> > CS2D > Lua Scripts > MikuAuahDark: Reconnect-Restore v1.1
Files overviewCS2D overviewLua Scripts overview

English MikuAuahDark: Reconnect-Restore v1.1 >

15 comments3 kb, 419 Downloads

old MikuAuahDark: Reconnect-Restore v1.1

MikuAuahDark
User Off Offline

Reconnect-Restore by MikuAuahDark

∗ Table of Contents ∗
1. Description
2. Features
3. Installation
4. Configuration
5. Reserved Variables
6. Useful Info
7. Notes
8. Limitations
9. Rules
10. Version History

∗ Description ∗
Just long time not uploading a script. Hey wait, i'm still alive, i'm just start learn to be a music producer.
This Lua allows you to restore all of your stats, position, weapons, and addtional script-specific stats data when you reconnect from connection problems.

∗ Features ∗
> Restores weapon and ammo(uses file cs2d MikuAuahDark: Log Capture v1.0 )
> Delete saved data after x seconds(configurable, uses file cs2d Timer Extra function(timerEx) v4.0 )
> You also can use file cs2d [ADMN, DEV] Permissions - WIP if you want.
> Should compatible with another scripts(also you can save script-specific data, example: your saved position in blocker's roleplay lua)

∗ Installation ∗
Install it as usual(see download page)

∗ Configuration ∗
> Recs.Permissions - Use VADemon's permissions(default false). The permission is reconnect.restore
> Recs.IPMatch - Match only x sequence of IP(default 3). If you only expect static-ip only, set to 4
> Recs.Timeout - Delete saved player data after x seconds(default 60)
> Recs.AddtionalData - List of table reference that retrieved when timeout(another script-specific table should be here. Just put the table name without quotes)

∗ Reserved Variables ∗
> Recs
> timerEx*
> freetimerEx*
> LogCapture*
* - Doesn't re-allocated when already exists

∗ Useful Info ∗
> 223 lines of code
> You can add your addtional data with table.insert(Recs.AddtionalData,<your data table name without quotes>)(key is player id)
> Uses 3 hooks(cs2d lua hook log,cs2d lua hook leave,cs2d lua hook join)
> It only save player data when leave reason is 1 or 9

∗ Notes ∗
1. Again, again, and again. Your feedbacks, bug reports on comments.
2. This is my first lua which uses UNIX End-Of-Line system.
3. I just test some parts of it. Like, it's basic feature.
4. Sometimes it doesn't set your weapon to your last-used weapon
5. Because bug in v1.0, you can update to v1.1 by replacing line 174 with this
local t,ain,a=w:match("Titem: #0, pl: %d+, typ: (%d*) %([^,]*%), a: (%d*)|(%d*)")


∗ Limitations ∗
> Skin look doesn't saved.

∗ Rules ∗
√ You can use it for your lua and your server
√ You can edit it
√ Share to others
√ Say user MikuAuahDark made it
√ Reupload with me on credits
× Say you made it
× Redistribute your edited version
× Re-upload without me on credits

∗ Version History ∗
> V1.1
>>
FIXED
Saving only works for player with ID 1
> V1.0
>>
INFO
...

I'm sure that screenshot doesn't needed
edited 1×, last 22.12.14 11:06:00 am
Approved by Seekay

Download Download

3 kb, 419 Downloads

Comments

15 comments
To the start Previous 1 Next To the start

Log in!

You need to log in to be able to write comments!Log in

old

Ajmin
User Off Offline

1 of the Awefull lua
I like it!

old

NiceBad
User Off Offline

Itihink this simple but good
I like it!

old

SpriNG
User Off Offline

Its pretty much useful, it really deserves a like.
I like it!

old

MikuAuahDark
User Off Offline

@user VADemon: Ok, i'm gonna add it later. Now i'm focus at music(learn to make music).

old

VADemon
User Off Offline

user MikuAuahDark in case when there's another building - simply do not restore.
I like it!

old

MikuAuahDark
User Off Offline

@user VADemon: well, restoring someone building can cause undefined berhaviour when someone also building at same position

old

VADemon
User Off Offline

A nice script for RPGs.
I thought a bit about construction servers: they tend to run for hours without restarts, but when a player leaves cs2d cmd mp_killbuildings allows buildings to remain. How about restoring these? (Only when the buildings were not destroyed or rebuilt)
I like it!

old

TrialAndError
User Off Offline

When I was reading the title.. I tought it was going to fix the issue with the /reconnect fix. But it's useful.
I like it!

old

XoOt
Super User Off Offline

@user Hellcat:
Pointless. If you want to learn how this works open the lua and simply read it. Screenshots wont help as its not supposed to be visible. Its a auto stat saving system. Means if you lag out of the game and reconnect you will just continue where you stoped before.

old

UnkN
User Off Offline

Restore money, level, after reconnect. Good description.
I like it!

old

MikuAuahDark
User Off Offline

@user Yates: What does i mean stats is health, armor, maxhealth, and money. Please note that it doesn't save score and deaths because it would lead to problems in stats file.
Also what i mean script-specific stats data is a data that only another script have(example, worldedit selection). It only saved when a player getting connections problems(timeout)

old

Hellcat
GAME BANNED Off Offline

user Yates: Screenshots for to learn better

old

Yates
Reviewer Off Offline

@user Hellcat: Nope:
Quote
This Lua allows you to restore all of your stats, position, weapons, and addtional script-specific stats data when you reconnect from connection problems.

The only thing this needs is a cleaner description. I can't stand reading this.

old

Hellcat
GAME BANNED Off Offline

Yes, Screenshoot needed.
To the start Previous 1 Next To the start