Coder Social home page Coder Social logo

ztizzlegaming / csgowinbig Goto Github PK

View Code? Open in Web Editor NEW
170.0 33.0 103.0 1.59 MB

Open-source Counter-Strike: Global Offensive jackpot betting website.

License: MIT License

HTML 34.84% PHP 50.96% JavaScript 12.60% CSS 1.61%
html css javascript php sql mysql steam counter-strike

csgowinbig's Introduction

CSGO Win Big

What is this?

CSGO Win Big is a Counter-Strike: Global Offensive jackpot skin betting website, created by me, Jordan Turley. It is no longer hosted, but you can view images of the site here, or download and inspect the code yourself.

How does CSGO Win Big work?

This is the repository for the website for CSGO Win Big. It is written in HTML/CSS/JavaScript for the client-side, and PHP for the server-side.
We are also making use of the following libraries/frameworks:

In addition to the website, we are also making use of a custom version of Jessecar96's Steam Bot, which can be found here, and is written in C#.

How to setup this project for my own use?

If you would like to setup this project for your own project, there are a couple of steps you must follow:

  • In src/php/default.php, you must configure your own database credentials. The way I have it setup is I have a file outside of the web root with my passwords in it, called 'passwords.txt', which I read and get the password for the database from, instead of writing my password directly in the code. Then, import database-config.sql to your MySQL database. If you want to use a database other than MySQL, you will have to set it up on your own.
  • Also, because you login through Steam for this site, you must have a Steam API Key. You can request a key for yourself here. Like the database password, I also have this key stored outside of the web root in passwords.txt.
  • You will also have to put in your own website url and database stuff in some places, instead of mine. These places are:
  • One last thing, the site assumes that there will always be chat messages, so you have to manually insert one chat message into the chat database table.
  • Here is an example of my passwords.txt:
    {"default-password":"YOUR DATABASE PASSWORD","steamAPIKey":"YOUR STEAM API KEY"}

How can I contribute to this project?

Please read CONTRIBUTING.md.

How can I donate to this project?

Donations are not necessary, but are greatly appreciated and help us out a lot. There are four ways you can donate:

  • Send a trade offer here with skin donations.
  • Send actual money through PayPal here.
  • Send Bitcoin to this address: 1GqszRekcjuUTARfXiroMnPoytRJWdk66A
  • Send Dogecoin to this address: DMWd9PLkDyQqEaQnoCWHi8EFDv2biD4AcS

If you are sending skins or money through PayPal, and would like to be recognized for your donation on our donations page, please add your name to the trade offer message or field on PayPal.

csgowinbig's People

Contributors

ztizzlegaming avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csgowinbig's Issues

Item price ticket spamming

Currently it's possible to spam the item price ticket system and send many emails to the administrator, clogging up the system. This could certainly be used in a malicious manner and could even crash the website with enough ticket spamming.

I think it would probably be best to add a system to only accept, say, one price suggestion per IP address per 10 seconds. Or, to make it even easier, only let logged in users submit price tickets.

I'm working on some code to fix this right now, just wanted to get this issue out there.

Fixed the steam login, stuck on loading now :/

http://glhfskins.net78.net/

My site is finally allowing me to login through steam without any problems with directing me to index.php .

Yet now...my jackpot bit and the chat is loading. I have literally spent 2-3 days trying to fix this and I seriously cannot find a way anymore.

pls help 4 cookie ;-;

Edit: I tried /php/login-status.php and it comes back up with "{"success":1,"data":{"loginStatus":0,"userInfo":null,"tradeToken":null,"info":{"gamesPlayedToday":0,"moneyWonToday":0,"biggestPotToday":0,"biggestPotEver":null}}}"

So I'm going to guess that the connection with the database is there.
Yet still my actual "jackpot" bit and the chat is still loading. Here's a image: https://gyazo.com/36480d54ca793096fb24fe084e322cac

I'm also using 000webhost if that has anything to do with this issue :/

Responsive mobile meta tag + css tweak.

The site works responsive if you make your browser window smaller however for mobile it doesn't.

This occurs due not having the meta tag related to it.

https://css-tricks.com/snippets/html/responsive-meta-tag/

Add this to all .html files in the html <head> part.

<meta name="viewport" content="width=device-width, initial-scale=1">

The css tweak is more for the 4 horizontal blocks which are glued together when viewed in mobile:

Add this to your style.css:

.col-sm-3{
    margin-top: 1.5em; 
    margin-bottom: 1.5em;
    }

As for: https://github.com/ztizzlegaming/CSGOWinBig/blob/master/src/index.html#L101 remove the style attribute completely.

Data base info items

How do you add items them to the database?
Do you use an website to add info to the database?

Thanks,

Adding a Timer

Hey mates, i wanna know where is this that you need to put 60 Skins in the Game to get started, because i want to add a Timer into this script, and i think i need to change it somewhere there, if some1 already got a timer, would be nice if you would release it here.

Depositing not working

