Share your repls and programming experiences

← Back to all posts
FIXED! -Multiplayer Clicker Game- Factions Online
CatR3kd

Hey Guys!

YESSS! It's finally done!

SO. Once upon a time I made a cool little clicker game and posted it on the share page, and it got pretty popular! So, me and @NoNameByProgram teamed up to make it online! Me and them (Mostly them) have added:

  • A leaderboard
  • An account system
  • Removed console hacking
  • A daily reset timer
  • Removed Enter-Clicking

HOW TO PLAY:

The goal of Factions Online is to get the most money in the shortest amount of time. The game works by resetting nightly.
You have to get the most amount of money before then, to get your name on the leaderboard.
You get money by clicking and getting upgrades and autoclickers, like most clicker games.

Be sure to check out @NoNameByProgram , they are a super good coder and were CRUCIAL to this and did 99% of the NodeJS.

Note:

If it's not letting you make an account or start the game, try in a separate tab.

Please don't set your username to anything inappropriate, as we will smack you with the mighty banhammer.

Thanks so much!

P.S. If you liked this, I would a much appreciate an upvote!
-CatR3kd with <3

Edit: We are looking for an artist!

If you want to help out by making art, you can read and comment on this post. Thanks!

P.P.S: Don't click this link

Voters
frostedbutton75
Kgbadz
Brendan23
StevenDavis2
elburg
LandonCode
DominicHuieWhit
AgastyaSandhuja
AidanTurc
dudeactualdev
Comments
hotnewtop
frostedbutton75

I love this! Can I pls fork and repost with a mention to you without the daily reset.
Love, fb75

NoNameByProgram

just realized that i forgot to stringify the json - everything is working now

CatR3kd

lmfao should i rerelease?
@NoNameByProgram

CatR3kd

Actually we could go back and add more stuff if you wanted to
@NoNameByProgram

NoNameByProgram

@CatR3kd depends lol ur choice

CuriousMonkey

umm it says

CatR3kd

yeah, i took it down do to it being so popular it lagged all of repl lol @CuriousMonkey

canyon2020

I can do your art... what do you need

CatR3kd

A favicon! @canyon2020

canyon2020

ez what do you want it to look like
@CatR3kd

CatR3kd
EmpireReedSQB

how did you disable the enter key so people cant hold it down instead of clicking?

CatR3kd

JS magic @EmpireReedSQB

EmpireReedSQB

@CatR3kd tell me your wasy

CatR3kd

???? lol @EmpireReedSQB

EmpireReedSQB

@CatR3kd tell me how you blocked people from just holding enter instead of tapping

CatR3kd

BIG BRAIN @EmpireReedSQB

CatR3kd

Ask noname @EmpireReedSQB

AidanTurc

Are servers just full rn that's why it can't reach my repl?

CatR3kd

No i turned it off because it was ending replit lol @AidanTurc

JustARegularR

I forked it so i can play with my friends but it gives me errors? Could you help me?

zabuzatheashura

Couldnt you just create a auto clicker to cheat

CatR3kd

Nope theres a CPS cap that autobans cheaters @zabuzatheashura

DJWang

First 1 million!!!

CatR3kd

nice! @DJWang

Blackout4344

Amazing!

CatR3kd

Thanks! @Blackout4344

CodersXD

What Module do you use to save the game? like a login?

CatR3kd

Yeah there's logins with cookies and a json file @CodersXD

NoNameByProgram

@CodersXD we don't use any module for those two :O

noway15

Uh, @CatR3kd, I think something's wrong with the leaderboard because when you hit the "back" button, it takes you to the main site, but with an extra /index.html
maybe you could fix that?

CatR3kd

Yeah, we know lol @noway15

Baconman321

You know you can set an interval to click right? Although you seem to have a system worked out for that.

CatR3kd

Yeah lol @Baconman321

Baconman321

@CatR3kd Still, you can set an interval to click slower, then leave the game to click for u

CatR3kd

Yes, we're gonna implement AFK detection @Baconman321

Baconman321

@CatR3kd just use window.onfocus and window.onblur (client side)

NoNameByProgram

@Baconman321 thanks!

Baconman321

@NoNameByProgram As long as you have client side scripts, there will always be a way around it. Just remember this: always treat info sent to backend by the client as unsafe and NEVER EVER handle sensitive information with javascript.

Baconman321

@NoNameByProgram Also, I see you are storing passwords in a json file. This is a big nono. Repl has recently made databases, I suggest you use those to store passwords and usernames, not a file.

CatR3kd

Yes, but we are going to move from repl eventually. Why is this a nono? @Baconman321

Baconman321

