Raised This Month: $51 Target: $400
 12% 

xRepo - Download Game Content via Console (1.0.0 - 09.09.2013)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-09-2013 , 12:30   xRepo - Download Game Content via Console (1.0.0 - 09.09.2013)
Reply With Quote #1



.: Description :.

xRepo is a plugin which allows you to download content for your server via console or rcon. You can make your own repository to provide others content too. You can add everything you want.
It's similar to Debian's "apt-get" or Cydia from iOS.

.: How is this working? :.

In your repos.cfg you can add repos to xRepo in this format.
Quote:
"xRepoOfficialRepo" "http://kiasprojects.tk/xrepo/official.txt"
If you want to make your own repo follow this steps. You need webspace for this.
  1. Create a text file on your Webserver and call it xrepo.txt for example.
  2. Enter packages to it like this
    Quote:
    ;Package Name Description URL
    "aim_map" "Downloads the Map aim_map to your Server." "http://xrepo.kiasprojects.tk/aim_map.txt"
    "awp_india" "Downloads the Map awp_india to your Server." "http://xrepo.kiasprojects.tk/awp_india.txt"
    "de_hell" "Downloads the Map de_hell to your Server." "http://xrepo.kiasprojects.tk/de_hell.txt"
    "de_tuscan" "Downloads the Map de_tuscan to your Server." "http://xrepo.kiasprojects.tk/de_tuscan.txt"
  3. As you can see there is a text file for each Package, you must enter each file from the map / plugin / etc. in one line, like this
    Quote:
    ;URL PATH_ON_SERVER
    "http://xrepo.kiasprojects.tk/de_tuscan/gfx/env/dustbk.tga" "gfx/env/dustbk.tga"
    "http://xrepo.kiasprojects.tk/de_tuscan/gfx/env/dustdn.tga" "gfx/env/dustdn.tga"
    "http://xrepo.kiasprojects.tk/de_tuscan/gfx/env/dustft.tga" "gfx/env/dustft.tga"
    "http://xrepo.kiasprojects.tk/de_tuscan/gfx/env/dustlf.tga" "gfx/env/dustlf.tga"
    "http://xrepo.kiasprojects.tk/de_tuscan/gfx/env/dustrt.tga" "gfx/env/dustrt.tga"
    "http://xrepo.kiasprojects.tk/de_tuscan/gfx/env/dustup.tga" "gfx/env/dustup.tga"
    "http://xrepo.kiasprojects.tk/de_tuscan/maps/de_tuscan.bsp" "maps/de_tuscan.bsp"
    "http://xrepo.kiasprojects.tk/de_tuscan/maps/de_tuscan.res" "maps/de_tuscan.res"
    "http://xrepo.kiasprojects.tk/de_tuscan/maps/de_tuscan.txt" "maps/de_tuscan.txt"
    "http://xrepo.kiasprojects.tk/de_tuscan/models/de_tuscan/tuscan_grass1a.mdl" "models/de_tuscan/tuscan_grass1a.mdl"
    "http://xrepo.kiasprojects.tk/de_tuscan/models/de_tuscan/tuscan_palmtree1.mdl" "models/de_tuscan/tuscan_palmtree1.mdl"
    "http://xrepo.kiasprojects.tk/de_tuscan/models/de_tuscan/tuscan_shade1a.mdl" "models/de_tuscan/tuscan_shade1a.mdl"
    "http://xrepo.kiasprojects.tk/de_tuscan/models/de_tuscan/tuscan_shade2a.mdl" "models/de_tuscan/tuscan_shade2a.mdl"
    "http://xrepo.kiasprojects.tk/de_tuscan/models/de_tuscan/tuscan_shade3a.mdl" "models/de_tuscan/tuscan_shade3a.mdl"
    "http://xrepo.kiasprojects.tk/de_tuscan/overviews/de_tuscan.bmp" "overviews/de_tuscan.bmp"
    "http://xrepo.kiasprojects.tk/de_tuscan/overviews/de_tuscan.txt" "overviews/de_tuscan.txt"

.: Commands :.

You should enter these commands via console, else you won't see the output! I've added apt-get as alternative command for all linux friends.
  • (xrepo / apt-get) help : Shows all commands")
  • (xrepo / apt-get) list : Lists all Repos from the .cfg file")
  • (xrepo / apt-get) search <name> : Searchs for <name> in all repos.")
  • (xrepo / apt-get) install <name> : Installs the package <name>.")
  • (xrepo / apt-get) update : Updates all repo files.")

