open All Channels
seplocked EVE Technology Lab
blankseplocked [EVEOTS] Eve Online Teamspeak 3 API Registration with PHP5 v1.5
 
This thread is older than 90 days and has been locked due to inactivity.


 
Pages: 1 [2] 3 4 5 6

Author Topic

MJ Maverick
IronPig
Sev3rance
Posted - 2011.03.31 17:30:00 - [31]
 

Try setting $tsport to 9186... Confused

Jorr Meditir
Gallente
Deathwatch Gaming
Posted - 2011.03.31 21:07:00 - [32]
 

Hello MJ Maverick.

Really nice thing you have going here!

Just a sugestion on this debate on validating the API key/user:
What about using the in game browser to validate the charid aganist what is found on the api key?

Varitina
Posted - 2011.03.31 21:21:00 - [33]
 

... Thats what I have been using.

Aaeolian
Perkone
Posted - 2011.03.31 21:28:00 - [34]
 

Evelopedia

Originally by: "Evelopedia"
Implementation Tips

Bear in mind that these headers are easily spoofed, and you should not rely on them for security or authentication.

MJ Maverick
IronPig
Sev3rance
Posted - 2011.03.31 21:57:00 - [35]
 

Indeed they are. Never rely on headers.

So Varitina you have tried setting $tsport (NOT $tscport) to 9100, 10011 and 9186? Does the Teamspeak account you created the ServerQuery user with have server admin? I mean full server admin (all your permissions should be 75).

Varitina
Posted - 2011.03.31 22:16:00 - [36]
 

Sorry, well just tried anyway, and no success.

And yes, it has full admin, except for global commands, the company can't let me touch other peoples servers.

MJ Maverick
IronPig
Sev3rance
Posted - 2011.03.31 23:58:00 - [37]
 

Edited by: MJ Maverick on 31/03/2011 23:59:47
Is your web server on your Teamspeak servers whitelist?

If not you need to contact your host, there is a file in the Teamspeak folder on the server called "query_ip_whitelist.txt". Your web servers IP must be in this. To find your websites IP adress open CMD and "ping www.mywebsite.com". Obviously make sure you send your web servers IP to your TS provider.

Varitina
Posted - 2011.04.01 10:45:00 - [38]
 

They have added it, and I've tried since, no success. I will give it a couple more hours, they said give it some time, that was 6 hours ago.

Sasha KittyPuss
Posted - 2011.04.01 10:45:00 - [39]
 

Ok I get to this stage and get this error.

Removing your old registrations...
0 old registrations removed.

An error occured: invalid URI supplied [F10]

any enlightenment would be welcome

cheers

MJ Maverick
IronPig
Sev3rance
Posted - 2011.04.01 13:21:00 - [40]
 

Edited by: MJ Maverick on 01/04/2011 13:42:51
Varitina if it wasn't set then your Teamspeak will need restarting.

Sasha, [F10] = Failed to connect to your Teamspeak 3 server, ensure your details are correct.

Also:
Update v1.17
cron.php will now know if it's being run via CPanel and format e-mails correctly.
Made readme.html into your EVEOTS bible for when I'm not around.

Sasha KittyPuss
Posted - 2011.04.01 14:49:00 - [41]
 

Edited by: Sasha KittyPuss on 01/04/2011 16:06:18
Originally by: MJ Maverick
Edited by: MJ Maverick on 01/04/2011 13:42:51
Varitina if it wasn't set then your Teamspeak will need restarting.

Sasha, [F10] = Failed to connect to your Teamspeak 3 server, ensure your details are correct.

Also:
Update v1.17
cron.php will now know if it's being run via CPanel and format e-mails correctly.
Made readme.html into your EVEOTS bible for when I'm not around.


Ok TS3 ip is correct serverquery admin name and pass correct, ports correct, database correct TS3 ip whitelist is also correct still same error.


API Connection was established.

Checking...
Character: Thickonumbnuts

You are on our alliance whitelist
Attempting to grant access to: BIG-I A-N-D Thickonumbnuts...

Removing your old registrations...
0 old registrations removed.

An error occured: invalid URI supplied [F10]

FIXED serveradmin was the issue TY

Peter Powers
FinFleet
Raiden.
Posted - 2011.04.01 16:12:00 - [42]
 

Originally by: Jorr Meditir
Hello MJ Maverick.

Really nice thing you have going here!

Just a sugestion on this debate on validating the API key/user:
What about using the in game browser to validate the charid aganist what is found on the api key?

