Poll

Custom compiled smx handling method

use a separate folder for custom compiled .smx
3 (25%)
use a ini file to specify which files not to update
6 (50%)
check plugin's build number to see if is a jenkins build or custom build
3 (25%)

Total Members Voted: 11

Voting closed: July 03, 2014, 03:23:08 PM

Author Topic: W3S Auto updater  (Read 4359 times)

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
W3S Auto updater
« on: June 15, 2014, 04:10:40 PM »
I am thinking of an auto updater plugin, it will download jenkins compiled .smx files onto your server when server admin runs an update manually.

However, this is hard to do when user has custom content. How should we handle versioning and custom content? The user may have compiled their own version of the race with slighly different numbers.

If user has his own version of a race, how do we deal with it?


Proposal 1:
User must have two directories under plugins folder:
plugins/w3s_autoupdated
plugins/w3s_custom

if a file exists in w3s_custom folder, autoupdate will not overwrite or update the file into w3s_autoupdated folder. This way the user just has to keep custom content in a separate folder that forces an override.

on the update server (ownageclan.com) there is no need to keep track of versioning for each single release as user can run update at will and no custom content shall be overwritten.

If user wants to update / revert back to an older version, the w3s_autoupdated folder will be wiped and freshly downloaded with an newer / older version while skipping files that already exists in w3s_custom folder.

Only smx is updated

User must enter a second command to confirm update, with warning that it will overwrite specified autoupdated folder

Proposal 2 by El Diablo:
If people don't want certain files overwritten, have them add those files to a INI file in the configs directory.  War3source can search that file, add it to an array, and make sure those files do not get touched on update... Or reject updating if one of those files might need the update... Just don't update at all if the file is in the list.

Proposal 3 by Necavi:
add a function to the war3source include which spits out the build number it was compiled with, defaulting to custom if it is a raw compile. Custom compiled .smx will not be automatically overwritten
« Last Edit: June 17, 2014, 09:00:16 PM by Ownz »