.: Requirements :.
  • A Steam Server
  • HTTP2 Include
  • Local compiler or a compiler with .inc uploading

.: Bugs :.
  • None reported yet, please post bugs if you find them.

.: Credits :.
  • Black Rose - HTTP2 Include and Scripting Help
  • red_bull2oo6 - His Code for cutting of a folder from a string.
  • Arkshine - Scripting Help
  • ConnorMcLeod - Scripting Help


Attached Files
File Type: zip xrepo.zip (3.3 KB, 206 views)
__________________

Last edited by Kia; 09-09-2013 at 12:31.
Kia is offline
DeLiriuM
Senior Member
Join Date: Dec 2006
Old 09-09-2013 , 12:54   Re: xRepo - Download Game Content via Console (1.0.0 - 09.09.2013)
Reply With Quote #2

Looks really useful! I'll definitely test it soon
__________________
DeLiriuM is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-09-2013 , 13:15   Re: xRepo - Download Game Content via Console (1.0.0 - 09.09.2013)
Reply With Quote #3

Glad to hear that.
If anyone can fix the AmxxZip Module I could add .zip support, so you don't need to make lists for each package.
__________________
Kia is offline
Smatify
Senior Member
Join Date: Nov 2012
Location: Where ever you want
Old 09-09-2013 , 13:32   Re: xRepo - Download Game Content via Console (1.0.0 - 09.09.2013)
Reply With Quote #4

He released it *-*

Nice plugin bro!
__________________
Selling Hosting stuff such as Webspace and Game- & VoiceServer

I'm also selling Steam Keys.
For more informations, contact me.

(Homepage is under development)
Smatify is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-09-2013 , 13:32   Re: xRepo - Download Game Content via Console (1.0.0 - 09.09.2013)
Reply With Quote #5

Thanks.
__________________
Kia is offline
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 09-09-2013 , 16:04   Re: xRepo - Download Game Content via Console (1.0.0 - 09.09.2013)
Reply With Quote #6

Code:
It's similar to Debian's "apt-get" or Cydia from iOS.
Exactly this... It reminds me Repos from cydia
__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science
oxygen935 is offline
Send a message via Skype™ to oxygen935
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-09-2013 , 16:11   Re: xRepo - Download Game Content via Console (1.0.0 - 09.09.2013)
Reply With Quote #7

Yes.. that's what I wrote..
__________________
Kia is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-09-2013 , 18:26   Re: xRepo - Download Game Content via Console (1.0.0 - 09.09.2013)
Reply With Quote #8

You need to understand better what does each native, to avoid unnecessary code or to make more robust code.
  • cmd_xrepo() :

    • read_argv() returns the length of the argument parsed. It should be checked in case empty arguments are passed.
    • Using equali seems pointless. Just checking first letter should be enough.
    • You should check more before releasing. You pass 3 in cmd_access, which means command without arguments can't be used. When dealing with extra params, you pass minimal arguments it requires.
    • Make sure you don't create buffer too large for the actual need (first).
    • You should show the "help" when command fails.

      Function could look something like that :
      Spoiler

  • cmd_list() :

    • Lower szConfigDir size. It's unlikely as it is.
    • Don't create sBuffer before check.
    • Don't use replace(sBuffer, charsmax(sBuffer), "^n", "") ; use instead trim(sBuffer) which will remove any kind of spaces.

      You could do like that about the loop :
      Spoiler

Etc.

I'm too lazy and tired to do all but more generally :
  • Don't create vars before check
  • Adjust buffer size
  • Most of natives dealing with string return length, use that
  • To create a file, you can just use fopen with "wt+". Check google.
  • parse returns the number of arguments parsed, use that.
  • Use trim instead of replace
  • Don't use get_configsdir in a loop.
  • Your check about "." is wrong, you will ignore file like "a.ext".
  • ...
__________________
Arkshine is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 09-10-2013 , 01:00   Re: xRepo - Download Game Content via Console (1.0.0 - 09.09.2013)
Reply With Quote #9

I'll optimize the plugin at home.
Thanks for the suggestions.
__________________
Kia is offline
Smatify
Senior Member
Join Date: Nov 2012
Location: Where ever you want
Old 09-14-2013 , 15:10   Re: xRepo - Download Game Content via Console (1.0.0 - 09.09.2013)
Reply With Quote #10

Code:
http://kiasprojects.tk/xrepo/
I think you have to fix this^^
__________________
Selling Hosting stuff such as Webspace and Game- & VoiceServer

I'm also selling Steam Keys.
For more informations, contact me.

(Homepage is under development)
Smatify is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode