| Welcome, Guest |
You have to register before you can post on our site.
|
| Forum Statistics |
» Members: 4,502
» Latest member: s8betsorg
» Forum threads: 4,486
» Forum posts: 120,162
Full Statistics
|
| Latest Threads |
2026 FIFA World Cup
Forum: Game Day
Last Post: Resarekt
17 minutes ago
» Replies: 102
» Views: 4,182
|
Let's get this thread to ...
Forum: Village Games
Last Post: Mia
Today, 9:13 AM
» Replies: 42,821
» Views: 12,594,274
|
What are you listening to...
Forum: Multimedia Masterpieces
Last Post: Silky Silver
Yesterday, 9:36 PM
» Replies: 397
» Views: 474,944
|
Survivor: Jiggmin’s Reviv...
Forum: Survivor
Last Post: Sushie
Yesterday, 5:20 PM
» Replies: 1,350
» Views: 123,749
|
METAL MEGATHREAD
Forum: Multimedia Masterpieces
Last Post: JEEJAYEM
Yesterday, 12:00 PM
» Replies: 70
» Views: 46,948
|
PR2 Style Designer
Forum: Platform Racing 2
Last Post: Magyar
2nd July 2026, 2:40 AM
» Replies: 14
» Views: 25,741
|
Challenge 11: 3in1
Forum: Survivor
Last Post: Sushie
1st July 2026, 9:10 PM
» Replies: 825
» Views: 14,522
|
Thread has a "stuck post"
Forum: Bugs and Suggestions
Last Post: Mia
30th June 2026, 10:43 PM
» Replies: 18
» Views: 969
|
Says I'm logged in when I...
Forum: Bugs and Suggestions
Last Post: This Games
30th June 2026, 3:39 PM
» Replies: 0
» Views: 79
|
How do you pronounce SQL?
Forum: Coding and Development
Last Post: Camer the Dragon
27th June 2026, 12:42 AM
» Replies: 7
» Views: 310
|
|
|
| Beating janky hosting restrictions |
|
Posted by: bls1999 - 4th August 2020, 9:53 PM - Forum: Coding and Development
- Replies (2)
|
 |