Necavi

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
Re: W3S Auto updater
« Reply #1 on: June 15, 2014, 09:05:03 PM »
I would recommend a "Running this command will overwrite any edits you have made to War3Source" message and a confirmation before running. Only updating the compiled version, not the source files, meaning they shouldn't lose anything they can't retrieve with a recompilation.

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: W3S Auto updater
« Reply #2 on: June 15, 2014, 09:42:23 PM »
added to original post

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: W3S Auto updater
« Reply #3 on: June 16, 2014, 06:50:06 AM »
Proposal 2:
User must enter a command and needs to verify that he's going to use the auto updater.
The plugin then scans the whole sourcemod/plugin directory and compares the filename of each file(=plugin) with War3Source(because there's no default w3s plugin that is not called War3Source).
Something like this:
Code: [Select]
BuildPath(Path_SM, g_szPluginPath, sizeof(g_szPluginPath), "plugins/");
FileWalker(hFileHashTrie, g_szPluginPath);

FileWalker(Handle:hFileHashes, const String:szDir[])
{
   ReadDirEntry .....
   if(strncmp(szFileName, "War3Source", 10, false) == 0)
   ....
}

If we need further confirmation if this is really a war3source plugin we can see if the plugin is currently loaded and do additional checks.
Code: [Select]
new Handle:hPlugin = FindPluginByFile(szPath)
new Function:func = GetFunctionByName(hPlugin, "War3InterfaceExec");
if( func == INVALID_HANDLE )
{
   // not a w3s plugin
}

For each found war3source plugin we add the checksum/MD5 of it to a key-value trie and after scanning the whole sourcemod/plugin directory we can compare the checksum with the Jenkins files and update the files one by one.
#war3source on gamesurge

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: W3S Auto updater
« Reply #4 on: June 16, 2014, 07:48:14 AM »
It's harder to handle cases where a smx in the new version is deleted and no longer used. Proposal 1 deletes the entire autoupdate folder.

hash can be used but it will only help if user tries to update to the same version again. Each compile gives a different .smx file

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: W3S Auto updater
« Reply #5 on: June 16, 2014, 05:40:21 PM »
All plugins are technically affected and considered updated on a new compile

user would have to manually unregister each plugin.

Why not have an auto updater? its like apt-get (except its not) :D
Having an auto updater does ease release to download time. When someone else makes a change to the trunk, its automatically compiled, and anyone can pull it with a update command. they can also revert to a previous version easily with a command.

a server restart is required on an update, thats no different than a manual update.
« Last Edit: June 16, 2014, 05:42:54 PM by Ownz »

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: W3S Auto updater
« Reply #6 on: June 17, 2014, 07:47:57 AM »
everyone seems to be concerned with partial updates. Updating one file is really no different than updating all files. It may take you 10 seconds to download all those files but a server restart is required anyway so performance is not an issue. Mixing and matching files from different releases is not something easy to do.

Necavi

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
Re: W3S Auto updater
« Reply #7 on: June 17, 2014, 01:46:16 PM »
add a function to the war3source include which spits out the build number it was compiled with, defaulting to custom if it is a raw compile. Simple fix

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: W3S Auto updater
« Reply #8 on: June 18, 2014, 07:24:27 AM »
ewwww key values, the most horrible sourcemod invention
ewwwww

nah i rather parse it myself

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: W3S Auto updater
« Reply #9 on: June 22, 2014, 08:31:23 AM »
3 votes for custom folder
2 votes for jenkins build
1 votes for ini file
« Last Edit: June 29, 2014, 03:22:02 PM by Ownz »

thinklogic

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: W3S Auto updater
« Reply #10 on: June 29, 2014, 10:24:18 AM »
I'd go with proposal 2

However perhaps there should be an option in the war3menu to toggle if custom content overrides war3 skins, or not. If overriding is enabled, war3 content that isnt overrided by custom content should be applied anyways



My Steam ID: STEAM_0:1:48982747

DarkDen

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: W3S Auto updater
« Reply #11 on: June 29, 2014, 10:28:28 AM »
I vote for ini file
« Last Edit: June 29, 2014, 03:24:40 PM by Ownz »

Ejaculating Gerbal

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: W3S Auto updater
« Reply #12 on: June 29, 2014, 01:12:41 PM »
I'd go with proposal 1. :)
4297

MrRick

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: W3S Auto updater
« Reply #13 on: June 29, 2014, 04:04:48 PM »
I'm gonna have to go with Proposal 2, also. An INI file seems to be the best, easiest to understand, and least cluttered way of dealing with this.
STEAM_0:1:29667456

Sergeant Shenanigans

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: W3S Auto updater
« Reply #14 on: June 29, 2014, 04:44:26 PM »
The .ini file seems to be a good idea, getting .ini files set up and organized shouldn't be difficult.
Hey, if you need me, find me;
STEAM_0:1:42914929.

┏━┓┏━━┳┓╋╋╋╋╋╋╋╋╋╋╋┏┓╋╋╋╋╋╋╋┏━┓┏━┓~~~~~~~~~~~~~~
┃┏┛┃━━┫┗┳━┳━┳┳━┓┏━┳╋╋━┳━┓┏━┳┫━┫┗┓┃~~~~~~~~~~~~
┃┃╋┣━━┃┃┃┻┫┃┃┃╋┗┫┃┃┃┃╋┃╋┗┫┃┃┣━┃╋┃┃~~~~~~~~~~
┃┗┓┗━━┻┻┻━┻┻━┻━━┻┻━┻╋┓┣━━┻┻━┻━┛┏┛┃~~~~~~~~
┗━┛╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋╋┗━┛╋╋╋╋╋╋╋╋┗━┛~~~~~~

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: W3S Auto updater
« Reply #15 on: June 29, 2014, 05:09:11 PM »
look at all the single post voters

either el diablo is buying votes or making duplicate accounts


anyway



major slapnuts

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: W3S Auto updater
« Reply #16 on: June 29, 2014, 05:51:08 PM »
I voted

STEAM_0:1:43484208

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: W3S Auto updater
« Reply #17 on: June 29, 2014, 06:26:45 PM »
you know el diablo, if you didnt make it so obviously i may have been fooled


« Last Edit: June 29, 2014, 06:29:17 PM by Ownz »

Necavi

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
Re: W3S Auto updater
« Reply #18 on: June 29, 2014, 07:05:48 PM »
Heh...nice...

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: W3S Auto updater
« Reply #19 on: June 30, 2014, 10:44:48 AM »


Let's do a vote to see what proposal is the best... yeah sure

I'm voting to exclude the .ini proposal from the vote because this is just insane!
#war3source on gamesurge

iceman

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: W3S Auto updater
« Reply #20 on: June 30, 2014, 01:28:31 PM »
As if it matters most of the votes are from server ops using there "version" of war3. My servers are running stock. I vote for option 1. Whatever changes iv'e made to stock races/addons i will request on git or the forums.

Remy Lebeau

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
Re: W3S Auto updater
« Reply #21 on: June 30, 2014, 06:20:28 PM »
I'm flabbergasted.... A simple search on war3evo forums for the url of this thread, and voila...

I hardly know what to say ... At what point of creating that request over at war3evo did El Diablo think it would fly?  Like we don't already know who the major players in w3s development are, because a ton of random newbie's posting votes wouldn't seem suspicious.

But even worse than that is the mentality that seeks to have the development progress in the direction he wants at whatever cost.  Charitably, I'm going to put this down to a brain snap, and assume it was just one of those things that seemed like a good idea at the time.

Necavi

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
Re: W3S Auto updater
« Reply #22 on: June 30, 2014, 08:09:12 PM »
Quote
20:02 - -W3E- El Diablo: im guessing that Ownz didn't like my use of community power :(
20:02 - Necavi: Is that what you're calling it?
20:03 - -W3E- El Diablo: perssuaion?
20:03 - -W3E- El Diablo: im a bad speller
20:03 - Necavi: Uhhh...yeah....
20:03 - -W3E- El Diablo: its more like commuinty persuassion
20:03 - Necavi: No, it is offerring rewards to rig a vote in your favour
20:03 - -W3E- El Diablo: I didn't think I'd get it past him.. if it was a ton of votes really fast
20:04 - -W3E- El Diablo: I was curious to see if it would work.
20:06 - Necavi: It was pretty damn obvious that something was up, I just didn't care enough to post, and I figured Ownz would just do whatever he wanted in the end anyway
20:10 - -W3E- El Diablo: Well.. War3Source needs a little more activity anyhow .. what better way to spice it up ?
20:10 - Necavi: With actual content rather than spam from your forums
20:11 - -W3E- El Diablo: Are you mad?
20:12 - -W3E- El Diablo: I don't expect mine to go thru anyhow.. I had the lesser votes in the first place.
20:13 - -W3E- El Diablo: I already knew by the time there was numerious votes that you guys would figure it was a fudge votes.
20:13 - Necavi: I don't really care enough to be mad, but I am very annoyed that you actually are deluded enough to think you're helping the community by paying members of your server to come post to try to get your way
20:15 - -W3E- El Diablo: I didn't think mine would go through.. but I was just a little curious if it would even make it... like 1% chance.   Platinum isn't real currency.  It is game currency.

joshtrav

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: W3S Auto updater
« Reply #23 on: July 02, 2014, 09:11:15 PM »
I got a lol out of the dude begging his community to vote.

But on topic,

I guess my idea would be to have a base update plugin that is updated no matter the case.  It would have hashes of all the current builds, or something of that nature.  If users plugin hash/version, w/e, is in the list, go ahead and update, otherwise don't.

But if I had choose between the remaining I would say its a split between Ownz/Necavi.  The ini is pretty, well, you know what I want to say there...

Either way, we don't use war3source but from a dev standpoint I thought I would chime in since the thread gave me a good chuckle.


Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: W3S Auto updater
« Reply #24 on: July 10, 2014, 04:55:53 AM »
I guess my idea would be to have a base update plugin that is updated no matter the case.  It would have hashes of all the current builds, or something of that nature.  If users plugin hash/version, w/e, is in the list, go ahead and update, otherwise don't.
Yup, I also proposed something like that - the problem is that the hash changes every time the plugin is compiled(an alternative is to compute the hash only from the .code section - that should stay the same across different compiles). Plugin version sounds like a nice way too!
#war3source on gamesurge