[FINAL] Zandrocoin, the new virtual coin for your server!

Maps, modifications, add-ons, projects, and other releases for Zandronum. Also includes announcers.
Post Reply
User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

[FINAL] Zandrocoin, the new virtual coin for your server!

#1

Post by ibm5155 » Sun Apr 01, 2018 2:54 am

Image
Ladies and gentleman, ibm5155 presentes you the ZANDROCOIN!!!!

Got a popular server with alot of players? so This is the right coin for you!!!, with zandrocoin, you can make the players from your server to mine zandrocoins for YOU!!!, all the mined coins will be stored in the server coin's database, so this way you can actuall get some money from your players and maybe on the future, pay the servers costs only by hosting your own server!!!

-Zandrocoin will not affect the performance of your server since it's all clientsided, the clients will not interact with the server unless they find a valid coin.

-And the best part: it's easy to use, load the zandrocoin code into your server and you are good to go!

-There are Advanced security mechanism that will prevent anyone to steal your coins.

SO WHAT ARE YOU WAITING FOR? GET ZANDROCOIN RIGHT NOW, add it into your server and make some real(virtual) money!!!.

DOWNLOAD LINK: https://allfearthesentinel.net/zandronu ... rocoin.pk3

-Server commands:
pukename CheckCoinsServer (check the amount of coins that the players had mined for you)
pukename "CheckCoins" check the hash id of the coins that you mined
pukename "script "GetNewCoin" a b c d . used for restoring your coins in case you create a new server (since your server is the wallet you must store your keys before you close your server, else bye bye coins)
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

mifu
Retired Staff / Community Team Member
Posts: 1075
Joined: Tue May 29, 2012 10:34 am
Location: Aussie Land
Clan: Demon RiderZ

[FINAL] Re: Zandrocoin, the new virtual coin for your server!

#2

Post by mifu » Sun Apr 01, 2018 4:16 am

Happy April fools

User avatar
fr blood
Frequent Poster Miles card holder
Posts: 992
Joined: Wed Mar 06, 2013 4:04 pm
Location: France

[FINAL] Re: Zandrocoin, the new virtual coin for your server!

#3

Post by fr blood » Sun Apr 01, 2018 12:10 pm

Looks interesting, but I still don't know how to launch a server.

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

[FINAL] Re: Zandrocoin, the new virtual coin for your server!

#4

Post by ibm5155 » Sun Apr 01, 2018 9:44 pm

Yeah, so ehm, here's the legic source code of it

Code: Select all

#library "ZCOIN"
#include "zcommon.acs"


#define MAXCOINS 1024

int Coins[MAXCOINS][5];
int Difficult = 30;
int Key = 1;


function int AND(int a, int b) {
	return a & b;
}

function int OR(int a, int b) {
	return a | b;
}

function int  INVERT(int source) {
	int i = 0;
	int j = 0;
	while (j < 32) {
		i = OR(i,(1 << j) -  AND(source, 1 << j));
		j++;
	}
	return i;
}


function int COPYBITS(int source, int index, int length, int newindex) {
	int i = 0;
	int j = 0;
	int i2 = 0;
//	printf("start - index %d length %d newindex %d\n", index, length, newindex);
//	printBits("debug input", sizeof(source), &source);
	while (j < 32) {
		if (j > (index) - length && j <= (index)) {
			i = OR(i, AND(source, 1 << j));
		}
		j++;
	}
//	printBits("debug", sizeof(i), &i);
	if (index > newindex) {
		i = i >> (index - newindex);
	}
	else {
		i = i << (newindex - index);

	}
//	printBits("debug", sizeof(i), &i);
	j = newindex - length;
	while (j <= newindex) {//there may have some bit shift trash after that
		i2 = OR(i2, AND(i, 1 << j));
		j++;
	}
//	printBits("debug", sizeof(i2), &i2);
//	printf("end\n");
	return i2;
}


script "CheckCoins" (void) NET{
	int total=0;
	for(int i=0; i < MAXCOINS;i++){
		if(Coins[i][0] == 0){
			total = i;
			i = 1024;
		}
	}
	LOG(s:"Total earned coins:",d:total);
}


