Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / A simple tchat : AGK client + php script (no AGK server needed)

Author
Message
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 23rd Nov 2021 14:15 Edited at: 23rd Nov 2021 14:16
Hi

I have adapted a code From Yrahen (pb code), in AGK.

It's an example to use a php page and SendHTTPRequest() which works fine .
You can do a lot of things with that kind of codes (a tchat, a simple online game (very basic, but it could work), online hi-score and a lots of things.
I have not add security test (with header for example), but it's an example to show how to use AGk and a simple PHP code :

Source :
in 2014, Yrahen has created a code (in Purebasic and PHP) to create a tchat system with no server, no DataBase, and simple.
I have adapted this code for AppGameKit .

The AppGameKit code :


The PHP script : should be in your website (web server), name it tchat.php (or anything you want, but don't forget to change the name in the agk code ).


I hope this can be usefull
A+
AGK2 tier1 - http://www.dracaena-studio.com
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 23rd Nov 2021 15:39
Nice, basic but effective, easy to bot spam tho

I have a half written tutorial showing how to use AGK/PHP/SQL to have full on persistent data (for example) user profiles and games stats, player driven market's, game event logging and replay (like clash of clans, pseudo multiplayer), its a powerful and secure system using session and api keys, I will finish it when this game comp is done.

A neat trick for using async is to send some prefix arguments that you send back (like message even codes) so the callback knows what action the response if for, I use a WinAPI style message system with a json table so you can send complex stacked request and have a WinProc style callback to process them, it expands the functionally of AppGameKit exponentially

with sync http calls like that if you hit latently the game will lock up, not good, I'd go with asynchronous every time.
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 23rd Nov 2021 15:52
Hi

Quote: "Nice, basic but effective, easy to bot spam tho"

Yes, it's a very simple and basic system, to show for new users who don't know php how to create a simple tchat system with agk and php .

Against the bots, this could be made in the AppGameKit client (and in the php script of course). For example :
- the player can send max 1message per 2 or 3 seconds.
- we could limit the characters which are send.
and so ^^

Quote: "I have a half written tutorial showing how to use AGK/PHP/SQL to have full on persistent data (for example) user profiles and games stats, player driven market's, game event logging and replay (like clash of clans, pseudo multiplayer), its a powerful and secure system using session and api keys, I will finish it when this game comp is done.

A neat trick for using async is to send some prefix arguments that you send back (like message even codes) so the callback knows what action the response if for, I use a WinAPI style message system with a json table so you can send complex stacked request and have a WinProc style callback to process them, it expands the functionally of AppGameKit exponentially"


Waho, I am very very interested by your systeme with AppGameKit + PHP

But should your script be executed on the server (for example, with "chmod +x" or other things like that), or can it be "no executed" (like the script of this example) ?
Because i only have a website (webserver), but I can't launch php script, just copy it on my site thanks to FTP ^^.


Quote: "with sync http calls like that if you hit latently the game will lock up, not good, I'd go with asynchronous every time."

Yes, it's better to use an async request, I totally agree .

If I have the time, I will change the code to use an async request .

AGK2 tier1 - http://www.dracaena-studio.com
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 23rd Nov 2021 15:53 Edited at: 23rd Nov 2021 15:55
https://parttimecoder.itch.io/iscore-test-app

Sorry, I have a 404 error with your link, I think it's private
AGK2 tier1 - http://www.dracaena-studio.com
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 23rd Nov 2021 16:16 Edited at: 23rd Nov 2021 16:20
Yeah soz its a private link, forgot to grab a preview link

https://parttimecoder.itch.io/iscore-test-app?secret=1btdL3yU9obDQndCL2Dus1L4

Quote: "But should your script be executed on the server"


That example ^^ is running from a remote server, all PHP/SQL no problems : https://www.000webhost.com/

WIP Site [its broken lol, I am not good with CSS] : https://parttimesoftware.000webhostapp.com/index.php

I will finish the site soon ... the framework is done just need to sort the formatting

Edit: next year I will consolidate all my stuff, fix the site, get some nice stuff going, until now I have been lazy, time to start focus!
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee

Login to post a reply

Server time is: 2024-04-25 08:44:01
Your offset time is: 2024-04-25 08:44:01