thats so ****ing easy to fake its not even funny to suggest this.

Cyerus
Galactic Dominion
Eternal Strife
Posted - 2011.04.02 00:10:00 - [43]
 

Edited by: Cyerus on 02/04/2011 00:14:41
Hi,

First I should thank you for trying to create something like this. As you said, your PHP skills aren't that good, and can easily be seen by checking out your code.
Here are some things you need to pay more attention to;

* Stop using die()
There is no need whatsoever to use die(). Everything can be caught by some if...else statements.

Instead of;

if(statement) {
die("Error");
}
do_something();

Try;

if(!statement) {
do_something();
}
else
{
echo "error";
}

Or the bigger version;

if(!statement) {
if(!other_statement) {
do_something();
}
else
{
echo "other error";
}
}
else
{
echo "error";
}



* Variable outside the quotes

Wrong;

format("Checking... $fetchCharacterName\n", "Checking... $fetchCharacterName<br />");

Good;

format("Checking... " . $fetchCharacterName . "\n", "Checking... $" . $fetchCharacterName . "<br />");


* PHP 'echo' is slow, and should be avoided for big texts

duplicates.php

echo "<html>
....
";

Instead, just close the PHP tag ( !> ), and let the HTML just be passed along. Variables always need to be outside the quotes, and can be echo'd by using using;
<!php echo $c->banner; !>



* Only 1 database connection is enough

Instead of every function calling the database on it's own (and hence repeating the same piece of code over and over), just make a seperate function and do the database connection there.
All the tables are loaded in the same database, meaning that select_db() function can be set in that function aswell.
For example;

function do_DB($host, $user, $pass, $db)
{
$connect = mysql_connect($host, $user, $pass);
if($connect)
{
$link = mysql_select_db($db, $db);
if($link)
{
return $link;
}
else
{
return false;
}
}
else
{
return false;
}
}

$link = do_DB($c->db_host, $c->db_user, $c->db_pass, $c->db_name);
if($link)
{
echo "Connection succesful";

do_stuff();

mysql_close($link);
}
else
{
echo "Connection failed; " . mysql_error($link);
}



After you get this under control, you want to remove PHP from the template. Meaning that no PHP will be used inside the template, instead tags like {$variable} will pe parsed by a template engine.
RainTPL is a very fast one, having all the functions you need.
Also things like CSS and JavaScript should be made seperate files, for caching purposes.


I hope this helps.

~Cyerus

MJ Maverick
IronPig
Sev3rance
Posted - 2011.04.02 00:32:00 - [44]
 

Thanks Cyerus.

However a few things are intentional so I'll just point them out.

die() is used all the time because if a single stage of the registration fails then you need everything to stop. Otherwise you could end up with anything like people registered on TS but not in the database or visa versa. It can just cause a total mess.

I see your point about the variables :P I just didn't think it was such a biggy as the PHP manual says if you use " then the variable value will be printed, ' will just print the variable.

The reason the database is opened and closed continuously is to prevent time-outs on long runs. I had a distinct problem on some web servers of the connection timing out if held open for too long. So it's like that for compatibility purposes with other servers.

I don't really want to add stuff I'm not going to totally utilise. I'm trying to keep it as "lite" as possible. Think Windows 95 not Vista.

Varitina
Posted - 2011.04.03 14:46:00 - [45]
 

I'm just going to give up on this, I don't know why in hell it keeps timing out, but its hopeless at this point.

MJ Maverick
IronPig
Sev3rance
Posted - 2011.04.03 16:00:00 - [46]
 

Edited by: MJ Maverick on 03/04/2011 16:01:00
I'm sorry to hear that. But it genuinely sounds like a real problem with your host. They have clearly messed with settings and screwed up the Teamspeaks ability to communicate. After they added your websites IP to their whitelist did they reboot the Teamspeak? Also have you tried the different query ports we tried before since?

Mediek Ordos
Caldari
Association of Commonwealth Enterprises
Imperial 0rder
Posted - 2011.04.04 08:46:00 - [47]
 

Originally by: Varitina
I'm just going to give up on this, I don't know why in hell it keeps timing out, but its hopeless at this point.


Ok I have been watching this problem, try this, set up a TS3 server on a local machine using the mysql tables on your host, once you have it set up make sure to add your hosts ip and your actual ip not local machine to the whitelist,
once you have done that install this application on your host and add the sql table to your TS3 sql on your host.
when you first start TS3 it will generate the serverquery admin for you with a password.
use this on the config >> serveradmin and what ever the password is. this does work and works well.
if this works then you will know there is a issue with the TS3 server you are having hosted.