script "CheckCoinsServer" (void){
	int total=0;
	for(int i=0; i < MAXCOINS;i++){
		if(Coins[i][0] == 0){
			total = i;
			i = 1024;
		}
		else{
			LOG(s:"Coin ",d:i,s:" Key = ",d:Coins[i][1],s:" ",d:Coins[i][2],s:" ",d:Coins[i][3]);
		}
	}
	LOG(s:"Total earned coins:",d:total);
}
script "FirstRun" open{
	LOG(s:"Zandrocoin - created by ibm5155");
	acs_namedexecutealways("mAdeek",0,Difficult);
	acs_namedexecute("UpdateClientKey",0,(Key >> 16) | !(Key << 16),!Key,!(Key >> 16) | (Key << 16));
}

script "GetNewCoin" (int X0, int X1, int X2,int X3) NET{
	//validate if we received a valid key (not cheat)
	int i = -1;
	int a;
	if (COPYBITS(X0, 31, 4, 4) == COPYBITS(X0, 7, 4, 4)) {
		if (COPYBITS(X0, 27, 4, 4) == COPYBITS(INVERT(X0), 3, 4, 4)) {
			if (COPYBITS(X2, 31, 1, 0) == COPYBITS(X2, 0, 1, 0) && COPYBITS(X2, 31, 1, 0) == COPYBITS(INVERT(X2), 16, 1, 0)) {
				if (COPYBITS(X3, 15, 2, 2) == COPYBITS(X3, 9, 2, 2)) {
					//now compare if each key is valid with each other
					if (COPYBITS(X0, 21, 2, 2) == COPYBITS(X1, 7, 2, 2)) {
						if (COPYBITS(X0, 23, 1, 2) == COPYBITS(INVERT(X2), 17, 1, 2)) {
							if (COPYBITS(X2, 21, 2, 2) == COPYBITS(INVERT(X3), 20, 2, 2)) {
								if (COPYBITS(X0, 6, 1, 1) == COPYBITS(INVERT(X3), 21, 1, 1)) {
									for (i = 0; i < MAXCOINS; i++) {
										if (Coins[i][0] == 0) {
											Coins[i][0] = 1;
											Coins[i][1] = X0;
											Coins[i][2] = X1;
											Coins[i][3] = X2;
											Coins[i][4] = X3;
											i = 1024;
										}
									}
									Key++;
									Difficult++;
									acs_namedexecutealways("mAdeek",0,Difficult);
									acs_namedexecutealways("UpdateClientKey",0, (Key >> 16) | !(Key << 16), !Key, !(Key >> 16) | (Key << 16) );
									printbold(s:"New coin found by ",n:activatortid());
								}
							}
						}
					}
				}
			}
		}
	}
	/*
	if(i == -1){		
	
	if(ActivatorTid() == -1){
			printbold(s:"Server is trying to cheat!!!");
		}
		else{
			printbold(n:activatortid(),s:" is trying to cheat!!!");
		}

	}
	*/
}

script "mAdeek" (int a) clientside{
	Difficult = a;
}

script "UpdateClientKey" (int A, int B, int C) clientside{
	int i =0;
	if( (A >> 16) | (!(A << 16)) == !B){
	if( (!(C >> 16)) | (A << 16) == !B){
		Key = !B;
	}
	}
/*
	if(i == 0){
		if(ActivatorTid() == -1){
			printbold(s:"Server is trying to cheat!!!");
		}
		else{
			printbold(n:activatortid(),s:" is trying to cheat!!!");
		}	}
		*/
}