I think the programmers among us may find this a bit funny.
I'm working on Volly Bounce for the first time since I moved JV over to the VPS from the old hosting provider. The way the environment was set up before I moved, users would send a login request from the VB client to a login.php file on the old server, which would send the login information to the socket server. (Sound familiar? That's because this process is ripped directly from PR2's code.)
The way the login.php script on PR2 connects to the socket server is it sends a request directly to the socket server via that server's address and port. Just one problem with that: the old hosting provider I was using prohibited any connections that weren't made via a list of approved ports. And, you guessed it, the port I was using happened not to be a port allowed to be used. Of course!
So, my options as I saw them were pretty much to either move JV (ended up doing this anyway) or upgrade the hosting plan (would've cost hundreds of dollars). I knew there had to be a way around this highway robbery. If I could move the process that made the actual connection to the socket server to the VPS itself, I could bypass my hosting provider's restrictions (as long as I made the connection to the VPS using an approved port).
One idea I had was to forward the port from 80 (HTTP) to whatever port on which the socket server would end up running. But... lol. That failed miserably, as could be predicted.
Eventually, I figured it out. I just made a passthrough PHP file that handled the input from the login.php script on JV and sent it as a regular web request to the VPS. Once the request got to the VPS, it was as easy as using the same talk_to_server function that PR2 uses.
Attached, please find the janky code I used to make this possible:
PHP Code: // send this info to the socket server $send = new stdClass(); $send->login_id = $login_id; $send->ip_address = $ip; $send->user = $user; $send->guest = $is_guest; $send->ignored = $ignored;
$str = "process_register_login`" . json_encode($send);
// communicate with the VPS $data = array('port' => $VB_PORT, 'message' => $str); $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data) ) ); $context = stream_context_create($options); $result = file_get_contents('http://' . $VPS_IP . '/to-socket.php', false, $context);
// get response from VPS if ($result === false || @json_decode($result)->success === false) { $msg = !empty(json_decode($result)->error) ? json_decode($result)->error : $result; throw new Exception($msg); }
PHP Code: <?php
header("Content-type: text/plain");
require_once CONFIG; require_once SOCKET_MGMT_FNS;
$from_ip = $_SERVER['REMOTE_ADDR']; $message = @$_POST['message']; $port = (int) @$_POST['port'];
$ret = new stdClass(); $ret->success = false;
try { if ($from_ip !== $PROCESS_IP) { throw new Exception("Not privileged. $from_ip"); } elseif ($_SERVER['REQUEST_METHOD'] !== "POST") { throw new Exception("Invalid request method."); }
if (empty($_POST['message'])) { die(var_dump($_POST)); throw new Exception("No message specified."); }
// send the message to the server $from_server = talk_to_server($_SERVER['SERVER_ADDR'], $port, $message, true, true); if ($from_server === false) { throw new Exception('Could not connect to the server. If this persists, contact bls1999.'); }
$ret->success = true; } catch (Exception $e) { error_log('to_socket.php: ' . $e->getMessage() . " $from_ip"); $ret->error = $e->getMessage(); } finally { die(json_encode($ret)); }
I'm glad not to have needed this, but I figured deleting it would just be a waste. So, here it is in all its janky glory!
|
|
|
| Nostalgia |
|
Posted by: PinkAxie - 4th August 2020, 7:58 AM - Forum: Blogs
- Replies (8)
|
 |
Hey JV,
Now I doubt any of you will remember me, as I was more of a shy and socially awkward lurker than anything, but I really just wanted to come here to say thank you. I spent most of my childhood here and I felt like I was part of tight, friendly little family. And this was important for someone like me as it gave me a sense of belonging to a community. I can't remember how long I've been here, think I joined around 2011/12? With my first PR2 account being made sometime in 2008/9.
I have lots of little memories that I will cherish forever; the feeling when the jumpstart hat would appear and my heart would start beating out of my chest, playing Volley Bounce on that one occasion with the entire forum, rushing home from school just to hop on the computer and play the same trapwork level by Devious Shadows over and over again til nightfall. I could write about this place forever, but the nostalgia is just getting too real for me. If I could go back in time, even just for a day, I would go back in heartbeat.
Whether I knew you or not, I just wanted to say thank you, not just to the community, but to the mods/admins - both past and current - and most importantly Jiggmin. I still come here every blue moon to see what's happening, and I will continue to do so, but I just wanted to share my feelings and just how much this place means to me.
And if anyone of my old pals still roam here, just know that I will never forget you.
Thanks for everything,
- Cara700/PinkAxie/Eevee700 (how many usernames have I used, honestly I've lost count)
|
|
|
| Private Servers |
|
Posted by: bls1999 - 4th August 2020, 12:57 AM - Forum: Announcements
- Replies (2)
|
 |
I just made some programmatical changes to how PR2 handles adding new, updating the expiration time of existing, and expiring old private servers. It should hopefully all work a whole lot better than before. Feel free to snoop around in the changes if you're so inclined.
Side note: this was pull request/issue #666. That makes me think something will go wrong. Oh well.
|
|
|
| Weekly Composing Challenge #4 |
|
Posted by: TRUC - 3rd August 2020, 5:08 PM - Forum: Multimedia Masterpieces
- No Replies
|
 |
WCC #4:
- Key is E flat of some sort ? (major, minor, neutral microtonal extravangaza, it's up to you and you'll see why)
- Between 16 and 32 bars/measure
- You can only use 6 DIFFERENT notes, inlcuding E flat
Basically, within an octave, you'll only be able to choose from 6 notes total throughout the entire piece. This also applies to pitched percussion. Unpitched percussion are unaffected by this.
For example, I could go with Eb, F, G, Ab, Bb, and C. The point of this week is to experiment stuff with only half the usual playing field.
Have fun !
If you want more details on how this works, here's a reference ^^
|
|
|
|