@CatR3kd Because people can see your repl, your files, and everything except for the .env files, which are a pain to use to store things. Of course, you could always encrypt the passwords (store the key in an .env file, then get that using process.env.nameOfValue), but I recommend encrypting the passwords then storing them in a database. Of course, in practice (since if a hacker gets a hold of the file, then they can see what key you use since it's in the encrypt function), encrypting passwords is a bad idea, but no one can access your key in the env file (easily). In reality, however, when you move away from repl.it, hash passwords instead. Read about hashing here.

CatR3kd

Hmmm, but lol the passwords are encrypted @Baconman321

Baconman321

@CatR3kd With what? What algorithm? Also, when you use the key, do you store it in an env file so that no one sees your key (otherwise they can easily decrypt it)

CatR3kd

I have no idea ask noname lol @Baconman321

Baconman321

@NoNameByProgram what do you use for encryption. Also, do you store the key in an env?

NoNameByProgram

@Baconman321 repl.it has a bad database.

NoNameByProgram

@Baconman321 wdym "key"?
we use sha256 enc.

CatR3kd

sadly kinda true lol
Did ya know cookiemann made it?
@NoNameByProgram

CatR3kd
Baconman321

@NoNameByProgram Ok, so that is a hash function. That is different than encryption. @CatR3kd told me it was encryption, but I see that it is a hash algorithm. Yeah, otherwise storing plain passwords in a json file is bad. Ok, NVM, just wanted to see how you secure your passwords :>
Edit: Sorry I took so long to respond, I'm not available over the weekends.

NoNameByProgram

@Baconman321 why is hash so bad revealing to the public?
hmm???

Baconman321

@NoNameByProgram It isn't. I was saying it was bad to reveal the passwords unencrypted/hashed. It's fine.

hihigood

What is the daily reset for?

CatR3kd

So that no single person dominates the leaderboard @hihigood

patrickxyz

How do you make an account???????

CatR3kd

You're gonna have to open in a new tab @patrickxyz

HyawMatias

why wont it load?

NoNameByProgram

@HyawMatias try opening in a new tab - cookies do not work in an iframe

HyawMatias

@NoNameByProgram it worked thanks

noway15

@CatR3kd I think that you should add a factor that increases the price of the bought items every time the user buys them. Otherwise, it's a fun game.

noway15

HEY IT WORKS NOW BOIS

EpicRaisin

I ran the repl, and it said Started Server in the console, but I only see this

NoNameByProgram

@EpicRaisin hmmm... it's supposed to be up forever, we'll look into it.

OskarBrady

My name is the only one showing up on the leaderboard...

OskarBrady

My computer is lagging so much

too much ahhhhh

NoNameByProgram

@OskarBrady holy shut

OskarBrady

@NoNameByProgram I wasted so much of my day doing this

NoNameByProgram

@OskarBrady is that good? :thonk:

OskarBrady

Well yes, but actually no @NoNameByProgram

CatR3kd
OskarBrady


2020

MichaelBarnes0

Hmmmm.... We Couldn't Reach Your Repl
Make sure your repl has a port open and is ready to receive HTTP traffic.

Does this sound familiar to anyone?

TalinSharma

Um...

Help.

CatR3kd

Lol, this repl is super laggy because of all the users @TalinSharma

noway15

Huh, I guess that makes sense, maybe in the next version I guess you could add some code that maybe allows more users @CatR3kd

noway15

It can't connect to the repl. Why is that?

CatR3kd

sigh... This game is too popular. There are 200+ users and it's laggy lol @noway15

noway15

What kind of JS is this running @CatR3kd

CatR3kd

node? @noway15

noway15

What exactly is the difference between node and [email protected]

CatR3kd

One is for backend idk as @NoNameByProgram lol @noway15

noway15

got it thanks @CatR3kd

CatR3kd
noway15

Bruh I have YouTube muted, so rickrolling me is impossible. Nice try [email protected]

noway15

Also, what are the numbers in parentheses displayed right next to a user's name? @CatR3kd

CatR3kd

It still counts bro @noway15

NoNameByProgram

@noway15 the cycles of the user (like reddit karma)

noway15

ya but how do you get cycles @NoNameByProgram

CatR3kd

Upvotes or answering questions @noway15

noway15

ah ok thanks @CatR3kd

Haizi

It says something along the lines of repl.it won't connect. Is this a thing that you guys did or is this all on my end.

CatR3kd

It's lag, there are more than 200 users @Haizi

Haizi

@CatR3kd OH WOW THAT IS AMAZING

CatR3kd

Thanks! @Haizi

Haizi

@CatR3kd I hope to play it soon after once it starts to die down. Maybe early tommorow morning

CatR3kd

yeah, we are hoping to eventually move to a digitalocean droplet, we'll change this repl to say so if we do. @Haizi

noway15

It says that it can't reach the repl. Why is that?

GeumjuKim

WOW THIS IS FUN
(reads: P.S. If you liked this, I would much appreciate an upvote!
-CatR3kd with <3) OH HAVE I NOT? UPVOTES

CatR3kd

lol ty @GeumjuKim

OskarBrady

This is very impressive, I can only hope to make something of this caliber one day!

CatR3kd

Thanks! @OskarBrady

OskarBrady

This is really good! Great job! It currently doesn't seem to be working though...

NoNameByProgram

@OskarBrady as in what way?

OskarBrady

@NoNameByProgram The repl wouldn't load, but I think it's fixed now. It seems like my data got reset, which is really annoying, as I was on the leaderboard.

NoNameByProgram

@OskarBrady Yeah...some hackers got into the database...

OskarBrady

@NoNameByProgram Aw man. Is the problem fixed? I would hate to see such a great project get destroyed by hackers.

NoNameByProgram

@OskarBrady Yea, it wiped out all 232 users.

OskarBrady

@NoNameByProgram At least it happened a few hours away from a reset instead of the middle of the countdown. Could have been worse, still not good.