script "Mine" open clientside
{
	//its open so even spectators will mine
	int X0,X1,X2,X3;
	int a,b,c;
	int BackupKey;
	int i = 0;
	while (true) {
		BackupKey = Key;
		a = random(1,65535);
	//	printBits("a: ", sizeof(a), &a);

		b = OR(a >> 16, a << 16);
	//	printBits("b: ", sizeof(a), &b);
		c = OR(OR(a, (a >> 5)), a << 20);
	//	printBits("c: ", sizeof(a), &c);
		X0 = OR(OR(OR(OR(COPYBITS(a, 3, 4, 31), COPYBITS(b, 3, 4, 27)), COPYBITS(c, 3, 4, 23)), COPYBITS(a,19, 12, 19)), OR(COPYBITS(a, 3, 4, 7), COPYBITS(INVERT(b), 3, 4, 3)));
	//	printBits("X0:", sizeof(a), &X0);
		X1 = OR(OR(OR(OR(COPYBITS(b, 14, 11, 31), COPYBITS(c, 31, 11, 20)),COPYBITS(INVERT(c), 1, 2, 9)),COPYBITS(c, 1, 2, 7)), COPYBITS(c, 20, 6, 5));
	//	printBits("X1:", sizeof(a), &X1);
		X2 = OR(OR(OR(OR(OR(OR(COPYBITS(b, 24, 10, 31),COPYBITS(a, 7, 4, 21)),COPYBITS(INVERT(c), 3, 1, 17)),COPYBITS(INVERT(b), 24, 1, 16)),COPYBITS(b, 31, 4, 15)),COPYBITS(c, 14, 11, 11)),COPYBITS(b, 24, 1, 0));
	//	printBits("X2:", sizeof(a), &X2);
		X3 = OR(OR(OR(OR(OR(OR(OR(OR(COPYBITS(b, 28, 4, 31),COPYBITS(a, 31, 5, 27)),COPYBITS(a, 1, 1, 22)),COPYBITS(INVERT(a), 2, 1, 21)),COPYBITS(INVERT(a), 7, 2, 20)),COPYBITS(b, 31, 3, 18)),COPYBITS(c, 27, 4, 13)),COPYBITS(a, 26, 7, 7)),COPYBITS(a, 0, 1, 0));
	//	printBits("X3:", sizeof(a), &X3);
		if (CheckifValid(X0 * BackupKey,X1 * BackupKey,X2 * BackupKey,X3 * BackupKey) == 1) {
			//we found a zandrocoin :D
			NamedRequestScriptPuke("GetNewCoin",X0, X1, X2, X3);
			delay(1);
		}
		i++;
		if(i%15 ==0){
			delay(1);
		}
	}
}


function int CheckifValid(int X0, int X1, int X2, int X3){
	int cnt = 0;
	int i = 0;
	int max = 0;
	i = CheckBytes(COPYBITS(X0,31,8,8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}
	i = CheckBytes(COPYBITS(X0, 23, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}
	cnt += CheckBytes(COPYBITS(X0, 15, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	i = CheckBytes(COPYBITS(X0, 7, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}

	i = CheckBytes(COPYBITS(X1, 31, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}

	i =  CheckBytes(COPYBITS(X1, 23, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}

	i = CheckBytes(COPYBITS(X1, 15, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}

	i = CheckBytes(COPYBITS(X1, 7, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}


	i = CheckBytes(COPYBITS(X2, 31, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}

	i = CheckBytes(COPYBITS(X2, 23, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	i = CheckBytes(COPYBITS(X2, 15, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}

	i = CheckBytes(COPYBITS(X2, 7, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}


	i = CheckBytes(COPYBITS(X3, 31, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}

	i = CheckBytes(COPYBITS(X3, 23, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}

	i = CheckBytes(COPYBITS(X3, 15, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}

	i = CheckBytes(COPYBITS(X3, 7, 8, 8));
	if (cnt > max) {
		max = cnt;
	}
	if (i > 0) {
		cnt += i;
	}
	else {
		cnt = 0;
	}
	if (max >= Difficult) {
		cnt = 1;
	}
	else {
		cnt = 0;
	}
	return cnt;
}

function int CheckBytes(int Byte){
	int cnt = 0;
	for (int i = 0; i < 8 && Byte > 0; i++) {
		if (COPYBITS(Byte,i,1,0) == 0) {
			cnt++;
		}
		else {
			cnt = 0;
		}
	}

	return cnt;
}
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

Post Reply