• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Using Flash Client in Ots

Give me that script php to fool policy schema :p
 
use my files, the are reaching login protocol of server. use port 7171!!!!!
port 7172 times out and a default message from tibia.swf will be displayed on port 7171 protocollogin.cpp will answer that their is no account name :O

Could be 2 reasons why it bounces.

Code:
  std::string sessionKey = msg.getString();   
   size_t pos = sessionKey.find('\n');
   if (pos == std::string::npos) {
     dispatchDisconnectClient("You must enter your account name.");
     return;
   }

   std::string accountName = sessionKey.substr(0, pos); 
   if (accountName.empty()) {
     dispatchDisconnectClient("You must enter your account name.");
     return;
   }
Unfortunatly i can't be of much help here since mine doesn't want to connect at all for some reason.
 
I'm uploading my setup with my files etc. I can't get what you have get Mokerhamer :(
Always "Could not connect to this player cast.".

Can you explain how to run that php script?

Or could you upload your setup?
 
I'm uploading my setup with my files etc. I can't get what you have get Mokerhamer :(
Always "Could not connect to this player cast.".

Can you explain how to run that php script?
you run it via commandline, just execute:
Code:
php socket.php

if you're running on linux, make sure you're root if you can't get the socket to bind and also if you want it to not stop the shell you can do
Code:
php socket.php &
 
Oke i've edited the source to see where it exactly fails. Turns out it's the session key.
4da61cbe94.png


added this to protocolgame.cpp

3c8753e2b1.png
Only if you teach us how to get this far :p
http://prntscr.com/6t176o
 
Just to be clear you only have the OX tibia.swf? and not the launch page? (want to see how the query their play.php)


1. place the trusted.xml in same folder as the php script that needs it. (place crossdomain.xml in head folder)
2. I use a debian server :S i just launch it through terminal.(php policy-server.php) Dosen't Xampp have an console?

557b655c8d.png




To be honest, i only wish to share Flash client with people who contribute. I'll be maiking a privet Github project soon. i will add u 2 since you are helping :)
//Maiking it tomorrow ill upload all files that i have so far.(i made so many debugging scripts, need to check wich one are usefull :p)

Dammit, i just can't get it to connect properly, it just closes the connection as soon as it's connected. Are you sure you didn't do anything else? also what distro are you running? TFS 1.1?
 
It it closes dirreclty then the xml files are wrong. i have a debugger for it but hard to explain..

Use this script and let flash connect to it on port 7072.
Code:
#!/usr/bin/php
<?php
error_reporting(1);
ini_set('display_errors', 1);
// Create
$socketlogin = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);

if ($socketlogin === false) {
  echo "socket_create() Failed, reason: " . socket_strerror(socket_last_error()) . "\n";
}

// Bind
if (socket_bind($socketlogin, "0.0.0.0", 7072) === false) {
  echo "socket_bind() Failed, reason: " . socket_strerror(socket_last_error($socketlogin)) . "\n";
}
// Listen
if (socket_listen($socketlogin, 90) === false) {
  echo "socket_listen() Failed, reason: " . socket_strerror(socket_last_error($socketlogin)) . "\n";
}
// Accept and loop through results:
while($clientlogin = socket_accept($socketlogin)) {
  //display information about the client who is connected
  if(socket_getpeername($clientlogin, $address, $port)) {
  echo "\n\n\nClient $address : $port connected.\n";
  }
  //Now receive reply from server
  if(socket_recv( $clientlogin , $buf , 2045000 , MSG_WAITALL ) !== FALSE) {
  echo "\n[Flash Client] Request $buf"; 

  }
  socket_close($clientlogin);
}
socket_close($socketlogin);
?>

If you get on console this "[Flash Client] Request" then your xml files are good!
if you get this in console "[Flash Client] Request <policy-file-request/>" Your crossdomain.xml is not working properly!
*With console i mean the console where you launched the php scripts in!

//Going to bed in a few minutes...


I got
Code:
Client 192.168.1.3 : 6496 connected.

So.. that should mean i'm good to go, right? o_O
 
Back
Top