Very Nice application well done

Varitina
Posted - 2011.04.04 22:14:00 - [48]
 

Okay Mediek, I'll try this. Give me a day or two, really busy this week, and I'm not the best at local sql. I've done it a few times, but ill need to refresh.

I'll post when i have tried. I like this idea though.

Mediek Ordos
Caldari
Association of Commonwealth Enterprises
Imperial 0rder
Posted - 2011.04.06 17:34:00 - [49]
 

Originally by: Varitina
Okay Mediek, I'll try this. Give me a day or two, really busy this week, and I'm not the best at local sql. I've done it a few times, but ill need to refresh.

I'll post when i have tried. I like this idea though.


If you have a problem look for me in game ill help you set it up :-) if i can co's ime rusty as well now
lol but i can assure you this really does work and it works well

Jetro Grissom
Amarr
Massive Dynamic Defense
Massive Dynamic Alliance
Posted - 2011.04.10 13:03:00 - [50]
 

Heya
Nice scripting but i have problems with using it.

Maybe i'm stupid, solution alway simple as we know.
I'm enterring whole data to config file as putted in readme.

Then i'm connecting to TS server as -MDD- Jetro Grissom (as showed in readme) and going to registration page.

Enterring limited api data and character name without corp ticker and press reigter.
I'm getting this message in reply:
Quote:
API Connection was established.

Checking...
Character: Jetro Grissom
Debug: User ID: 6XXXXX
Debug: API Key: XXXXXXXXXXXXXX
Character ID: XXXXXXXX

Debug: Character List:
Debug: Jetro Grissom
Debug: API verified.
You are not allowed to register on this server.


So how to fix it?

Mediek Ordos
Caldari
Association of Commonwealth Enterprises
Imperial 0rder
Posted - 2011.04.10 17:15:00 - [51]
 

Edited by: Mediek Ordos on 10/04/2011 17:27:58
Edited by: Mediek Ordos on 10/04/2011 17:18:32
Originally by: Jetro Grissom
Heya
Nice scripting but i have problems with using it.

Maybe i'm stupid, solution alway simple as we know.
I'm enterring whole data to config file as putted in readme.

Then i'm connecting to TS server as -MDD- Jetro Grissom (as showed in readme) and going to registration page.

Enterring limited api data and character name without corp ticker and press reigter.
I'm getting this message in reply:
Quote:
API Connection was established.

Checking...
Character: Jetro Grissom
Debug: User ID: 6XXXXX
Debug: API Key: XXXXXXXXXXXXXX
Character ID: XXXXXXXX

Debug: Character List:
Debug: Jetro Grissom
Debug: API verified.
You are not allowed to register on this server.


So how to fix it?


Ok How to fix, make sure you have your Corp and alliance names added to the whitelist that should rectify the problem in your case as you are in an alliance just add your alliance name in both.

// API Connection Testing Information (REQUIRED) - TESTID and TESTname MUST be the characterID and characterName of the SAME character respectively
public $TESTID = 00000000; <<<<<<<<<<<<<replace with your char id no
public $TESTname = "Jetro Grissom";
// Your alliance/corp name
public $ourname = "Massive Dynamic Alliance";
// Alliance Whitelist Information (REQUIRED) - Example: ("Alliance1","Alliance 2");
public $allyList = array("Massive Dynamic Alliance");
// Corporation Whitelist Information (REQUIRED) - Example: ("Corporation1","Corporation 2");
public $corpList = array("");
ok once config set up like this when you register do not use your Alliance tikker only your corp tikker on teamspeak server, no brackets
example A-C-E Mediek Ordos

Jetro Grissom
Amarr
Massive Dynamic Defense
Massive Dynamic Alliance
Posted - 2011.04.10 18:01:00 - [52]
 

well now it looks better, but now i'm getting same error as few posts above and don't know how to fix it.

Removing your old registrations...
0 old registrations removed.

An error occured: invalid URI supplied [F10]
I've restarted my TS server and it didn't helped.

Mediek Ordos
Caldari
Association of Commonwealth Enterprises
Imperial 0rder
Posted - 2011.04.10 18:21:00 - [53]
 

Edited by: Mediek Ordos on 10/04/2011 18:26:56
Originally by: Jetro Grissom
well now it looks better, but now i'm getting same error as few posts above and don't know how to fix it.