I have configured the not and deposited and accepted the trade and it appear in the site 0/60 items deposited

Getting error when I try to login through steam?

When I go to login to steam for my website it doesn't let me and it just echos "ERROR" on the steam login page and won't let me login to my website and doesn't redirect me to my website either because of the fact that it failed to log me in. Anyone help me fix this please!? SS: http://i.imgur.com/TLsb007.png

UPDATE: I changed it so my it isn't in its own seperate directory and in my main page now but still getting a different error. For some reason when I login through steam it redirects me to a blank page and echos User is not logged in. and I looked into the file where that error is located (steamauth.php) but cannot seem to find the issue?

Infinite 'loading...'

The current pot items and chat box both are stuck on 'loading…'
I've made sure that the database connection is correct and the bot is online. It just wont get off of loading..

Nothing work in localhost

Hey, I just add you on steam to talk about this.

Hum i'm trying to make your system work in localhost and i've try to modify default.php and nothing.

Best regards.

Invalid SteamID32/64 saved in database when saving trade offer url

As posted earlier on another issue on how to fix i will post it here again:

Few people seems to have issues when it comes to saving their steam trade offer url. This occurs due the steamid32/64 being saved incorrectly in the database.

How to fix in 2 edits:

First edit:
From here: https://github.com/ztizzlegaming/CSGOWinBig/blob/master/src/php/save-trade-token.php#L37

Line 37 till 43 replace them with the lines i posted below.

# Get steam id
$steamUserId = $steamprofile['steamid'];
# Convert steam 64 id to steam 32 id
//Get the steamid (really the community id)
$communityid = $steamUserId;
//Get the map name
//See if the second number in the steamid (the auth server) is 0 or 1. Odd is 1, even is 0
$authserver = bcsub($communityid, '76561197960265728') & 1;
//Get the third number of the steamid
$authid = (bcsub($communityid, '76561197960265728')-$authserver)/2;
//Concatenate the STEAM_ prefix and the first number, which is always 0, as well as colons with the other two numbers
$steam32Id = "STEAM_0:$authserver:$authid";

Second edit:
https://github.com/ztizzlegaming/CSGOWinBig/blob/master/src/php/deposit.php#L19 & https://github.com/ztizzlegaming/CSGOWinBig/blob/master/src/php/check-items.php#L19

Line 19 till 23 replace them with lines posted below.

# Convert Steam ID to Steam64 ID
$idParts = explode(':', $tradeOwnerSteamId32);
$authServer = $idParts[1];
$accountNumber = $idParts[2];

function steamid32ToSteamid64($steamid32) {
    $iServer = "0";
    $iAuthID = "0";

    $szTmp = strtok($steamid32, ":");

    while(($szTmp = strtok(":")) !== false)
    {
        $szTmp2 = strtok(":");
        if($szTmp2 !== false)
        {
            $iServer = $szTmp;
            $iAuthID = $szTmp2;
        }
    }
    if($iAuthID == "0")
        return "0";

    $steamId64 = bcmul($iAuthID, "2");
    $steamId64 = bcadd($steamId64, bcadd("76561197960265728", $iServer)); 
    $part = explode('.',$steamId64);
    return $part[0];
}

//$tradeOwnerSteamId64 = ($accountNumber * 2) + ($authServer + 76561197960265728);
$tradeOwnerSteamId64 = steamid32ToSteamid64($tradeOwnerSteamId32);

Timer doesnt work

Hey there! Just as the title said. The timer isnt working.
I just pasted the new files into my directory and replaced the stuff I replaced before.
(databases, passwords, steam etc) but the timer isnt Starting.
Example: http://csgospin.eu/

Bot Error

When the winner is selected I keep getting this error:

image

loading… (Already tried the password)

I downloaded your script last night and need some help. I haven't actually bought the host yet so I have been testing with wampserver. Basically, I can get everything but the php scripts to work. I think it has to do with some confusion while I am setting up the mysql server. Here are some screenshots of where I am at.
https://gyazo.com/82ce8ccfd63995c483816c5767fdbb8e
https://gyazo.com/39ba63d0dfd7b373ba764f284e0a5dbe
https://gyazo.com/460fb2bae73fe433e87d6ded4c5199ce
https://gyazo.com/3a7edf4294c764bd0e24b7ececdc9395
https://gyazo.com/a1e8c84cc804d47ef043f8781f4159bd
https://gyazo.com/ddd61120a6696423b2358635acd86fa7
https://gyazo.com/d997247e86fa9dde9c363206bb0b175c
I am not sure if I miss-typed something or what but I can't seem to find my mistake. Thanks so much.

loading...

i have set everything up which has resulted in a loading... on the index page. i get this error on the http://altislifeeu.esy.es/php/login-status.php (note this isnt going to be the domain just setting it up here so i know it all works) page and i get that error i have set everything up right on the default page

this is my default.php file

