GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - BaseMax/SampleGameAPI: A tiny implement API for game apps with a web service using PHP.

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
googlegame.sql
googlegame.sql
 
 

Repository files navigation

Sample Game API

A tiny implement such as google play game web service using PHP.

Features

  • API
  • Create app, game
  • Create user (email, random password just for one time)
  • Submit score

Game API

createApp

http://localhost/matno4/?method=createApp

{
	status: "failed",
	message: "Cannot create an app without passing package name!"
}

http://localhost/matno4/?method=createApp&packageName=org.max.blog

Without headers:

{
	status: "failed",
	message: "This token and key is not valid!"
}

http://localhost/matno4/?method=createApp&packageName=org.max.blog

With headers:

{
	status: "success",
	message: "successfully created!",
	result: {
		publicKey: "ksqmpzlduf80i5s9ljhce2g9n9yurxl0kfw6avrdgftm4zzqyn",
		token: "qn2vwnad16rjfcxb6vu9u3neb153ca7wotbacphyl6dklj5it8"
	}
}

again refresh:

{
	status: "failed",
	message: "Cannot create an app with dublicate package name!"
}

createUser

http://localhost/matno4/SampleGameAPI/src/?method=registerUser

{
	status: "failed",
	message: "Cannot create a user without passing device, version and packageName!"
}

http://localhost/matno4/SampleGameAPI/src/?method=registerUser&packageName=org.max.blog&version=1.0.0&device=samsung-SL10&[email protected]

{
	status: "success",
	message: "successfully created!",
	result: {
		publicKey: "n1owugbezggmgdubwzbwni9jhq7t2xqqjj5heywrbwt4k1a1jo",
		token: "6rrnr9dmvb1cwfjva6yhoot3ydc8tkvcbwtj96m5pia2tzbgz7"
	}
}

Again reload:

{
	status: "failed",
	message: "Cannot create a user with dublicate email address!"
}

loginUser

http://localhost/matno4/SampleGameAPI/src/?method=loginUser&packageName=org.max.blog&version=1.0.0&device=samsung-SL10&[email protected]

{
	status: "failed",
	message: "Email not exists!"
}

http://localhost/matno4/SampleGameAPI/src/?method=loginUser&packageName=org.max.blog&version=1.0.0&device=samsung-SL10&[email protected]

{
	status: "success",
	message: "successfully created!",
	result: {
		email: "[email protected]"
	}
}

authUser

http://localhost/matno4/SampleGameAPI/src/?method=authUser&packageName=org.max.blog&version=1.0.0&device=samsung-SL10&[email protected]&code=4561

{
	status: "success",
	message: "Wellcome!",
	result: {
		session: "vb9jbwuuwh1qyr07yp6kd8dwjkf2xz18d29vx8b0p20q4kvu1v"
	}
}

and reload:

{
	status: "failed",
	message: "You not have this premission to do this task!"
}

submitScore

http://localhost/matno4/SampleGameAPI/src/?method=submitScore&packageName=org.max.blog&value=500

{
	status: "failed",
	message: "Cannot verify you without passing device, version, packageName, email, session and value!"
}

http://localhost/matno4/SampleGameAPI/src/?method=submitScore&packageName=org.max.blog&version=1.0.0&device=samsung-SL10&[email protected]&session=vb9jbwuuwh1qyr07yp6kd8dwjkf2xz18d29vx8b0p20q4kvu1v&value=500

{
	status: "success",
	message: "Great, Enjoy!"
}

highScore

http://localhost/matno4/SampleGameAPI/src/?method=highScore&packageName=org.max.blog

{
	status: "success",
	message: "You get list as below...",
	result: {
		list: [
			{
				id: "5",
				appID: "2",
				userID: "1",
				session: "vb9jbwuuwh1qyr07yp6kd8dwjkf2xz18d29vx8b0p20q4kvu1v",
				value: "1648",
				datetime: "2020-03-01 03:08:55"
			},
			{
				id: "4",
				appID: "2",
				userID: "1",
				session: "vb9jbwuuwh1qyr07yp6kd8dwjkf2xz18d29vx8b0p20q4kvu1v",
				value: "840",
				datetime: "2020-03-01 03:08:53"
			},
			{
				id: "3",
				appID: "2",
				userID: "1",
				session: "vb9jbwuuwh1qyr07yp6kd8dwjkf2xz18d29vx8b0p20q4kvu1v",
				value: "500",
				datetime: "2020-03-01 03:08:43"
			}
		],
		count: 0,
		hightest: null,
		lowest: null
	}
}

But it's not secure, so i did change PHP code and results to:

{
	status: "success",
	message: "You get list as below...",
	result: {
		list: [
			{
				value: "1648"
			},
			{
				value: "840"
			},
			{
				value: "500"
			}
		],
		count: 0,
		hightest: null,
		lowest: null
	}
}

Max Base

My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. (Max Base)

Asrez Team

A team includes some programmer, developer, designer, researcher(s) especially Max Base.

Asrez Team

About

A tiny implement API for game apps with a web service using PHP.

Topics

api-phpcontestcontest-matnogoogle-game-samplematnomatno-contestphpphp-api

Resources

Readme
GPL-3.0 license
Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.