Removing your old registrations...
0 old registrations removed.

An error occured: invalid URI supplied [F10]
I've restarted my TS server and it didn't helped.


[F10] = Failed to connect to your Teamspeak 3 server, ensure your details are correct (see $tsname in "Config Guide" to set up a ServerQuery user). If your details are certainly right, check with your host that they have ServerQuery enabled and haven't arsed about with the settings. If everything is in order make sure your webserver is on the Teamspeaks whitelist (see "Teamspeak Whitelist").

add your host ip where you are running the app from into your whitelist on your teamspeak server, if you are running your TS3 server on local machine add the actual ip not your local machine ip to whitelist as well, that done make sure if you are running on local machine to set the ports on your router and firewall.
also on the config, did you add the correct serveradmin query name and password that was created and you saved when you first started your server.

class Config {
// Administrators character
public $admin = "Mediek Ordos";
// Teamspeak 3 Server Query Information (REQUIRED)
public $tshost = "put ts3 host ip here";
public $tsname = "serveradmin";
public $tspass = "put serveradmin pass here";
public $tsport = "10011"; //ServerQuery Port
public $tscport = "9987"; //TeamSpeak client port

if not convo me in game

Agent Unknown
Caldari
Posted - 2011.04.10 20:26:00 - [54]
 

Very nice work MJ Maverick. I stopped playing a while ago because I've been busy with school and other life things. Good to see someone taking over the project. :)

Jetro Grissom
Amarr
Massive Dynamic Defense
Massive Dynamic Alliance
Posted - 2011.04.11 11:04:00 - [55]
 

hmm i did everything like you said, but still getting this error
Quote:
Debug: Running: Teamspeak 3 PHP Framework version: 1.1.5-beta

API Connection was established.

Checking...
Character: Jetro Grissom
Debug: User ID: XXXXX
Debug: API Key: XXXXX
Character ID: XXXXX
Debug: Character List:
Debug: Jetro Grissom
Debug: API verified.
You are on our alliance whitelist
Debug: Getting your corp ticker... -MDD-
Debug: Getting your alliance ticker... M D
Attempting to grant access to: -MDD- Jetro Grissom...

Removing your old registrations...
0 old registrations removed.

An error occured: invalid URI supplied [F10]

Jetro Grissom
Amarr
Massive Dynamic Defense
Massive Dynamic Alliance
Posted - 2011.04.11 11:24:00 - [56]
 

wow now it works
the error was in tsname

now its perfect ;-)

Mediek Ordos
Caldari
Association of Commonwealth Enterprises
Imperial 0rder
Posted - 2011.04.11 16:50:00 - [57]
 

Originally by: Jetro Grissom
wow now it works
the error was in tsname

now its perfect ;-)


that is why i posted an example for you to look at it, glad you got it working ok.

MJ Maverick
IronPig
Sev3rance
Posted - 2011.04.11 17:27:00 - [58]
 

Thanks for assisting Mediek :)

MJ Maverick
IronPig
Sev3rance
Posted - 2011.04.11 18:07:00 - [59]
 

Update: v1.2

Security bot now optional to make sure people have the correct name. If you changed register.php to have "TICKER | NAME" then don't worry. The bot will know about you putting the | in and shouldn't go on a kicking spree if you did it properly.
General code tweaks made.
Readme updated.

Mediek Ordos
Caldari
Association of Commonwealth Enterprises
Imperial 0rder
Posted - 2011.04.12 11:43:00 - [60]
 

Originally by: MJ Maverick
Update: v1.2

Security bot now optional to make sure people have the correct name. If you changed register.php to have "TICKER | NAME" then don't worry. The bot will know about you putting the | in and shouldn't go on a kicking spree if you did it properly.
General code tweaks made.
Readme updated.


If you changed register.php to have "TICKER | NAME" <<< would this be here line 192 // SET NICKNAME
$nickname = $corpTicker." ".$character;
// TRY TO CONNECT - GATHER DETAILS - GRANT PERMISSIONS - STORE DETAILS

and like this ? $nickname = $corpTicker."| A-C-E | ".$character; ? co's i am thick when it comes to php :-)
ps only to glad to help peeps


Pages: 1 [2] 3 4 5 6

This thread is older than 90 days and has been locked due to inactivity.


 


The new forums are live

Please adjust your bookmarks to https://forums.eveonline.com

These forums are archived and read-only