1, 'data' => $data)); } function jsonErr($errMsg) { return json_encode(array('success' => 0, 'errMsg' => $errMsg)); } function getSteamAPIKey() { $fileLoc = $_SERVER['DOCUMENT_ROOT'] . '/../passwords.txt'; if (file_exists($fileLoc)) { $fh = fopen($fileLoc, 'r'); $jsonStr = fgets($fh); $arr = json_decode($jsonStr, true); $key = $arr['steamAPIKey']; fclose($fh); return $key; } else { die('no file found'); } } function postVar($varName) { $var = isset($_POST[$varName]) ? $_POST[$varName] : null; ``` if (is_null($var) || strlen($var) === 0) { return null; } else { return $var; } ``` } function getVar($varName) { $var = isset($_GET[$varName]) ? $_GET[$varName] : null; ``` if (is_null($var) || strlen($var) === 0) { return null; } else { return $var; } ``` } ?>

any help would be great thanks.

button deposit problem

When i click on the deposit button, it says
http://www.csgolowbet.com/href
Not Found

The requested URL /href was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

http://www.csgolowbet.com/

Also , the button is not clickable in mozilla, also in your site i have problem with this, cuz in chrome working i mean its clickable, but mozilla not

Getting the winner's username in deposit.php.

I know this would go in the deposit.php, but I'm not sure how to get the name of the winning account. Any help would be nice, I just need to know how to get the name and I can do the checks from there if there is my website name in it or not.

Kappa History

@ztizzlegaming

We need a Legend for all Kappa History Issues please in a Pastebin Document can you add a Pastebin Doc pls who i have the rights with Anthony NL than we add faq and all other sh1t ^^?

Can´t login through Steam

Hello

I´m learning by doing, and this is an awesome project to work with - Thanks.

But I´m have some problems with the steam login.
After I try to login, it return me to "steam-login-handle.php" with the message "User is not logged in."

I have done all the Readme steps and the password, API key seems to work

Anyone had the same problem?
I really hope there is a kind person there will help me out..

DC

Change Title and Chat Format

Hey there,
now the site is working fine. But how can i change the title "$0.00 | CSGO Win Big" and how can i remove the time and fate stamp in chat.

thank you in advance.

passwords.txt database password

Hi,

I am trying to setup the site on my GoDaddy web hosting account. ( csgoheist.com ) The package includes web hosting and MySQL databases. However I have followed your steps but am stuck on what to put for the database password. I have googles everywhere for how to find the database details on godaddy but they are all out dated. This is the page i see, next to the very badly drawn red star is the database i have setup, and uploaded the database .sql file you gave onto.
image I cannot work out how to find the database's password? Unless it is the password to the user account that has admin rights to the database? Can anyone help?

Thanks.

Winner drawing

Hey. I have a question in which file is the winner being choosen? I was looking for that but can't find that :(

incorrect $tradeOwnerSteamId64 in check-items.php

I'm having a problem getting this running. The bot is reporting Server deposit request failed, declining trade.

For some reason the $tradeOwnerSteamId64 is calculated incorrectly in check-items.php:

$depositorInventory = json_decode(file_get_contents("https://steamcommunity.com/profiles/$tradeOwnerSteamId64/inventory/json/730/2"), true);

Here's the url its converting to:

https://steamcommunity.com/profiles/7.6561198243301E+16/inventory/json/730/2

"User is not logged in." Login error

When I am going to log in on my website I get the Steam Community login and when I login with Steam I get an error message saying "User is not logged in."

Please help me! :/ I have tried everything and don't know whats wrong.. :/

allitemsjson problem in database/

when winner is drawn and items are sent the page will reload but it doesnt get updated since the database field exceeded the max characters somehow. maybe a good idea leave out some info or not.

Chat messages cant be written, but can be read

The site i have is set up properly and the database can handle writing in login tokens, but not writing chat messages, what is the issue?

prepare('INSERT INTO chat (steamUserID, `text`, `date`, `time`) VALUES (:userid, :text, CURDATE(), CURTIME())'); $stmt->bindValue(':userid', $steamUserID); $stmt->bindValue(':text', $text); $stmt->execute(); echo $steamUserID; echo $text; echo jsonSuccess(array('message' => 'Message has been sent!')); ?>

edit: im not sure if its the code, or my host, thats why i've submitted it into issues.

Fix for Firefox deposit buttons not working.

Due some firefox changes i decided to fix this problem of not working buttons.

replace line 149 of script.js: https://github.com/ztizzlegaming/CSGOWinBig/blob/master/src/script.js#L149

with following code:

if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1)
            {
                window.open('your steam trade offer url of your bot', '_blank');
                console.log('firefox');
                }else{
                $('<a>').attr('href', 'your steam trade offer url of your bot').attr('target', '_blank')[0].click();            
                console.log('not firefox');
            }

No wheel

Hi. When a winner is drawn I can see no wheel that spins and shows wich wins. It just picks a winner "in the dark". Is this an error or isnt a wheel included in the code?? :(

Best regards, optiix.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.